[pygrib] 01/07: upstream 2.0.0

Alastair McKinstry mckinstry at moszumanska.debian.org
Thu Jun 25 15:51:43 UTC 2015


This is an automated email from the git hooks/post-receive script.

mckinstry pushed a commit to tag unstable/2.0.0-1
in repository pygrib.

commit d3a53ad12524a33cf9855288e966270c9fdcffdc
Author: Alastair McKinstry <mckinstry at debian.org>
Date:   Fri May 1 07:09:31 2015 +0100

    upstream 2.0.0
---
 MANIFEST.in                                      |     2 +-
 PKG-INFO                                         |     6 +-
 README => README.md                              |     7 +-
 docs/class-tree.html                             |     2 +-
 docs/help.html                                   |     2 +-
 docs/identifier-index.html                       |     2 +-
 docs/index.html                                  |    23 +-
 docs/module-tree.html                            |     2 +-
 docs/pygrib-module.html                          |    23 +-
 docs/pygrib.gribmessage-class.html               |     6 +-
 docs/pygrib.index-class.html                     |    27 +-
 docs/pygrib.open-class.html                      |     2 +-
 g2clib.c                                         |  6111 ++---
 g2clib.pyx                                       |    54 +-
 g2clib_src/CHANGES                               |    68 +
 g2clib_src/README                                |    68 +
 g2clib_src/cmplxpack.c                           |    75 +
 g2clib_src/compack.c                             |   416 +
 g2clib_src/comunpack.c                           |   336 +
 g2clib_src/dec_jpeg2000.c                        |   142 +
 g2clib_src/dec_png.c                             |   144 +
 g2clib_src/drstemplates.c                        |   157 +
 g2clib_src/drstemplates.h                        |    69 +
 g2clib_src/enc_jpeg2000.c                        |   179 +
 g2clib_src/enc_png.c                             |   134 +
 g2clib_src/g2_addfield.c                         |   511 +
 g2clib_src/g2_addgrid.c                          |   244 +
 g2clib_src/g2_addlocal.c                         |   147 +
 g2clib_src/g2_create.c                           |   127 +
 g2clib_src/g2_free.c                             |    44 +
 g2clib_src/g2_getfld.c                           |   552 +
 g2clib_src/g2_gribend.c                          |   122 +
 g2clib_src/g2_info.c                             |   190 +
 g2clib_src/g2_miss.c                             |    69 +
 g2clib_src/g2_unpack1.c                          |    99 +
 g2clib_src/g2_unpack2.c                          |    86 +
 g2clib_src/g2_unpack3.c                          |   214 +
 g2clib_src/g2_unpack4.c                          |   185 +
 g2clib_src/g2_unpack5.c                          |   152 +
 g2clib_src/g2_unpack6.c                          |    97 +
 g2clib_src/g2_unpack7.c                          |   152 +
 g2clib_src/gbits.c                               |   124 +
 g2clib_src/getdim.c                              |   127 +
 g2clib_src/getpoly.c                             |    80 +
 g2clib_src/grib2.h                               |   249 +
 g2clib_src/grib2c.doc                            |   946 +
 g2clib_src/gridtemplates.c                       |   210 +
 g2clib_src/gridtemplates.h                       |   121 +
 g2clib_src/int_power.c                           |    30 +
 g2clib_src/jpcpack.c                             |   175 +
 g2clib_src/jpcunpack.c                           |    72 +
 g2clib_src/makefile                              |    92 +
 g2clib_src/misspack.c                            |   532 +
 g2clib_src/mkieee.c                              |   123 +
 g2clib_src/pack_gp.c                             |  1447 ++
 g2clib_src/pdstemplates.c                        |   430 +
 g2clib_src/pdstemplates.h                        |   206 +
 g2clib_src/pngpack.c                             |   162 +
 g2clib_src/pngunpack.c                           |    76 +
 g2clib_src/rdieee.c                              |    78 +
 g2clib_src/reduce.c                              |   410 +
 g2clib_src/seekgb.c                              |    83 +
 g2clib_src/simpack.c                             |   181 +
 g2clib_src/simunpack.c                           |    76 +
 g2clib_src/specpack.c                            |   128 +
 g2clib_src/specunpack.c                          |   115 +
 ncepgrib2.py                                     |     2 +-
 ncepgrib2_docs/class-tree.html                   |     3 +-
 ncepgrib2_docs/epydoc.css                        |     4 +-
 ncepgrib2_docs/help.html                         |     3 +-
 ncepgrib2_docs/identifier-index.html             |     3 +-
 ncepgrib2_docs/index.html                        |    13 +-
 ncepgrib2_docs/module-tree.html                  |     3 +-
 ncepgrib2_docs/ncepgrib2-module.html             |    13 +-
 ncepgrib2_docs/ncepgrib2-pysrc.html              |  1440 +-
 ncepgrib2_docs/ncepgrib2.Grib2Encode-class.html  |     3 +-
 ncepgrib2_docs/ncepgrib2.Grib2Message-class.html |     3 +-
 pygrib.c                                         | 28029 +++++++++++----------
 pygrib.pyx                                       |    34 +-
 redtoreg.c                                       |  3756 ++-
 redtoreg.pyx                                     |     3 +-
 setup.cfg                                        |    31 +
 setup.py                                         |     6 +-
 utils/grib_list                                  |     4 +-
 84 files changed, 32091 insertions(+), 18583 deletions(-)

diff --git a/MANIFEST.in b/MANIFEST.in
index bf583ac..9026ca3 100755
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -10,7 +10,7 @@ include ncepgrib2.py
 include setup.cfg.template
 include setup.py
 include test.py
-include README
+include README.md
 include README.macosx
 include utils/*grib*
 recursive-include docs *
diff --git a/PKG-INFO b/PKG-INFO
index e51bbfc..d7c330d 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,11 +1,11 @@
 Metadata-Version: 1.1
 Name: pygrib
-Version: 1.9.9
+Version: 2.0.0
 Summary: Python module for reading/writing GRIB files
-Home-page: http://code.google.com/p/pygrib
+Home-page: https://github.com/jswhit/pygrib
 Author: Jeff Whitaker
 Author-email: jeffrey.s.whitaker at noaa.gov
 License: UNKNOWN
-Download-URL: http://code.google.com/p/pygrib/downloads/list
+Download-URL: http://python.org/pypi/pygrib
 Description: UNKNOWN
 Platform: UNKNOWN
diff --git a/README b/README.md
similarity index 74%
rename from README
rename to README.md
index 7edc0ac..94dd753 100644
--- a/README
+++ b/README.md
@@ -10,6 +10,8 @@ GRIB files.
 
 Quickstart:
 
+* Clone the github repository, or download a source release from https://pypi.python.org/pypi/pygrib.
+
 * Copy setup.cfg.template to setup.cfg, open in text editor, follow instructions in
 comments for editing.
 
@@ -19,8 +21,7 @@ comments for editing.
 
 * Run 'python test.py' to test your pygrib installation.
 
-For full installation instructions and API documentation, see docs/index.html or
-http://pygrib.googlecode.com/svn/trunk/docs/index.html.
+For full installation instructions and API documentation, see https://jswhit.github.io/pygrib.
 
 Questions or comments - contact Jeff Whitaker <jeffrey.s.whitaker at noaa.gov>
-or use http://code.google.com/p/pygrib/issues.
+or use https://github.com/jswhit/pygrib/issues.
diff --git a/docs/class-tree.html b/docs/class-tree.html
index 64d13c1..7096087 100644
--- a/docs/class-tree.html
+++ b/docs/class-tree.html
@@ -90,7 +90,7 @@
 <table border="0" cellpadding="0" cellspacing="0" width="100%%">
   <tr>
     <td align="left" class="footer">
-    Generated by Epydoc 3.0.1 on Fri Feb  7 15:35:47 2014
+    Generated by Epydoc 3.0.1 on Mon Dec 29 14:23:16 2014
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
diff --git a/docs/help.html b/docs/help.html
index 19be57b..da043be 100644
--- a/docs/help.html
+++ b/docs/help.html
@@ -240,7 +240,7 @@ page was last updated. </p>
 <table border="0" cellpadding="0" cellspacing="0" width="100%%">
   <tr>
     <td align="left" class="footer">
-    Generated by Epydoc 3.0.1 on Fri Feb  7 15:35:47 2014
+    Generated by Epydoc 3.0.1 on Mon Dec 29 14:23:16 2014
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
diff --git a/docs/identifier-index.html b/docs/identifier-index.html
index 188ec16..32bcc7a 100644
--- a/docs/identifier-index.html
+++ b/docs/identifier-index.html
@@ -473,7 +473,7 @@
 <table border="0" cellpadding="0" cellspacing="0" width="100%%">
   <tr>
     <td align="left" class="footer">
-    Generated by Epydoc 3.0.1 on Fri Feb  7 15:35:47 2014
+    Generated by Epydoc 3.0.1 on Mon Dec 29 14:23:16 2014
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
diff --git a/docs/index.html b/docs/index.html
index 3bbe171..cecb694 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -154,10 +154,8 @@
         target="_top">basemap</a>).
       </li>
       <li>
-        If you're on MacOS X, see <a 
-        href="http://pygrib.googlecode.com/svn/trunk/README.macosx" 
-        target="_top">README.macosx</a> for special instruction on how to 
-        install pygrib and all it's dependencies using <a 
+        If you're on MacOS X, see README.macosx for special instruction on 
+        how to install pygrib and all it's dependencies using <a 
         href="http://macports.org" target="_top">macports</a>.
       </li>
     </ul>
@@ -280,13 +278,6 @@
         see below for the full python API documentation.
       </li>
     </ul>
-  <h1 class="heading">Changelog</h1>
-    <ul>
-      <li>
-        see <a href="http://pygrib.googlecode.com/svn/trunk/Changelog" 
-        target="_top">Changelog</a> file.
-      </li>
-    </ul>
 
 <hr />
 <div class="fields">      <p><strong>Author:</strong>
@@ -297,7 +288,7 @@
         Whitaker</a>
       </p>
       <p><strong>Version:</strong>
-        1.9.9
+        2.0.0
       </p>
       <p><strong>Copyright:</strong>
         copyright 2010 by Jeffrey Whitaker.
@@ -555,7 +546,7 @@
     <td width="15%" align="right" valign="top" class="summary">
       <span class="summary-type"> </span>
     </td><td class="summary">
-        <a name="__version__"></a><span class="summary-name">__version__</span> = <code title="'1.9.9'"><code class="variable-quote">'</code><code class="variable-string">1.9.9</code><code class="variable-quote">'</code></code>
+        <a name="__version__"></a><span class="summary-name">__version__</span> = <code title="'2.0.0'"><code class="variable-quote">'</code><code class="variable-string">2.0.0</code><code class="variable-quote">'</code></code>
     </td>
   </tr>
 <tr>
@@ -569,7 +560,7 @@
     <td width="15%" align="right" valign="top" class="summary">
       <span class="summary-type"> </span>
     </td><td class="summary">
-        <a name="grib_api_version"></a><span class="summary-name">grib_api_version</span> = <code title="'1.11.0'"><code class="variable-quote">'</code><code class="variable-string">1.11.0</code><code class="variable-quote">'</code></code>
+        <a name="grib_api_version"></a><span class="summary-name">grib_api_version</span> = <code title="'1.12.3'"><code class="variable-quote">'</code><code class="variable-string">1.12.3</code><code class="variable-quote">'</code></code>
     </td>
   </tr>
 <tr>
@@ -583,7 +574,7 @@
     <td width="15%" align="right" valign="top" class="summary">
       <span class="summary-type"> </span>
     </td><td class="summary">
-        <a name="missingvalue_int"></a><span class="summary-name">missingvalue_int</span> = <code title="4294967295">4294967295</code>
+        <a name="missingvalue_int"></a><span class="summary-name">missingvalue_int</span> = <code title="-1">-1</code>
     </td>
   </tr>
 <tr>
@@ -716,7 +707,7 @@
 <table border="0" cellpadding="0" cellspacing="0" width="100%%">
   <tr>
     <td align="left" class="footer">
-    Generated by Epydoc 3.0.1 on Fri Feb  7 15:35:47 2014
+    Generated by Epydoc 3.0.1 on Mon Dec 29 14:23:16 2014
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
diff --git a/docs/module-tree.html b/docs/module-tree.html
index 912cca2..e45c454 100644
--- a/docs/module-tree.html
+++ b/docs/module-tree.html
@@ -78,7 +78,7 @@
 <table border="0" cellpadding="0" cellspacing="0" width="100%%">
   <tr>
     <td align="left" class="footer">
-    Generated by Epydoc 3.0.1 on Fri Feb  7 15:35:47 2014
+    Generated by Epydoc 3.0.1 on Mon Dec 29 14:23:16 2014
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
diff --git a/docs/pygrib-module.html b/docs/pygrib-module.html
index 3bbe171..cecb694 100644
--- a/docs/pygrib-module.html
+++ b/docs/pygrib-module.html
@@ -154,10 +154,8 @@
         target="_top">basemap</a>).
       </li>
       <li>
-        If you're on MacOS X, see <a 
-        href="http://pygrib.googlecode.com/svn/trunk/README.macosx" 
-        target="_top">README.macosx</a> for special instruction on how to 
-        install pygrib and all it's dependencies using <a 
+        If you're on MacOS X, see README.macosx for special instruction on 
+        how to install pygrib and all it's dependencies using <a 
         href="http://macports.org" target="_top">macports</a>.
       </li>
     </ul>
@@ -280,13 +278,6 @@
         see below for the full python API documentation.
       </li>
     </ul>
-  <h1 class="heading">Changelog</h1>
-    <ul>
-      <li>
-        see <a href="http://pygrib.googlecode.com/svn/trunk/Changelog" 
-        target="_top">Changelog</a> file.
-      </li>
-    </ul>
 
 <hr />
 <div class="fields">      <p><strong>Author:</strong>
@@ -297,7 +288,7 @@
         Whitaker</a>
       </p>
       <p><strong>Version:</strong>
-        1.9.9
+        2.0.0
       </p>
       <p><strong>Copyright:</strong>
         copyright 2010 by Jeffrey Whitaker.
@@ -555,7 +546,7 @@
     <td width="15%" align="right" valign="top" class="summary">
       <span class="summary-type"> </span>
     </td><td class="summary">
-        <a name="__version__"></a><span class="summary-name">__version__</span> = <code title="'1.9.9'"><code class="variable-quote">'</code><code class="variable-string">1.9.9</code><code class="variable-quote">'</code></code>
+        <a name="__version__"></a><span class="summary-name">__version__</span> = <code title="'2.0.0'"><code class="variable-quote">'</code><code class="variable-string">2.0.0</code><code class="variable-quote">'</code></code>
     </td>
   </tr>
 <tr>
@@ -569,7 +560,7 @@
     <td width="15%" align="right" valign="top" class="summary">
       <span class="summary-type"> </span>
     </td><td class="summary">
-        <a name="grib_api_version"></a><span class="summary-name">grib_api_version</span> = <code title="'1.11.0'"><code class="variable-quote">'</code><code class="variable-string">1.11.0</code><code class="variable-quote">'</code></code>
+        <a name="grib_api_version"></a><span class="summary-name">grib_api_version</span> = <code title="'1.12.3'"><code class="variable-quote">'</code><code class="variable-string">1.12.3</code><code class="variable-quote">'</code></code>
     </td>
   </tr>
 <tr>
@@ -583,7 +574,7 @@
     <td width="15%" align="right" valign="top" class="summary">
       <span class="summary-type"> </span>
     </td><td class="summary">
-        <a name="missingvalue_int"></a><span class="summary-name">missingvalue_int</span> = <code title="4294967295">4294967295</code>
+        <a name="missingvalue_int"></a><span class="summary-name">missingvalue_int</span> = <code title="-1">-1</code>
     </td>
   </tr>
 <tr>
@@ -716,7 +707,7 @@
 <table border="0" cellpadding="0" cellspacing="0" width="100%%">
   <tr>
     <td align="left" class="footer">
-    Generated by Epydoc 3.0.1 on Fri Feb  7 15:35:47 2014
+    Generated by Epydoc 3.0.1 on Mon Dec 29 14:23:16 2014
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
diff --git a/docs/pygrib.gribmessage-class.html b/docs/pygrib.gribmessage-class.html
index f35d294..9423904 100644
--- a/docs/pygrib.gribmessage-class.html
+++ b/docs/pygrib.gribmessage-class.html
@@ -310,8 +310,8 @@ object --+
       <table width="100%" cellpadding="0" cellspacing="0" border="0">
         <tr>
           <td><span class="summary-sig"><a name="is_missing"></a><span class="summary-sig-name">is_missing</span>(<span class="summary-sig-arg">key</span>)</span><br />
-      returns True if value associated with key is equal to grib missing 
-      value flag (False otherwise)</td>
+      returns True if key is invalid or value associated with key is equal 
+      to grib missing value flag (False otherwise)</td>
           <td align="right" valign="top">
             
             
@@ -797,7 +797,7 @@ object --+
 <table border="0" cellpadding="0" cellspacing="0" width="100%%">
   <tr>
     <td align="left" class="footer">
-    Generated by Epydoc 3.0.1 on Fri Feb  7 15:35:47 2014
+    Generated by Epydoc 3.0.1 on Mon Dec 29 14:23:16 2014
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
diff --git a/docs/pygrib.index-class.html b/docs/pygrib.index-class.html
index 23e9bd2..4e71bc2 100644
--- a/docs/pygrib.index-class.html
+++ b/docs/pygrib.index-class.html
@@ -85,7 +85,9 @@ object --+
 <pre class="py-doctest">
 <span class="py-prompt">>>> </span><span class="py-keyword">import</span> pygrib
 <span class="py-prompt">>>> </span>grbindx=pygrib.index(<span class="py-string">'sampledata/gfs.grb'</span>,<span class="py-string">'shortName'</span>,<span class="py-string">'typeOfLevel'</span>,<span class="py-string">'level'</span>)
-<span class="py-prompt">>>> </span>selected_grbs=grbindx.select(shortName=<span class="py-string">'gh'</span>,typeOfLevel=<span class="py-string">'isobaricInhPa'</span>,level=500)
+<span class="py-prompt">>>> </span>grbindx.keys
+<span class="py-output">['shortName', 'level']</span>
+<span class="py-output"></span><span class="py-prompt">>>> </span>selected_grbs=grbindx.select(shortName=<span class="py-string">'gh'</span>,typeOfLevel=<span class="py-string">'isobaricInhPa'</span>,level=500)
 <span class="py-prompt">>>> </span><span class="py-keyword">for</span> grb <span class="py-keyword">in</span> selected_grbs:
 <span class="py-prompt">>>> </span>    grb
 <span class="py-output">1:Geopotential height:gpm (instant):regular_ll:isobaricInhPa:level 500 Pa:fcst time 72 hrs:from 200412091200:lo res cntl fcst</span>
@@ -97,7 +99,9 @@ object --+
 <span class="py-output"></span><span class="py-prompt">>>> </span>grbindx.write(<span class="py-string">'gfs.grb.idx'</span>) <span class="py-comment"># save index to a file</span>
 <span class="py-prompt">>>> </span>grbindx.close()
 <span class="py-prompt">>>> </span>grbindx = pygrib.index(<span class="py-string">'gfs.grb.idx'</span>) <span class="py-comment"># re-open index (no keys specified)</span>
-<span class="py-prompt">>>> </span><span class="py-keyword">for</span> grb <span class="py-keyword">in</span> selected_grbs:
+<span class="py-prompt">>>> </span>grbindx.keys <span class="py-comment"># not set when opening a saved index file.</span>
+<span class="py-output">None</span>
+<span class="py-output"></span><span class="py-prompt">>>> </span><span class="py-keyword">for</span> grb <span class="py-keyword">in</span> selected_grbs:
 <span class="py-prompt">>>> </span>    grb
 <span class="py-output">1:u-component of wind:m s**-1 (instant):regular_ll:isobaricInhPa:level 250 Pa:fcst time 72 hrs:from 200412091200:lo res cntl fcst</span></pre>
 
@@ -246,7 +250,7 @@ object --+
     <td width="15%" align="right" valign="top" class="summary">
       <span class="summary-type"> </span>
     </td><td class="summary">
-        <a name="keys"></a><span class="summary-name">keys</span><br />
+        <a href="pygrib.index-class.html#keys" class="summary-name">keys</a><br />
       list of strings containing keys used in the index.
     </td>
   </tr>
@@ -392,6 +396,18 @@ object --+
     <span class="table-header">Instance Variable Details</span></td>
 </tr>
 </table>
+<a name="keys"></a>
+<div>
+<table class="details" border="1" cellpadding="3"
+       cellspacing="0" width="100%" bgcolor="white">
+<tr><td>
+  <h3 class="epydoc">keys</h3>
+  list of strings containing keys used in the index.  Set to 
+  <code>None</code> when opening a previously saved grib index file.
+  <dl class="fields">
+  </dl>
+</td></tr></table>
+</div>
 <a name="types"></a>
 <div>
 <table class="details" border="1" cellpadding="3"
@@ -401,7 +417,8 @@ object --+
   if keys are typed, this list contains the type declarations 
   (<code>l</code>, <code>s</code> or <code>d</code>). Type declarations are
   specified by appending to the key name (i.e. <code>level:l</code> will 
-  search for values of <code>level</code> that are longs).
+  search for values of <code>level</code> that are longs). Set to 
+  <code>None</code> when opening a previously saved grib index file.
   <dl class="fields">
   </dl>
 </td></tr></table>
@@ -433,7 +450,7 @@ object --+
 <table border="0" cellpadding="0" cellspacing="0" width="100%%">
   <tr>
     <td align="left" class="footer">
-    Generated by Epydoc 3.0.1 on Fri Feb  7 15:35:47 2014
+    Generated by Epydoc 3.0.1 on Mon Dec 29 14:23:16 2014
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
diff --git a/docs/pygrib.open-class.html b/docs/pygrib.open-class.html
index 6819963..bc97663 100644
--- a/docs/pygrib.open-class.html
+++ b/docs/pygrib.open-class.html
@@ -667,7 +667,7 @@ object --+
 <table border="0" cellpadding="0" cellspacing="0" width="100%%">
   <tr>
     <td align="left" class="footer">
-    Generated by Epydoc 3.0.1 on Fri Feb  7 15:35:47 2014
+    Generated by Epydoc 3.0.1 on Mon Dec 29 14:23:16 2014
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
diff --git a/g2clib.c b/g2clib.c
index 45fc2bf..a9f1280 100644
--- a/g2clib.c
+++ b/g2clib.c
@@ -1,13 +1,26 @@
-/* Generated by Cython 0.17.4 on Fri Jan 11 07:16:35 2013 */
+/* Generated by Cython 0.21.1 */
 
 #define PY_SSIZE_T_CLEAN
+#ifndef CYTHON_USE_PYLONG_INTERNALS
+#ifdef PYLONG_BITS_IN_DIGIT
+#define CYTHON_USE_PYLONG_INTERNALS 0
+#else
+#include "pyconfig.h"
+#ifdef PYLONG_BITS_IN_DIGIT
+#define CYTHON_USE_PYLONG_INTERNALS 1
+#else
+#define CYTHON_USE_PYLONG_INTERNALS 0
+#endif
+#endif
+#endif
 #include "Python.h"
 #ifndef Py_PYTHON_H
     #error Python headers needed to compile C extensions, please install development version of Python.
-#elif PY_VERSION_HEX < 0x02040000
-    #error Cython requires Python 2.4+.
+#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
+    #error Cython requires Python 2.6+ or Python 3.2+.
 #else
-#include <stddef.h> /* For offsetof */
+#define CYTHON_ABI "0_21_1"
+#include <stddef.h>
 #ifndef offsetof
 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
 #endif
@@ -41,94 +54,64 @@
 #define CYTHON_COMPILING_IN_PYPY 0
 #define CYTHON_COMPILING_IN_CPYTHON 1
 #endif
-#if PY_VERSION_HEX < 0x02050000
-  typedef int Py_ssize_t;
-  #define PY_SSIZE_T_MAX INT_MAX
-  #define PY_SSIZE_T_MIN INT_MIN
-  #define PY_FORMAT_SIZE_T ""
-  #define CYTHON_FORMAT_SSIZE_T ""
-  #define PyInt_FromSsize_t(z) PyInt_FromLong(z)
-  #define PyInt_AsSsize_t(o)   __Pyx_PyInt_AsInt(o)
-  #define PyNumber_Index(o)    ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \
-                                (PyErr_Format(PyExc_TypeError, \
-                                              "expected index value, got %.200s", Py_TYPE(o)->tp_name), \
-                                 (PyObject*)0))
-  #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \
-                                  !PyComplex_Check(o))
-  #define PyIndex_Check __Pyx_PyIndex_Check
-  #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message)
-  #define __PYX_BUILD_PY_SSIZE_T "i"
-#else
-  #define __PYX_BUILD_PY_SSIZE_T "n"
-  #define CYTHON_FORMAT_SSIZE_T "z"
-  #define __Pyx_PyIndex_Check PyIndex_Check
-#endif
-#if PY_VERSION_HEX < 0x02060000
-  #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)
-  #define Py_TYPE(ob)   (((PyObject*)(ob))->ob_type)
-  #define Py_SIZE(ob)   (((PyVarObject*)(ob))->ob_size)
-  #define PyVarObject_HEAD_INIT(type, size) \
-          PyObject_HEAD_INIT(type) size,
-  #define PyType_Modified(t)
-  typedef struct {
-     void *buf;
-     PyObject *obj;
-     Py_ssize_t len;
-     Py_ssize_t itemsize;
-     int readonly;
-     int ndim;
-     char *format;
-     Py_ssize_t *shape;
-     Py_ssize_t *strides;
-     Py_ssize_t *suboffsets;
-     void *internal;
-  } Py_buffer;
-  #define PyBUF_SIMPLE 0
-  #define PyBUF_WRITABLE 0x0001
-  #define PyBUF_FORMAT 0x0004
-  #define PyBUF_ND 0x0008
-  #define PyBUF_STRIDES (0x0010 | PyBUF_ND)
-  #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES)
-  #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES)
-  #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES)
-  #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES)
-  #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE)
-  #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE)
-  typedef int (*getbufferproc)(PyObject *, Py_buffer *, int);
-  typedef void (*releasebufferproc)(PyObject *, Py_buffer *);
+#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600
+#define Py_OptimizeFlag 0
 #endif
+#define __PYX_BUILD_PY_SSIZE_T "n"
+#define CYTHON_FORMAT_SSIZE_T "z"
 #if PY_MAJOR_VERSION < 3
   #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
   #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
-          PyCode_New(a, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
+          PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
+  #define __Pyx_DefaultClassType PyClass_Type
 #else
   #define __Pyx_BUILTIN_MODULE_NAME "builtins"
   #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
           PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
-#endif
-#if PY_MAJOR_VERSION < 3 && PY_MINOR_VERSION < 6
-  #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict")
+  #define __Pyx_DefaultClassType PyType_Type
 #endif
 #if PY_MAJOR_VERSION >= 3
   #define Py_TPFLAGS_CHECKTYPES 0
   #define Py_TPFLAGS_HAVE_INDEX 0
-#endif
-#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3)
   #define Py_TPFLAGS_HAVE_NEWBUFFER 0
 #endif
+#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE)
+  #define Py_TPFLAGS_HAVE_FINALIZE 0
+#endif
 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
   #define CYTHON_PEP393_ENABLED 1
   #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ? \
                                               0 : _PyUnicode_Ready((PyObject *)(op)))
   #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
   #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
+  #define __Pyx_PyUnicode_KIND(u)         PyUnicode_KIND(u)
+  #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
   #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
 #else
   #define CYTHON_PEP393_ENABLED 0
   #define __Pyx_PyUnicode_READY(op)       (0)
   #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
   #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
-  #define __Pyx_PyUnicode_READ(k, d, i)   ((k=k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
+  #define __Pyx_PyUnicode_KIND(u)         (sizeof(Py_UNICODE))
+  #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
+  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
+#endif
+#if CYTHON_COMPILING_IN_PYPY
+  #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
+  #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
+  #define __Pyx_PyFrozenSet_Size(s)         PyObject_Size(s)
+#else
+  #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
+  #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ? \
+      PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
+  #define __Pyx_PyFrozenSet_Size(s)         PySet_Size(s)
+#endif
+#define __Pyx_PyString_FormatSafe(a, b)   ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
+#define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
+#if PY_MAJOR_VERSION >= 3
+  #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
+#else
+  #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
 #endif
 #if PY_MAJOR_VERSION >= 3
   #define PyBaseString_Type            PyUnicode_Type
@@ -137,27 +120,12 @@
   #define PyString_Check               PyUnicode_Check
   #define PyString_CheckExact          PyUnicode_CheckExact
 #endif
-#if PY_VERSION_HEX < 0x02060000
-  #define PyBytesObject                PyStringObject
-  #define PyBytes_Type                 PyString_Type
-  #define PyBytes_Check                PyString_Check
-  #define PyBytes_CheckExact           PyString_CheckExact
-  #define PyBytes_FromString           PyString_FromString
-  #define PyBytes_FromStringAndSize    PyString_FromStringAndSize
-  #define PyBytes_FromFormat           PyString_FromFormat
-  #define PyBytes_DecodeEscape         PyString_DecodeEscape
-  #define PyBytes_AsString             PyString_AsString
-  #define PyBytes_AsStringAndSize      PyString_AsStringAndSize
-  #define PyBytes_Size                 PyString_Size
-  #define PyBytes_AS_STRING            PyString_AS_STRING
-  #define PyBytes_GET_SIZE             PyString_GET_SIZE
-  #define PyBytes_Repr                 PyString_Repr
-  #define PyBytes_Concat               PyString_Concat
-  #define PyBytes_ConcatAndDel         PyString_ConcatAndDel
-#endif
-#if PY_VERSION_HEX < 0x02060000
-  #define PySet_Check(obj)             PyObject_TypeCheck(obj, &PySet_Type)
-  #define PyFrozenSet_Check(obj)       PyObject_TypeCheck(obj, &PyFrozenSet_Type)
+#if PY_MAJOR_VERSION >= 3
+  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
+  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
+#else
+  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
+  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
 #endif
 #ifndef PySet_CheckExact
   #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
@@ -178,11 +146,17 @@
   #define PyInt_AsSsize_t              PyLong_AsSsize_t
   #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
   #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
+  #define PyNumber_Int                 PyNumber_Long
 #endif
 #if PY_MAJOR_VERSION >= 3
   #define PyBoolObject                 PyLongObject
 #endif
-#if PY_VERSION_HEX < 0x03020000
+#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
+  #ifndef PyUnicode_InternFromString
+    #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
+  #endif
+#endif
+#if PY_VERSION_HEX < 0x030200A4
   typedef long Py_hash_t;
   #define __Pyx_PyInt_FromHash_t PyInt_FromLong
   #define __Pyx_PyInt_AsHash_t   PyInt_AsLong
@@ -190,42 +164,50 @@
   #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
   #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
 #endif
-#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300)
-  #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b)
-  #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value)
-  #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b)
+#if PY_MAJOR_VERSION >= 3
+  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
 #else
-  #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \
-        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \
-        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \
-            (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0)))
-  #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \
-        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
-        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \
-            (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1)))
-  #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \
-        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
-        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \
-            (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1)))
+  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
 #endif
-#if PY_MAJOR_VERSION >= 3
-  #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
+#ifndef CYTHON_INLINE
+  #if defined(__GNUC__)
+    #define CYTHON_INLINE __inline__
+  #elif defined(_MSC_VER)
+    #define CYTHON_INLINE __inline
+  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+    #define CYTHON_INLINE inline
+  #else
+    #define CYTHON_INLINE
+  #endif
 #endif
-#if PY_VERSION_HEX < 0x02050000
-  #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),((char *)(n)))
-  #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a))
-  #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),((char *)(n)))
-#else
-  #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),(n))
-  #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a))
-  #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),(n))
+#ifndef CYTHON_RESTRICT
+  #if defined(__GNUC__)
+    #define CYTHON_RESTRICT __restrict__
+  #elif defined(_MSC_VER) && _MSC_VER >= 1400
+    #define CYTHON_RESTRICT __restrict
+  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+    #define CYTHON_RESTRICT restrict
+  #else
+    #define CYTHON_RESTRICT
+  #endif
 #endif
-#if PY_VERSION_HEX < 0x02050000
-  #define __Pyx_NAMESTR(n) ((char *)(n))
-  #define __Pyx_DOCSTR(n)  ((char *)(n))
+#ifdef NAN
+#define __PYX_NAN() ((float) NAN)
 #else
-  #define __Pyx_NAMESTR(n) (n)
-  #define __Pyx_DOCSTR(n)  (n)
+static CYTHON_INLINE float __PYX_NAN() {
+  /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and
+   a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is
+   a quiet NaN. */
+  float value;
+  memset(&value, 0xFF, sizeof(value));
+  return value;
+}
+#endif
+#ifdef __cplusplus
+template<typename T>
+void __Pyx_call_destructor(T* x) {
+    x->~T();
+}
 #endif
 
 
@@ -262,21 +244,6 @@
 #define CYTHON_WITHOUT_ASSERTIONS
 #endif
 
-
-/* inline attribute */
-#ifndef CYTHON_INLINE
-  #if defined(__GNUC__)
-    #define CYTHON_INLINE __inline__
-  #elif defined(_MSC_VER)
-    #define CYTHON_INLINE __inline
-  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
-    #define CYTHON_INLINE inline
-  #else
-    #define CYTHON_INLINE
-  #endif
-#endif
-
-/* unused attribute */
 #ifndef CYTHON_UNUSED
 # if defined(__GNUC__)
 #   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
@@ -290,46 +257,157 @@
 #   define CYTHON_UNUSED
 # endif
 #endif
-
-typedef struct {PyObject **p; char *s; const long n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/
-
-
-/* Type Conversion Predeclarations */
-
-#define __Pyx_PyBytes_FromUString(s) PyBytes_FromString((char*)s)
-#define __Pyx_PyBytes_AsUString(s)   ((unsigned char*) PyBytes_AsString(s))
-
+typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding;
+                const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
+
+#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
+#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
+#define __PYX_DEFAULT_STRING_ENCODING ""
+#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
+#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
+#define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (    \
+    (sizeof(type) < sizeof(Py_ssize_t))  ||             \
+    (sizeof(type) > sizeof(Py_ssize_t) &&               \
+          likely(v < (type)PY_SSIZE_T_MAX ||            \
+                 v == (type)PY_SSIZE_T_MAX)  &&         \
+          (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||       \
+                                v == (type)PY_SSIZE_T_MIN)))  ||  \
+    (sizeof(type) == sizeof(Py_ssize_t) &&              \
+          (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||        \
+                               v == (type)PY_SSIZE_T_MAX)))  )
+static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
+static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
+#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
+#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
+#define __Pyx_PyBytes_FromString        PyBytes_FromString
+#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
+static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
+#if PY_MAJOR_VERSION < 3
+    #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
+    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
+#else
+    #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
+    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
+#endif
+#define __Pyx_PyObject_AsSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
+#define __Pyx_PyObject_AsUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
+#define __Pyx_PyObject_FromUString(s)  __Pyx_PyObject_FromString((const char*)s)
+#define __Pyx_PyBytes_FromUString(s)   __Pyx_PyBytes_FromString((const char*)s)
+#define __Pyx_PyByteArray_FromUString(s)   __Pyx_PyByteArray_FromString((const char*)s)
+#define __Pyx_PyStr_FromUString(s)     __Pyx_PyStr_FromString((const char*)s)
+#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((const char*)s)
+#if PY_MAJOR_VERSION < 3
+static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
+{
+    const Py_UNICODE *u_end = u;
+    while (*u_end++) ;
+    return (size_t)(u_end - u - 1);
+}
+#else
+#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
+#endif
+#define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
+#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
+#define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
 #define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None)
 #define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
 static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
-
 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
-static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);
-
 #if CYTHON_COMPILING_IN_CPYTHON
 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
 #else
 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
 #endif
 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
+#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+static int __Pyx_sys_getdefaultencoding_not_ascii;
+static int __Pyx_init_sys_getdefaultencoding_params(void) {
+    PyObject* sys;
+    PyObject* default_encoding = NULL;
+    PyObject* ascii_chars_u = NULL;
+    PyObject* ascii_chars_b = NULL;
+    const char* default_encoding_c;
+    sys = PyImport_ImportModule("sys");
+    if (!sys) goto bad;
+    default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
+    Py_DECREF(sys);
+    if (!default_encoding) goto bad;
+    default_encoding_c = PyBytes_AsString(default_encoding);
+    if (!default_encoding_c) goto bad;
+    if (strcmp(default_encoding_c, "ascii") == 0) {
+        __Pyx_sys_getdefaultencoding_not_ascii = 0;
+    } else {
+        char ascii_chars[128];
+        int c;
+        for (c = 0; c < 128; c++) {
+            ascii_chars[c] = c;
+        }
+        __Pyx_sys_getdefaultencoding_not_ascii = 1;
+        ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
+        if (!ascii_chars_u) goto bad;
+        ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
+        if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
+            PyErr_Format(
+                PyExc_ValueError,
+                "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
+                default_encoding_c);
+            goto bad;
+        }
+        Py_DECREF(ascii_chars_u);
+        Py_DECREF(ascii_chars_b);
+    }
+    Py_DECREF(default_encoding);
+    return 0;
+bad:
+    Py_XDECREF(default_encoding);
+    Py_XDECREF(ascii_chars_u);
+    Py_XDECREF(ascii_chars_b);
+    return -1;
+}
+#endif
+#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
+#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
+#else
+#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
+#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
+static char* __PYX_DEFAULT_STRING_ENCODING;
+static int __Pyx_init_sys_getdefaultencoding_params(void) {
+    PyObject* sys;
+    PyObject* default_encoding = NULL;
+    char* default_encoding_c;
+    sys = PyImport_ImportModule("sys");
+    if (!sys) goto bad;
+    default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
+    Py_DECREF(sys);
+    if (!default_encoding) goto bad;
+    default_encoding_c = PyBytes_AsString(default_encoding);
+    if (!default_encoding_c) goto bad;
+    __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c));
+    if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
+    strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
+    Py_DECREF(default_encoding);
+    return 0;
+bad:
+    Py_XDECREF(default_encoding);
+    return -1;
+}
+#endif
+#endif
+
 
-#ifdef __GNUC__
-  /* Test for GCC > 2.95 */
-  #if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))
-    #define likely(x)   __builtin_expect(!!(x), 1)
-    #define unlikely(x) __builtin_expect(!!(x), 0)
-  #else /* __GNUC__ > 2 ... */
-    #define likely(x)   (x)
-    #define unlikely(x) (x)
-  #endif /* __GNUC__ > 2 ... */
-#else /* __GNUC__ */
+/* Test for GCC > 2.95 */
+#if defined(__GNUC__)     && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
+  #define likely(x)   __builtin_expect(!!(x), 1)
+  #define unlikely(x) __builtin_expect(!!(x), 0)
+#else /* !__GNUC__ or GCC < 2.95 */
   #define likely(x)   (x)
   #define unlikely(x) (x)
 #endif /* __GNUC__ */
-    
+
 static PyObject *__pyx_m;
+static PyObject *__pyx_d;
 static PyObject *__pyx_b;
 static PyObject *__pyx_empty_tuple;
 static PyObject *__pyx_empty_bytes;
@@ -357,7 +435,7 @@ static const char *__pyx_f[] = {
     void (*FinishContext)(void**);
   } __Pyx_RefNannyAPIStruct;
   static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
-  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/
+  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
   #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
 #ifdef WITH_THREAD
   #define __Pyx_RefNannySetupContext(name, acquire_gil) \
@@ -394,161 +472,99 @@ static const char *__pyx_f[] = {
   #define __Pyx_XDECREF(r) Py_XDECREF(r)
   #define __Pyx_XGOTREF(r)
   #define __Pyx_XGIVEREF(r)
-#endif /* CYTHON_REFNANNY */
+#endif
+#define __Pyx_XDECREF_SET(r, v) do {                            \
+        PyObject *tmp = (PyObject *) r;                         \
+        r = v; __Pyx_XDECREF(tmp);                              \
+    } while (0)
+#define __Pyx_DECREF_SET(r, v) do {                             \
+        PyObject *tmp = (PyObject *) r;                         \
+        r = v; __Pyx_DECREF(tmp);                               \
+    } while (0)
 #define __Pyx_CLEAR(r)    do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
 #define __Pyx_XCLEAR(r)   do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
 
-static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
+    PyTypeObject* tp = Py_TYPE(obj);
+    if (likely(tp->tp_getattro))
+        return tp->tp_getattro(obj, attr_name);
+#if PY_MAJOR_VERSION < 3
+    if (likely(tp->tp_getattr))
+        return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
+#endif
+    return PyObject_GetAttr(obj, attr_name);
+}
+#else
+#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
+#endif
+
+static PyObject *__Pyx_GetBuiltinName(PyObject *name);
 
 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
-    Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/
+    Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
 
-static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/
+static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
 
 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \
     PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \
-    const char* function_name); /*proto*/
+    const char* function_name);
 
-static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
-static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
+static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb);
+static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb);
 
-static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
 
 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t); /* proto */
 
-static CYTHON_INLINE long __Pyx_div_long(long, long); /* proto */
-
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
-    PyObject *r;
-    if (!j) return NULL;
-    r = PyObject_GetItem(o, j);
-    Py_DECREF(j);
-    return r;
-}
-#define __Pyx_GetItemInt_List(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
-                                                    __Pyx_GetItemInt_List_Fast(o, i) : \
-                                                    __Pyx_GetItemInt_Generic(o, to_py_func(i)))
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i) {
-#if CYTHON_COMPILING_IN_CPYTHON
-    if (likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
-        PyObject *r = PyList_GET_ITEM(o, i);
-        Py_INCREF(r);
-        return r;
-    }
-    else if ((-PyList_GET_SIZE(o) <= i) & (i < 0)) {
-        PyObject *r = PyList_GET_ITEM(o, PyList_GET_SIZE(o) + i);
-        Py_INCREF(r);
-        return r;
-    }
-    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
-#else
-    return PySequence_GetItem(o, i);
-#endif
-}
-#define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
-                                                    __Pyx_GetItemInt_Tuple_Fast(o, i) : \
-                                                    __Pyx_GetItemInt_Generic(o, to_py_func(i)))
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i) {
-#if CYTHON_COMPILING_IN_CPYTHON
-    if (likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
-        PyObject *r = PyTuple_GET_ITEM(o, i);
-        Py_INCREF(r);
-        return r;
-    }
-    else if ((-PyTuple_GET_SIZE(o) <= i) & (i < 0)) {
-        PyObject *r = PyTuple_GET_ITEM(o, PyTuple_GET_SIZE(o) + i);
-        Py_INCREF(r);
-        return r;
-    }
-    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
-#else
-    return PySequence_GetItem(o, i);
-#endif
-}
-#define __Pyx_GetItemInt(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
-                                                    __Pyx_GetItemInt_Fast(o, i) : \
-                                                    __Pyx_GetItemInt_Generic(o, to_py_func(i)))
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i) {
 #if CYTHON_COMPILING_IN_CPYTHON
-    if (PyList_CheckExact(o)) {
-        Py_ssize_t n = (likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
-        if (likely((n >= 0) & (n < PyList_GET_SIZE(o)))) {
-            PyObject *r = PyList_GET_ITEM(o, n);
-            Py_INCREF(r);
-            return r;
-        }
-    }
-    else if (PyTuple_CheckExact(o)) {
-        Py_ssize_t n = (likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
-        if (likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
-            PyObject *r = PyTuple_GET_ITEM(o, n);
-            Py_INCREF(r);
-            return r;
-        }
-    } else {  /* inlined PySequence_GetItem() */
-        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
-        if (likely(m && m->sq_item)) {
-            if (unlikely(i < 0) && likely(m->sq_length)) {
-                Py_ssize_t l = m->sq_length(o);
-                if (unlikely(l < 0)) return NULL;
-                i += l;
-            }
-            return m->sq_item(o, i);
-        }
-    }
+static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
 #else
-    if (PySequence_Check(o)) {
-        return PySequence_GetItem(o, i);
-    }
-#endif
-    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
-}
-
-static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, long level); /*proto*/
-
-static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_int32_t(int32_t);
-
-static int __Pyx_Print(PyObject*, PyObject *, int); /*proto*/
-#if CYTHON_COMPILING_IN_PYPY || PY_MAJOR_VERSION >= 3
-static PyObject* __pyx_print = 0;
-static PyObject* __pyx_print_kwargs = 0;
+#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
 #endif
 
-static int __Pyx_PrintOne(PyObject* stream, PyObject *o); /*proto*/
+#include <string.h>
 
-static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);
+static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
 
-static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);
+static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
 
-static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);
-
-static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *);
-
-static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *);
-
-static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *);
-
-static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);
-
-static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);
-
-static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);
-
-static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *);
-
-static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);
-
-static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);
-
-static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *);
+#if PY_MAJOR_VERSION >= 3
+#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
+#else
+#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
+#endif
 
-static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);
+static CYTHON_INLINE long __Pyx_div_long(long, long); /* proto */
 
-static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);
+#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
+    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
+    __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) : \
+    (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) : \
+               __Pyx_GetItemInt_Generic(o, to_py_func(i))))
+#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
+    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
+    __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \
+    (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
+                                                              int wraparound, int boundscheck);
+#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
+    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
+    __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \
+    (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
+                                                              int wraparound, int boundscheck);
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
+                                                     int is_list, int wraparound, int boundscheck);
+
+static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);
 
-static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
+#endif
 
-static int __Pyx_check_binary_version(void);
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
 
 typedef struct {
     int code_line;
@@ -565,9 +581,29 @@ static PyCodeObject *__pyx_find_code_object(int code_line);
 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
 
 static void __Pyx_AddTraceback(const char *funcname, int c_line,
-                               int py_line, const char *filename); /*proto*/
+                               int py_line, const char *filename);
+
+static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int32_t(int32_t value);
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
+
+static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
+
+static int __Pyx_Print(PyObject*, PyObject *, int);
+#if CYTHON_COMPILING_IN_PYPY || PY_MAJOR_VERSION >= 3
+static PyObject* __pyx_print = 0;
+static PyObject* __pyx_print_kwargs = 0;
+#endif
+
+static int __Pyx_PrintOne(PyObject* stream, PyObject *o);
+
+static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
 
-static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
+static int __Pyx_check_binary_version(void);
+
+static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
 
 
 /* Module declarations from 'g2clib' */
@@ -589,285 +625,293 @@ static PyObject *__pyx_pf_6g2clib_16grib2_create(CYTHON_UNUSED PyObject *__pyx_s
 static PyObject *__pyx_pf_6g2clib_18grib2_end(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_gribmsg); /* proto */
 static PyObject *__pyx_pf_6g2clib_20grib2_addgrid(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_gribmsg, PyObject *__pyx_v_gds, PyObject *__pyx_v_gdstmpl, PyObject *__pyx_v_deflist, CYTHON_UNUSED PyObject *__pyx_v_defnum); /* proto */
 static PyObject *__pyx_pf_6g2clib_22grib2_addfield(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_gribmsg, PyObject *__pyx_v_pdsnum, PyObject *__pyx_v_pdstmpl, PyObject *__pyx_v_coordlist, PyObject *__pyx_v_drsnum, PyObject *__pyx_v_drstmpl, PyObject *__pyx_v_field, PyObject *__pyx_v_ibitmap, PyObject *__pyx_v_bitmap); /* proto */
-static char __pyx_k_1[] = "error getting buffer for input real array";
-static char __pyx_k_2[] = "error getting buffer for output integer array";
-static char __pyx_k_3[] = "integer output array must be as least as long a real input array";
-static char __pyx_k_4[] = "error getting buffer for output real array";
-static char __pyx_k_5[] = "error getting buffer for input integer array";
-static char __pyx_k_6[] = "real output array must be as least as long a integerinput array";
-static char __pyx_k_7[] = "unknown array type %s";
-static char __pyx_k_8[] = "Error unpacking section 1 - error code = %i";
-static char __pyx_k_9[] = "Error unpacking section 3 - error code = %i";
-static char __pyx_k_11[] = "Error unpacking section 4 - error code = %i";
-static char __pyx_k_12[] = "Error unpacking section 5 - error code = %i";
-static char __pyx_k_13[] = "Error unpacking section 6 - error code = %i";
-static char __pyx_k_15[] = "Error unpacking section 7 - error code = %i";
-static char __pyx_k_16[] = "%.";
-static char __pyx_k_17[] = "min/max=";
-static char __pyx_k_18[] = "/";
-static char __pyx_k_19[] = " ";
-static char __pyx_k_20[] = "Error in grib2_create, error code = %i";
-static char __pyx_k_21[] = "        ";
-static char __pyx_k_22[] = "error in grib2_end, error code = %i";
-static char __pyx_k_23[] = "error in grib2_addgrid, error code = %i";
-static char __pyx_k_24[] = "error in grib2_addfield, error code = %i";
-static char __pyx_k_25[] = "Pyrex code to provide python interfaces to functions\nin the NCEP grib2c library. Make changes to this file, not the\nc-wrappers that Pyrex generates.";
-static char __pyx_k_28[] = "/Users/jsw/python/pygrib/g2clib.pyx";
-static char __pyx_k__C[] = "C";
-static char __pyx_k__g[] = "g";
-static char __pyx_k__i[] = "i";
-static char __pyx_k__n[] = "n";
-static char __pyx_k__f4[] = "f4";
-static char __pyx_k__i1[] = "i1";
-static char __pyx_k__i4[] = "i4";
-static char __pyx_k__r1[] = "r1";
-static char __pyx_k__fld[] = "fld";
-static char __pyx_k__gds[] = "gds";
-static char __pyx_k__ids[] = "ids";
-static char __pyx_k__msg[] = "msg";
-static char __pyx_k__pow[] = "pow";
-static char __pyx_k__bmap[] = "bmap";
-static char __pyx_k__ceil[] = "ceil";
-static char __pyx_k__data[] = "data";
-static char __pyx_k__iarr[] = "iarr";
-static char __pyx_k__idat[] = "idat";
-static char __pyx_k__ierr[] = "ierr";
-static char __pyx_k__igds[] = "igds";
-static char __pyx_k__ipos[] = "ipos";
-static char __pyx_k__math[] = "math";
-static char __pyx_k__rarr[] = "rarr";
-static char __pyx_k__rdat[] = "rdat";
-static char __pyx_k__rmax[] = "rmax";
-static char __pyx_k__rmin[] = "rmin";
-static char __pyx_k__cgrib[] = "cgrib";
-static char __pyx_k__dtype[] = "dtype";
-static char __pyx_k__field[] = "field";
-static char __pyx_k__ibmap[] = "ibmap";
-static char __pyx_k__idata[] = "idata";
-static char __pyx_k__int32[] = "int32";
-static char __pyx_k__iofst[] = "iofst";
-static char __pyx_k__isec0[] = "isec0";
-static char __pyx_k__isec1[] = "isec1";
-static char __pyx_k__lgrib[] = "lgrib";
-static char __pyx_k__log10[] = "log10";
-static char __pyx_k__ndpts[] = "ndpts";
-static char __pyx_k__ngpts[] = "ngpts";
-static char __pyx_k__order[] = "order";
-static char __pyx_k__rdata[] = "rdata";
-static char __pyx_k__zeros[] = "zeros";
-static char __pyx_k__bitmap[] = "bitmap";
-static char __pyx_k__buflen[] = "buflen";
-static char __pyx_k__defnum[] = "defnum";
-static char __pyx_k__drsnum[] = "drsnum";
-static char __pyx_k__drtmpl[] = "drtmpl";
-static char __pyx_k__drtnum[] = "drtnum";
-static char __pyx_k__fldmax[] = "fldmax";
-static char __pyx_k__fldmin[] = "fldmin";
-static char __pyx_k__format[] = "format";
-static char __pyx_k__g2clib[] = "g2clib";
-static char __pyx_k__gdsdat[] = "gdsdat";
-static char __pyx_k__gdtmpl[] = "gdtmpl";
-static char __pyx_k__gdtnum[] = "gdtnum";
-static char __pyx_k__idsect[] = "idsect";
-static char __pyx_k__idslen[] = "idslen";
-static char __pyx_k__pdsnum[] = "pdsnum";
-static char __pyx_k__pdtmpl[] = "pdtmpl";
-static char __pyx_k__bufleni[] = "bufleni";
-static char __pyx_k__buflenr[] = "buflenr";
-static char __pyx_k__deflist[] = "deflist";
-static char __pyx_k__drstmpl[] = "drstmpl";
-static char __pyx_k__float32[] = "float32";
-static char __pyx_k__gdstmpl[] = "gdstmpl";
-static char __pyx_k__gribmsg[] = "gribmsg";
-static char __pyx_k__ibitmap[] = "ibitmap";
-static char __pyx_k__idefnum[] = "idefnum";
-static char __pyx_k__idrsnum[] = "idrsnum";
-static char __pyx_k__igdsnum[] = "igdsnum";
-static char __pyx_k__ipdsnum[] = "ipdsnum";
-static char __pyx_k__ngrdpts[] = "ngrdpts";
-static char __pyx_k__pdstmpl[] = "pdstmpl";
-static char __pyx_k__unpack1[] = "unpack1";
-static char __pyx_k__unpack3[] = "unpack3";
-static char __pyx_k__unpack4[] = "unpack4";
-static char __pyx_k__unpack5[] = "unpack5";
-static char __pyx_k__unpack6[] = "unpack6";
-static char __pyx_k__unpack7[] = "unpack7";
-static char __pyx_k____main__[] = "__main__";
-static char __pyx_k____test__[] = "__test__";
-static char __pyx_k__fielddat[] = "fielddat";
-static char __pyx_k__ideflist[] = "ideflist";
-static char __pyx_k__idrstmpl[] = "idrstmpl";
-static char __pyx_k__igdstmpl[] = "igdstmpl";
-static char __pyx_k__ipdstmpl[] = "ipdstmpl";
-static char __pyx_k__listsec0[] = "listsec0";
-static char __pyx_k__listsec1[] = "listsec1";
-static char __pyx_k__numcoord[] = "numcoord";
-static char __pyx_k__bitmapdat[] = "bitmapdat";
-static char __pyx_k__coordlist[] = "coordlist";
-static char __pyx_k__drtmpldat[] = "drtmpldat";
-static char __pyx_k__gdtmpldat[] = "gdtmpldat";
-static char __pyx_k__grib2_end[] = "grib2_end";
-static char __pyx_k__itor_ieee[] = "itor_ieee";
-static char __pyx_k__mapdrslen[] = "mapdrslen";
-static char __pyx_k__mappdslen[] = "mappdslen";
-static char __pyx_k__pdtmpldat[] = "pdtmpldat";
-static char __pyx_k__rtoi_ieee[] = "rtoi_ieee";
-static char __pyx_k__deflistdat[] = "deflistdat";
-static char __pyx_k__fcoordlist[] = "fcoordlist";
-static char __pyx_k__gdstmpldat[] = "gdstmpldat";
-static char __pyx_k__icoordlist[] = "icoordlist";
-static char __pyx_k__mapgridlen[] = "mapgridlen";
-static char __pyx_k__listsec0dat[] = "listsec0dat";
-static char __pyx_k__listsec1dat[] = "listsec1dat";
-static char __pyx_k__printminmax[] = "printminmax";
-static char __pyx_k__RuntimeError[] = "RuntimeError";
-static char __pyx_k__coordlistdat[] = "coordlistdat";
-static char __pyx_k__grib2_create[] = "grib2_create";
-static char __pyx_k__minmaxstring[] = "minmaxstring";
-static char __pyx_k__storageorder[] = "storageorder";
-static char __pyx_k__grib2_addgrid[] = "grib2_addgrid";
-static char __pyx_k__grib2_addfield[] = "grib2_addfield";
-static char __pyx_k__bitsofprecision[] = "bitsofprecision";
-static char __pyx_k__digitsofprecision[] = "digitsofprecision";
-static PyObject *__pyx_kp_s_1;
-static PyObject *__pyx_kp_s_11;
-static PyObject *__pyx_kp_s_12;
-static PyObject *__pyx_kp_s_13;
-static PyObject *__pyx_kp_s_15;
-static PyObject *__pyx_kp_s_16;
-static PyObject *__pyx_kp_s_17;
-static PyObject *__pyx_kp_s_18;
-static PyObject *__pyx_kp_b_19;
-static PyObject *__pyx_kp_s_2;
-static PyObject *__pyx_kp_s_20;
-static PyObject *__pyx_kp_b_21;
-static PyObject *__pyx_kp_s_22;
-static PyObject *__pyx_kp_s_23;
-static PyObject *__pyx_kp_s_24;
-static PyObject *__pyx_kp_s_28;
-static PyObject *__pyx_kp_s_3;
-static PyObject *__pyx_kp_s_4;
-static PyObject *__pyx_kp_s_5;
-static PyObject *__pyx_kp_s_6;
-static PyObject *__pyx_kp_s_7;
-static PyObject *__pyx_kp_s_8;
-static PyObject *__pyx_kp_s_9;
-static PyObject *__pyx_n_s__C;
-static PyObject *__pyx_n_s__RuntimeError;
-static PyObject *__pyx_n_s____main__;
-static PyObject *__pyx_n_s____test__;
-static PyObject *__pyx_n_s__bitmap;
-static PyObject *__pyx_n_s__bitmapdat;
-static PyObject *__pyx_n_s__bitsofprecision;
-static PyObject *__pyx_n_s__bmap;
-static PyObject *__pyx_n_s__buflen;
-static PyObject *__pyx_n_s__bufleni;
-static PyObject *__pyx_n_s__buflenr;
-static PyObject *__pyx_n_s__ceil;
-static PyObject *__pyx_n_s__cgrib;
-static PyObject *__pyx_n_s__coordlist;
-static PyObject *__pyx_n_s__coordlistdat;
-static PyObject *__pyx_n_s__data;
-static PyObject *__pyx_n_s__deflist;
-static PyObject *__pyx_n_s__deflistdat;
-static PyObject *__pyx_n_s__defnum;
-static PyObject *__pyx_n_s__digitsofprecision;
-static PyObject *__pyx_n_s__drsnum;
-static PyObject *__pyx_n_s__drstmpl;
-static PyObject *__pyx_n_s__drtmpl;
-static PyObject *__pyx_n_s__drtmpldat;
-static PyObject *__pyx_n_s__drtnum;
-static PyObject *__pyx_n_s__dtype;
-static PyObject *__pyx_n_s__f4;
-static PyObject *__pyx_n_s__fcoordlist;
-static PyObject *__pyx_n_s__field;
-static PyObject *__pyx_n_s__fielddat;
-static PyObject *__pyx_n_s__fld;
-static PyObject *__pyx_n_s__fldmax;
-static PyObject *__pyx_n_s__fldmin;
-static PyObject *__pyx_n_s__float32;
-static PyObject *__pyx_n_s__format;
-static PyObject *__pyx_n_s__g;
-static PyObject *__pyx_n_s__g2clib;
-static PyObject *__pyx_n_s__gds;
-static PyObject *__pyx_n_s__gdsdat;
-static PyObject *__pyx_n_s__gdstmpl;
-static PyObject *__pyx_n_s__gdstmpldat;
-static PyObject *__pyx_n_s__gdtmpl;
-static PyObject *__pyx_n_s__gdtmpldat;
-static PyObject *__pyx_n_s__gdtnum;
-static PyObject *__pyx_n_s__grib2_addfield;
-static PyObject *__pyx_n_s__grib2_addgrid;
-static PyObject *__pyx_n_s__grib2_create;
-static PyObject *__pyx_n_s__grib2_end;
-static PyObject *__pyx_n_s__gribmsg;
-static PyObject *__pyx_n_s__i;
-static PyObject *__pyx_n_s__i1;
-static PyObject *__pyx_n_s__i4;
-static PyObject *__pyx_n_s__iarr;
-static PyObject *__pyx_n_s__ibitmap;
-static PyObject *__pyx_n_s__ibmap;
-static PyObject *__pyx_n_s__icoordlist;
-static PyObject *__pyx_n_s__idat;
-static PyObject *__pyx_n_s__idata;
-static PyObject *__pyx_n_s__ideflist;
-static PyObject *__pyx_n_s__idefnum;
-static PyObject *__pyx_n_s__idrsnum;
-static PyObject *__pyx_n_s__idrstmpl;
-static PyObject *__pyx_n_s__ids;
-static PyObject *__pyx_n_s__idsect;
-static PyObject *__pyx_n_s__idslen;
-static PyObject *__pyx_n_s__ierr;
-static PyObject *__pyx_n_s__igds;
-static PyObject *__pyx_n_s__igdsnum;
-static PyObject *__pyx_n_s__igdstmpl;
-static PyObject *__pyx_n_s__int32;
-static PyObject *__pyx_n_s__iofst;
-static PyObject *__pyx_n_s__ipdsnum;
-static PyObject *__pyx_n_s__ipdstmpl;
-static PyObject *__pyx_n_s__ipos;
-static PyObject *__pyx_n_s__isec0;
-static PyObject *__pyx_n_s__isec1;
-static PyObject *__pyx_n_s__itor_ieee;
-static PyObject *__pyx_n_s__lgrib;
-static PyObject *__pyx_n_s__listsec0;
-static PyObject *__pyx_n_s__listsec0dat;
-static PyObject *__pyx_n_s__listsec1;
-static PyObject *__pyx_n_s__listsec1dat;
-static PyObject *__pyx_n_s__log10;
-static PyObject *__pyx_n_s__mapdrslen;
-static PyObject *__pyx_n_s__mapgridlen;
-static PyObject *__pyx_n_s__mappdslen;
-static PyObject *__pyx_n_s__math;
-static PyObject *__pyx_n_s__minmaxstring;
-static PyObject *__pyx_n_s__msg;
-static PyObject *__pyx_n_s__n;
-static PyObject *__pyx_n_s__ndpts;
-static PyObject *__pyx_n_s__ngpts;
-static PyObject *__pyx_n_s__ngrdpts;
-static PyObject *__pyx_n_s__numcoord;
-static PyObject *__pyx_n_s__order;
-static PyObject *__pyx_n_s__pdsnum;
-static PyObject *__pyx_n_s__pdstmpl;
-static PyObject *__pyx_n_s__pdtmpl;
-static PyObject *__pyx_n_s__pdtmpldat;
-static PyObject *__pyx_n_s__pow;
-static PyObject *__pyx_n_s__printminmax;
-static PyObject *__pyx_n_s__r1;
-static PyObject *__pyx_n_s__rarr;
-static PyObject *__pyx_n_s__rdat;
-static PyObject *__pyx_n_s__rdata;
-static PyObject *__pyx_n_s__rmax;
-static PyObject *__pyx_n_s__rmin;
-static PyObject *__pyx_n_s__rtoi_ieee;
-static PyObject *__pyx_n_s__storageorder;
-static PyObject *__pyx_n_s__unpack1;
-static PyObject *__pyx_n_s__unpack3;
-static PyObject *__pyx_n_s__unpack4;
-static PyObject *__pyx_n_s__unpack5;
-static PyObject *__pyx_n_s__unpack6;
-static PyObject *__pyx_n_s__unpack7;
-static PyObject *__pyx_n_s__zeros;
+static char __pyx_k_C[] = "C";
+static char __pyx_k_g[] = "g";
+static char __pyx_k_i[] = "i";
+static char __pyx_k_n[] = "n";
+static char __pyx_k__2[] = "%.";
+static char __pyx_k__3[] = "/";
+static char __pyx_k__4[] = " ";
+static char __pyx_k__5[] = "        ";
+static char __pyx_k_f4[] = "f4";
+static char __pyx_k_i1[] = "i1";
+static char __pyx_k_i4[] = "i4";
+static char __pyx_k_r1[] = "r1";
+static char __pyx_k_end[] = "end";
+static char __pyx_k_fld[] = "fld";
+static char __pyx_k_gds[] = "gds";
+static char __pyx_k_ids[] = "ids";
+static char __pyx_k_msg[] = "msg";
+static char __pyx_k_pow[] = "pow";
+static char __pyx_k_bmap[] = "bmap";
+static char __pyx_k_ceil[] = "ceil";
+static char __pyx_k_data[] = "data";
+static char __pyx_k_file[] = "file";
+static char __pyx_k_iarr[] = "iarr";
+static char __pyx_k_idat[] = "idat";
+static char __pyx_k_ierr[] = "ierr";
+static char __pyx_k_igds[] = "igds";
+static char __pyx_k_ipos[] = "ipos";
+static char __pyx_k_main[] = "__main__";
+static char __pyx_k_math[] = "math";
+static char __pyx_k_rarr[] = "rarr";
+static char __pyx_k_rdat[] = "rdat";
+static char __pyx_k_rmax[] = "rmax";
+static char __pyx_k_rmin[] = "rmin";
+static char __pyx_k_test[] = "__test__";
+static char __pyx_k_cgrib[] = "cgrib";
+static char __pyx_k_dtype[] = "dtype";
+static char __pyx_k_field[] = "field";
+static char __pyx_k_ibmap[] = "ibmap";
+static char __pyx_k_idata[] = "idata";
+static char __pyx_k_int32[] = "int32";
+static char __pyx_k_iofst[] = "iofst";
+static char __pyx_k_isec0[] = "isec0";
+static char __pyx_k_isec1[] = "isec1";
+static char __pyx_k_lgrib[] = "lgrib";
+static char __pyx_k_log10[] = "log10";
+static char __pyx_k_ndpts[] = "ndpts";
+static char __pyx_k_ngpts[] = "ngpts";
+static char __pyx_k_order[] = "order";
+static char __pyx_k_print[] = "print";
+static char __pyx_k_rdata[] = "rdata";
+static char __pyx_k_zeros[] = "zeros";
+static char __pyx_k_bitmap[] = "bitmap";
+static char __pyx_k_buflen[] = "buflen";
+static char __pyx_k_defnum[] = "defnum";
+static char __pyx_k_drsnum[] = "drsnum";
+static char __pyx_k_drtmpl[] = "drtmpl";
+static char __pyx_k_drtnum[] = "drtnum";
+static char __pyx_k_fldmax[] = "fldmax";
+static char __pyx_k_fldmin[] = "fldmin";
+static char __pyx_k_format[] = "format";
+static char __pyx_k_g2clib[] = "g2clib";
+static char __pyx_k_gdsdat[] = "gdsdat";
+static char __pyx_k_gdtmpl[] = "gdtmpl";
+static char __pyx_k_gdtnum[] = "gdtnum";
+static char __pyx_k_idsect[] = "idsect";
+static char __pyx_k_idslen[] = "idslen";
+static char __pyx_k_import[] = "__import__";
+static char __pyx_k_pdsnum[] = "pdsnum";
+static char __pyx_k_pdtmpl[] = "pdtmpl";
+static char __pyx_k_bufleni[] = "bufleni";
+static char __pyx_k_buflenr[] = "buflenr";
+static char __pyx_k_deflist[] = "deflist";
+static char __pyx_k_drstmpl[] = "drstmpl";
+static char __pyx_k_float32[] = "float32";
+static char __pyx_k_gdstmpl[] = "gdstmpl";
+static char __pyx_k_gribmsg[] = "gribmsg";
+static char __pyx_k_ibitmap[] = "ibitmap";
+static char __pyx_k_idefnum[] = "idefnum";
+static char __pyx_k_idrsnum[] = "idrsnum";
+static char __pyx_k_igdsnum[] = "igdsnum";
+static char __pyx_k_ipdsnum[] = "ipdsnum";
+static char __pyx_k_min_max[] = "min/max=";
+static char __pyx_k_ngrdpts[] = "ngrdpts";
+static char __pyx_k_pdstmpl[] = "pdstmpl";
+static char __pyx_k_unpack1[] = "unpack1";
+static char __pyx_k_unpack3[] = "unpack3";
+static char __pyx_k_unpack4[] = "unpack4";
+static char __pyx_k_unpack5[] = "unpack5";
+static char __pyx_k_unpack6[] = "unpack6";
+static char __pyx_k_unpack7[] = "unpack7";
+static char __pyx_k_fielddat[] = "fielddat";
+static char __pyx_k_ideflist[] = "ideflist";
+static char __pyx_k_idrstmpl[] = "idrstmpl";
+static char __pyx_k_igdstmpl[] = "igdstmpl";
+static char __pyx_k_ipdstmpl[] = "ipdstmpl";
+static char __pyx_k_listsec0[] = "listsec0";
+static char __pyx_k_listsec1[] = "listsec1";
+static char __pyx_k_numcoord[] = "numcoord";
+static char __pyx_k_bitmapdat[] = "bitmapdat";
+static char __pyx_k_coordlist[] = "coordlist";
+static char __pyx_k_drtmpldat[] = "drtmpldat";
+static char __pyx_k_gdtmpldat[] = "gdtmpldat";
+static char __pyx_k_grib2_end[] = "grib2_end";
+static char __pyx_k_itor_ieee[] = "itor_ieee";
+static char __pyx_k_mapdrslen[] = "mapdrslen";
+static char __pyx_k_mappdslen[] = "mappdslen";
+static char __pyx_k_pdtmpldat[] = "pdtmpldat";
+static char __pyx_k_rtoi_ieee[] = "rtoi_ieee";
+static char __pyx_k_deflistdat[] = "deflistdat";
+static char __pyx_k_fcoordlist[] = "fcoordlist";
+static char __pyx_k_gdstmpldat[] = "gdstmpldat";
+static char __pyx_k_icoordlist[] = "icoordlist";
+static char __pyx_k_mapgridlen[] = "mapgridlen";
+static char __pyx_k_listsec0dat[] = "listsec0dat";
+static char __pyx_k_listsec1dat[] = "listsec1dat";
+static char __pyx_k_printminmax[] = "printminmax";
+static char __pyx_k_RuntimeError[] = "RuntimeError";
+static char __pyx_k_coordlistdat[] = "coordlistdat";
+static char __pyx_k_grib2_create[] = "grib2_create";
+static char __pyx_k_minmaxstring[] = "minmaxstring";
+static char __pyx_k_storageorder[] = "storageorder";
+static char __pyx_k_grib2_addgrid[] = "grib2_addgrid";
+static char __pyx_k_grib2_addfield[] = "grib2_addfield";
+static char __pyx_k_bitsofprecision[] = "bitsofprecision";
+static char __pyx_k_digitsofprecision[] = "digitsofprecision";
+static char __pyx_k_unknown_array_type_s[] = "unknown array type %s";
+static char __pyx_k_Error_unpacking_section_1_error[] = "Error unpacking section 1 - error code = %i";
+static char __pyx_k_Error_unpacking_section_3_error[] = "Error unpacking section 3 - error code = %i";
+static char __pyx_k_Error_unpacking_section_4_error[] = "Error unpacking section 4 - error code = %i";
+static char __pyx_k_Error_unpacking_section_5_error[] = "Error unpacking section 5 - error code = %i";
+static char __pyx_k_Error_unpacking_section_6_error[] = "Error unpacking section 6 - error code = %i";
+static char __pyx_k_Error_unpacking_section_7_error[] = "Error unpacking section 7 - error code = %i";
+static char __pyx_k_Volumes_User_jwhitaker_python_p[] = "/Volumes/User/jwhitaker/python/pygrib.git/g2clib.pyx";
+static char __pyx_k_error_getting_buffer_for_output[] = "error getting buffer for output integer array";
+static char __pyx_k_error_in_grib2_end_error_code_i[] = "error in grib2_end, error code = %i";
+static char __pyx_k_integer_output_array_must_be_as[] = "integer output array must be as least as long a real input array";
+static char __pyx_k_Error_in_grib2_create_error_code[] = "Error in grib2_create, error code = %i";
+static char __pyx_k_Pyrex_code_to_provide_python_int[] = "Pyrex code to provide python interfaces to functions\nin the NCEP grib2c library. Make changes to this file, not the\nc-wrappers that Pyrex generates.";
+static char __pyx_k_error_getting_buffer_for_input_i[] = "error getting buffer for input integer array";
+static char __pyx_k_error_getting_buffer_for_input_r[] = "error getting buffer for input real array";
+static char __pyx_k_error_in_grib2_addfield_error_co[] = "error in grib2_addfield, error code = %i";
+static char __pyx_k_error_in_grib2_addgrid_error_cod[] = "error in grib2_addgrid, error code = %i";
+static char __pyx_k_real_output_array_must_be_as_lea[] = "real output array must be as least as long a integerinput array";
+static char __pyx_k_error_getting_buffer_for_output_2[] = "error getting buffer for output real array";
+static PyObject *__pyx_n_s_C;
+static PyObject *__pyx_kp_s_Error_in_grib2_create_error_code;
+static PyObject *__pyx_kp_s_Error_unpacking_section_1_error;
+static PyObject *__pyx_kp_s_Error_unpacking_section_3_error;
+static PyObject *__pyx_kp_s_Error_unpacking_section_4_error;
+static PyObject *__pyx_kp_s_Error_unpacking_section_5_error;
+static PyObject *__pyx_kp_s_Error_unpacking_section_6_error;
+static PyObject *__pyx_kp_s_Error_unpacking_section_7_error;
+static PyObject *__pyx_n_s_RuntimeError;
+static PyObject *__pyx_kp_s_Volumes_User_jwhitaker_python_p;
+static PyObject *__pyx_kp_s__2;
+static PyObject *__pyx_kp_s__3;
+static PyObject *__pyx_kp_b__4;
+static PyObject *__pyx_kp_b__5;
+static PyObject *__pyx_n_s_bitmap;
+static PyObject *__pyx_n_s_bitmapdat;
+static PyObject *__pyx_n_s_bitsofprecision;
+static PyObject *__pyx_n_s_bmap;
+static PyObject *__pyx_n_s_buflen;
+static PyObject *__pyx_n_s_bufleni;
+static PyObject *__pyx_n_s_buflenr;
+static PyObject *__pyx_n_s_ceil;
+static PyObject *__pyx_n_s_cgrib;
+static PyObject *__pyx_n_s_coordlist;
+static PyObject *__pyx_n_s_coordlistdat;
+static PyObject *__pyx_n_s_data;
+static PyObject *__pyx_n_s_deflist;
+static PyObject *__pyx_n_s_deflistdat;
+static PyObject *__pyx_n_s_defnum;
+static PyObject *__pyx_n_s_digitsofprecision;
+static PyObject *__pyx_n_s_drsnum;
+static PyObject *__pyx_n_s_drstmpl;
+static PyObject *__pyx_n_s_drtmpl;
+static PyObject *__pyx_n_s_drtmpldat;
+static PyObject *__pyx_n_s_drtnum;
+static PyObject *__pyx_n_s_dtype;
+static PyObject *__pyx_n_s_end;
+static PyObject *__pyx_kp_s_error_getting_buffer_for_input_i;
+static PyObject *__pyx_kp_s_error_getting_buffer_for_input_r;
+static PyObject *__pyx_kp_s_error_getting_buffer_for_output;
+static PyObject *__pyx_kp_s_error_getting_buffer_for_output_2;
+static PyObject *__pyx_kp_s_error_in_grib2_addfield_error_co;
+static PyObject *__pyx_kp_s_error_in_grib2_addgrid_error_cod;
+static PyObject *__pyx_kp_s_error_in_grib2_end_error_code_i;
+static PyObject *__pyx_n_s_f4;
+static PyObject *__pyx_n_s_fcoordlist;
+static PyObject *__pyx_n_s_field;
+static PyObject *__pyx_n_s_fielddat;
+static PyObject *__pyx_n_s_file;
+static PyObject *__pyx_n_s_fld;
+static PyObject *__pyx_n_s_fldmax;
+static PyObject *__pyx_n_s_fldmin;
+static PyObject *__pyx_n_s_float32;
+static PyObject *__pyx_n_s_format;
+static PyObject *__pyx_n_s_g;
+static PyObject *__pyx_n_s_g2clib;
+static PyObject *__pyx_n_s_gds;
+static PyObject *__pyx_n_s_gdsdat;
+static PyObject *__pyx_n_s_gdstmpl;
+static PyObject *__pyx_n_s_gdstmpldat;
+static PyObject *__pyx_n_s_gdtmpl;
+static PyObject *__pyx_n_s_gdtmpldat;
+static PyObject *__pyx_n_s_gdtnum;
+static PyObject *__pyx_n_s_grib2_addfield;
+static PyObject *__pyx_n_s_grib2_addgrid;
+static PyObject *__pyx_n_s_grib2_create;
+static PyObject *__pyx_n_s_grib2_end;
+static PyObject *__pyx_n_s_gribmsg;
+static PyObject *__pyx_n_s_i;
+static PyObject *__pyx_n_s_i1;
+static PyObject *__pyx_n_s_i4;
+static PyObject *__pyx_n_s_iarr;
+static PyObject *__pyx_n_s_ibitmap;
+static PyObject *__pyx_n_s_ibmap;
+static PyObject *__pyx_n_s_icoordlist;
+static PyObject *__pyx_n_s_idat;
+static PyObject *__pyx_n_s_idata;
+static PyObject *__pyx_n_s_ideflist;
+static PyObject *__pyx_n_s_idefnum;
+static PyObject *__pyx_n_s_idrsnum;
+static PyObject *__pyx_n_s_idrstmpl;
+static PyObject *__pyx_n_s_ids;
+static PyObject *__pyx_n_s_idsect;
+static PyObject *__pyx_n_s_idslen;
+static PyObject *__pyx_n_s_ierr;
+static PyObject *__pyx_n_s_igds;
+static PyObject *__pyx_n_s_igdsnum;
+static PyObject *__pyx_n_s_igdstmpl;
+static PyObject *__pyx_n_s_import;
+static PyObject *__pyx_n_s_int32;
+static PyObject *__pyx_kp_s_integer_output_array_must_be_as;
+static PyObject *__pyx_n_s_iofst;
+static PyObject *__pyx_n_s_ipdsnum;
+static PyObject *__pyx_n_s_ipdstmpl;
+static PyObject *__pyx_n_s_ipos;
+static PyObject *__pyx_n_s_isec0;
+static PyObject *__pyx_n_s_isec1;
+static PyObject *__pyx_n_s_itor_ieee;
+static PyObject *__pyx_n_s_lgrib;
+static PyObject *__pyx_n_s_listsec0;
+static PyObject *__pyx_n_s_listsec0dat;
+static PyObject *__pyx_n_s_listsec1;
+static PyObject *__pyx_n_s_listsec1dat;
+static PyObject *__pyx_n_s_log10;
+static PyObject *__pyx_n_s_main;
+static PyObject *__pyx_n_s_mapdrslen;
+static PyObject *__pyx_n_s_mapgridlen;
+static PyObject *__pyx_n_s_mappdslen;
+static PyObject *__pyx_n_s_math;
+static PyObject *__pyx_kp_s_min_max;
+static PyObject *__pyx_n_s_minmaxstring;
+static PyObject *__pyx_n_s_msg;
+static PyObject *__pyx_n_s_n;
+static PyObject *__pyx_n_s_ndpts;
+static PyObject *__pyx_n_s_ngpts;
+static PyObject *__pyx_n_s_ngrdpts;
+static PyObject *__pyx_n_s_numcoord;
+static PyObject *__pyx_n_s_order;
+static PyObject *__pyx_n_s_pdsnum;
+static PyObject *__pyx_n_s_pdstmpl;
+static PyObject *__pyx_n_s_pdtmpl;
+static PyObject *__pyx_n_s_pdtmpldat;
+static PyObject *__pyx_n_s_pow;
+static PyObject *__pyx_n_s_print;
+static PyObject *__pyx_n_s_printminmax;
+static PyObject *__pyx_n_s_r1;
+static PyObject *__pyx_n_s_rarr;
+static PyObject *__pyx_n_s_rdat;
+static PyObject *__pyx_n_s_rdata;
+static PyObject *__pyx_kp_s_real_output_array_must_be_as_lea;
+static PyObject *__pyx_n_s_rmax;
+static PyObject *__pyx_n_s_rmin;
+static PyObject *__pyx_n_s_rtoi_ieee;
+static PyObject *__pyx_n_s_storageorder;
+static PyObject *__pyx_n_s_test;
+static PyObject *__pyx_kp_s_unknown_array_type_s;
+static PyObject *__pyx_n_s_unpack1;
+static PyObject *__pyx_n_s_unpack3;
+static PyObject *__pyx_n_s_unpack4;
+static PyObject *__pyx_n_s_unpack5;
+static PyObject *__pyx_n_s_unpack6;
+static PyObject *__pyx_n_s_unpack7;
+static PyObject *__pyx_n_s_zeros;
 static PyObject *__pyx_int_0;
 static PyObject *__pyx_int_1;
 static PyObject *__pyx_int_2;
@@ -876,45 +920,55 @@ static PyObject *__pyx_int_5;
 static PyObject *__pyx_int_8;
 static PyObject *__pyx_int_254;
 static PyObject *__pyx_int_260;
-static PyObject *__pyx_k_14;
-static PyObject *__pyx_k_tuple_10;
-static PyObject *__pyx_k_tuple_26;
-static PyObject *__pyx_k_tuple_29;
-static PyObject *__pyx_k_tuple_31;
-static PyObject *__pyx_k_tuple_33;
-static PyObject *__pyx_k_tuple_35;
-static PyObject *__pyx_k_tuple_37;
-static PyObject *__pyx_k_tuple_39;
-static PyObject *__pyx_k_tuple_41;
-static PyObject *__pyx_k_tuple_43;
-static PyObject *__pyx_k_tuple_45;
-static PyObject *__pyx_k_tuple_47;
-static PyObject *__pyx_k_tuple_49;
-static PyObject *__pyx_k_codeobj_27;
-static PyObject *__pyx_k_codeobj_30;
-static PyObject *__pyx_k_codeobj_32;
-static PyObject *__pyx_k_codeobj_34;
-static PyObject *__pyx_k_codeobj_36;
-static PyObject *__pyx_k_codeobj_38;
-static PyObject *__pyx_k_codeobj_40;
-static PyObject *__pyx_k_codeobj_42;
-static PyObject *__pyx_k_codeobj_44;
-static PyObject *__pyx_k_codeobj_46;
-static PyObject *__pyx_k_codeobj_48;
-static PyObject *__pyx_k_codeobj_50;
+static PyObject *__pyx_tuple_;
+static PyObject *__pyx_tuple__6;
+static PyObject *__pyx_tuple__8;
+static PyObject *__pyx_tuple__10;
+static PyObject *__pyx_tuple__12;
+static PyObject *__pyx_tuple__14;
+static PyObject *__pyx_tuple__16;
+static PyObject *__pyx_tuple__18;
+static PyObject *__pyx_tuple__20;
+static PyObject *__pyx_tuple__22;
+static PyObject *__pyx_tuple__24;
+static PyObject *__pyx_tuple__26;
+static PyObject *__pyx_tuple__28;
+static PyObject *__pyx_codeobj__7;
+static PyObject *__pyx_codeobj__9;
+static PyObject *__pyx_codeobj__11;
+static PyObject *__pyx_codeobj__13;
+static PyObject *__pyx_codeobj__15;
+static PyObject *__pyx_codeobj__17;
+static PyObject *__pyx_codeobj__19;
+static PyObject *__pyx_codeobj__21;
+static PyObject *__pyx_codeobj__23;
+static PyObject *__pyx_codeobj__25;
+static PyObject *__pyx_codeobj__27;
+static PyObject *__pyx_codeobj__29;
+
+/* "g2clib.pyx":55
+ * # routines for convert to/from IEEE integers.
+ * 
+ * def rtoi_ieee(object rarr, object iarr):             # <<<<<<<<<<<<<<
+ *     """
+ *  Converts a float32 array into an int32 array of IEEE formatted values
+ */
 
 /* Python wrapper */
 static PyObject *__pyx_pw_6g2clib_1rtoi_ieee(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static char __pyx_doc_6g2clib_rtoi_ieee[] = "\n Converts a float32 array into an int32 array of IEEE formatted values\n    ";
-static PyMethodDef __pyx_mdef_6g2clib_1rtoi_ieee = {__Pyx_NAMESTR("rtoi_ieee"), (PyCFunction)__pyx_pw_6g2clib_1rtoi_ieee, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6g2clib_rtoi_ieee)};
+static PyMethodDef __pyx_mdef_6g2clib_1rtoi_ieee = {"rtoi_ieee", (PyCFunction)__pyx_pw_6g2clib_1rtoi_ieee, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6g2clib_rtoi_ieee};
 static PyObject *__pyx_pw_6g2clib_1rtoi_ieee(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyObject *__pyx_v_rarr = 0;
   PyObject *__pyx_v_iarr = 0;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("rtoi_ieee (wrapper)", 0);
   {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__rarr,&__pyx_n_s__iarr,0};
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rarr,&__pyx_n_s_iarr,0};
     PyObject* values[2] = {0,0};
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
@@ -928,10 +982,10 @@ static PyObject *__pyx_pw_6g2clib_1rtoi_ieee(PyObject *__pyx_self, PyObject *__p
       kw_args = PyDict_Size(__pyx_kwds);
       switch (pos_args) {
         case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__rarr)) != 0)) kw_args--;
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rarr)) != 0)) kw_args--;
         else goto __pyx_L5_argtuple_error;
         case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__iarr)) != 0)) kw_args--;
+        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_iarr)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("rtoi_ieee", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
@@ -957,18 +1011,12 @@ static PyObject *__pyx_pw_6g2clib_1rtoi_ieee(PyObject *__pyx_self, PyObject *__p
   return NULL;
   __pyx_L4_argument_unpacking_done:;
   __pyx_r = __pyx_pf_6g2clib_rtoi_ieee(__pyx_self, __pyx_v_rarr, __pyx_v_iarr);
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "g2clib.pyx":55
- * # routines for convert to/from IEEE integers.
- * 
- * def rtoi_ieee(object rarr, object iarr):             # <<<<<<<<<<<<<<
- *     """
- *  Converts a float32 array into an int32 array of IEEE formatted values
- */
-
 static PyObject *__pyx_pf_6g2clib_rtoi_ieee(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_rarr, PyObject *__pyx_v_iarr) {
   void *__pyx_v_rdat;
   void *__pyx_v_idat;
@@ -984,76 +1032,70 @@ static PyObject *__pyx_pf_6g2clib_rtoi_ieee(CYTHON_UNUSED PyObject *__pyx_self,
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("rtoi_ieee", 0);
 
-  /* "g2clib.pyx":63
- *     cdef g2int *idata, i1
+  /* "g2clib.pyx":66
+ *     cdef g2int i1
  *     cdef Py_ssize_t bufleni, buflenr
  *     if PyObject_AsReadBuffer(rarr, &rdat, &buflenr) <> 0:             # <<<<<<<<<<<<<<
  *         raise RuntimeError, 'error getting buffer for input real array'
  *     if PyObject_AsWriteBuffer(iarr, &idat, &bufleni)  <> 0 :
  */
-  __pyx_t_1 = (PyObject_AsReadBuffer(__pyx_v_rarr, (&__pyx_v_rdat), (&__pyx_v_buflenr)) != 0);
+  __pyx_t_1 = ((PyObject_AsReadBuffer(__pyx_v_rarr, (&__pyx_v_rdat), (&__pyx_v_buflenr)) != 0) != 0);
   if (__pyx_t_1) {
 
-    /* "g2clib.pyx":64
+    /* "g2clib.pyx":67
  *     cdef Py_ssize_t bufleni, buflenr
  *     if PyObject_AsReadBuffer(rarr, &rdat, &buflenr) <> 0:
  *         raise RuntimeError, 'error getting buffer for input real array'             # <<<<<<<<<<<<<<
  *     if PyObject_AsWriteBuffer(iarr, &idat, &bufleni)  <> 0 :
  *         raise RuntimeError, 'error getting buffer for output integer array'
  */
-    __Pyx_Raise(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_kp_s_1), 0, 0);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L3;
+    __Pyx_Raise(__pyx_builtin_RuntimeError, __pyx_kp_s_error_getting_buffer_for_input_r, 0, 0);
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
-  __pyx_L3:;
 
-  /* "g2clib.pyx":65
+  /* "g2clib.pyx":68
  *     if PyObject_AsReadBuffer(rarr, &rdat, &buflenr) <> 0:
  *         raise RuntimeError, 'error getting buffer for input real array'
  *     if PyObject_AsWriteBuffer(iarr, &idat, &bufleni)  <> 0 :             # <<<<<<<<<<<<<<
  *         raise RuntimeError, 'error getting buffer for output integer array'
  *     if bufleni < buflenr:
  */
-  __pyx_t_1 = (PyObject_AsWriteBuffer(__pyx_v_iarr, (&__pyx_v_idat), (&__pyx_v_bufleni)) != 0);
+  __pyx_t_1 = ((PyObject_AsWriteBuffer(__pyx_v_iarr, (&__pyx_v_idat), (&__pyx_v_bufleni)) != 0) != 0);
   if (__pyx_t_1) {
 
-    /* "g2clib.pyx":66
+    /* "g2clib.pyx":69
  *         raise RuntimeError, 'error getting buffer for input real array'
  *     if PyObject_AsWriteBuffer(iarr, &idat, &bufleni)  <> 0 :
  *         raise RuntimeError, 'error getting buffer for output integer array'             # <<<<<<<<<<<<<<
  *     if bufleni < buflenr:
  *         raise RuntimeError, 'integer output array must be as least as long a real input array'
  */
-    __Pyx_Raise(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_kp_s_2), 0, 0);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L4;
+    __Pyx_Raise(__pyx_builtin_RuntimeError, __pyx_kp_s_error_getting_buffer_for_output, 0, 0);
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
-  __pyx_L4:;
 
-  /* "g2clib.pyx":67
+  /* "g2clib.pyx":70
  *     if PyObject_AsWriteBuffer(iarr, &idat, &bufleni)  <> 0 :
  *         raise RuntimeError, 'error getting buffer for output integer array'
  *     if bufleni < buflenr:             # <<<<<<<<<<<<<<
  *         raise RuntimeError, 'integer output array must be as least as long a real input array'
  *     rdata = <g2float *>rdat
  */
-  __pyx_t_1 = (__pyx_v_bufleni < __pyx_v_buflenr);
+  __pyx_t_1 = ((__pyx_v_bufleni < __pyx_v_buflenr) != 0);
   if (__pyx_t_1) {
 
-    /* "g2clib.pyx":68
+    /* "g2clib.pyx":71
  *         raise RuntimeError, 'error getting buffer for output integer array'
  *     if bufleni < buflenr:
  *         raise RuntimeError, 'integer output array must be as least as long a real input array'             # <<<<<<<<<<<<<<
  *     rdata = <g2float *>rdat
  *     idata = <g2int *>idat
  */
-    __Pyx_Raise(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_kp_s_3), 0, 0);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L5;
+    __Pyx_Raise(__pyx_builtin_RuntimeError, __pyx_kp_s_integer_output_array_must_be_as, 0, 0);
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
-  __pyx_L5:;
 
-  /* "g2clib.pyx":69
+  /* "g2clib.pyx":72
  *     if bufleni < buflenr:
  *         raise RuntimeError, 'integer output array must be as least as long a real input array'
  *     rdata = <g2float *>rdat             # <<<<<<<<<<<<<<
@@ -1062,7 +1104,7 @@ static PyObject *__pyx_pf_6g2clib_rtoi_ieee(CYTHON_UNUSED PyObject *__pyx_self,
  */
   __pyx_v_rdata = ((g2float *)__pyx_v_rdat);
 
-  /* "g2clib.pyx":70
+  /* "g2clib.pyx":73
  *         raise RuntimeError, 'integer output array must be as least as long a real input array'
  *     rdata = <g2float *>rdat
  *     idata = <g2int *>idat             # <<<<<<<<<<<<<<
@@ -1071,7 +1113,7 @@ static PyObject *__pyx_pf_6g2clib_rtoi_ieee(CYTHON_UNUSED PyObject *__pyx_self,
  */
   __pyx_v_idata = ((g2int *)__pyx_v_idat);
 
-  /* "g2clib.pyx":71
+  /* "g2clib.pyx":74
  *     rdata = <g2float *>rdat
  *     idata = <g2int *>idat
  *     mkieee(rdata, idata, buflenr/4)             # <<<<<<<<<<<<<<
@@ -1080,6 +1122,15 @@ static PyObject *__pyx_pf_6g2clib_rtoi_ieee(CYTHON_UNUSED PyObject *__pyx_self,
  */
   mkieee(__pyx_v_rdata, __pyx_v_idata, __Pyx_div_Py_ssize_t(__pyx_v_buflenr, 4));
 
+  /* "g2clib.pyx":55
+ * # routines for convert to/from IEEE integers.
+ * 
+ * def rtoi_ieee(object rarr, object iarr):             # <<<<<<<<<<<<<<
+ *     """
+ *  Converts a float32 array into an int32 array of IEEE formatted values
+ */
+
+  /* function exit code */
   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
   goto __pyx_L0;
   __pyx_L1_error:;
@@ -1091,18 +1142,29 @@ static PyObject *__pyx_pf_6g2clib_rtoi_ieee(CYTHON_UNUSED PyObject *__pyx_self,
   return __pyx_r;
 }
 
+/* "g2clib.pyx":76
+ *     mkieee(rdata, idata, buflenr/4)
+ * 
+ * def itor_ieee(object iarr, object rarr):             # <<<<<<<<<<<<<<
+ *     """
+ *  Converts an int32 array of IEEE values into a float32 array.
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_6g2clib_3itor_ieee(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static char __pyx_doc_6g2clib_2itor_ieee[] = "\n Converts an int32 array of IEEE values into a float32 array.\n    ";
-static PyMethodDef __pyx_mdef_6g2clib_3itor_ieee = {__Pyx_NAMESTR("itor_ieee"), (PyCFunction)__pyx_pw_6g2clib_3itor_ieee, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6g2clib_2itor_ieee)};
+static PyMethodDef __pyx_mdef_6g2clib_3itor_ieee = {"itor_ieee", (PyCFunction)__pyx_pw_6g2clib_3itor_ieee, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6g2clib_2itor_ieee};
 static PyObject *__pyx_pw_6g2clib_3itor_ieee(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyObject *__pyx_v_iarr = 0;
   PyObject *__pyx_v_rarr = 0;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("itor_ieee (wrapper)", 0);
   {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__iarr,&__pyx_n_s__rarr,0};
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_iarr,&__pyx_n_s_rarr,0};
     PyObject* values[2] = {0,0};
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
@@ -1116,16 +1178,16 @@ static PyObject *__pyx_pw_6g2clib_3itor_ieee(PyObject *__pyx_self, PyObject *__p
       kw_args = PyDict_Size(__pyx_kwds);
       switch (pos_args) {
         case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__iarr)) != 0)) kw_args--;
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_iarr)) != 0)) kw_args--;
         else goto __pyx_L5_argtuple_error;
         case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__rarr)) != 0)) kw_args--;
+        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rarr)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("itor_ieee", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+          __Pyx_RaiseArgtupleInvalid("itor_ieee", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "itor_ieee") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "itor_ieee") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
       goto __pyx_L5_argtuple_error;
@@ -1138,25 +1200,19 @@ static PyObject *__pyx_pw_6g2clib_3itor_ieee(PyObject *__pyx_self, PyObject *__p
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("itor_ieee", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+  __Pyx_RaiseArgtupleInvalid("itor_ieee", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
   __pyx_L3_error:;
   __Pyx_AddTraceback("g2clib.itor_ieee", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
   return NULL;
   __pyx_L4_argument_unpacking_done:;
   __pyx_r = __pyx_pf_6g2clib_2itor_ieee(__pyx_self, __pyx_v_iarr, __pyx_v_rarr);
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "g2clib.pyx":73
- *     mkieee(rdata, idata, buflenr/4)
- * 
- * def itor_ieee(object iarr, object rarr):             # <<<<<<<<<<<<<<
- *     """
- *  Converts an int32 array of IEEE values into a float32 array.
- */
-
 static PyObject *__pyx_pf_6g2clib_2itor_ieee(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_iarr, PyObject *__pyx_v_rarr) {
   void *__pyx_v_rdat;
   void *__pyx_v_idat;
@@ -1172,76 +1228,70 @@ static PyObject *__pyx_pf_6g2clib_2itor_ieee(CYTHON_UNUSED PyObject *__pyx_self,
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("itor_ieee", 0);
 
-  /* "g2clib.pyx":81
+  /* "g2clib.pyx":85
  *     cdef g2int *idata
  *     cdef Py_ssize_t bufleni, buflenr
  *     if PyObject_AsReadBuffer(rarr, &rdat, &buflenr) <> 0:             # <<<<<<<<<<<<<<
  *         raise RuntimeError, 'error getting buffer for output real array'
  *     if PyObject_AsWriteBuffer(iarr, &idat, &bufleni)  <> 0 :
  */
-  __pyx_t_1 = (PyObject_AsReadBuffer(__pyx_v_rarr, (&__pyx_v_rdat), (&__pyx_v_buflenr)) != 0);
+  __pyx_t_1 = ((PyObject_AsReadBuffer(__pyx_v_rarr, (&__pyx_v_rdat), (&__pyx_v_buflenr)) != 0) != 0);
   if (__pyx_t_1) {
 
-    /* "g2clib.pyx":82
+    /* "g2clib.pyx":86
  *     cdef Py_ssize_t bufleni, buflenr
  *     if PyObject_AsReadBuffer(rarr, &rdat, &buflenr) <> 0:
  *         raise RuntimeError, 'error getting buffer for output real array'             # <<<<<<<<<<<<<<
  *     if PyObject_AsWriteBuffer(iarr, &idat, &bufleni)  <> 0 :
  *         raise RuntimeError, 'error getting buffer for input integer array'
  */
-    __Pyx_Raise(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_kp_s_4), 0, 0);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L3;
+    __Pyx_Raise(__pyx_builtin_RuntimeError, __pyx_kp_s_error_getting_buffer_for_output_2, 0, 0);
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
-  __pyx_L3:;
 
-  /* "g2clib.pyx":83
+  /* "g2clib.pyx":87
  *     if PyObject_AsReadBuffer(rarr, &rdat, &buflenr) <> 0:
  *         raise RuntimeError, 'error getting buffer for output real array'
  *     if PyObject_AsWriteBuffer(iarr, &idat, &bufleni)  <> 0 :             # <<<<<<<<<<<<<<
  *         raise RuntimeError, 'error getting buffer for input integer array'
  *     if buflenr < bufleni:
  */
-  __pyx_t_1 = (PyObject_AsWriteBuffer(__pyx_v_iarr, (&__pyx_v_idat), (&__pyx_v_bufleni)) != 0);
+  __pyx_t_1 = ((PyObject_AsWriteBuffer(__pyx_v_iarr, (&__pyx_v_idat), (&__pyx_v_bufleni)) != 0) != 0);
   if (__pyx_t_1) {
 
-    /* "g2clib.pyx":84
+    /* "g2clib.pyx":88
  *         raise RuntimeError, 'error getting buffer for output real array'
  *     if PyObject_AsWriteBuffer(iarr, &idat, &bufleni)  <> 0 :
  *         raise RuntimeError, 'error getting buffer for input integer array'             # <<<<<<<<<<<<<<
  *     if buflenr < bufleni:
  *         raise RuntimeError, 'real output array must be as least as long a integerinput array'
  */
-    __Pyx_Raise(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_kp_s_5), 0, 0);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L4;
+    __Pyx_Raise(__pyx_builtin_RuntimeError, __pyx_kp_s_error_getting_buffer_for_input_i, 0, 0);
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
-  __pyx_L4:;
 
-  /* "g2clib.pyx":85
+  /* "g2clib.pyx":89
  *     if PyObject_AsWriteBuffer(iarr, &idat, &bufleni)  <> 0 :
  *         raise RuntimeError, 'error getting buffer for input integer array'
  *     if buflenr < bufleni:             # <<<<<<<<<<<<<<
  *         raise RuntimeError, 'real output array must be as least as long a integerinput array'
  *     rdata = <g2float *>rdat
  */
-  __pyx_t_1 = (__pyx_v_buflenr < __pyx_v_bufleni);
+  __pyx_t_1 = ((__pyx_v_buflenr < __pyx_v_bufleni) != 0);
   if (__pyx_t_1) {
 
-    /* "g2clib.pyx":86
+    /* "g2clib.pyx":90
  *         raise RuntimeError, 'error getting buffer for input integer array'
  *     if buflenr < bufleni:
  *         raise RuntimeError, 'real output array must be as least as long a integerinput array'             # <<<<<<<<<<<<<<
  *     rdata = <g2float *>rdat
  *     idata = <g2int *>idat
  */
-    __Pyx_Raise(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_kp_s_6), 0, 0);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L5;
+    __Pyx_Raise(__pyx_builtin_RuntimeError, __pyx_kp_s_real_output_array_must_be_as_lea, 0, 0);
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
-  __pyx_L5:;
 
-  /* "g2clib.pyx":87
+  /* "g2clib.pyx":91
  *     if buflenr < bufleni:
  *         raise RuntimeError, 'real output array must be as least as long a integerinput array'
  *     rdata = <g2float *>rdat             # <<<<<<<<<<<<<<
@@ -1250,7 +1300,7 @@ static PyObject *__pyx_pf_6g2clib_2itor_ieee(CYTHON_UNUSED PyObject *__pyx_self,
  */
   __pyx_v_rdata = ((g2float *)__pyx_v_rdat);
 
-  /* "g2clib.pyx":88
+  /* "g2clib.pyx":92
  *         raise RuntimeError, 'real output array must be as least as long a integerinput array'
  *     rdata = <g2float *>rdat
  *     idata = <g2int *>idat             # <<<<<<<<<<<<<<
@@ -1259,7 +1309,7 @@ static PyObject *__pyx_pf_6g2clib_2itor_ieee(CYTHON_UNUSED PyObject *__pyx_self,
  */
   __pyx_v_idata = ((g2int *)__pyx_v_idat);
 
-  /* "g2clib.pyx":89
+  /* "g2clib.pyx":93
  *     rdata = <g2float *>rdat
  *     idata = <g2int *>idat
  *     rdieee(idata, rdata, bufleni/4)             # <<<<<<<<<<<<<<
@@ -1268,6 +1318,15 @@ static PyObject *__pyx_pf_6g2clib_2itor_ieee(CYTHON_UNUSED PyObject *__pyx_self,
  */
   rdieee(__pyx_v_idata, __pyx_v_rdata, __Pyx_div_Py_ssize_t(__pyx_v_bufleni, 4));
 
+  /* "g2clib.pyx":76
+ *     mkieee(rdata, idata, buflenr/4)
+ * 
+ * def itor_ieee(object iarr, object rarr):             # <<<<<<<<<<<<<<
+ *     """
+ *  Converts an int32 array of IEEE values into a float32 array.
+ */
+
+  /* function exit code */
   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
   goto __pyx_L0;
   __pyx_L1_error:;
@@ -1279,7 +1338,7 @@ static PyObject *__pyx_pf_6g2clib_2itor_ieee(CYTHON_UNUSED PyObject *__pyx_self,
   return __pyx_r;
 }
 
-/* "g2clib.pyx":91
+/* "g2clib.pyx":95
  *     rdieee(idata, rdata, bufleni/4)
  * 
  * cdef _toarray(void *items, object a):             # <<<<<<<<<<<<<<
@@ -1304,7 +1363,7 @@ static PyObject *__pyx_f_6g2clib__toarray(void *__pyx_v_items, PyObject *__pyx_v
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("_toarray", 0);
 
-  /* "g2clib.pyx":101
+  /* "g2clib.pyx":105
  * 
  *     # get pointer to data buffer.
  *     PyObject_AsWriteBuffer(a, &abuf, &buflen)             # <<<<<<<<<<<<<<
@@ -1313,30 +1372,28 @@ static PyObject *__pyx_f_6g2clib__toarray(void *__pyx_v_items, PyObject *__pyx_v
  */
   PyObject_AsWriteBuffer(__pyx_v_a, (&__pyx_v_abuf), (&__pyx_v_buflen));
 
-  /* "g2clib.pyx":103
+  /* "g2clib.pyx":107
  *     PyObject_AsWriteBuffer(a, &abuf, &buflen)
  * 
  *     if str(a.dtype) == 'int32':             # <<<<<<<<<<<<<<
  *       idata = <g2int *>abuf
  *       # fill buffer.
  */
-  __pyx_t_1 = PyObject_GetAttr(__pyx_v_a, __pyx_n_s__dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_a, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
   __Pyx_GIVEREF(__pyx_t_1);
   __pyx_t_1 = 0;
-  __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
-  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, ((PyObject *)__pyx_n_s__int32), Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_int32, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (__pyx_t_3) {
 
-    /* "g2clib.pyx":104
+    /* "g2clib.pyx":108
  * 
  *     if str(a.dtype) == 'int32':
  *       idata = <g2int *>abuf             # <<<<<<<<<<<<<<
@@ -1345,17 +1402,17 @@ static PyObject *__pyx_f_6g2clib__toarray(void *__pyx_v_items, PyObject *__pyx_v
  */
     __pyx_v_idata = ((g2int *)__pyx_v_abuf);
 
-    /* "g2clib.pyx":106
+    /* "g2clib.pyx":110
  *       idata = <g2int *>abuf
  *       # fill buffer.
  *       for i from 0 <= i < len(a):             # <<<<<<<<<<<<<<
  *         idata[i] = (<g2int *>items)[i]
  *     elif str(a.dtype) == 'float32':
  */
-    __pyx_t_4 = PyObject_Length(__pyx_v_a); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = PyObject_Length(__pyx_v_a); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) {
 
-      /* "g2clib.pyx":107
+      /* "g2clib.pyx":111
  *       # fill buffer.
  *       for i from 0 <= i < len(a):
  *         idata[i] = (<g2int *>items)[i]             # <<<<<<<<<<<<<<
@@ -1367,30 +1424,28 @@ static PyObject *__pyx_f_6g2clib__toarray(void *__pyx_v_items, PyObject *__pyx_v
     goto __pyx_L3;
   }
 
-  /* "g2clib.pyx":108
+  /* "g2clib.pyx":112
  *       for i from 0 <= i < len(a):
  *         idata[i] = (<g2int *>items)[i]
  *     elif str(a.dtype) == 'float32':             # <<<<<<<<<<<<<<
  *       fdata = <g2float *>abuf
  *       # fill buffer.
  */
-  __pyx_t_2 = PyObject_GetAttr(__pyx_v_a, __pyx_n_s__dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_a, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
-  __Pyx_GIVEREF(__pyx_t_2);
-  __pyx_t_2 = 0;
-  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
-  __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, ((PyObject *)__pyx_n_s__float32), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_float32, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (__pyx_t_3) {
 
-    /* "g2clib.pyx":109
+    /* "g2clib.pyx":113
  *         idata[i] = (<g2int *>items)[i]
  *     elif str(a.dtype) == 'float32':
  *       fdata = <g2float *>abuf             # <<<<<<<<<<<<<<
@@ -1399,17 +1454,17 @@ static PyObject *__pyx_f_6g2clib__toarray(void *__pyx_v_items, PyObject *__pyx_v
  */
     __pyx_v_fdata = ((g2float *)__pyx_v_abuf);
 
-    /* "g2clib.pyx":111
+    /* "g2clib.pyx":115
  *       fdata = <g2float *>abuf
  *       # fill buffer.
  *       for i from 0 <= i < len(a):             # <<<<<<<<<<<<<<
  *         fdata[i] = (<g2float *>items)[i]
  *     else:
  */
-    __pyx_t_4 = PyObject_Length(__pyx_v_a); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = PyObject_Length(__pyx_v_a); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) {
 
-      /* "g2clib.pyx":112
+      /* "g2clib.pyx":116
  *       # fill buffer.
  *       for i from 0 <= i < len(a):
  *         fdata[i] = (<g2float *>items)[i]             # <<<<<<<<<<<<<<
@@ -1422,7 +1477,7 @@ static PyObject *__pyx_f_6g2clib__toarray(void *__pyx_v_items, PyObject *__pyx_v
   }
   /*else*/ {
 
-    /* "g2clib.pyx":114
+    /* "g2clib.pyx":118
  *         fdata[i] = (<g2float *>items)[i]
  *     else:
  *       free(items)             # <<<<<<<<<<<<<<
@@ -1431,33 +1486,33 @@ static PyObject *__pyx_f_6g2clib__toarray(void *__pyx_v_items, PyObject *__pyx_v
  */
     free(__pyx_v_items);
 
-    /* "g2clib.pyx":115
+    /* "g2clib.pyx":119
  *     else:
  *       free(items)
  *       raise RuntimeError('unknown array type %s' % a.dtype)             # <<<<<<<<<<<<<<
  * 
  *     free(items)
  */
-    __pyx_t_1 = PyObject_GetAttr(__pyx_v_a, __pyx_n_s__dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_a, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_7), __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
+    __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_unknown_array_type_s, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_1);
-    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_2));
-    __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
+    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
+    __Pyx_GIVEREF(__pyx_t_2);
     __pyx_t_2 = 0;
-    __pyx_t_2 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
   __pyx_L3:;
 
-  /* "g2clib.pyx":117
+  /* "g2clib.pyx":121
  *       raise RuntimeError('unknown array type %s' % a.dtype)
  * 
  *     free(items)             # <<<<<<<<<<<<<<
@@ -1466,7 +1521,7 @@ static PyObject *__pyx_f_6g2clib__toarray(void *__pyx_v_items, PyObject *__pyx_v
  */
   free(__pyx_v_items);
 
-  /* "g2clib.pyx":118
+  /* "g2clib.pyx":122
  * 
  *     free(items)
  *     return a             # <<<<<<<<<<<<<<
@@ -1478,8 +1533,15 @@ static PyObject *__pyx_f_6g2clib__toarray(void *__pyx_v_items, PyObject *__pyx_v
   __pyx_r = __pyx_v_a;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "g2clib.pyx":95
+ *     rdieee(idata, rdata, bufleni/4)
+ * 
+ * cdef _toarray(void *items, object a):             # <<<<<<<<<<<<<<
+ *     """
+ *  Fill a numpy array from the grib2 file.  Note that this free()s the items argument!
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_XDECREF(__pyx_t_2);
@@ -1491,19 +1553,30 @@ static PyObject *__pyx_f_6g2clib__toarray(void *__pyx_v_items, PyObject *__pyx_v
   return __pyx_r;
 }
 
+/* "g2clib.pyx":127
+ * # routines for reading grib2 files.
+ * 
+ * def unpack1(gribmsg, ipos, object zeros):             # <<<<<<<<<<<<<<
+ *     """              .      .    .                                       .
+ *  Unpacks Section 1 (Identification Section) as defined in GRIB Edition 2.
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_6g2clib_5unpack1(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static char __pyx_doc_6g2clib_4unpack1[] = "              .      .    .                                       .\n Unpacks Section 1 (Identification Section) as defined in GRIB Edition 2.\n \n idsect,ipos = unpack1(gribmsg,ipos)\n\n INPUTS:\n  gribmsg - chararcter string containing Section 1 of the GRIB2 message\n  ipos    - Byte offset for the beginning of Section 1 in gribmsg.\n  zeros   - Numeric/numpy array/scip.base zeros function (used to allocate\n            output python arrays). [...]
-static PyMethodDef __pyx_mdef_6g2clib_5unpack1 = {__Pyx_NAMESTR("unpack1"), (PyCFunction)__pyx_pw_6g2clib_5unpack1, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6g2clib_4unpack1)};
+static PyMethodDef __pyx_mdef_6g2clib_5unpack1 = {"unpack1", (PyCFunction)__pyx_pw_6g2clib_5unpack1, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6g2clib_4unpack1};
 static PyObject *__pyx_pw_6g2clib_5unpack1(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyObject *__pyx_v_gribmsg = 0;
   PyObject *__pyx_v_ipos = 0;
   PyObject *__pyx_v_zeros = 0;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("unpack1 (wrapper)", 0);
   {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__gribmsg,&__pyx_n_s__ipos,&__pyx_n_s__zeros,0};
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gribmsg,&__pyx_n_s_ipos,&__pyx_n_s_zeros,0};
     PyObject* values[3] = {0,0,0};
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
@@ -1518,21 +1591,21 @@ static PyObject *__pyx_pw_6g2clib_5unpack1(PyObject *__pyx_self, PyObject *__pyx
       kw_args = PyDict_Size(__pyx_kwds);
       switch (pos_args) {
         case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__gribmsg)) != 0)) kw_args--;
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_gribmsg)) != 0)) kw_args--;
         else goto __pyx_L5_argtuple_error;
         case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ipos)) != 0)) kw_args--;
+        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ipos)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("unpack1", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+          __Pyx_RaiseArgtupleInvalid("unpack1", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
         case  2:
-        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__zeros)) != 0)) kw_args--;
+        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_zeros)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("unpack1", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+          __Pyx_RaiseArgtupleInvalid("unpack1", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "unpack1") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "unpack1") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
       goto __pyx_L5_argtuple_error;
@@ -1547,25 +1620,19 @@ static PyObject *__pyx_pw_6g2clib_5unpack1(PyObject *__pyx_self, PyObject *__pyx
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("unpack1", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+  __Pyx_RaiseArgtupleInvalid("unpack1", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
   __pyx_L3_error:;
   __Pyx_AddTraceback("g2clib.unpack1", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
   return NULL;
   __pyx_L4_argument_unpacking_done:;
   __pyx_r = __pyx_pf_6g2clib_4unpack1(__pyx_self, __pyx_v_gribmsg, __pyx_v_ipos, __pyx_v_zeros);
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "g2clib.pyx":123
- * # routines for reading grib2 files.
- * 
- * def unpack1(gribmsg, ipos, object zeros):             # <<<<<<<<<<<<<<
- *     """              .      .    .                                       .
- *  Unpacks Section 1 (Identification Section) as defined in GRIB Edition 2.
- */
-
 static PyObject *__pyx_pf_6g2clib_4unpack1(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_gribmsg, PyObject *__pyx_v_ipos, PyObject *__pyx_v_zeros) {
   unsigned char *__pyx_v_cgrib;
   g2int __pyx_v_iofst;
@@ -1579,12 +1646,16 @@ static PyObject *__pyx_pf_6g2clib_4unpack1(CYTHON_UNUSED PyObject *__pyx_self, P
   PyObject *__pyx_t_1 = NULL;
   int __pyx_t_2;
   PyObject *__pyx_t_3 = NULL;
+  PyObject *__pyx_t_4 = NULL;
+  PyObject *__pyx_t_5 = NULL;
+  Py_ssize_t __pyx_t_6;
+  PyObject *__pyx_t_7 = NULL;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("unpack1", 0);
 
-  /* "g2clib.pyx":165
+  /* "g2clib.pyx":169
  *     cdef g2int i, iofst, ierr, idslen
  *     cdef g2int *ids
  *     cgrib = <unsigned char *>PyBytes_AsString(gribmsg)             # <<<<<<<<<<<<<<
@@ -1593,19 +1664,19 @@ static PyObject *__pyx_pf_6g2clib_4unpack1(CYTHON_UNUSED PyObject *__pyx_self, P
  */
   __pyx_v_cgrib = ((unsigned char *)PyBytes_AsString(__pyx_v_gribmsg));
 
-  /* "g2clib.pyx":166
+  /* "g2clib.pyx":170
  *     cdef g2int *ids
  *     cgrib = <unsigned char *>PyBytes_AsString(gribmsg)
  *     iofst = <g2int>PyInt_AsLong(ipos*8)             # <<<<<<<<<<<<<<
  *     ierr = g2_unpack1(cgrib, &iofst, &ids, &idslen)
  *     if ierr != 0:
  */
-  __pyx_t_1 = PyNumber_Multiply(__pyx_v_ipos, __pyx_int_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyNumber_Multiply(__pyx_v_ipos, __pyx_int_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_v_iofst = ((g2int)PyInt_AsLong(__pyx_t_1));
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "g2clib.pyx":167
+  /* "g2clib.pyx":171
  *     cgrib = <unsigned char *>PyBytes_AsString(gribmsg)
  *     iofst = <g2int>PyInt_AsLong(ipos*8)
  *     ierr = g2_unpack1(cgrib, &iofst, &ids, &idslen)             # <<<<<<<<<<<<<<
@@ -1614,80 +1685,95 @@ static PyObject *__pyx_pf_6g2clib_4unpack1(CYTHON_UNUSED PyObject *__pyx_self, P
  */
   __pyx_v_ierr = g2_unpack1(__pyx_v_cgrib, (&__pyx_v_iofst), (&__pyx_v_ids), (&__pyx_v_idslen));
 
-  /* "g2clib.pyx":168
+  /* "g2clib.pyx":172
  *     iofst = <g2int>PyInt_AsLong(ipos*8)
  *     ierr = g2_unpack1(cgrib, &iofst, &ids, &idslen)
  *     if ierr != 0:             # <<<<<<<<<<<<<<
  *        msg = "Error unpacking section 1 - error code = %i" % ierr
  *        raise RuntimeError(msg)
  */
-  __pyx_t_2 = (__pyx_v_ierr != 0);
+  __pyx_t_2 = ((__pyx_v_ierr != 0) != 0);
   if (__pyx_t_2) {
 
-    /* "g2clib.pyx":169
+    /* "g2clib.pyx":173
  *     ierr = g2_unpack1(cgrib, &iofst, &ids, &idslen)
  *     if ierr != 0:
  *        msg = "Error unpacking section 1 - error code = %i" % ierr             # <<<<<<<<<<<<<<
  *        raise RuntimeError(msg)
  * 
  */
-    __pyx_t_1 = __Pyx_PyInt_to_py_int32_t(__pyx_v_ierr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = __Pyx_PyInt_From_int32_t(__pyx_v_ierr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_8), __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
+    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Error_unpacking_section_1_error, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_v_msg = ((PyObject *)__pyx_t_3);
+    __pyx_v_msg = __pyx_t_3;
     __pyx_t_3 = 0;
 
-    /* "g2clib.pyx":170
+    /* "g2clib.pyx":174
  *     if ierr != 0:
  *        msg = "Error unpacking section 1 - error code = %i" % ierr
  *        raise RuntimeError(msg)             # <<<<<<<<<<<<<<
  * 
  *     idsect = _toarray(ids, zeros(idslen, 'i4'))
  */
-    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_INCREF(__pyx_v_msg);
     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_msg);
     __Pyx_GIVEREF(__pyx_v_msg);
-    __pyx_t_1 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_Raise(__pyx_t_1, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L3;
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
-  __pyx_L3:;
 
-  /* "g2clib.pyx":172
+  /* "g2clib.pyx":176
  *        raise RuntimeError(msg)
  * 
  *     idsect = _toarray(ids, zeros(idslen, 'i4'))             # <<<<<<<<<<<<<<
  *     return idsect,iofst/8
  * 
  */
-  __pyx_t_1 = __Pyx_PyInt_to_py_int32_t(__pyx_v_idslen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_PyInt_From_int32_t(__pyx_v_idslen); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
-  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
-  __Pyx_GIVEREF(__pyx_t_1);
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__i4));
-  PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_n_s__i4));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__i4));
-  __pyx_t_1 = 0;
-  __pyx_t_1 = PyObject_Call(__pyx_v_zeros, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_INCREF(__pyx_v_zeros);
+  __pyx_t_4 = __pyx_v_zeros; __pyx_t_5 = NULL;
+  __pyx_t_6 = 0;
+  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
+    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
+    if (likely(__pyx_t_5)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+      __Pyx_INCREF(__pyx_t_5);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_4, function);
+      __pyx_t_6 = 1;
+    }
+  }
+  __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_7);
+  if (__pyx_t_5) {
+    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
+  }
+  PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_3);
+  __Pyx_INCREF(__pyx_n_s_i4);
+  PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_n_s_i4);
+  __Pyx_GIVEREF(__pyx_n_s_i4);
+  __pyx_t_3 = 0;
+  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-  __pyx_t_3 = __pyx_f_6g2clib__toarray(__pyx_v_ids, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_t_4 = __pyx_f_6g2clib__toarray(__pyx_v_ids, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_v_idsect = __pyx_t_3;
-  __pyx_t_3 = 0;
+  __pyx_v_idsect = __pyx_t_4;
+  __pyx_t_4 = 0;
 
-  /* "g2clib.pyx":173
+  /* "g2clib.pyx":177
  * 
  *     idsect = _toarray(ids, zeros(idslen, 'i4'))
  *     return idsect,iofst/8             # <<<<<<<<<<<<<<
@@ -1695,25 +1781,35 @@ static PyObject *__pyx_pf_6g2clib_4unpack1(CYTHON_UNUSED PyObject *__pyx_self, P
  * 
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_3 = PyInt_FromLong(__Pyx_div_long(__pyx_v_iofst, 8)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = __Pyx_PyInt_From_long(__Pyx_div_long(__pyx_v_iofst, 8)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_INCREF(__pyx_v_idsect);
   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_idsect);
   __Pyx_GIVEREF(__pyx_v_idsect);
-  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
-  __Pyx_GIVEREF(__pyx_t_3);
-  __pyx_t_3 = 0;
-  __pyx_r = ((PyObject *)__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
+  __Pyx_GIVEREF(__pyx_t_4);
+  __pyx_t_4 = 0;
+  __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "g2clib.pyx":127
+ * # routines for reading grib2 files.
+ * 
+ * def unpack1(gribmsg, ipos, object zeros):             # <<<<<<<<<<<<<<
+ *     """              .      .    .                                       .
+ *  Unpacks Section 1 (Identification Section) as defined in GRIB Edition 2.
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_7);
   __Pyx_AddTraceback("g2clib.unpack1", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_r = NULL;
   __pyx_L0:;
@@ -1724,19 +1820,30 @@ static PyObject *__pyx_pf_6g2clib_4unpack1(CYTHON_UNUSED PyObject *__pyx_self, P
   return __pyx_r;
 }
 
+/* "g2clib.pyx":181
+ * 
+ * 
+ * def unpack3(gribmsg, ipos, object zeros):             # <<<<<<<<<<<<<<
+ *     """
+ *  Unpacks Section 3 (Grid Definition Section) as defined in GRIB Edition 2.
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_6g2clib_7unpack3(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static char __pyx_doc_6g2clib_6unpack3[] = "\n Unpacks Section 3 (Grid Definition Section) as defined in GRIB Edition 2.\n\n gds,gdtmpl,deflist,ipos = unpack3(gribmsg,ipos)\n \n INPUTS:\n cgrib    - Char array ontaining Section 3 of the GRIB2 message\n iofst    - Byte offset for the beginning of Section 3 in cgrib.\n zeros    - Numeric/numpy array/scip.base zeros function (used to allocate\n            output python arrays).  Python is used to allocate the arrays\n            so no imple [...]
-static PyMethodDef __pyx_mdef_6g2clib_7unpack3 = {__Pyx_NAMESTR("unpack3"), (PyCFunction)__pyx_pw_6g2clib_7unpack3, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6g2clib_6unpack3)};
+static PyMethodDef __pyx_mdef_6g2clib_7unpack3 = {"unpack3", (PyCFunction)__pyx_pw_6g2clib_7unpack3, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6g2clib_6unpack3};
 static PyObject *__pyx_pw_6g2clib_7unpack3(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyObject *__pyx_v_gribmsg = 0;
   PyObject *__pyx_v_ipos = 0;
   PyObject *__pyx_v_zeros = 0;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("unpack3 (wrapper)", 0);
   {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__gribmsg,&__pyx_n_s__ipos,&__pyx_n_s__zeros,0};
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gribmsg,&__pyx_n_s_ipos,&__pyx_n_s_zeros,0};
     PyObject* values[3] = {0,0,0};
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
@@ -1751,21 +1858,21 @@ static PyObject *__pyx_pw_6g2clib_7unpack3(PyObject *__pyx_self, PyObject *__pyx
       kw_args = PyDict_Size(__pyx_kwds);
       switch (pos_args) {
         case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__gribmsg)) != 0)) kw_args--;
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_gribmsg)) != 0)) kw_args--;
         else goto __pyx_L5_argtuple_error;
         case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ipos)) != 0)) kw_args--;
+        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ipos)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("unpack3", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+          __Pyx_RaiseArgtupleInvalid("unpack3", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
         case  2:
-        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__zeros)) != 0)) kw_args--;
+        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_zeros)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("unpack3", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+          __Pyx_RaiseArgtupleInvalid("unpack3", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "unpack3") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "unpack3") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
       goto __pyx_L5_argtuple_error;
@@ -1780,25 +1887,19 @@ static PyObject *__pyx_pw_6g2clib_7unpack3(PyObject *__pyx_self, PyObject *__pyx
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("unpack3", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+  __Pyx_RaiseArgtupleInvalid("unpack3", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
   __pyx_L3_error:;
   __Pyx_AddTraceback("g2clib.unpack3", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
   return NULL;
   __pyx_L4_argument_unpacking_done:;
   __pyx_r = __pyx_pf_6g2clib_6unpack3(__pyx_self, __pyx_v_gribmsg, __pyx_v_ipos, __pyx_v_zeros);
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "g2clib.pyx":177
- * 
- * 
- * def unpack3(gribmsg, ipos, object zeros):             # <<<<<<<<<<<<<<
- *     """
- *  Unpacks Section 3 (Grid Definition Section) as defined in GRIB Edition 2.
- */
-
 static PyObject *__pyx_pf_6g2clib_6unpack3(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_gribmsg, PyObject *__pyx_v_ipos, PyObject *__pyx_v_zeros) {
   unsigned char *__pyx_v_cgrib;
   g2int *__pyx_v_igds;
@@ -1817,13 +1918,17 @@ static PyObject *__pyx_pf_6g2clib_6unpack3(CYTHON_UNUSED PyObject *__pyx_self, P
   PyObject *__pyx_t_1 = NULL;
   int __pyx_t_2;
   PyObject *__pyx_t_3 = NULL;
+  PyObject *__pyx_t_4 = NULL;
+  PyObject *__pyx_t_5 = NULL;
+  Py_ssize_t __pyx_t_6;
+  PyObject *__pyx_t_7 = NULL;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("unpack3", 0);
 
-  /* "g2clib.pyx":224
- *     cdef g2int *igds, *igdstmpl, *ideflist
+  /* "g2clib.pyx":230
+ *     cdef g2int *ideflist
  *     cdef g2int mapgridlen, iofst, idefnum, ierr
  *     cgrib = <unsigned char *>PyBytes_AsString(gribmsg)             # <<<<<<<<<<<<<<
  *     iofst = <g2int>PyInt_AsLong(ipos*8)
@@ -1831,19 +1936,19 @@ static PyObject *__pyx_pf_6g2clib_6unpack3(CYTHON_UNUSED PyObject *__pyx_self, P
  */
   __pyx_v_cgrib = ((unsigned char *)PyBytes_AsString(__pyx_v_gribmsg));
 
-  /* "g2clib.pyx":225
+  /* "g2clib.pyx":231
  *     cdef g2int mapgridlen, iofst, idefnum, ierr
  *     cgrib = <unsigned char *>PyBytes_AsString(gribmsg)
  *     iofst = <g2int>PyInt_AsLong(ipos*8)             # <<<<<<<<<<<<<<
  *     ierr=g2_unpack3(cgrib,&iofst,&igds,&igdstmpl,&mapgridlen,&ideflist,&idefnum)
  *     if ierr != 0:
  */
-  __pyx_t_1 = PyNumber_Multiply(__pyx_v_ipos, __pyx_int_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyNumber_Multiply(__pyx_v_ipos, __pyx_int_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_v_iofst = ((g2int)PyInt_AsLong(__pyx_t_1));
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "g2clib.pyx":226
+  /* "g2clib.pyx":232
  *     cgrib = <unsigned char *>PyBytes_AsString(gribmsg)
  *     iofst = <g2int>PyInt_AsLong(ipos*8)
  *     ierr=g2_unpack3(cgrib,&iofst,&igds,&igdstmpl,&mapgridlen,&ideflist,&idefnum)             # <<<<<<<<<<<<<<
@@ -1852,121 +1957,153 @@ static PyObject *__pyx_pf_6g2clib_6unpack3(CYTHON_UNUSED PyObject *__pyx_self, P
  */
   __pyx_v_ierr = g2_unpack3(__pyx_v_cgrib, (&__pyx_v_iofst), (&__pyx_v_igds), (&__pyx_v_igdstmpl), (&__pyx_v_mapgridlen), (&__pyx_v_ideflist), (&__pyx_v_idefnum));
 
-  /* "g2clib.pyx":227
+  /* "g2clib.pyx":233
  *     iofst = <g2int>PyInt_AsLong(ipos*8)
  *     ierr=g2_unpack3(cgrib,&iofst,&igds,&igdstmpl,&mapgridlen,&ideflist,&idefnum)
  *     if ierr != 0:             # <<<<<<<<<<<<<<
  *        msg = "Error unpacking section 3 - error code = %i" % ierr
  *        raise RuntimeError(msg)
  */
-  __pyx_t_2 = (__pyx_v_ierr != 0);
+  __pyx_t_2 = ((__pyx_v_ierr != 0) != 0);
   if (__pyx_t_2) {
 
-    /* "g2clib.pyx":228
+    /* "g2clib.pyx":234
  *     ierr=g2_unpack3(cgrib,&iofst,&igds,&igdstmpl,&mapgridlen,&ideflist,&idefnum)
  *     if ierr != 0:
  *        msg = "Error unpacking section 3 - error code = %i" % ierr             # <<<<<<<<<<<<<<
  *        raise RuntimeError(msg)
  * 
  */
-    __pyx_t_1 = __Pyx_PyInt_to_py_int32_t(__pyx_v_ierr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = __Pyx_PyInt_From_int32_t(__pyx_v_ierr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_9), __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
+    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Error_unpacking_section_3_error, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_v_msg = ((PyObject *)__pyx_t_3);
+    __pyx_v_msg = __pyx_t_3;
     __pyx_t_3 = 0;
 
-    /* "g2clib.pyx":229
+    /* "g2clib.pyx":235
  *     if ierr != 0:
  *        msg = "Error unpacking section 3 - error code = %i" % ierr
  *        raise RuntimeError(msg)             # <<<<<<<<<<<<<<
  * 
  *     gdtmpl = _toarray(igdstmpl, zeros(mapgridlen, 'i4'))
  */
-    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_INCREF(__pyx_v_msg);
     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_msg);
     __Pyx_GIVEREF(__pyx_v_msg);
-    __pyx_t_1 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_Raise(__pyx_t_1, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L3;
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
-  __pyx_L3:;
 
-  /* "g2clib.pyx":231
+  /* "g2clib.pyx":237
  *        raise RuntimeError(msg)
  * 
  *     gdtmpl = _toarray(igdstmpl, zeros(mapgridlen, 'i4'))             # <<<<<<<<<<<<<<
  *     gds = _toarray(igds, zeros(5, 'i4'))
  *     deflist = _toarray(ideflist, zeros(idefnum, 'i4'))
  */
-  __pyx_t_1 = __Pyx_PyInt_to_py_int32_t(__pyx_v_mapgridlen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_PyInt_From_int32_t(__pyx_v_mapgridlen); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
-  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
-  __Pyx_GIVEREF(__pyx_t_1);
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__i4));
-  PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_n_s__i4));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__i4));
-  __pyx_t_1 = 0;
-  __pyx_t_1 = PyObject_Call(__pyx_v_zeros, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_INCREF(__pyx_v_zeros);
+  __pyx_t_4 = __pyx_v_zeros; __pyx_t_5 = NULL;
+  __pyx_t_6 = 0;
+  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
+    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
+    if (likely(__pyx_t_5)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+      __Pyx_INCREF(__pyx_t_5);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_4, function);
+      __pyx_t_6 = 1;
+    }
+  }
+  __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_7);
+  if (__pyx_t_5) {
+    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
+  }
+  PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_3);
+  __Pyx_INCREF(__pyx_n_s_i4);
+  PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_n_s_i4);
+  __Pyx_GIVEREF(__pyx_n_s_i4);
+  __pyx_t_3 = 0;
+  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-  __pyx_t_3 = __pyx_f_6g2clib__toarray(__pyx_v_igdstmpl, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_t_4 = __pyx_f_6g2clib__toarray(__pyx_v_igdstmpl, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_v_gdtmpl = __pyx_t_3;
-  __pyx_t_3 = 0;
+  __pyx_v_gdtmpl = __pyx_t_4;
+  __pyx_t_4 = 0;
 
-  /* "g2clib.pyx":232
+  /* "g2clib.pyx":238
  * 
  *     gdtmpl = _toarray(igdstmpl, zeros(mapgridlen, 'i4'))
  *     gds = _toarray(igds, zeros(5, 'i4'))             # <<<<<<<<<<<<<<
  *     deflist = _toarray(ideflist, zeros(idefnum, 'i4'))
  * 
  */
-  __pyx_t_3 = PyObject_Call(__pyx_v_zeros, ((PyObject *)__pyx_k_tuple_10), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_1 = __pyx_f_6g2clib__toarray(__pyx_v_igds, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_v_zeros, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_1 = __pyx_f_6g2clib__toarray(__pyx_v_igds, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   __pyx_v_gds = __pyx_t_1;
   __pyx_t_1 = 0;
 
-  /* "g2clib.pyx":233
+  /* "g2clib.pyx":239
  *     gdtmpl = _toarray(igdstmpl, zeros(mapgridlen, 'i4'))
  *     gds = _toarray(igds, zeros(5, 'i4'))
  *     deflist = _toarray(ideflist, zeros(idefnum, 'i4'))             # <<<<<<<<<<<<<<
  * 
  *     return gds,gdtmpl,deflist,iofst/8
  */
-  __pyx_t_1 = __Pyx_PyInt_to_py_int32_t(__pyx_v_idefnum); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
-  __Pyx_GIVEREF(__pyx_t_1);
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__i4));
-  PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_n_s__i4));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__i4));
-  __pyx_t_1 = 0;
-  __pyx_t_1 = PyObject_Call(__pyx_v_zeros, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = __Pyx_PyInt_From_int32_t(__pyx_v_idefnum); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_INCREF(__pyx_v_zeros);
+  __pyx_t_7 = __pyx_v_zeros; __pyx_t_3 = NULL;
+  __pyx_t_6 = 0;
+  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_7, function);
+      __pyx_t_6 = 1;
+    }
+  }
+  __pyx_t_5 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  if (__pyx_t_3) {
+    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
+  }
+  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_6, __pyx_t_4);
+  __Pyx_GIVEREF(__pyx_t_4);
+  __Pyx_INCREF(__pyx_n_s_i4);
+  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_6, __pyx_n_s_i4);
+  __Pyx_GIVEREF(__pyx_n_s_i4);
+  __pyx_t_4 = 0;
+  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-  __pyx_t_3 = __pyx_f_6g2clib__toarray(__pyx_v_ideflist, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_7 = __pyx_f_6g2clib__toarray(__pyx_v_ideflist, __pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_v_deflist = __pyx_t_3;
-  __pyx_t_3 = 0;
+  __pyx_v_deflist = __pyx_t_7;
+  __pyx_t_7 = 0;
 
-  /* "g2clib.pyx":235
+  /* "g2clib.pyx":241
  *     deflist = _toarray(ideflist, zeros(idefnum, 'i4'))
  * 
  *     return gds,gdtmpl,deflist,iofst/8             # <<<<<<<<<<<<<<
@@ -1974,9 +2111,9 @@ static PyObject *__pyx_pf_6g2clib_6unpack3(CYTHON_UNUSED PyObject *__pyx_self, P
  * def unpack4(gribmsg,ipos,object zeros):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_3 = PyInt_FromLong(__Pyx_div_long(__pyx_v_iofst, 8)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_7 = __Pyx_PyInt_From_long(__Pyx_div_long(__pyx_v_iofst, 8)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_7);
+  __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_INCREF(__pyx_v_gds);
   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_gds);
@@ -1987,18 +2124,28 @@ static PyObject *__pyx_pf_6g2clib_6unpack3(CYTHON_UNUSED PyObject *__pyx_self, P
   __Pyx_INCREF(__pyx_v_deflist);
   PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_deflist);
   __Pyx_GIVEREF(__pyx_v_deflist);
-  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_3);
-  __Pyx_GIVEREF(__pyx_t_3);
-  __pyx_t_3 = 0;
-  __pyx_r = ((PyObject *)__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_7);
+  __Pyx_GIVEREF(__pyx_t_7);
+  __pyx_t_7 = 0;
+  __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "g2clib.pyx":181
+ * 
+ * 
+ * def unpack3(gribmsg, ipos, object zeros):             # <<<<<<<<<<<<<<
+ *     """
+ *  Unpacks Section 3 (Grid Definition Section) as defined in GRIB Edition 2.
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_7);
   __Pyx_AddTraceback("g2clib.unpack3", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_r = NULL;
   __pyx_L0:;
@@ -2011,19 +2158,30 @@ static PyObject *__pyx_pf_6g2clib_6unpack3(CYTHON_UNUSED PyObject *__pyx_self, P
   return __pyx_r;
 }
 
+/* "g2clib.pyx":243
+ *     return gds,gdtmpl,deflist,iofst/8
+ * 
+ * def unpack4(gribmsg,ipos,object zeros):             # <<<<<<<<<<<<<<
+ *     """
+ *  Unpacks Section 4 (Product Definition Section) as defined in GRIB Edition 2.
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_6g2clib_9unpack4(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static char __pyx_doc_6g2clib_8unpack4[] = "\n Unpacks Section 4 (Product Definition Section) as defined in GRIB Edition 2.\n\n pdtmpl,pdtnum,coordlist,ipos = unpack4(gribmsg,ipos)\n \n INPUTS:\n   gribmsg  - Character string containing Section 4 of the GRIB2 message\n   ipos     - Byte offset of the beginning of Section 4 in cgrib.\n   zeros    - Numeric/numpy array/scip.base zeros function (used to allocate\n              output python arrays).  Python is used to allocate the arrays\n  [...]
-static PyMethodDef __pyx_mdef_6g2clib_9unpack4 = {__Pyx_NAMESTR("unpack4"), (PyCFunction)__pyx_pw_6g2clib_9unpack4, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6g2clib_8unpack4)};
+static PyMethodDef __pyx_mdef_6g2clib_9unpack4 = {"unpack4", (PyCFunction)__pyx_pw_6g2clib_9unpack4, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6g2clib_8unpack4};
 static PyObject *__pyx_pw_6g2clib_9unpack4(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyObject *__pyx_v_gribmsg = 0;
   PyObject *__pyx_v_ipos = 0;
   PyObject *__pyx_v_zeros = 0;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("unpack4 (wrapper)", 0);
   {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__gribmsg,&__pyx_n_s__ipos,&__pyx_n_s__zeros,0};
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gribmsg,&__pyx_n_s_ipos,&__pyx_n_s_zeros,0};
     PyObject* values[3] = {0,0,0};
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
@@ -2038,21 +2196,21 @@ static PyObject *__pyx_pw_6g2clib_9unpack4(PyObject *__pyx_self, PyObject *__pyx
       kw_args = PyDict_Size(__pyx_kwds);
       switch (pos_args) {
         case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__gribmsg)) != 0)) kw_args--;
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_gribmsg)) != 0)) kw_args--;
         else goto __pyx_L5_argtuple_error;
         case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ipos)) != 0)) kw_args--;
+        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ipos)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("unpack4", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+          __Pyx_RaiseArgtupleInvalid("unpack4", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
         case  2:
-        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__zeros)) != 0)) kw_args--;
+        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_zeros)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("unpack4", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+          __Pyx_RaiseArgtupleInvalid("unpack4", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "unpack4") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "unpack4") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
       goto __pyx_L5_argtuple_error;
@@ -2067,25 +2225,19 @@ static PyObject *__pyx_pw_6g2clib_9unpack4(PyObject *__pyx_self, PyObject *__pyx
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("unpack4", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+  __Pyx_RaiseArgtupleInvalid("unpack4", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
   __pyx_L3_error:;
   __Pyx_AddTraceback("g2clib.unpack4", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
   return NULL;
   __pyx_L4_argument_unpacking_done:;
   __pyx_r = __pyx_pf_6g2clib_8unpack4(__pyx_self, __pyx_v_gribmsg, __pyx_v_ipos, __pyx_v_zeros);
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "g2clib.pyx":237
- *     return gds,gdtmpl,deflist,iofst/8
- * 
- * def unpack4(gribmsg,ipos,object zeros):             # <<<<<<<<<<<<<<
- *     """
- *  Unpacks Section 4 (Product Definition Section) as defined in GRIB Edition 2.
- */
-
 static PyObject *__pyx_pf_6g2clib_8unpack4(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_gribmsg, PyObject *__pyx_v_ipos, PyObject *__pyx_v_zeros) {
   unsigned char *__pyx_v_cgrib;
   g2int *__pyx_v_ipdstmpl;
@@ -2104,12 +2256,15 @@ static PyObject *__pyx_pf_6g2clib_8unpack4(CYTHON_UNUSED PyObject *__pyx_self, P
   int __pyx_t_2;
   PyObject *__pyx_t_3 = NULL;
   PyObject *__pyx_t_4 = NULL;
+  PyObject *__pyx_t_5 = NULL;
+  Py_ssize_t __pyx_t_6;
+  PyObject *__pyx_t_7 = NULL;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("unpack4", 0);
 
-  /* "g2clib.pyx":275
+  /* "g2clib.pyx":281
  *     cdef g2float *icoordlist
  *     cdef g2int mappdslen, iofst, ipdsnum, ierr, numcoord
  *     cgrib = <unsigned char *>PyBytes_AsString(gribmsg)             # <<<<<<<<<<<<<<
@@ -2118,19 +2273,19 @@ static PyObject *__pyx_pf_6g2clib_8unpack4(CYTHON_UNUSED PyObject *__pyx_self, P
  */
   __pyx_v_cgrib = ((unsigned char *)PyBytes_AsString(__pyx_v_gribmsg));
 
-  /* "g2clib.pyx":276
+  /* "g2clib.pyx":282
  *     cdef g2int mappdslen, iofst, ipdsnum, ierr, numcoord
  *     cgrib = <unsigned char *>PyBytes_AsString(gribmsg)
  *     iofst = <g2int>PyInt_AsLong(ipos*8)             # <<<<<<<<<<<<<<
  *     ierr=g2_unpack4(cgrib,&iofst,&ipdsnum,&ipdstmpl,&mappdslen,&icoordlist,&numcoord)
  *     if ierr != 0:
  */
-  __pyx_t_1 = PyNumber_Multiply(__pyx_v_ipos, __pyx_int_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyNumber_Multiply(__pyx_v_ipos, __pyx_int_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_v_iofst = ((g2int)PyInt_AsLong(__pyx_t_1));
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "g2clib.pyx":277
+  /* "g2clib.pyx":283
  *     cgrib = <unsigned char *>PyBytes_AsString(gribmsg)
  *     iofst = <g2int>PyInt_AsLong(ipos*8)
  *     ierr=g2_unpack4(cgrib,&iofst,&ipdsnum,&ipdstmpl,&mappdslen,&icoordlist,&numcoord)             # <<<<<<<<<<<<<<
@@ -2139,106 +2294,138 @@ static PyObject *__pyx_pf_6g2clib_8unpack4(CYTHON_UNUSED PyObject *__pyx_self, P
  */
   __pyx_v_ierr = g2_unpack4(__pyx_v_cgrib, (&__pyx_v_iofst), (&__pyx_v_ipdsnum), (&__pyx_v_ipdstmpl), (&__pyx_v_mappdslen), (&__pyx_v_icoordlist), (&__pyx_v_numcoord));
 
-  /* "g2clib.pyx":278
+  /* "g2clib.pyx":284
  *     iofst = <g2int>PyInt_AsLong(ipos*8)
  *     ierr=g2_unpack4(cgrib,&iofst,&ipdsnum,&ipdstmpl,&mappdslen,&icoordlist,&numcoord)
  *     if ierr != 0:             # <<<<<<<<<<<<<<
  *        msg = "Error unpacking section 4 - error code = %i" % ierr
  *        raise RuntimeError(msg)
  */
-  __pyx_t_2 = (__pyx_v_ierr != 0);
+  __pyx_t_2 = ((__pyx_v_ierr != 0) != 0);
   if (__pyx_t_2) {
 
-    /* "g2clib.pyx":279
+    /* "g2clib.pyx":285
  *     ierr=g2_unpack4(cgrib,&iofst,&ipdsnum,&ipdstmpl,&mappdslen,&icoordlist,&numcoord)
  *     if ierr != 0:
  *        msg = "Error unpacking section 4 - error code = %i" % ierr             # <<<<<<<<<<<<<<
  *        raise RuntimeError(msg)
  * 
  */
-    __pyx_t_1 = __Pyx_PyInt_to_py_int32_t(__pyx_v_ierr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = __Pyx_PyInt_From_int32_t(__pyx_v_ierr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_11), __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
+    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Error_unpacking_section_4_error, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_v_msg = ((PyObject *)__pyx_t_3);
+    __pyx_v_msg = __pyx_t_3;
     __pyx_t_3 = 0;
 
-    /* "g2clib.pyx":280
+    /* "g2clib.pyx":286
  *     if ierr != 0:
  *        msg = "Error unpacking section 4 - error code = %i" % ierr
  *        raise RuntimeError(msg)             # <<<<<<<<<<<<<<
  * 
  *     pdtmpl = _toarray(ipdstmpl, zeros(mappdslen, 'i4'))
  */
-    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_INCREF(__pyx_v_msg);
     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_msg);
     __Pyx_GIVEREF(__pyx_v_msg);
-    __pyx_t_1 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_Raise(__pyx_t_1, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L3;
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
-  __pyx_L3:;
 
-  /* "g2clib.pyx":282
+  /* "g2clib.pyx":288
  *        raise RuntimeError(msg)
  * 
  *     pdtmpl = _toarray(ipdstmpl, zeros(mappdslen, 'i4'))             # <<<<<<<<<<<<<<
  *     coordlist = _toarray(icoordlist, zeros(numcoord, 'f4'))
  * 
  */
-  __pyx_t_1 = __Pyx_PyInt_to_py_int32_t(__pyx_v_mappdslen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_PyInt_From_int32_t(__pyx_v_mappdslen); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
-  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
-  __Pyx_GIVEREF(__pyx_t_1);
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__i4));
-  PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_n_s__i4));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__i4));
-  __pyx_t_1 = 0;
-  __pyx_t_1 = PyObject_Call(__pyx_v_zeros, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_INCREF(__pyx_v_zeros);
+  __pyx_t_4 = __pyx_v_zeros; __pyx_t_5 = NULL;
+  __pyx_t_6 = 0;
+  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
+    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
+    if (likely(__pyx_t_5)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+      __Pyx_INCREF(__pyx_t_5);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_4, function);
+      __pyx_t_6 = 1;
+    }
+  }
+  __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_7);
+  if (__pyx_t_5) {
+    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
+  }
+  PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_3);
+  __Pyx_INCREF(__pyx_n_s_i4);
+  PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_n_s_i4);
+  __Pyx_GIVEREF(__pyx_n_s_i4);
+  __pyx_t_3 = 0;
+  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-  __pyx_t_3 = __pyx_f_6g2clib__toarray(__pyx_v_ipdstmpl, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_t_4 = __pyx_f_6g2clib__toarray(__pyx_v_ipdstmpl, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_v_pdtmpl = __pyx_t_3;
-  __pyx_t_3 = 0;
+  __pyx_v_pdtmpl = __pyx_t_4;
+  __pyx_t_4 = 0;
 
-  /* "g2clib.pyx":283
+  /* "g2clib.pyx":289
  * 
  *     pdtmpl = _toarray(ipdstmpl, zeros(mappdslen, 'i4'))
  *     coordlist = _toarray(icoordlist, zeros(numcoord, 'f4'))             # <<<<<<<<<<<<<<
  * 
  *     return pdtmpl,ipdsnum,coordlist,iofst/8
  */
-  __pyx_t_3 = __Pyx_PyInt_to_py_int32_t(__pyx_v_numcoord); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
-  __Pyx_GIVEREF(__pyx_t_3);
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__f4));
-  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_n_s__f4));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__f4));
-  __pyx_t_3 = 0;
-  __pyx_t_3 = PyObject_Call(__pyx_v_zeros, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
-  __pyx_t_1 = __pyx_f_6g2clib__toarray(__pyx_v_icoordlist, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_PyInt_From_int32_t(__pyx_v_numcoord); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_v_coordlist = __pyx_t_1;
+  __Pyx_INCREF(__pyx_v_zeros);
+  __pyx_t_7 = __pyx_v_zeros; __pyx_t_3 = NULL;
+  __pyx_t_6 = 0;
+  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_7, function);
+      __pyx_t_6 = 1;
+    }
+  }
+  __pyx_t_5 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  if (__pyx_t_3) {
+    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
+  }
+  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_6, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_f4);
+  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_6, __pyx_n_s_f4);
+  __Pyx_GIVEREF(__pyx_n_s_f4);
   __pyx_t_1 = 0;
+  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_7 = __pyx_f_6g2clib__toarray(__pyx_v_icoordlist, __pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_7);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_v_coordlist = __pyx_t_7;
+  __pyx_t_7 = 0;
 
-  /* "g2clib.pyx":285
+  /* "g2clib.pyx":291
  *     coordlist = _toarray(icoordlist, zeros(numcoord, 'f4'))
  * 
  *     return pdtmpl,ipdsnum,coordlist,iofst/8             # <<<<<<<<<<<<<<
@@ -2246,34 +2433,43 @@ static PyObject *__pyx_pf_6g2clib_8unpack4(CYTHON_UNUSED PyObject *__pyx_self, P
  * def unpack5(gribmsg,ipos,object zeros):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyInt_to_py_int32_t(__pyx_v_ipdsnum); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_3 = PyInt_FromLong(__Pyx_div_long(__pyx_v_iofst, 8)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_7 = __Pyx_PyInt_From_int32_t(__pyx_v_ipdsnum); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_7);
+  __pyx_t_4 = __Pyx_PyInt_From_long(__Pyx_div_long(__pyx_v_iofst, 8)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
   __Pyx_INCREF(__pyx_v_pdtmpl);
-  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_pdtmpl);
+  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_pdtmpl);
   __Pyx_GIVEREF(__pyx_v_pdtmpl);
-  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
-  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_7);
+  __Pyx_GIVEREF(__pyx_t_7);
   __Pyx_INCREF(__pyx_v_coordlist);
-  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_coordlist);
+  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_coordlist);
   __Pyx_GIVEREF(__pyx_v_coordlist);
-  PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_3);
-  __Pyx_GIVEREF(__pyx_t_3);
-  __pyx_t_1 = 0;
-  __pyx_t_3 = 0;
-  __pyx_r = ((PyObject *)__pyx_t_4);
+  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
+  __Pyx_GIVEREF(__pyx_t_4);
+  __pyx_t_7 = 0;
   __pyx_t_4 = 0;
+  __pyx_r = __pyx_t_5;
+  __pyx_t_5 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_3);
+  /* "g2clib.pyx":243
+ *     return gds,gdtmpl,deflist,iofst/8
+ * 
+ * def unpack4(gribmsg,ipos,object zeros):             # <<<<<<<<<<<<<<
+ *     """
+ *  Unpacks Section 4 (Product Definition Section) as defined in GRIB Edition 2.
+ */
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_3);
   __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_7);
   __Pyx_AddTraceback("g2clib.unpack4", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_r = NULL;
   __pyx_L0:;
@@ -2285,19 +2481,30 @@ static PyObject *__pyx_pf_6g2clib_8unpack4(CYTHON_UNUSED PyObject *__pyx_self, P
   return __pyx_r;
 }
 
+/* "g2clib.pyx":293
+ *     return pdtmpl,ipdsnum,coordlist,iofst/8
+ * 
+ * def unpack5(gribmsg,ipos,object zeros):             # <<<<<<<<<<<<<<
+ *     """
+ *  Unpacks Section 5 (Data Representation Section) as defined in GRIB Edition 2.
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_6g2clib_11unpack5(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static char __pyx_doc_6g2clib_10unpack5[] = "\n Unpacks Section 5 (Data Representation Section) as defined in GRIB Edition 2.\n\n drtmpl,drtnum,ndpts,ipos = unpack5(gribmsg,ipos)\n\n INPUTS:\n   gribmsg  - Character string containing Section 5 of the GRIB2 message\n   ipos     - Byte offset for the beginning of Section 5 in cgrib.\n   zeros   - Numeric/numpy array/scip.base zeros function (used to allocate\n             output python arrays).  Python is used to allocate the arrays\n      [...]
-static PyMethodDef __pyx_mdef_6g2clib_11unpack5 = {__Pyx_NAMESTR("unpack5"), (PyCFunction)__pyx_pw_6g2clib_11unpack5, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6g2clib_10unpack5)};
+static PyMethodDef __pyx_mdef_6g2clib_11unpack5 = {"unpack5", (PyCFunction)__pyx_pw_6g2clib_11unpack5, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6g2clib_10unpack5};
 static PyObject *__pyx_pw_6g2clib_11unpack5(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyObject *__pyx_v_gribmsg = 0;
   PyObject *__pyx_v_ipos = 0;
   PyObject *__pyx_v_zeros = 0;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("unpack5 (wrapper)", 0);
   {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__gribmsg,&__pyx_n_s__ipos,&__pyx_n_s__zeros,0};
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gribmsg,&__pyx_n_s_ipos,&__pyx_n_s_zeros,0};
     PyObject* values[3] = {0,0,0};
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
@@ -2312,21 +2519,21 @@ static PyObject *__pyx_pw_6g2clib_11unpack5(PyObject *__pyx_self, PyObject *__py
       kw_args = PyDict_Size(__pyx_kwds);
       switch (pos_args) {
         case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__gribmsg)) != 0)) kw_args--;
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_gribmsg)) != 0)) kw_args--;
         else goto __pyx_L5_argtuple_error;
         case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ipos)) != 0)) kw_args--;
+        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ipos)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("unpack5", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+          __Pyx_RaiseArgtupleInvalid("unpack5", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
         case  2:
-        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__zeros)) != 0)) kw_args--;
+        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_zeros)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("unpack5", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+          __Pyx_RaiseArgtupleInvalid("unpack5", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "unpack5") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "unpack5") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
       goto __pyx_L5_argtuple_error;
@@ -2341,25 +2548,19 @@ static PyObject *__pyx_pw_6g2clib_11unpack5(PyObject *__pyx_self, PyObject *__py
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("unpack5", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+  __Pyx_RaiseArgtupleInvalid("unpack5", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
   __pyx_L3_error:;
   __Pyx_AddTraceback("g2clib.unpack5", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
   return NULL;
   __pyx_L4_argument_unpacking_done:;
   __pyx_r = __pyx_pf_6g2clib_10unpack5(__pyx_self, __pyx_v_gribmsg, __pyx_v_ipos, __pyx_v_zeros);
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "g2clib.pyx":287
- *     return pdtmpl,ipdsnum,coordlist,iofst/8
- * 
- * def unpack5(gribmsg,ipos,object zeros):             # <<<<<<<<<<<<<<
- *     """
- *  Unpacks Section 5 (Data Representation Section) as defined in GRIB Edition 2.
- */
-
 static PyObject *__pyx_pf_6g2clib_10unpack5(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_gribmsg, PyObject *__pyx_v_ipos, PyObject *__pyx_v_zeros) {
   unsigned char *__pyx_v_cgrib;
   g2int *__pyx_v_idrstmpl;
@@ -2377,12 +2578,14 @@ static PyObject *__pyx_pf_6g2clib_10unpack5(CYTHON_UNUSED PyObject *__pyx_self,
   PyObject *__pyx_t_3 = NULL;
   PyObject *__pyx_t_4 = NULL;
   PyObject *__pyx_t_5 = NULL;
+  Py_ssize_t __pyx_t_6;
+  PyObject *__pyx_t_7 = NULL;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("unpack5", 0);
 
-  /* "g2clib.pyx":321
+  /* "g2clib.pyx":327
  *     cdef g2int *idrstmpl
  *     cdef g2int iofst, ierr, ndpts, idrsnum, mapdrslen
  *     cgrib = <unsigned char *>PyBytes_AsString(gribmsg)             # <<<<<<<<<<<<<<
@@ -2391,19 +2594,19 @@ static PyObject *__pyx_pf_6g2clib_10unpack5(CYTHON_UNUSED PyObject *__pyx_self,
  */
   __pyx_v_cgrib = ((unsigned char *)PyBytes_AsString(__pyx_v_gribmsg));
 
-  /* "g2clib.pyx":322
+  /* "g2clib.pyx":328
  *     cdef g2int iofst, ierr, ndpts, idrsnum, mapdrslen
  *     cgrib = <unsigned char *>PyBytes_AsString(gribmsg)
  *     iofst = <g2int>PyInt_AsLong(ipos*8)             # <<<<<<<<<<<<<<
  *     ierr=g2_unpack5(cgrib,&iofst,&ndpts,&idrsnum,&idrstmpl,&mapdrslen)
  *     if ierr != 0:
  */
-  __pyx_t_1 = PyNumber_Multiply(__pyx_v_ipos, __pyx_int_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyNumber_Multiply(__pyx_v_ipos, __pyx_int_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_v_iofst = ((g2int)PyInt_AsLong(__pyx_t_1));
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "g2clib.pyx":323
+  /* "g2clib.pyx":329
  *     cgrib = <unsigned char *>PyBytes_AsString(gribmsg)
  *     iofst = <g2int>PyInt_AsLong(ipos*8)
  *     ierr=g2_unpack5(cgrib,&iofst,&ndpts,&idrsnum,&idrstmpl,&mapdrslen)             # <<<<<<<<<<<<<<
@@ -2412,80 +2615,95 @@ static PyObject *__pyx_pf_6g2clib_10unpack5(CYTHON_UNUSED PyObject *__pyx_self,
  */
   __pyx_v_ierr = g2_unpack5(__pyx_v_cgrib, (&__pyx_v_iofst), (&__pyx_v_ndpts), (&__pyx_v_idrsnum), (&__pyx_v_idrstmpl), (&__pyx_v_mapdrslen));
 
-  /* "g2clib.pyx":324
+  /* "g2clib.pyx":330
  *     iofst = <g2int>PyInt_AsLong(ipos*8)
  *     ierr=g2_unpack5(cgrib,&iofst,&ndpts,&idrsnum,&idrstmpl,&mapdrslen)
  *     if ierr != 0:             # <<<<<<<<<<<<<<
  *        msg = "Error unpacking section 5 - error code = %i" % ierr
  *        raise RuntimeError(msg)
  */
-  __pyx_t_2 = (__pyx_v_ierr != 0);
+  __pyx_t_2 = ((__pyx_v_ierr != 0) != 0);
   if (__pyx_t_2) {
 
-    /* "g2clib.pyx":325
+    /* "g2clib.pyx":331
  *     ierr=g2_unpack5(cgrib,&iofst,&ndpts,&idrsnum,&idrstmpl,&mapdrslen)
  *     if ierr != 0:
  *        msg = "Error unpacking section 5 - error code = %i" % ierr             # <<<<<<<<<<<<<<
  *        raise RuntimeError(msg)
  * 
  */
-    __pyx_t_1 = __Pyx_PyInt_to_py_int32_t(__pyx_v_ierr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = __Pyx_PyInt_From_int32_t(__pyx_v_ierr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_12), __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
+    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Error_unpacking_section_5_error, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_v_msg = ((PyObject *)__pyx_t_3);
+    __pyx_v_msg = __pyx_t_3;
     __pyx_t_3 = 0;
 
-    /* "g2clib.pyx":326
+    /* "g2clib.pyx":332
  *     if ierr != 0:
  *        msg = "Error unpacking section 5 - error code = %i" % ierr
  *        raise RuntimeError(msg)             # <<<<<<<<<<<<<<
  * 
  *     drtmpl = _toarray(idrstmpl, zeros(mapdrslen, 'i4'))
  */
-    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_INCREF(__pyx_v_msg);
     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_msg);
     __Pyx_GIVEREF(__pyx_v_msg);
-    __pyx_t_1 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_Raise(__pyx_t_1, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L3;
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
-  __pyx_L3:;
 
-  /* "g2clib.pyx":328
+  /* "g2clib.pyx":334
  *        raise RuntimeError(msg)
  * 
  *     drtmpl = _toarray(idrstmpl, zeros(mapdrslen, 'i4'))             # <<<<<<<<<<<<<<
  *     return drtmpl,idrsnum,ndpts,iofst/8
  * 
  */
-  __pyx_t_1 = __Pyx_PyInt_to_py_int32_t(__pyx_v_mapdrslen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_PyInt_From_int32_t(__pyx_v_mapdrslen); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
-  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
-  __Pyx_GIVEREF(__pyx_t_1);
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__i4));
-  PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_n_s__i4));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__i4));
-  __pyx_t_1 = 0;
-  __pyx_t_1 = PyObject_Call(__pyx_v_zeros, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_INCREF(__pyx_v_zeros);
+  __pyx_t_4 = __pyx_v_zeros; __pyx_t_5 = NULL;
+  __pyx_t_6 = 0;
+  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
+    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
+    if (likely(__pyx_t_5)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+      __Pyx_INCREF(__pyx_t_5);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_4, function);
+      __pyx_t_6 = 1;
+    }
+  }
+  __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_7);
+  if (__pyx_t_5) {
+    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
+  }
+  PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_3);
+  __Pyx_INCREF(__pyx_n_s_i4);
+  PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_n_s_i4);
+  __Pyx_GIVEREF(__pyx_n_s_i4);
+  __pyx_t_3 = 0;
+  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-  __pyx_t_3 = __pyx_f_6g2clib__toarray(__pyx_v_idrstmpl, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_t_4 = __pyx_f_6g2clib__toarray(__pyx_v_idrstmpl, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_v_drtmpl = __pyx_t_3;
-  __pyx_t_3 = 0;
+  __pyx_v_drtmpl = __pyx_t_4;
+  __pyx_t_4 = 0;
 
-  /* "g2clib.pyx":329
+  /* "g2clib.pyx":335
  * 
  *     drtmpl = _toarray(idrstmpl, zeros(mapdrslen, 'i4'))
  *     return drtmpl,idrsnum,ndpts,iofst/8             # <<<<<<<<<<<<<<
@@ -2493,37 +2711,45 @@ static PyObject *__pyx_pf_6g2clib_10unpack5(CYTHON_UNUSED PyObject *__pyx_self,
  * def unpack6(gribmsg,ndpts,ipos,object zeros):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_3 = __Pyx_PyInt_to_py_int32_t(__pyx_v_idrsnum); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_1 = __Pyx_PyInt_to_py_int32_t(__pyx_v_ndpts); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_4 = PyInt_FromLong(__Pyx_div_long(__pyx_v_iofst, 8)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = __Pyx_PyInt_From_int32_t(__pyx_v_idrsnum); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_1 = __Pyx_PyInt_From_int32_t(__pyx_v_ndpts); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_7 = __Pyx_PyInt_From_long(__Pyx_div_long(__pyx_v_iofst, 8)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_7);
+  __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
   __Pyx_INCREF(__pyx_v_drtmpl);
-  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_drtmpl);
+  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_drtmpl);
   __Pyx_GIVEREF(__pyx_v_drtmpl);
-  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
-  __Pyx_GIVEREF(__pyx_t_3);
-  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_1);
-  __Pyx_GIVEREF(__pyx_t_1);
-  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
+  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
   __Pyx_GIVEREF(__pyx_t_4);
-  __pyx_t_3 = 0;
-  __pyx_t_1 = 0;
+  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_7);
+  __Pyx_GIVEREF(__pyx_t_7);
   __pyx_t_4 = 0;
-  __pyx_r = ((PyObject *)__pyx_t_5);
-  __pyx_t_5 = 0;
+  __pyx_t_1 = 0;
+  __pyx_t_7 = 0;
+  __pyx_r = __pyx_t_3;
+  __pyx_t_3 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "g2clib.pyx":293
+ *     return pdtmpl,ipdsnum,coordlist,iofst/8
+ * 
+ * def unpack5(gribmsg,ipos,object zeros):             # <<<<<<<<<<<<<<
+ *     """
+ *  Unpacks Section 5 (Data Representation Section) as defined in GRIB Edition 2.
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_XDECREF(__pyx_t_3);
   __Pyx_XDECREF(__pyx_t_4);
   __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_7);
   __Pyx_AddTraceback("g2clib.unpack5", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_r = NULL;
   __pyx_L0:;
@@ -2534,20 +2760,31 @@ static PyObject *__pyx_pf_6g2clib_10unpack5(CYTHON_UNUSED PyObject *__pyx_self,
   return __pyx_r;
 }
 
+/* "g2clib.pyx":337
+ *     return drtmpl,idrsnum,ndpts,iofst/8
+ * 
+ * def unpack6(gribmsg,ndpts,ipos,object zeros):             # <<<<<<<<<<<<<<
+ *     """
+ *  Unpacks Section 6 (Bit-Map Section) as defined in GRIB Edition 2.
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_6g2clib_13unpack6(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static char __pyx_doc_6g2clib_12unpack6[] = "\n Unpacks Section 6 (Bit-Map Section) as defined in GRIB Edition 2.\n\n bitmap = unpack6(gribmsg,ndpts,ipos)         \n\n INPUTS:\n   gribmsg  - String containing Section 6 of the GRIB2 message\n   ndpts    - Number of grid points specified in the bit-map (from\n              gds[1] returned by unpack3).\n   ipos     - Byte offset of the beginning of Section 6 in cgrib.\n   zeros   - Numeric/numpy array/scip.base zeros function (used to alloc [...]
-static PyMethodDef __pyx_mdef_6g2clib_13unpack6 = {__Pyx_NAMESTR("unpack6"), (PyCFunction)__pyx_pw_6g2clib_13unpack6, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6g2clib_12unpack6)};
+static PyMethodDef __pyx_mdef_6g2clib_13unpack6 = {"unpack6", (PyCFunction)__pyx_pw_6g2clib_13unpack6, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6g2clib_12unpack6};
 static PyObject *__pyx_pw_6g2clib_13unpack6(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyObject *__pyx_v_gribmsg = 0;
   PyObject *__pyx_v_ndpts = 0;
   PyObject *__pyx_v_ipos = 0;
   PyObject *__pyx_v_zeros = 0;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("unpack6 (wrapper)", 0);
   {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__gribmsg,&__pyx_n_s__ndpts,&__pyx_n_s__ipos,&__pyx_n_s__zeros,0};
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gribmsg,&__pyx_n_s_ndpts,&__pyx_n_s_ipos,&__pyx_n_s_zeros,0};
     PyObject* values[4] = {0,0,0,0};
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
@@ -2563,26 +2800,26 @@ static PyObject *__pyx_pw_6g2clib_13unpack6(PyObject *__pyx_self, PyObject *__py
       kw_args = PyDict_Size(__pyx_kwds);
       switch (pos_args) {
         case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__gribmsg)) != 0)) kw_args--;
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_gribmsg)) != 0)) kw_args--;
         else goto __pyx_L5_argtuple_error;
         case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ndpts)) != 0)) kw_args--;
+        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ndpts)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("unpack6", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+          __Pyx_RaiseArgtupleInvalid("unpack6", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
         case  2:
-        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ipos)) != 0)) kw_args--;
+        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ipos)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("unpack6", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+          __Pyx_RaiseArgtupleInvalid("unpack6", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
         case  3:
-        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__zeros)) != 0)) kw_args--;
+        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_zeros)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("unpack6", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+          __Pyx_RaiseArgtupleInvalid("unpack6", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "unpack6") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "unpack6") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
       goto __pyx_L5_argtuple_error;
@@ -2599,25 +2836,19 @@ static PyObject *__pyx_pw_6g2clib_13unpack6(PyObject *__pyx_self, PyObject *__py
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("unpack6", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+  __Pyx_RaiseArgtupleInvalid("unpack6", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
   __pyx_L3_error:;
   __Pyx_AddTraceback("g2clib.unpack6", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
   return NULL;
   __pyx_L4_argument_unpacking_done:;
   __pyx_r = __pyx_pf_6g2clib_12unpack6(__pyx_self, __pyx_v_gribmsg, __pyx_v_ndpts, __pyx_v_ipos, __pyx_v_zeros);
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "g2clib.pyx":331
- *     return drtmpl,idrsnum,ndpts,iofst/8
- * 
- * def unpack6(gribmsg,ndpts,ipos,object zeros):             # <<<<<<<<<<<<<<
- *     """
- *  Unpacks Section 6 (Bit-Map Section) as defined in GRIB Edition 2.
- */
-
 static PyObject *__pyx_pf_6g2clib_12unpack6(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_gribmsg, PyObject *__pyx_v_ndpts, PyObject *__pyx_v_ipos, PyObject *__pyx_v_zeros) {
   PyObject *__pyx_v_bitmap = 0;
   unsigned char *__pyx_v_cgrib;
@@ -2632,12 +2863,16 @@ static PyObject *__pyx_pf_6g2clib_12unpack6(CYTHON_UNUSED PyObject *__pyx_self,
   PyObject *__pyx_t_1 = NULL;
   int __pyx_t_2;
   PyObject *__pyx_t_3 = NULL;
+  PyObject *__pyx_t_4 = NULL;
+  PyObject *__pyx_t_5 = NULL;
+  Py_ssize_t __pyx_t_6;
+  PyObject *__pyx_t_7 = NULL;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("unpack6", 0);
 
-  /* "g2clib.pyx":363
+  /* "g2clib.pyx":369
  *     cdef g2int iofst, ierr, ngpts, ibmap
  *     cdef g2int *bmap
  *     cgrib = <unsigned char *>PyBytes_AsString(gribmsg)             # <<<<<<<<<<<<<<
@@ -2646,19 +2881,19 @@ static PyObject *__pyx_pf_6g2clib_12unpack6(CYTHON_UNUSED PyObject *__pyx_self,
  */
   __pyx_v_cgrib = ((unsigned char *)PyBytes_AsString(__pyx_v_gribmsg));
 
-  /* "g2clib.pyx":364
+  /* "g2clib.pyx":370
  *     cdef g2int *bmap
  *     cgrib = <unsigned char *>PyBytes_AsString(gribmsg)
  *     iofst = <g2int>PyInt_AsLong(ipos*8)             # <<<<<<<<<<<<<<
  *     ngpts = <g2int>PyInt_AsLong(ndpts)
  *     ierr=g2_unpack6(cgrib,&iofst,ngpts,&ibmap,&bmap)
  */
-  __pyx_t_1 = PyNumber_Multiply(__pyx_v_ipos, __pyx_int_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyNumber_Multiply(__pyx_v_ipos, __pyx_int_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_v_iofst = ((g2int)PyInt_AsLong(__pyx_t_1));
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "g2clib.pyx":365
+  /* "g2clib.pyx":371
  *     cgrib = <unsigned char *>PyBytes_AsString(gribmsg)
  *     iofst = <g2int>PyInt_AsLong(ipos*8)
  *     ngpts = <g2int>PyInt_AsLong(ndpts)             # <<<<<<<<<<<<<<
@@ -2667,7 +2902,7 @@ static PyObject *__pyx_pf_6g2clib_12unpack6(CYTHON_UNUSED PyObject *__pyx_self,
  */
   __pyx_v_ngpts = ((g2int)PyInt_AsLong(__pyx_v_ndpts));
 
-  /* "g2clib.pyx":366
+  /* "g2clib.pyx":372
  *     iofst = <g2int>PyInt_AsLong(ipos*8)
  *     ngpts = <g2int>PyInt_AsLong(ndpts)
  *     ierr=g2_unpack6(cgrib,&iofst,ngpts,&ibmap,&bmap)             # <<<<<<<<<<<<<<
@@ -2676,93 +2911,108 @@ static PyObject *__pyx_pf_6g2clib_12unpack6(CYTHON_UNUSED PyObject *__pyx_self,
  */
   __pyx_v_ierr = g2_unpack6(__pyx_v_cgrib, (&__pyx_v_iofst), __pyx_v_ngpts, (&__pyx_v_ibmap), (&__pyx_v_bmap));
 
-  /* "g2clib.pyx":367
+  /* "g2clib.pyx":373
  *     ngpts = <g2int>PyInt_AsLong(ndpts)
  *     ierr=g2_unpack6(cgrib,&iofst,ngpts,&ibmap,&bmap)
  *     if ierr != 0:             # <<<<<<<<<<<<<<
  *         msg = "Error unpacking section 6 - error code = %i" % ierr
  *         raise RuntimeError(msg)
  */
-  __pyx_t_2 = (__pyx_v_ierr != 0);
+  __pyx_t_2 = ((__pyx_v_ierr != 0) != 0);
   if (__pyx_t_2) {
 
-    /* "g2clib.pyx":368
+    /* "g2clib.pyx":374
  *     ierr=g2_unpack6(cgrib,&iofst,ngpts,&ibmap,&bmap)
  *     if ierr != 0:
  *         msg = "Error unpacking section 6 - error code = %i" % ierr             # <<<<<<<<<<<<<<
  *         raise RuntimeError(msg)
  *     if ibmap == 0:
  */
-    __pyx_t_1 = __Pyx_PyInt_to_py_int32_t(__pyx_v_ierr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = __Pyx_PyInt_From_int32_t(__pyx_v_ierr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_13), __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
+    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Error_unpacking_section_6_error, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_v_msg = ((PyObject *)__pyx_t_3);
+    __pyx_v_msg = __pyx_t_3;
     __pyx_t_3 = 0;
 
-    /* "g2clib.pyx":369
+    /* "g2clib.pyx":375
  *     if ierr != 0:
  *         msg = "Error unpacking section 6 - error code = %i" % ierr
  *         raise RuntimeError(msg)             # <<<<<<<<<<<<<<
  *     if ibmap == 0:
  *         bitmap = _toarray(bmap, zeros(ngpts, 'i4'))
  */
-    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_INCREF(__pyx_v_msg);
     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_msg);
     __Pyx_GIVEREF(__pyx_v_msg);
-    __pyx_t_1 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_Raise(__pyx_t_1, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L3;
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
-  __pyx_L3:;
 
-  /* "g2clib.pyx":370
+  /* "g2clib.pyx":376
  *         msg = "Error unpacking section 6 - error code = %i" % ierr
  *         raise RuntimeError(msg)
  *     if ibmap == 0:             # <<<<<<<<<<<<<<
  *         bitmap = _toarray(bmap, zeros(ngpts, 'i4'))
  *     else:
  */
-  __pyx_t_2 = (__pyx_v_ibmap == 0);
+  __pyx_t_2 = ((__pyx_v_ibmap == 0) != 0);
   if (__pyx_t_2) {
 
-    /* "g2clib.pyx":371
+    /* "g2clib.pyx":377
  *         raise RuntimeError(msg)
  *     if ibmap == 0:
  *         bitmap = _toarray(bmap, zeros(ngpts, 'i4'))             # <<<<<<<<<<<<<<
  *     else:
  *         bitmap = None
  */
-    __pyx_t_1 = __Pyx_PyInt_to_py_int32_t(__pyx_v_ngpts); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = __Pyx_PyInt_From_int32_t(__pyx_v_ngpts); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
-    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
-    __Pyx_GIVEREF(__pyx_t_1);
-    __Pyx_INCREF(((PyObject *)__pyx_n_s__i4));
-    PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_n_s__i4));
-    __Pyx_GIVEREF(((PyObject *)__pyx_n_s__i4));
-    __pyx_t_1 = 0;
-    __pyx_t_1 = PyObject_Call(__pyx_v_zeros, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_INCREF(__pyx_v_zeros);
+    __pyx_t_4 = __pyx_v_zeros; __pyx_t_5 = NULL;
+    __pyx_t_6 = 0;
+    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
+      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
+      if (likely(__pyx_t_5)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+        __Pyx_INCREF(__pyx_t_5);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_4, function);
+        __pyx_t_6 = 1;
+      }
+    }
+    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_7);
+    if (__pyx_t_5) {
+      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
+    }
+    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_3);
+    __Pyx_GIVEREF(__pyx_t_3);
+    __Pyx_INCREF(__pyx_n_s_i4);
+    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_n_s_i4);
+    __Pyx_GIVEREF(__pyx_n_s_i4);
+    __pyx_t_3 = 0;
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-    __pyx_t_3 = __pyx_f_6g2clib__toarray(__pyx_v_bmap, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_4 = __pyx_f_6g2clib__toarray(__pyx_v_bmap, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_v_bitmap = __pyx_t_3;
-    __pyx_t_3 = 0;
+    __pyx_v_bitmap = __pyx_t_4;
+    __pyx_t_4 = 0;
     goto __pyx_L4;
   }
   /*else*/ {
 
-    /* "g2clib.pyx":373
+    /* "g2clib.pyx":379
  *         bitmap = _toarray(bmap, zeros(ngpts, 'i4'))
  *     else:
  *         bitmap = None             # <<<<<<<<<<<<<<
@@ -2772,7 +3022,7 @@ static PyObject *__pyx_pf_6g2clib_12unpack6(CYTHON_UNUSED PyObject *__pyx_self,
     __Pyx_INCREF(Py_None);
     __pyx_v_bitmap = Py_None;
 
-    /* "g2clib.pyx":374
+    /* "g2clib.pyx":380
  *     else:
  *         bitmap = None
  *         free(bmap)             # <<<<<<<<<<<<<<
@@ -2783,7 +3033,7 @@ static PyObject *__pyx_pf_6g2clib_12unpack6(CYTHON_UNUSED PyObject *__pyx_self,
   }
   __pyx_L4:;
 
-  /* "g2clib.pyx":375
+  /* "g2clib.pyx":381
  *         bitmap = None
  *         free(bmap)
  *     return bitmap,ibmap             # <<<<<<<<<<<<<<
@@ -2791,25 +3041,35 @@ static PyObject *__pyx_pf_6g2clib_12unpack6(CYTHON_UNUSED PyObject *__pyx_self,
  * def unpack7(gribmsg,gdtnum,object gdtmpl,drtnum,object drtmpl,ndpts,ipos,object zeros,printminmax=False,storageorder='C'):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_3 = __Pyx_PyInt_to_py_int32_t(__pyx_v_ibmap); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = __Pyx_PyInt_From_int32_t(__pyx_v_ibmap); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_INCREF(__pyx_v_bitmap);
   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_bitmap);
   __Pyx_GIVEREF(__pyx_v_bitmap);
-  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
-  __Pyx_GIVEREF(__pyx_t_3);
-  __pyx_t_3 = 0;
-  __pyx_r = ((PyObject *)__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
+  __Pyx_GIVEREF(__pyx_t_4);
+  __pyx_t_4 = 0;
+  __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "g2clib.pyx":337
+ *     return drtmpl,idrsnum,ndpts,iofst/8
+ * 
+ * def unpack6(gribmsg,ndpts,ipos,object zeros):             # <<<<<<<<<<<<<<
+ *     """
+ *  Unpacks Section 6 (Bit-Map Section) as defined in GRIB Edition 2.
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_7);
   __Pyx_AddTraceback("g2clib.unpack6", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_r = NULL;
   __pyx_L0:;
@@ -2820,10 +3080,18 @@ static PyObject *__pyx_pf_6g2clib_12unpack6(CYTHON_UNUSED PyObject *__pyx_self,
   return __pyx_r;
 }
 
+/* "g2clib.pyx":383
+ *     return bitmap,ibmap
+ * 
+ * def unpack7(gribmsg,gdtnum,object gdtmpl,drtnum,object drtmpl,ndpts,ipos,object zeros,printminmax=False,storageorder='C'):             # <<<<<<<<<<<<<<
+ *     """
+ *  Unpacks Section 7 (Data Section) as defined in GRIB Edition 2.
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_6g2clib_15unpack7(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static char __pyx_doc_6g2clib_14unpack7[] = "\n Unpacks Section 7 (Data Section) as defined in GRIB Edition 2.\n\n fld,fldmin,fldmax = unpack7(gribmsg,gdtnum,gdtmpl,drtnum,drtmpl,ndpts,ipos)\n INPUTS:\n   gribmsg  - String containing Section 7 of the GRIB2 message\n   gdtnum   - Grid Definition Template Number ( see Code Table 3.0)\n              ( Only used for DRS Template 5.51 )\n   gdtmpl   - numpy array containing the data values for\n              the specified Grid Definition\n    [...]
-static PyMethodDef __pyx_mdef_6g2clib_15unpack7 = {__Pyx_NAMESTR("unpack7"), (PyCFunction)__pyx_pw_6g2clib_15unpack7, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6g2clib_14unpack7)};
+static PyMethodDef __pyx_mdef_6g2clib_15unpack7 = {"unpack7", (PyCFunction)__pyx_pw_6g2clib_15unpack7, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6g2clib_14unpack7};
 static PyObject *__pyx_pw_6g2clib_15unpack7(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyObject *__pyx_v_gribmsg = 0;
   PyObject *__pyx_v_gdtnum = 0;
@@ -2835,14 +3103,17 @@ static PyObject *__pyx_pw_6g2clib_15unpack7(PyObject *__pyx_self, PyObject *__py
   PyObject *__pyx_v_zeros = 0;
   PyObject *__pyx_v_printminmax = 0;
   PyObject *__pyx_v_storageorder = 0;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("unpack7 (wrapper)", 0);
   {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__gribmsg,&__pyx_n_s__gdtnum,&__pyx_n_s__gdtmpl,&__pyx_n_s__drtnum,&__pyx_n_s__drtmpl,&__pyx_n_s__ndpts,&__pyx_n_s__ipos,&__pyx_n_s__zeros,&__pyx_n_s__printminmax,&__pyx_n_s__storageorder,0};
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gribmsg,&__pyx_n_s_gdtnum,&__pyx_n_s_gdtmpl,&__pyx_n_s_drtnum,&__pyx_n_s_drtmpl,&__pyx_n_s_ndpts,&__pyx_n_s_ipos,&__pyx_n_s_zeros,&__pyx_n_s_printminmax,&__pyx_n_s_storageorder,0};
     PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
-    values[8] = __pyx_k_14;
-    values[9] = ((PyObject *)__pyx_n_s__C);
+    values[8] = ((PyObject *)Py_False);
+    values[9] = ((PyObject *)__pyx_n_s_C);
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
@@ -2863,56 +3134,56 @@ static PyObject *__pyx_pw_6g2clib_15unpack7(PyObject *__pyx_self, PyObject *__py
       kw_args = PyDict_Size(__pyx_kwds);
       switch (pos_args) {
         case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__gribmsg)) != 0)) kw_args--;
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_gribmsg)) != 0)) kw_args--;
         else goto __pyx_L5_argtuple_error;
         case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__gdtnum)) != 0)) kw_args--;
+        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_gdtnum)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("unpack7", 0, 8, 10, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+          __Pyx_RaiseArgtupleInvalid("unpack7", 0, 8, 10, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
         case  2:
-        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__gdtmpl)) != 0)) kw_args--;
+        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_gdtmpl)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("unpack7", 0, 8, 10, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+          __Pyx_RaiseArgtupleInvalid("unpack7", 0, 8, 10, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
         case  3:
-        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__drtnum)) != 0)) kw_args--;
+        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_drtnum)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("unpack7", 0, 8, 10, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+          __Pyx_RaiseArgtupleInvalid("unpack7", 0, 8, 10, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
         case  4:
-        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__drtmpl)) != 0)) kw_args--;
+        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_drtmpl)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("unpack7", 0, 8, 10, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+          __Pyx_RaiseArgtupleInvalid("unpack7", 0, 8, 10, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
         case  5:
-        if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ndpts)) != 0)) kw_args--;
+        if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ndpts)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("unpack7", 0, 8, 10, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+          __Pyx_RaiseArgtupleInvalid("unpack7", 0, 8, 10, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
         case  6:
-        if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ipos)) != 0)) kw_args--;
+        if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ipos)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("unpack7", 0, 8, 10, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+          __Pyx_RaiseArgtupleInvalid("unpack7", 0, 8, 10, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
         case  7:
-        if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__zeros)) != 0)) kw_args--;
+        if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_zeros)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("unpack7", 0, 8, 10, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+          __Pyx_RaiseArgtupleInvalid("unpack7", 0, 8, 10, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
         case  8:
         if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__printminmax);
+          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_printminmax);
           if (value) { values[8] = value; kw_args--; }
         }
         case  9:
         if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__storageorder);
+          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_storageorder);
           if (value) { values[9] = value; kw_args--; }
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "unpack7") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "unpack7") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -2943,25 +3214,19 @@ static PyObject *__pyx_pw_6g2clib_15unpack7(PyObject *__pyx_self, PyObject *__py
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("unpack7", 0, 8, 10, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+  __Pyx_RaiseArgtupleInvalid("unpack7", 0, 8, 10, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
   __pyx_L3_error:;
   __Pyx_AddTraceback("g2clib.unpack7", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
   return NULL;
   __pyx_L4_argument_unpacking_done:;
   __pyx_r = __pyx_pf_6g2clib_14unpack7(__pyx_self, __pyx_v_gribmsg, __pyx_v_gdtnum, __pyx_v_gdtmpl, __pyx_v_drtnum, __pyx_v_drtmpl, __pyx_v_ndpts, __pyx_v_ipos, __pyx_v_zeros, __pyx_v_printminmax, __pyx_v_storageorder);
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "g2clib.pyx":377
- *     return bitmap,ibmap
- * 
- * def unpack7(gribmsg,gdtnum,object gdtmpl,drtnum,object drtmpl,ndpts,ipos,object zeros,printminmax=False,storageorder='C'):             # <<<<<<<<<<<<<<
- *     """
- *  Unpacks Section 7 (Data Section) as defined in GRIB Edition 2.
- */
-
 static PyObject *__pyx_pf_6g2clib_14unpack7(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_gribmsg, PyObject *__pyx_v_gdtnum, PyObject *__pyx_v_gdtmpl, PyObject *__pyx_v_drtnum, PyObject *__pyx_v_drtmpl, PyObject *__pyx_v_ndpts, PyObject *__pyx_v_ipos, PyObject *__pyx_v_zeros, PyObject *__pyx_v_printminmax, PyObject *__pyx_v_storageorder) {
   unsigned char *__pyx_v_cgrib;
   g2int __pyx_v_iofst;
@@ -2995,12 +3260,16 @@ static PyObject *__pyx_pf_6g2clib_14unpack7(CYTHON_UNUSED PyObject *__pyx_self,
   PyObject *__pyx_t_5 = NULL;
   PyObject *__pyx_t_6 = NULL;
   PyObject *__pyx_t_7 = NULL;
+  PyObject *__pyx_t_8 = NULL;
+  PyObject *__pyx_t_9 = NULL;
+  Py_ssize_t __pyx_t_10;
+  PyObject *__pyx_t_11 = NULL;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("unpack7", 0);
 
-  /* "g2clib.pyx":425
+  /* "g2clib.pyx":433
  *     cdef int n
  *     cdef Py_ssize_t buflen
  *     cgrib = <unsigned char *>PyBytes_AsString(gribmsg)             # <<<<<<<<<<<<<<
@@ -3009,19 +3278,19 @@ static PyObject *__pyx_pf_6g2clib_14unpack7(CYTHON_UNUSED PyObject *__pyx_self,
  */
   __pyx_v_cgrib = ((unsigned char *)PyBytes_AsString(__pyx_v_gribmsg));
 
-  /* "g2clib.pyx":426
+  /* "g2clib.pyx":434
  *     cdef Py_ssize_t buflen
  *     cgrib = <unsigned char *>PyBytes_AsString(gribmsg)
  *     iofst = <g2int>PyInt_AsLong(ipos*8)             # <<<<<<<<<<<<<<
  *     ngpts = <g2int>PyInt_AsLong(ndpts)
  *     idrsnum = <g2int>PyInt_AsLong(drtnum)
  */
-  __pyx_t_1 = PyNumber_Multiply(__pyx_v_ipos, __pyx_int_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyNumber_Multiply(__pyx_v_ipos, __pyx_int_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_v_iofst = ((g2int)PyInt_AsLong(__pyx_t_1));
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "g2clib.pyx":427
+  /* "g2clib.pyx":435
  *     cgrib = <unsigned char *>PyBytes_AsString(gribmsg)
  *     iofst = <g2int>PyInt_AsLong(ipos*8)
  *     ngpts = <g2int>PyInt_AsLong(ndpts)             # <<<<<<<<<<<<<<
@@ -3030,7 +3299,7 @@ static PyObject *__pyx_pf_6g2clib_14unpack7(CYTHON_UNUSED PyObject *__pyx_self,
  */
   __pyx_v_ngpts = ((g2int)PyInt_AsLong(__pyx_v_ndpts));
 
-  /* "g2clib.pyx":428
+  /* "g2clib.pyx":436
  *     iofst = <g2int>PyInt_AsLong(ipos*8)
  *     ngpts = <g2int>PyInt_AsLong(ndpts)
  *     idrsnum = <g2int>PyInt_AsLong(drtnum)             # <<<<<<<<<<<<<<
@@ -3039,7 +3308,7 @@ static PyObject *__pyx_pf_6g2clib_14unpack7(CYTHON_UNUSED PyObject *__pyx_self,
  */
   __pyx_v_idrsnum = ((g2int)PyInt_AsLong(__pyx_v_drtnum));
 
-  /* "g2clib.pyx":429
+  /* "g2clib.pyx":437
  *     ngpts = <g2int>PyInt_AsLong(ndpts)
  *     idrsnum = <g2int>PyInt_AsLong(drtnum)
  *     igdsnum = <g2int>PyInt_AsLong(gdtnum)             # <<<<<<<<<<<<<<
@@ -3048,7 +3317,7 @@ static PyObject *__pyx_pf_6g2clib_14unpack7(CYTHON_UNUSED PyObject *__pyx_self,
  */
   __pyx_v_igdsnum = ((g2int)PyInt_AsLong(__pyx_v_gdtnum));
 
-  /* "g2clib.pyx":430
+  /* "g2clib.pyx":438
  *     idrsnum = <g2int>PyInt_AsLong(drtnum)
  *     igdsnum = <g2int>PyInt_AsLong(gdtnum)
  *     PyObject_AsReadBuffer(drtmpl, &drtmpldat, &buflen)             # <<<<<<<<<<<<<<
@@ -3057,7 +3326,7 @@ static PyObject *__pyx_pf_6g2clib_14unpack7(CYTHON_UNUSED PyObject *__pyx_self,
  */
   PyObject_AsReadBuffer(__pyx_v_drtmpl, (&__pyx_v_drtmpldat), (&__pyx_v_buflen));
 
-  /* "g2clib.pyx":431
+  /* "g2clib.pyx":439
  *     igdsnum = <g2int>PyInt_AsLong(gdtnum)
  *     PyObject_AsReadBuffer(drtmpl, &drtmpldat, &buflen)
  *     PyObject_AsReadBuffer(gdtmpl, &gdtmpldat, &buflen)             # <<<<<<<<<<<<<<
@@ -3066,7 +3335,7 @@ static PyObject *__pyx_pf_6g2clib_14unpack7(CYTHON_UNUSED PyObject *__pyx_self,
  */
   PyObject_AsReadBuffer(__pyx_v_gdtmpl, (&__pyx_v_gdtmpldat), (&__pyx_v_buflen));
 
-  /* "g2clib.pyx":432
+  /* "g2clib.pyx":440
  *     PyObject_AsReadBuffer(drtmpl, &drtmpldat, &buflen)
  *     PyObject_AsReadBuffer(gdtmpl, &gdtmpldat, &buflen)
  *     idrstmpl = <g2int *>drtmpldat             # <<<<<<<<<<<<<<
@@ -3075,7 +3344,7 @@ static PyObject *__pyx_pf_6g2clib_14unpack7(CYTHON_UNUSED PyObject *__pyx_self,
  */
   __pyx_v_idrstmpl = ((g2int *)__pyx_v_drtmpldat);
 
-  /* "g2clib.pyx":433
+  /* "g2clib.pyx":441
  *     PyObject_AsReadBuffer(gdtmpl, &gdtmpldat, &buflen)
  *     idrstmpl = <g2int *>drtmpldat
  *     igdstmpl = <g2int *>gdtmpldat             # <<<<<<<<<<<<<<
@@ -3084,7 +3353,7 @@ static PyObject *__pyx_pf_6g2clib_14unpack7(CYTHON_UNUSED PyObject *__pyx_self,
  */
   __pyx_v_igdstmpl = ((g2int *)__pyx_v_gdtmpldat);
 
-  /* "g2clib.pyx":434
+  /* "g2clib.pyx":442
  *     idrstmpl = <g2int *>drtmpldat
  *     igdstmpl = <g2int *>gdtmpldat
  *     ierr=g2_unpack7(cgrib,&iofst,igdsnum,igdstmpl,idrsnum,idrstmpl,ngpts,&fld)             # <<<<<<<<<<<<<<
@@ -3093,64 +3362,62 @@ static PyObject *__pyx_pf_6g2clib_14unpack7(CYTHON_UNUSED PyObject *__pyx_self,
  */
   __pyx_v_ierr = g2_unpack7(__pyx_v_cgrib, (&__pyx_v_iofst), __pyx_v_igdsnum, __pyx_v_igdstmpl, __pyx_v_idrsnum, __pyx_v_idrstmpl, __pyx_v_ngpts, (&__pyx_v_fld));
 
-  /* "g2clib.pyx":435
+  /* "g2clib.pyx":443
  *     igdstmpl = <g2int *>gdtmpldat
  *     ierr=g2_unpack7(cgrib,&iofst,igdsnum,igdstmpl,idrsnum,idrstmpl,ngpts,&fld)
  *     if ierr != 0:             # <<<<<<<<<<<<<<
  *        msg = "Error unpacking section 7 - error code = %i" % ierr
  *        raise RuntimeError(msg)
  */
-  __pyx_t_2 = (__pyx_v_ierr != 0);
+  __pyx_t_2 = ((__pyx_v_ierr != 0) != 0);
   if (__pyx_t_2) {
 
-    /* "g2clib.pyx":436
+    /* "g2clib.pyx":444
  *     ierr=g2_unpack7(cgrib,&iofst,igdsnum,igdstmpl,idrsnum,idrstmpl,ngpts,&fld)
  *     if ierr != 0:
  *        msg = "Error unpacking section 7 - error code = %i" % ierr             # <<<<<<<<<<<<<<
  *        raise RuntimeError(msg)
  * 
  */
-    __pyx_t_1 = __Pyx_PyInt_to_py_int32_t(__pyx_v_ierr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = __Pyx_PyInt_From_int32_t(__pyx_v_ierr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_15), __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
+    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Error_unpacking_section_7_error, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_v_msg = ((PyObject *)__pyx_t_3);
+    __pyx_v_msg = __pyx_t_3;
     __pyx_t_3 = 0;
 
-    /* "g2clib.pyx":437
+    /* "g2clib.pyx":445
  *     if ierr != 0:
  *        msg = "Error unpacking section 7 - error code = %i" % ierr
  *        raise RuntimeError(msg)             # <<<<<<<<<<<<<<
  * 
  * 
  */
-    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_INCREF(__pyx_v_msg);
     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_msg);
     __Pyx_GIVEREF(__pyx_v_msg);
-    __pyx_t_1 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_Raise(__pyx_t_1, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L3;
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
-  __pyx_L3:;
 
-  /* "g2clib.pyx":440
+  /* "g2clib.pyx":448
  * 
  * 
  *     if printminmax:             # <<<<<<<<<<<<<<
  *         rmax=-<float>9.9e31
  *         rmin=<float>9.9e31
  */
-  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_printminmax); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_printminmax); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   if (__pyx_t_2) {
 
-    /* "g2clib.pyx":441
+    /* "g2clib.pyx":449
  * 
  *     if printminmax:
  *         rmax=-<float>9.9e31             # <<<<<<<<<<<<<<
@@ -3159,7 +3426,7 @@ static PyObject *__pyx_pf_6g2clib_14unpack7(CYTHON_UNUSED PyObject *__pyx_self,
  */
     __pyx_v_rmax = (-((float)9.9e31));
 
-    /* "g2clib.pyx":442
+    /* "g2clib.pyx":450
  *     if printminmax:
  *         rmax=-<float>9.9e31
  *         rmin=<float>9.9e31             # <<<<<<<<<<<<<<
@@ -3168,38 +3435,38 @@ static PyObject *__pyx_pf_6g2clib_14unpack7(CYTHON_UNUSED PyObject *__pyx_self,
  */
     __pyx_v_rmin = ((float)9.9e31);
 
-    /* "g2clib.pyx":443
+    /* "g2clib.pyx":451
  *         rmax=-<float>9.9e31
  *         rmin=<float>9.9e31
  *         for n from 0 <= n < ndpts:             # <<<<<<<<<<<<<<
  *             if fld[n] > rmax: rmax=fld[n]
  *             if fld[n] < rmin: rmin=fld[n]
  */
-    __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_v_ndpts); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_ndpts); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     for (__pyx_v_n = 0; __pyx_v_n < __pyx_t_4; __pyx_v_n++) {
 
-      /* "g2clib.pyx":444
+      /* "g2clib.pyx":452
  *         rmin=<float>9.9e31
  *         for n from 0 <= n < ndpts:
  *             if fld[n] > rmax: rmax=fld[n]             # <<<<<<<<<<<<<<
  *             if fld[n] < rmin: rmin=fld[n]
  *         fldmax = PyFloat_FromDouble(rmax)
  */
-      __pyx_t_2 = ((__pyx_v_fld[__pyx_v_n]) > __pyx_v_rmax);
+      __pyx_t_2 = (((__pyx_v_fld[__pyx_v_n]) > __pyx_v_rmax) != 0);
       if (__pyx_t_2) {
         __pyx_v_rmax = (__pyx_v_fld[__pyx_v_n]);
         goto __pyx_L7;
       }
       __pyx_L7:;
 
-      /* "g2clib.pyx":445
+      /* "g2clib.pyx":453
  *         for n from 0 <= n < ndpts:
  *             if fld[n] > rmax: rmax=fld[n]
  *             if fld[n] < rmin: rmin=fld[n]             # <<<<<<<<<<<<<<
  *         fldmax = PyFloat_FromDouble(rmax)
  *         fldmin = PyFloat_FromDouble(rmin)
  */
-      __pyx_t_2 = ((__pyx_v_fld[__pyx_v_n]) < __pyx_v_rmin);
+      __pyx_t_2 = (((__pyx_v_fld[__pyx_v_n]) < __pyx_v_rmin) != 0);
       if (__pyx_t_2) {
         __pyx_v_rmin = (__pyx_v_fld[__pyx_v_n]);
         goto __pyx_L8;
@@ -3207,152 +3474,196 @@ static PyObject *__pyx_pf_6g2clib_14unpack7(CYTHON_UNUSED PyObject *__pyx_self,
       __pyx_L8:;
     }
 
-    /* "g2clib.pyx":446
+    /* "g2clib.pyx":454
  *             if fld[n] > rmax: rmax=fld[n]
  *             if fld[n] < rmin: rmin=fld[n]
  *         fldmax = PyFloat_FromDouble(rmax)             # <<<<<<<<<<<<<<
  *         fldmin = PyFloat_FromDouble(rmin)
  *         bitsofprecision = drtmpl[3]
  */
-    __pyx_t_1 = PyFloat_FromDouble(__pyx_v_rmax); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = PyFloat_FromDouble(__pyx_v_rmax); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_1);
     __pyx_v_fldmax = __pyx_t_1;
     __pyx_t_1 = 0;
 
-    /* "g2clib.pyx":447
+    /* "g2clib.pyx":455
  *             if fld[n] < rmin: rmin=fld[n]
  *         fldmax = PyFloat_FromDouble(rmax)
  *         fldmin = PyFloat_FromDouble(rmin)             # <<<<<<<<<<<<<<
  *         bitsofprecision = drtmpl[3]
  *         digitsofprecision = int(math.ceil(math.log10(math.pow(2,bitsofprecision))))
  */
-    __pyx_t_1 = PyFloat_FromDouble(__pyx_v_rmin); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = PyFloat_FromDouble(__pyx_v_rmin); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_1);
     __pyx_v_fldmin = __pyx_t_1;
     __pyx_t_1 = 0;
 
-    /* "g2clib.pyx":448
+    /* "g2clib.pyx":456
  *         fldmax = PyFloat_FromDouble(rmax)
  *         fldmin = PyFloat_FromDouble(rmin)
  *         bitsofprecision = drtmpl[3]             # <<<<<<<<<<<<<<
  *         digitsofprecision = int(math.ceil(math.log10(math.pow(2,bitsofprecision))))
  *         format = "%."+repr(digitsofprecision+1)+"g"
  */
-    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_drtmpl, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_drtmpl, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
     __Pyx_GOTREF(__pyx_t_1);
     __pyx_v_bitsofprecision = __pyx_t_1;
     __pyx_t_1 = 0;
 
-    /* "g2clib.pyx":449
+    /* "g2clib.pyx":457
  *         fldmin = PyFloat_FromDouble(rmin)
  *         bitsofprecision = drtmpl[3]
  *         digitsofprecision = int(math.ceil(math.log10(math.pow(2,bitsofprecision))))             # <<<<<<<<<<<<<<
  *         format = "%."+repr(digitsofprecision+1)+"g"
  *         minmaxstring = 'min/max='+format+'/'+format
  */
-    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__math); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__ceil); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_math); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__math); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_5 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__log10); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ceil); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__math); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_6 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__pow); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_math); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_6);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_log10); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_7);
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_math); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_8);
+    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_pow); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_9);
+    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+    __pyx_t_8 = NULL;
+    __pyx_t_10 = 0;
+    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) {
+      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_9);
+      if (likely(__pyx_t_8)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
+        __Pyx_INCREF(__pyx_t_8);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_9, function);
+        __pyx_t_10 = 1;
+      }
+    }
+    __pyx_t_11 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_11);
+    if (__pyx_t_8) {
+      PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_8 = NULL;
+    }
     __Pyx_INCREF(__pyx_int_2);
-    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_int_2);
+    PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_10, __pyx_int_2);
     __Pyx_GIVEREF(__pyx_int_2);
     __Pyx_INCREF(__pyx_v_bitsofprecision);
-    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_bitsofprecision);
+    PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, __pyx_v_bitsofprecision);
     __Pyx_GIVEREF(__pyx_v_bitsofprecision);
-    __pyx_t_7 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
-    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_7);
-    __Pyx_GIVEREF(__pyx_t_7);
-    __pyx_t_7 = 0;
-    __pyx_t_7 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
+    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_6);
+    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+    __pyx_t_9 = NULL;
+    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
+      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_7);
+      if (likely(__pyx_t_9)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
+        __Pyx_INCREF(__pyx_t_9);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_7, function);
+      }
+    }
+    if (!__pyx_t_9) {
+      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __Pyx_GOTREF(__pyx_t_3);
+    } else {
+      __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_11);
+      PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); __pyx_t_9 = NULL;
+      PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_6);
+      __Pyx_GIVEREF(__pyx_t_6);
+      __pyx_t_6 = 0;
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_11, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+    }
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __pyx_t_7 = NULL;
+    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
+      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
+      if (likely(__pyx_t_7)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+        __Pyx_INCREF(__pyx_t_7);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_5, function);
+      }
+    }
+    if (!__pyx_t_7) {
+      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_GOTREF(__pyx_t_1);
+    } else {
+      __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_11);
+      PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = NULL;
+      PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_3);
+      __Pyx_GIVEREF(__pyx_t_3);
+      __pyx_t_3 = 0;
+      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+    }
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
-    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_7);
-    __Pyx_GIVEREF(__pyx_t_7);
-    __pyx_t_7 = 0;
-    __pyx_t_7 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
-    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_7);
-    __Pyx_GIVEREF(__pyx_t_7);
-    __pyx_t_7 = 0;
-    __pyx_t_7 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
-    __pyx_v_digitsofprecision = __pyx_t_7;
-    __pyx_t_7 = 0;
+    __pyx_t_5 = PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_v_digitsofprecision = __pyx_t_5;
+    __pyx_t_5 = 0;
 
-    /* "g2clib.pyx":450
+    /* "g2clib.pyx":458
  *         bitsofprecision = drtmpl[3]
  *         digitsofprecision = int(math.ceil(math.log10(math.pow(2,bitsofprecision))))
  *         format = "%."+repr(digitsofprecision+1)+"g"             # <<<<<<<<<<<<<<
  *         minmaxstring = 'min/max='+format+'/'+format
  *         minmaxstring = minmaxstring % (fldmin,fldmax)
  */
-    __pyx_t_7 = PyNumber_Add(__pyx_v_digitsofprecision, __pyx_int_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __pyx_t_1 = PyObject_Repr(__pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_5 = PyNumber_Add(__pyx_v_digitsofprecision, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_1 = PyObject_Repr(__pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __pyx_t_7 = PyNumber_Add(((PyObject *)__pyx_kp_s_16), __pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __pyx_t_5 = PyNumber_Add(__pyx_kp_s__2, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_1 = PyNumber_Add(__pyx_t_7, ((PyObject *)__pyx_n_s__g)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_n_s_g); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     __pyx_v_format = __pyx_t_1;
     __pyx_t_1 = 0;
 
-    /* "g2clib.pyx":451
+    /* "g2clib.pyx":459
  *         digitsofprecision = int(math.ceil(math.log10(math.pow(2,bitsofprecision))))
  *         format = "%."+repr(digitsofprecision+1)+"g"
  *         minmaxstring = 'min/max='+format+'/'+format             # <<<<<<<<<<<<<<
  *         minmaxstring = minmaxstring % (fldmin,fldmax)
  *         print minmaxstring
  */
-    __pyx_t_1 = PyNumber_Add(((PyObject *)__pyx_kp_s_17), __pyx_v_format); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = PyNumber_Add(__pyx_kp_s_min_max, __pyx_v_format); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_7 = PyNumber_Add(__pyx_t_1, ((PyObject *)__pyx_kp_s_18)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
+    __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_kp_s__3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_1 = PyNumber_Add(__pyx_t_7, __pyx_v_format); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_v_format); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     __pyx_v_minmaxstring = __pyx_t_1;
     __pyx_t_1 = 0;
 
-    /* "g2clib.pyx":452
+    /* "g2clib.pyx":460
  *         format = "%."+repr(digitsofprecision+1)+"g"
  *         minmaxstring = 'min/max='+format+'/'+format
  *         minmaxstring = minmaxstring % (fldmin,fldmax)             # <<<<<<<<<<<<<<
  *         print minmaxstring
  * 
  */
-    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_INCREF(__pyx_v_fldmin);
     PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_fldmin);
@@ -3360,56 +3671,55 @@ static PyObject *__pyx_pf_6g2clib_14unpack7(CYTHON_UNUSED PyObject *__pyx_self,
     __Pyx_INCREF(__pyx_v_fldmax);
     PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_fldmax);
     __Pyx_GIVEREF(__pyx_v_fldmax);
-    __pyx_t_7 = PyNumber_Remainder(__pyx_v_minmaxstring, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
-    __Pyx_DECREF(__pyx_v_minmaxstring);
-    __pyx_v_minmaxstring = __pyx_t_7;
-    __pyx_t_7 = 0;
+    __pyx_t_5 = PyNumber_Remainder(__pyx_v_minmaxstring, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_DECREF_SET(__pyx_v_minmaxstring, __pyx_t_5);
+    __pyx_t_5 = 0;
 
-    /* "g2clib.pyx":453
+    /* "g2clib.pyx":461
  *         minmaxstring = 'min/max='+format+'/'+format
  *         minmaxstring = minmaxstring % (fldmin,fldmax)
  *         print minmaxstring             # <<<<<<<<<<<<<<
  * 
  *     data = _toarray(fld, zeros(ngpts, 'f4', order=storageorder))
  */
-    if (__Pyx_PrintOne(0, __pyx_v_minmaxstring) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (__Pyx_PrintOne(0, __pyx_v_minmaxstring) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     goto __pyx_L4;
   }
   __pyx_L4:;
 
-  /* "g2clib.pyx":455
+  /* "g2clib.pyx":463
  *         print minmaxstring
  * 
  *     data = _toarray(fld, zeros(ngpts, 'f4', order=storageorder))             # <<<<<<<<<<<<<<
  *     return data
  * 
  */
-  __pyx_t_7 = __Pyx_PyInt_to_py_int32_t(__pyx_v_ngpts); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_PyInt_From_int32_t(__pyx_v_ngpts); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_7);
-  __Pyx_GIVEREF(__pyx_t_7);
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__f4));
-  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_n_s__f4));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__f4));
-  __pyx_t_7 = 0;
-  __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_7));
-  if (PyDict_SetItem(__pyx_t_7, ((PyObject *)__pyx_n_s__order), __pyx_v_storageorder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_3 = PyObject_Call(__pyx_v_zeros, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_7)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
-  __pyx_t_7 = __pyx_f_6g2clib__toarray(__pyx_v_fld, __pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_v_data = __pyx_t_7;
-  __pyx_t_7 = 0;
+  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5);
+  __Pyx_GIVEREF(__pyx_t_5);
+  __Pyx_INCREF(__pyx_n_s_f4);
+  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_f4);
+  __Pyx_GIVEREF(__pyx_n_s_f4);
+  __pyx_t_5 = 0;
+  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_order, __pyx_v_storageorder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_11 = __Pyx_PyObject_Call(__pyx_v_zeros, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_11);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __pyx_t_5 = __pyx_f_6g2clib__toarray(__pyx_v_fld, __pyx_t_11); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+  __pyx_v_data = __pyx_t_5;
+  __pyx_t_5 = 0;
 
-  /* "g2clib.pyx":456
+  /* "g2clib.pyx":464
  * 
  *     data = _toarray(fld, zeros(ngpts, 'f4', order=storageorder))
  *     return data             # <<<<<<<<<<<<<<
@@ -3421,14 +3731,24 @@ static PyObject *__pyx_pf_6g2clib_14unpack7(CYTHON_UNUSED PyObject *__pyx_self,
   __pyx_r = __pyx_v_data;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "g2clib.pyx":383
+ *     return bitmap,ibmap
+ * 
+ * def unpack7(gribmsg,gdtnum,object gdtmpl,drtnum,object drtmpl,ndpts,ipos,object zeros,printminmax=False,storageorder='C'):             # <<<<<<<<<<<<<<
+ *     """
+ *  Unpacks Section 7 (Data Section) as defined in GRIB Edition 2.
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_XDECREF(__pyx_t_3);
   __Pyx_XDECREF(__pyx_t_5);
   __Pyx_XDECREF(__pyx_t_6);
   __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_XDECREF(__pyx_t_8);
+  __Pyx_XDECREF(__pyx_t_9);
+  __Pyx_XDECREF(__pyx_t_11);
   __Pyx_AddTraceback("g2clib.unpack7", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_r = NULL;
   __pyx_L0:;
@@ -3445,18 +3765,29 @@ static PyObject *__pyx_pf_6g2clib_14unpack7(CYTHON_UNUSED PyObject *__pyx_self,
   return __pyx_r;
 }
 
-/* Python wrapper */
-static PyObject *__pyx_pw_6g2clib_17grib2_create(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_6g2clib_16grib2_create[] = "\n Initializes a new GRIB2 message and packs\n GRIB2 sections 0 (Indicator Section) and 1 (Identification Section).\n This routine is used with routines \"g2_addgrid\", \n \"grib2_addfield\", and \"grib2_gribend\" to create a complete GRIB2 message.  \n grib2_create must be called first to initialize a new GRIB2 message.\n Also, a call to grib2_gribend is required to complete GRIB2 message\n after all fields have been added.\n\n gribmsg,  [...]
-static PyMethodDef __pyx_mdef_6g2clib_17grib2_create = {__Pyx_NAMESTR("grib2_create"), (PyCFunction)__pyx_pw_6g2clib_17grib2_create, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6g2clib_16grib2_create)};
+/* "g2clib.pyx":468
+ * # routines for writing grib2 files.
+ * 
+ * def grib2_create(object listsec0, object listsec1):             # <<<<<<<<<<<<<<
+ *     """
+ *  Initializes a new GRIB2 message and packs
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6g2clib_17grib2_create(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6g2clib_16grib2_create[] = "\n Initializes a new GRIB2 message and packs\n GRIB2 sections 0 (Indicator Section) and 1 (Identification Section).\n This routine is used with routines \"g2_addgrid\", \n \"grib2_addfield\", and \"grib2_gribend\" to create a complete GRIB2 message.  \n grib2_create must be called first to initialize a new GRIB2 message.\n Also, a call to grib2_gribend is required to complete GRIB2 message\n after all fields have been added.\n\n gribmsg,  [...]
+static PyMethodDef __pyx_mdef_6g2clib_17grib2_create = {"grib2_create", (PyCFunction)__pyx_pw_6g2clib_17grib2_create, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6g2clib_16grib2_create};
 static PyObject *__pyx_pw_6g2clib_17grib2_create(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyObject *__pyx_v_listsec0 = 0;
   PyObject *__pyx_v_listsec1 = 0;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("grib2_create (wrapper)", 0);
   {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__listsec0,&__pyx_n_s__listsec1,0};
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_listsec0,&__pyx_n_s_listsec1,0};
     PyObject* values[2] = {0,0};
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
@@ -3470,16 +3801,16 @@ static PyObject *__pyx_pw_6g2clib_17grib2_create(PyObject *__pyx_self, PyObject
       kw_args = PyDict_Size(__pyx_kwds);
       switch (pos_args) {
         case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__listsec0)) != 0)) kw_args--;
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_listsec0)) != 0)) kw_args--;
         else goto __pyx_L5_argtuple_error;
         case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__listsec1)) != 0)) kw_args--;
+        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_listsec1)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("grib2_create", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+          __Pyx_RaiseArgtupleInvalid("grib2_create", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "grib2_create") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "grib2_create") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
       goto __pyx_L5_argtuple_error;
@@ -3492,25 +3823,19 @@ static PyObject *__pyx_pw_6g2clib_17grib2_create(PyObject *__pyx_self, PyObject
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("grib2_create", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+  __Pyx_RaiseArgtupleInvalid("grib2_create", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
   __pyx_L3_error:;
   __Pyx_AddTraceback("g2clib.grib2_create", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
   return NULL;
   __pyx_L4_argument_unpacking_done:;
   __pyx_r = __pyx_pf_6g2clib_16grib2_create(__pyx_self, __pyx_v_listsec0, __pyx_v_listsec1);
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "g2clib.pyx":460
- * # routines for writing grib2 files.
- * 
- * def grib2_create(object listsec0, object listsec1):             # <<<<<<<<<<<<<<
- *     """
- *  Initializes a new GRIB2 message and packs
- */
-
 static PyObject *__pyx_pf_6g2clib_16grib2_create(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_listsec0, PyObject *__pyx_v_listsec1) {
   g2int *__pyx_v_isec0;
   g2int *__pyx_v_isec1;
@@ -3534,33 +3859,33 @@ static PyObject *__pyx_pf_6g2clib_16grib2_create(CYTHON_UNUSED PyObject *__pyx_s
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("grib2_create", 0);
 
-  /* "g2clib.pyx":506
+  /* "g2clib.pyx":517
  *     cdef unsigned char *cgrib
  *     # cgrib needs to be big enough to hold sec0 and sec1.
  *     lgrib = 4*(len(listsec0)+len(listsec1))             # <<<<<<<<<<<<<<
  *     gribmsg = lgrib*b" "
  *     cgrib = <unsigned char *>PyBytes_AsString(gribmsg)
  */
-  __pyx_t_1 = PyObject_Length(__pyx_v_listsec0); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_2 = PyObject_Length(__pyx_v_listsec1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_3 = PyInt_FromSsize_t((4 * (__pyx_t_1 + __pyx_t_2))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyObject_Length(__pyx_v_listsec0); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyObject_Length(__pyx_v_listsec1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = PyInt_FromSsize_t((4 * (__pyx_t_1 + __pyx_t_2))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
   __pyx_v_lgrib = __pyx_t_3;
   __pyx_t_3 = 0;
 
-  /* "g2clib.pyx":507
+  /* "g2clib.pyx":518
  *     # cgrib needs to be big enough to hold sec0 and sec1.
  *     lgrib = 4*(len(listsec0)+len(listsec1))
  *     gribmsg = lgrib*b" "             # <<<<<<<<<<<<<<
  *     cgrib = <unsigned char *>PyBytes_AsString(gribmsg)
  *     PyObject_AsReadBuffer(listsec0, &listsec0dat, &buflen)
  */
-  __pyx_t_3 = PyNumber_Multiply(__pyx_v_lgrib, ((PyObject *)__pyx_kp_b_19)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = PyNumber_Multiply(__pyx_v_lgrib, __pyx_kp_b__4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
   __pyx_v_gribmsg = __pyx_t_3;
   __pyx_t_3 = 0;
 
-  /* "g2clib.pyx":508
+  /* "g2clib.pyx":519
  *     lgrib = 4*(len(listsec0)+len(listsec1))
  *     gribmsg = lgrib*b" "
  *     cgrib = <unsigned char *>PyBytes_AsString(gribmsg)             # <<<<<<<<<<<<<<
@@ -3569,7 +3894,7 @@ static PyObject *__pyx_pf_6g2clib_16grib2_create(CYTHON_UNUSED PyObject *__pyx_s
  */
   __pyx_v_cgrib = ((unsigned char *)PyBytes_AsString(__pyx_v_gribmsg));
 
-  /* "g2clib.pyx":509
+  /* "g2clib.pyx":520
  *     gribmsg = lgrib*b" "
  *     cgrib = <unsigned char *>PyBytes_AsString(gribmsg)
  *     PyObject_AsReadBuffer(listsec0, &listsec0dat, &buflen)             # <<<<<<<<<<<<<<
@@ -3578,7 +3903,7 @@ static PyObject *__pyx_pf_6g2clib_16grib2_create(CYTHON_UNUSED PyObject *__pyx_s
  */
   PyObject_AsReadBuffer(__pyx_v_listsec0, (&__pyx_v_listsec0dat), (&__pyx_v_buflen));
 
-  /* "g2clib.pyx":510
+  /* "g2clib.pyx":521
  *     cgrib = <unsigned char *>PyBytes_AsString(gribmsg)
  *     PyObject_AsReadBuffer(listsec0, &listsec0dat, &buflen)
  *     PyObject_AsReadBuffer(listsec1, &listsec1dat, &buflen)             # <<<<<<<<<<<<<<
@@ -3587,7 +3912,7 @@ static PyObject *__pyx_pf_6g2clib_16grib2_create(CYTHON_UNUSED PyObject *__pyx_s
  */
   PyObject_AsReadBuffer(__pyx_v_listsec1, (&__pyx_v_listsec1dat), (&__pyx_v_buflen));
 
-  /* "g2clib.pyx":511
+  /* "g2clib.pyx":522
  *     PyObject_AsReadBuffer(listsec0, &listsec0dat, &buflen)
  *     PyObject_AsReadBuffer(listsec1, &listsec1dat, &buflen)
  *     isec0 = <g2int *>listsec0dat             # <<<<<<<<<<<<<<
@@ -3596,7 +3921,7 @@ static PyObject *__pyx_pf_6g2clib_16grib2_create(CYTHON_UNUSED PyObject *__pyx_s
  */
   __pyx_v_isec0 = ((g2int *)__pyx_v_listsec0dat);
 
-  /* "g2clib.pyx":512
+  /* "g2clib.pyx":523
  *     PyObject_AsReadBuffer(listsec1, &listsec1dat, &buflen)
  *     isec0 = <g2int *>listsec0dat
  *     isec1 = <g2int *>listsec1dat             # <<<<<<<<<<<<<<
@@ -3605,7 +3930,7 @@ static PyObject *__pyx_pf_6g2clib_16grib2_create(CYTHON_UNUSED PyObject *__pyx_s
  */
   __pyx_v_isec1 = ((g2int *)__pyx_v_listsec1dat);
 
-  /* "g2clib.pyx":513
+  /* "g2clib.pyx":524
  *     isec0 = <g2int *>listsec0dat
  *     isec1 = <g2int *>listsec1dat
  *     ierr = g2_create(cgrib,isec0,isec1)             # <<<<<<<<<<<<<<
@@ -3614,67 +3939,64 @@ static PyObject *__pyx_pf_6g2clib_16grib2_create(CYTHON_UNUSED PyObject *__pyx_s
  */
   __pyx_v_ierr = g2_create(__pyx_v_cgrib, __pyx_v_isec0, __pyx_v_isec1);
 
-  /* "g2clib.pyx":514
+  /* "g2clib.pyx":525
  *     isec1 = <g2int *>listsec1dat
  *     ierr = g2_create(cgrib,isec0,isec1)
  *     if ierr < 0:             # <<<<<<<<<<<<<<
  *        msg = "Error in grib2_create, error code = %i" % ierr
  *        raise RuntimeError(msg)
  */
-  __pyx_t_4 = (__pyx_v_ierr < 0);
+  __pyx_t_4 = ((__pyx_v_ierr < 0) != 0);
   if (__pyx_t_4) {
 
-    /* "g2clib.pyx":515
+    /* "g2clib.pyx":526
  *     ierr = g2_create(cgrib,isec0,isec1)
  *     if ierr < 0:
  *        msg = "Error in grib2_create, error code = %i" % ierr             # <<<<<<<<<<<<<<
  *        raise RuntimeError(msg)
  *     gribmsg = PyBytes_FromStringAndSize(<char *>cgrib, ierr)
  */
-    __pyx_t_3 = __Pyx_PyInt_to_py_int32_t(__pyx_v_ierr); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = __Pyx_PyInt_From_int32_t(__pyx_v_ierr); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_20), __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
+    __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Error_in_grib2_create_error_code, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_v_msg = ((PyObject *)__pyx_t_5);
+    __pyx_v_msg = __pyx_t_5;
     __pyx_t_5 = 0;
 
-    /* "g2clib.pyx":516
+    /* "g2clib.pyx":527
  *     if ierr < 0:
  *        msg = "Error in grib2_create, error code = %i" % ierr
  *        raise RuntimeError(msg)             # <<<<<<<<<<<<<<
  *     gribmsg = PyBytes_FromStringAndSize(<char *>cgrib, ierr)
  *     return gribmsg, ierr
  */
-    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_INCREF(__pyx_v_msg);
     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_msg);
     __Pyx_GIVEREF(__pyx_v_msg);
-    __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L3;
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
-  __pyx_L3:;
 
-  /* "g2clib.pyx":517
+  /* "g2clib.pyx":528
  *        msg = "Error in grib2_create, error code = %i" % ierr
  *        raise RuntimeError(msg)
  *     gribmsg = PyBytes_FromStringAndSize(<char *>cgrib, ierr)             # <<<<<<<<<<<<<<
  *     return gribmsg, ierr
  * 
  */
-  __pyx_t_3 = PyBytes_FromStringAndSize(((char *)__pyx_v_cgrib), __pyx_v_ierr); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = PyBytes_FromStringAndSize(((char *)__pyx_v_cgrib), __pyx_v_ierr); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_v_gribmsg);
-  __pyx_v_gribmsg = __pyx_t_3;
+  __Pyx_DECREF_SET(__pyx_v_gribmsg, __pyx_t_3);
   __pyx_t_3 = 0;
 
-  /* "g2clib.pyx":518
+  /* "g2clib.pyx":529
  *        raise RuntimeError(msg)
  *     gribmsg = PyBytes_FromStringAndSize(<char *>cgrib, ierr)
  *     return gribmsg, ierr             # <<<<<<<<<<<<<<
@@ -3682,9 +4004,9 @@ static PyObject *__pyx_pf_6g2clib_16grib2_create(CYTHON_UNUSED PyObject *__pyx_s
  * def grib2_end(gribmsg):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_3 = __Pyx_PyInt_to_py_int32_t(__pyx_v_ierr); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_PyInt_From_int32_t(__pyx_v_ierr); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_INCREF(__pyx_v_gribmsg);
   PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_gribmsg);
@@ -3692,12 +4014,19 @@ static PyObject *__pyx_pf_6g2clib_16grib2_create(CYTHON_UNUSED PyObject *__pyx_s
   PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
   __Pyx_GIVEREF(__pyx_t_3);
   __pyx_t_3 = 0;
-  __pyx_r = ((PyObject *)__pyx_t_5);
+  __pyx_r = __pyx_t_5;
   __pyx_t_5 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "g2clib.pyx":468
+ * # routines for writing grib2 files.
+ * 
+ * def grib2_create(object listsec0, object listsec1):             # <<<<<<<<<<<<<<
+ *     """
+ *  Initializes a new GRIB2 message and packs
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_3);
   __Pyx_XDECREF(__pyx_t_5);
@@ -3712,27 +4041,29 @@ static PyObject *__pyx_pf_6g2clib_16grib2_create(CYTHON_UNUSED PyObject *__pyx_s
   return __pyx_r;
 }
 
+/* "g2clib.pyx":531
+ *     return gribmsg, ierr
+ * 
+ * def grib2_end(gribmsg):             # <<<<<<<<<<<<<<
+ *     """
+ * 
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_6g2clib_19grib2_end(PyObject *__pyx_self, PyObject *__pyx_v_gribmsg); /*proto*/
 static char __pyx_doc_6g2clib_18grib2_end[] = "\n\n    Finalizes a GRIB2 message after all grids\n    and fields have been added.  It adds the End Section ( \"7777\" )\n    to the end of the GRIB message and calculates the length and stores\n    it in the appropriate place in Section 0.\n    This routine is used with routines \"g2_create\",  \n    \"g2_addgrid\", and \"g2_addfield\" to create a complete GRIB2 message.\n    g2_create must be called first to initialize a new GRIB2 message. [...]
-static PyMethodDef __pyx_mdef_6g2clib_19grib2_end = {__Pyx_NAMESTR("grib2_end"), (PyCFunction)__pyx_pw_6g2clib_19grib2_end, METH_O, __Pyx_DOCSTR(__pyx_doc_6g2clib_18grib2_end)};
+static PyMethodDef __pyx_mdef_6g2clib_19grib2_end = {"grib2_end", (PyCFunction)__pyx_pw_6g2clib_19grib2_end, METH_O, __pyx_doc_6g2clib_18grib2_end};
 static PyObject *__pyx_pw_6g2clib_19grib2_end(PyObject *__pyx_self, PyObject *__pyx_v_gribmsg) {
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("grib2_end (wrapper)", 0);
   __pyx_r = __pyx_pf_6g2clib_18grib2_end(__pyx_self, ((PyObject *)__pyx_v_gribmsg));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "g2clib.pyx":520
- *     return gribmsg, ierr
- * 
- * def grib2_end(gribmsg):             # <<<<<<<<<<<<<<
- *     """
- * 
- */
-
 static PyObject *__pyx_pf_6g2clib_18grib2_end(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_gribmsg) {
   g2int __pyx_v_ierr;
   unsigned char *__pyx_v_cgrib;
@@ -3748,20 +4079,19 @@ static PyObject *__pyx_pf_6g2clib_18grib2_end(CYTHON_UNUSED PyObject *__pyx_self
   __Pyx_RefNannySetupContext("grib2_end", 0);
   __Pyx_INCREF(__pyx_v_gribmsg);
 
-  /* "g2clib.pyx":553
+  /* "g2clib.pyx":564
  *     cdef unsigned char *cgrib
  *     # add some extra space to grib message (enough to hold section 8).
  *     gribmsg = gribmsg + b'        '             # <<<<<<<<<<<<<<
  *     cgrib = <unsigned char *>PyBytes_AsString(gribmsg)
  *     ierr = g2_gribend(cgrib)
  */
-  __pyx_t_1 = PyNumber_Add(__pyx_v_gribmsg, ((PyObject *)__pyx_kp_b_21)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyNumber_Add(__pyx_v_gribmsg, __pyx_kp_b__5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_v_gribmsg);
-  __pyx_v_gribmsg = __pyx_t_1;
+  __Pyx_DECREF_SET(__pyx_v_gribmsg, __pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "g2clib.pyx":554
+  /* "g2clib.pyx":565
  *     # add some extra space to grib message (enough to hold section 8).
  *     gribmsg = gribmsg + b'        '
  *     cgrib = <unsigned char *>PyBytes_AsString(gribmsg)             # <<<<<<<<<<<<<<
@@ -3770,7 +4100,7 @@ static PyObject *__pyx_pf_6g2clib_18grib2_end(CYTHON_UNUSED PyObject *__pyx_self
  */
   __pyx_v_cgrib = ((unsigned char *)PyBytes_AsString(__pyx_v_gribmsg));
 
-  /* "g2clib.pyx":555
+  /* "g2clib.pyx":566
  *     gribmsg = gribmsg + b'        '
  *     cgrib = <unsigned char *>PyBytes_AsString(gribmsg)
  *     ierr = g2_gribend(cgrib)             # <<<<<<<<<<<<<<
@@ -3779,67 +4109,64 @@ static PyObject *__pyx_pf_6g2clib_18grib2_end(CYTHON_UNUSED PyObject *__pyx_self
  */
   __pyx_v_ierr = g2_gribend(__pyx_v_cgrib);
 
-  /* "g2clib.pyx":556
+  /* "g2clib.pyx":567
  *     cgrib = <unsigned char *>PyBytes_AsString(gribmsg)
  *     ierr = g2_gribend(cgrib)
  *     if ierr < 0:             # <<<<<<<<<<<<<<
  *        msg = "error in grib2_end, error code = %i" % ierr
  *        raise RuntimeError(msg)
  */
-  __pyx_t_2 = (__pyx_v_ierr < 0);
+  __pyx_t_2 = ((__pyx_v_ierr < 0) != 0);
   if (__pyx_t_2) {
 
-    /* "g2clib.pyx":557
+    /* "g2clib.pyx":568
  *     ierr = g2_gribend(cgrib)
  *     if ierr < 0:
  *        msg = "error in grib2_end, error code = %i" % ierr             # <<<<<<<<<<<<<<
  *        raise RuntimeError(msg)
  *     gribmsg = PyBytes_FromStringAndSize(<char *>cgrib, ierr)
  */
-    __pyx_t_1 = __Pyx_PyInt_to_py_int32_t(__pyx_v_ierr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = __Pyx_PyInt_From_int32_t(__pyx_v_ierr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_22), __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
+    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_error_in_grib2_end_error_code_i, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_v_msg = ((PyObject *)__pyx_t_3);
+    __pyx_v_msg = __pyx_t_3;
     __pyx_t_3 = 0;
 
-    /* "g2clib.pyx":558
+    /* "g2clib.pyx":569
  *     if ierr < 0:
  *        msg = "error in grib2_end, error code = %i" % ierr
  *        raise RuntimeError(msg)             # <<<<<<<<<<<<<<
  *     gribmsg = PyBytes_FromStringAndSize(<char *>cgrib, ierr)
  *     return gribmsg, ierr
  */
-    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_INCREF(__pyx_v_msg);
     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_msg);
     __Pyx_GIVEREF(__pyx_v_msg);
-    __pyx_t_1 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_Raise(__pyx_t_1, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L3;
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
-  __pyx_L3:;
 
-  /* "g2clib.pyx":559
+  /* "g2clib.pyx":570
  *        msg = "error in grib2_end, error code = %i" % ierr
  *        raise RuntimeError(msg)
  *     gribmsg = PyBytes_FromStringAndSize(<char *>cgrib, ierr)             # <<<<<<<<<<<<<<
  *     return gribmsg, ierr
  * 
  */
-  __pyx_t_1 = PyBytes_FromStringAndSize(((char *)__pyx_v_cgrib), __pyx_v_ierr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyBytes_FromStringAndSize(((char *)__pyx_v_cgrib), __pyx_v_ierr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_v_gribmsg);
-  __pyx_v_gribmsg = __pyx_t_1;
+  __Pyx_DECREF_SET(__pyx_v_gribmsg, __pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "g2clib.pyx":560
+  /* "g2clib.pyx":571
  *        raise RuntimeError(msg)
  *     gribmsg = PyBytes_FromStringAndSize(<char *>cgrib, ierr)
  *     return gribmsg, ierr             # <<<<<<<<<<<<<<
@@ -3847,9 +4174,9 @@ static PyObject *__pyx_pf_6g2clib_18grib2_end(CYTHON_UNUSED PyObject *__pyx_self
  * def grib2_addgrid(gribmsg,object gds,object gdstmpl,object deflist=None, defnum = 0):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyInt_to_py_int32_t(__pyx_v_ierr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_PyInt_From_int32_t(__pyx_v_ierr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_INCREF(__pyx_v_gribmsg);
   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_gribmsg);
@@ -3857,12 +4184,19 @@ static PyObject *__pyx_pf_6g2clib_18grib2_end(CYTHON_UNUSED PyObject *__pyx_self
   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
   __Pyx_GIVEREF(__pyx_t_1);
   __pyx_t_1 = 0;
-  __pyx_r = ((PyObject *)__pyx_t_3);
+  __pyx_r = __pyx_t_3;
   __pyx_t_3 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "g2clib.pyx":531
+ *     return gribmsg, ierr
+ * 
+ * def grib2_end(gribmsg):             # <<<<<<<<<<<<<<
+ *     """
+ * 
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_XDECREF(__pyx_t_3);
@@ -3876,30 +4210,33 @@ static PyObject *__pyx_pf_6g2clib_18grib2_end(CYTHON_UNUSED PyObject *__pyx_self
   return __pyx_r;
 }
 
+/* "g2clib.pyx":573
+ *     return gribmsg, ierr
+ * 
+ * def grib2_addgrid(gribmsg,object gds,object gdstmpl,object deflist=None, defnum = 0):             # <<<<<<<<<<<<<<
+ *     """
+ *    Packs up a Grid Definition Section (Section 3)
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_6g2clib_21grib2_addgrid(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static char __pyx_doc_6g2clib_20grib2_addgrid[] = "\n   Packs up a Grid Definition Section (Section 3) \n   and adds it to a GRIB2 message.  It is used with routines \"g2_create\",\n   \"g2_addfield\" and \"g2_gribend\" to create a complete GRIB2 message.\n   g2_create must be called first to initialize a new GRIB2 message.\n\n   gribmsg, ierr = grib2_addgrid(gribmsg,gds,gdstmpl,ideflist)\n \n   INPUT ARGUMENTS:\n     cgrib    - Char array that contains the GRIB2 message to which\n       [...]
-static PyMethodDef __pyx_mdef_6g2clib_21grib2_addgrid = {__Pyx_NAMESTR("grib2_addgrid"), (PyCFunction)__pyx_pw_6g2clib_21grib2_addgrid, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6g2clib_20grib2_addgrid)};
+static PyMethodDef __pyx_mdef_6g2clib_21grib2_addgrid = {"grib2_addgrid", (PyCFunction)__pyx_pw_6g2clib_21grib2_addgrid, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6g2clib_20grib2_addgrid};
 static PyObject *__pyx_pw_6g2clib_21grib2_addgrid(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyObject *__pyx_v_gribmsg = 0;
   PyObject *__pyx_v_gds = 0;
   PyObject *__pyx_v_gdstmpl = 0;
   PyObject *__pyx_v_deflist = 0;
   CYTHON_UNUSED PyObject *__pyx_v_defnum = 0;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("grib2_addgrid (wrapper)", 0);
   {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__gribmsg,&__pyx_n_s__gds,&__pyx_n_s__gdstmpl,&__pyx_n_s__deflist,&__pyx_n_s__defnum,0};
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gribmsg,&__pyx_n_s_gds,&__pyx_n_s_gdstmpl,&__pyx_n_s_deflist,&__pyx_n_s_defnum,0};
     PyObject* values[5] = {0,0,0,0,0};
-
-    /* "g2clib.pyx":562
- *     return gribmsg, ierr
- * 
- * def grib2_addgrid(gribmsg,object gds,object gdstmpl,object deflist=None, defnum = 0):             # <<<<<<<<<<<<<<
- *     """
- *    Packs up a Grid Definition Section (Section 3)
- */
     values[3] = ((PyObject *)Py_None);
     values[4] = ((PyObject *)__pyx_int_0);
     if (unlikely(__pyx_kwds)) {
@@ -3917,31 +4254,31 @@ static PyObject *__pyx_pw_6g2clib_21grib2_addgrid(PyObject *__pyx_self, PyObject
       kw_args = PyDict_Size(__pyx_kwds);
       switch (pos_args) {
         case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__gribmsg)) != 0)) kw_args--;
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_gribmsg)) != 0)) kw_args--;
         else goto __pyx_L5_argtuple_error;
         case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__gds)) != 0)) kw_args--;
+        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_gds)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("grib2_addgrid", 0, 3, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+          __Pyx_RaiseArgtupleInvalid("grib2_addgrid", 0, 3, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
         case  2:
-        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__gdstmpl)) != 0)) kw_args--;
+        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_gdstmpl)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("grib2_addgrid", 0, 3, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+          __Pyx_RaiseArgtupleInvalid("grib2_addgrid", 0, 3, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
         case  3:
         if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__deflist);
+          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_deflist);
           if (value) { values[3] = value; kw_args--; }
         }
         case  4:
         if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__defnum);
+          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_defnum);
           if (value) { values[4] = value; kw_args--; }
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "grib2_addgrid") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "grib2_addgrid") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -3962,13 +4299,15 @@ static PyObject *__pyx_pw_6g2clib_21grib2_addgrid(PyObject *__pyx_self, PyObject
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("grib2_addgrid", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+  __Pyx_RaiseArgtupleInvalid("grib2_addgrid", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
   __pyx_L3_error:;
   __Pyx_AddTraceback("g2clib.grib2_addgrid", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
   return NULL;
   __pyx_L4_argument_unpacking_done:;
   __pyx_r = __pyx_pf_6g2clib_20grib2_addgrid(__pyx_self, __pyx_v_gribmsg, __pyx_v_gds, __pyx_v_gdstmpl, __pyx_v_deflist, __pyx_v_defnum);
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
@@ -3997,8 +4336,8 @@ static PyObject *__pyx_pf_6g2clib_20grib2_addgrid(CYTHON_UNUSED PyObject *__pyx_
   __Pyx_RefNannySetupContext("grib2_addgrid", 0);
   __Pyx_INCREF(__pyx_v_gribmsg);
 
-  /* "g2clib.pyx":613
- *     cdef void *gdsdat, *deflistdat, *gdstmpldat
+  /* "g2clib.pyx":629
+ *     cdef void *gdstmpldat
  *     cdef Py_ssize_t buflen
  *     PyObject_AsReadBuffer(gds, &gdsdat, &buflen)             # <<<<<<<<<<<<<<
  *     PyObject_AsReadBuffer(gdstmpl, &gdstmpldat, &buflen)
@@ -4006,7 +4345,7 @@ static PyObject *__pyx_pf_6g2clib_20grib2_addgrid(CYTHON_UNUSED PyObject *__pyx_
  */
   PyObject_AsReadBuffer(__pyx_v_gds, (&__pyx_v_gdsdat), (&__pyx_v_buflen));
 
-  /* "g2clib.pyx":614
+  /* "g2clib.pyx":630
  *     cdef Py_ssize_t buflen
  *     PyObject_AsReadBuffer(gds, &gdsdat, &buflen)
  *     PyObject_AsReadBuffer(gdstmpl, &gdstmpldat, &buflen)             # <<<<<<<<<<<<<<
@@ -4015,7 +4354,7 @@ static PyObject *__pyx_pf_6g2clib_20grib2_addgrid(CYTHON_UNUSED PyObject *__pyx_
  */
   PyObject_AsReadBuffer(__pyx_v_gdstmpl, (&__pyx_v_gdstmpldat), (&__pyx_v_buflen));
 
-  /* "g2clib.pyx":615
+  /* "g2clib.pyx":631
  *     PyObject_AsReadBuffer(gds, &gdsdat, &buflen)
  *     PyObject_AsReadBuffer(gdstmpl, &gdstmpldat, &buflen)
  *     igds = <g2int *>gdsdat             # <<<<<<<<<<<<<<
@@ -4024,7 +4363,7 @@ static PyObject *__pyx_pf_6g2clib_20grib2_addgrid(CYTHON_UNUSED PyObject *__pyx_
  */
   __pyx_v_igds = ((g2int *)__pyx_v_gdsdat);
 
-  /* "g2clib.pyx":616
+  /* "g2clib.pyx":632
  *     PyObject_AsReadBuffer(gdstmpl, &gdstmpldat, &buflen)
  *     igds = <g2int *>gdsdat
  *     igdstmpl = <g2int *>gdstmpldat             # <<<<<<<<<<<<<<
@@ -4033,17 +4372,17 @@ static PyObject *__pyx_pf_6g2clib_20grib2_addgrid(CYTHON_UNUSED PyObject *__pyx_
  */
   __pyx_v_igdstmpl = ((g2int *)__pyx_v_gdstmpldat);
 
-  /* "g2clib.pyx":617
+  /* "g2clib.pyx":633
  *     igds = <g2int *>gdsdat
  *     igdstmpl = <g2int *>gdstmpldat
  *     if igds[2] != 0:             # <<<<<<<<<<<<<<
  *        PyObject_AsReadBuffer(deflist, &deflistdat, &buflen)
  *        ideflist = <g2int *>deflistdat
  */
-  __pyx_t_1 = ((__pyx_v_igds[2]) != 0);
+  __pyx_t_1 = (((__pyx_v_igds[2]) != 0) != 0);
   if (__pyx_t_1) {
 
-    /* "g2clib.pyx":618
+    /* "g2clib.pyx":634
  *     igdstmpl = <g2int *>gdstmpldat
  *     if igds[2] != 0:
  *        PyObject_AsReadBuffer(deflist, &deflistdat, &buflen)             # <<<<<<<<<<<<<<
@@ -4052,7 +4391,7 @@ static PyObject *__pyx_pf_6g2clib_20grib2_addgrid(CYTHON_UNUSED PyObject *__pyx_
  */
     PyObject_AsReadBuffer(__pyx_v_deflist, (&__pyx_v_deflistdat), (&__pyx_v_buflen));
 
-    /* "g2clib.pyx":619
+    /* "g2clib.pyx":635
  *     if igds[2] != 0:
  *        PyObject_AsReadBuffer(deflist, &deflistdat, &buflen)
  *        ideflist = <g2int *>deflistdat             # <<<<<<<<<<<<<<
@@ -4061,15 +4400,15 @@ static PyObject *__pyx_pf_6g2clib_20grib2_addgrid(CYTHON_UNUSED PyObject *__pyx_
  */
     __pyx_v_ideflist = ((g2int *)__pyx_v_deflistdat);
 
-    /* "g2clib.pyx":620
+    /* "g2clib.pyx":636
  *        PyObject_AsReadBuffer(deflist, &deflistdat, &buflen)
  *        ideflist = <g2int *>deflistdat
  *        idefnum = <g2int>PyInt_AsLong(len(deflist))             # <<<<<<<<<<<<<<
  *     else:
  *        ideflist = NULL
  */
-    __pyx_t_2 = PyObject_Length(__pyx_v_deflist); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = PyObject_Length(__pyx_v_deflist); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
     __pyx_v_idefnum = ((g2int)PyInt_AsLong(__pyx_t_3));
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
@@ -4077,7 +4416,7 @@ static PyObject *__pyx_pf_6g2clib_20grib2_addgrid(CYTHON_UNUSED PyObject *__pyx_
   }
   /*else*/ {
 
-    /* "g2clib.pyx":622
+    /* "g2clib.pyx":638
  *        idefnum = <g2int>PyInt_AsLong(len(deflist))
  *     else:
  *        ideflist = NULL             # <<<<<<<<<<<<<<
@@ -4086,7 +4425,7 @@ static PyObject *__pyx_pf_6g2clib_20grib2_addgrid(CYTHON_UNUSED PyObject *__pyx_
  */
     __pyx_v_ideflist = NULL;
 
-    /* "g2clib.pyx":623
+    /* "g2clib.pyx":639
  *     else:
  *        ideflist = NULL
  *        idefnum = 0             # <<<<<<<<<<<<<<
@@ -4097,35 +4436,34 @@ static PyObject *__pyx_pf_6g2clib_20grib2_addgrid(CYTHON_UNUSED PyObject *__pyx_
   }
   __pyx_L3:;
 
-  /* "g2clib.pyx":624
+  /* "g2clib.pyx":640
  *        ideflist = NULL
  *        idefnum = 0
  *     gribmsg = gribmsg + 4*(256+4+gds[2]+1)*b" "             # <<<<<<<<<<<<<<
  *     cgrib = <unsigned char *>PyBytes_AsString(gribmsg)
  *     ierr = g2_addgrid(cgrib, igds, igdstmpl, ideflist, idefnum)
  */
-  __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_gds, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_gds, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
   __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_4 = PyNumber_Add(__pyx_int_260, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = PyNumber_Add(__pyx_int_260, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_t_4 = PyNumber_Multiply(__pyx_int_4, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = PyNumber_Multiply(__pyx_int_4, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_t_3 = PyNumber_Multiply(__pyx_t_4, ((PyObject *)__pyx_kp_b_19)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = PyNumber_Multiply(__pyx_t_4, __pyx_kp_b__4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_t_4 = PyNumber_Add(__pyx_v_gribmsg, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = PyNumber_Add(__pyx_v_gribmsg, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_DECREF(__pyx_v_gribmsg);
-  __pyx_v_gribmsg = __pyx_t_4;
+  __Pyx_DECREF_SET(__pyx_v_gribmsg, __pyx_t_4);
   __pyx_t_4 = 0;
 
-  /* "g2clib.pyx":625
+  /* "g2clib.pyx":641
  *        idefnum = 0
  *     gribmsg = gribmsg + 4*(256+4+gds[2]+1)*b" "
  *     cgrib = <unsigned char *>PyBytes_AsString(gribmsg)             # <<<<<<<<<<<<<<
@@ -4134,7 +4472,7 @@ static PyObject *__pyx_pf_6g2clib_20grib2_addgrid(CYTHON_UNUSED PyObject *__pyx_
  */
   __pyx_v_cgrib = ((unsigned char *)PyBytes_AsString(__pyx_v_gribmsg));
 
-  /* "g2clib.pyx":626
+  /* "g2clib.pyx":642
  *     gribmsg = gribmsg + 4*(256+4+gds[2]+1)*b" "
  *     cgrib = <unsigned char *>PyBytes_AsString(gribmsg)
  *     ierr = g2_addgrid(cgrib, igds, igdstmpl, ideflist, idefnum)             # <<<<<<<<<<<<<<
@@ -4143,67 +4481,64 @@ static PyObject *__pyx_pf_6g2clib_20grib2_addgrid(CYTHON_UNUSED PyObject *__pyx_
  */
   __pyx_v_ierr = g2_addgrid(__pyx_v_cgrib, __pyx_v_igds, __pyx_v_igdstmpl, __pyx_v_ideflist, __pyx_v_idefnum);
 
-  /* "g2clib.pyx":627
+  /* "g2clib.pyx":643
  *     cgrib = <unsigned char *>PyBytes_AsString(gribmsg)
  *     ierr = g2_addgrid(cgrib, igds, igdstmpl, ideflist, idefnum)
  *     if ierr < 0:             # <<<<<<<<<<<<<<
  *        msg = "error in grib2_addgrid, error code = %i" % ierr
  *        raise RuntimeError(msg)
  */
-  __pyx_t_1 = (__pyx_v_ierr < 0);
+  __pyx_t_1 = ((__pyx_v_ierr < 0) != 0);
   if (__pyx_t_1) {
 
-    /* "g2clib.pyx":628
+    /* "g2clib.pyx":644
  *     ierr = g2_addgrid(cgrib, igds, igdstmpl, ideflist, idefnum)
  *     if ierr < 0:
  *        msg = "error in grib2_addgrid, error code = %i" % ierr             # <<<<<<<<<<<<<<
  *        raise RuntimeError(msg)
  *     gribmsg = PyBytes_FromStringAndSize(<char *>cgrib, ierr)
  */
-    __pyx_t_4 = __Pyx_PyInt_to_py_int32_t(__pyx_v_ierr); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = __Pyx_PyInt_From_int32_t(__pyx_v_ierr); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 644; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_23), __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
+    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_error_in_grib2_addgrid_error_cod, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 644; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_v_msg = ((PyObject *)__pyx_t_3);
+    __pyx_v_msg = __pyx_t_3;
     __pyx_t_3 = 0;
 
-    /* "g2clib.pyx":629
+    /* "g2clib.pyx":645
  *     if ierr < 0:
  *        msg = "error in grib2_addgrid, error code = %i" % ierr
  *        raise RuntimeError(msg)             # <<<<<<<<<<<<<<
  *     gribmsg = PyBytes_FromStringAndSize(<char *>cgrib, ierr)
  *     return gribmsg, ierr
  */
-    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_INCREF(__pyx_v_msg);
     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_msg);
     __Pyx_GIVEREF(__pyx_v_msg);
-    __pyx_t_4 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_Raise(__pyx_t_4, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L4;
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
-  __pyx_L4:;
 
-  /* "g2clib.pyx":630
+  /* "g2clib.pyx":646
  *        msg = "error in grib2_addgrid, error code = %i" % ierr
  *        raise RuntimeError(msg)
  *     gribmsg = PyBytes_FromStringAndSize(<char *>cgrib, ierr)             # <<<<<<<<<<<<<<
  *     return gribmsg, ierr
  * 
  */
-  __pyx_t_4 = PyBytes_FromStringAndSize(((char *)__pyx_v_cgrib), __pyx_v_ierr); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = PyBytes_FromStringAndSize(((char *)__pyx_v_cgrib), __pyx_v_ierr); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_DECREF(__pyx_v_gribmsg);
-  __pyx_v_gribmsg = __pyx_t_4;
+  __Pyx_DECREF_SET(__pyx_v_gribmsg, __pyx_t_4);
   __pyx_t_4 = 0;
 
-  /* "g2clib.pyx":631
+  /* "g2clib.pyx":647
  *        raise RuntimeError(msg)
  *     gribmsg = PyBytes_FromStringAndSize(<char *>cgrib, ierr)
  *     return gribmsg, ierr             # <<<<<<<<<<<<<<
@@ -4211,9 +4546,9 @@ static PyObject *__pyx_pf_6g2clib_20grib2_addgrid(CYTHON_UNUSED PyObject *__pyx_
  * 
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_4 = __Pyx_PyInt_to_py_int32_t(__pyx_v_ierr); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = __Pyx_PyInt_From_int32_t(__pyx_v_ierr); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_INCREF(__pyx_v_gribmsg);
   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_gribmsg);
@@ -4221,12 +4556,19 @@ static PyObject *__pyx_pf_6g2clib_20grib2_addgrid(CYTHON_UNUSED PyObject *__pyx_
   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
   __Pyx_GIVEREF(__pyx_t_4);
   __pyx_t_4 = 0;
-  __pyx_r = ((PyObject *)__pyx_t_3);
+  __pyx_r = __pyx_t_3;
   __pyx_t_3 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "g2clib.pyx":573
+ *     return gribmsg, ierr
+ * 
+ * def grib2_addgrid(gribmsg,object gds,object gdstmpl,object deflist=None, defnum = 0):             # <<<<<<<<<<<<<<
+ *     """
+ *    Packs up a Grid Definition Section (Section 3)
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_3);
   __Pyx_XDECREF(__pyx_t_4);
@@ -4240,10 +4582,18 @@ static PyObject *__pyx_pf_6g2clib_20grib2_addgrid(CYTHON_UNUSED PyObject *__pyx_
   return __pyx_r;
 }
 
+/* "g2clib.pyx":650
+ * 
+ * 
+ * def grib2_addfield(gribmsg,pdsnum,object pdstmpl,object coordlist,             # <<<<<<<<<<<<<<
+ *                    drsnum,object drstmpl,object field,
+ *                    ibitmap,object bitmap):
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_6g2clib_23grib2_addfield(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static char __pyx_doc_6g2clib_22grib2_addfield[] = "\n   Packs up Sections 4 through 7 for a given field\n   and adds them to a GRIB2 message.  They are Product Definition Section,\n   Data Representation Section, Bit-Map Section and Data Section, respectively.\n   This routine is used with routines \"g2_create\",  \n   \"g2_addgrid\", and \"g2_gribend\" to create a complete GRIB2 message.  \n   g2_create must be called first to initialize a new GRIB2 message.\n   g2_addgrid must be call [...]
-static PyMethodDef __pyx_mdef_6g2clib_23grib2_addfield = {__Pyx_NAMESTR("grib2_addfield"), (PyCFunction)__pyx_pw_6g2clib_23grib2_addfield, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6g2clib_22grib2_addfield)};
+static PyMethodDef __pyx_mdef_6g2clib_23grib2_addfield = {"grib2_addfield", (PyCFunction)__pyx_pw_6g2clib_23grib2_addfield, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6g2clib_22grib2_addfield};
 static PyObject *__pyx_pw_6g2clib_23grib2_addfield(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyObject *__pyx_v_gribmsg = 0;
   PyObject *__pyx_v_pdsnum = 0;
@@ -4254,11 +4604,14 @@ static PyObject *__pyx_pw_6g2clib_23grib2_addfield(PyObject *__pyx_self, PyObjec
   PyObject *__pyx_v_field = 0;
   PyObject *__pyx_v_ibitmap = 0;
   PyObject *__pyx_v_bitmap = 0;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("grib2_addfield (wrapper)", 0);
   {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__gribmsg,&__pyx_n_s__pdsnum,&__pyx_n_s__pdstmpl,&__pyx_n_s__coordlist,&__pyx_n_s__drsnum,&__pyx_n_s__drstmpl,&__pyx_n_s__field,&__pyx_n_s__ibitmap,&__pyx_n_s__bitmap,0};
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gribmsg,&__pyx_n_s_pdsnum,&__pyx_n_s_pdstmpl,&__pyx_n_s_coordlist,&__pyx_n_s_drsnum,&__pyx_n_s_drstmpl,&__pyx_n_s_field,&__pyx_n_s_ibitmap,&__pyx_n_s_bitmap,0};
     PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
@@ -4279,51 +4632,51 @@ static PyObject *__pyx_pw_6g2clib_23grib2_addfield(PyObject *__pyx_self, PyObjec
       kw_args = PyDict_Size(__pyx_kwds);
       switch (pos_args) {
         case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__gribmsg)) != 0)) kw_args--;
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_gribmsg)) != 0)) kw_args--;
         else goto __pyx_L5_argtuple_error;
         case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pdsnum)) != 0)) kw_args--;
+        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pdsnum)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("grib2_addfield", 1, 9, 9, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 634; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+          __Pyx_RaiseArgtupleInvalid("grib2_addfield", 1, 9, 9, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
         case  2:
-        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pdstmpl)) != 0)) kw_args--;
+        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pdstmpl)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("grib2_addfield", 1, 9, 9, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 634; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+          __Pyx_RaiseArgtupleInvalid("grib2_addfield", 1, 9, 9, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
         case  3:
-        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__coordlist)) != 0)) kw_args--;
+        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_coordlist)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("grib2_addfield", 1, 9, 9, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 634; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+          __Pyx_RaiseArgtupleInvalid("grib2_addfield", 1, 9, 9, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
         case  4:
-        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__drsnum)) != 0)) kw_args--;
+        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_drsnum)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("grib2_addfield", 1, 9, 9, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 634; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+          __Pyx_RaiseArgtupleInvalid("grib2_addfield", 1, 9, 9, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
         case  5:
-        if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__drstmpl)) != 0)) kw_args--;
+        if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_drstmpl)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("grib2_addfield", 1, 9, 9, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 634; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+          __Pyx_RaiseArgtupleInvalid("grib2_addfield", 1, 9, 9, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
         case  6:
-        if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__field)) != 0)) kw_args--;
+        if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("grib2_addfield", 1, 9, 9, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 634; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+          __Pyx_RaiseArgtupleInvalid("grib2_addfield", 1, 9, 9, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
         case  7:
-        if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ibitmap)) != 0)) kw_args--;
+        if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ibitmap)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("grib2_addfield", 1, 9, 9, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 634; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+          __Pyx_RaiseArgtupleInvalid("grib2_addfield", 1, 9, 9, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
         case  8:
-        if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__bitmap)) != 0)) kw_args--;
+        if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bitmap)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("grib2_addfield", 1, 9, 9, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 634; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+          __Pyx_RaiseArgtupleInvalid("grib2_addfield", 1, 9, 9, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "grib2_addfield") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 634; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "grib2_addfield") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
       goto __pyx_L5_argtuple_error;
@@ -4350,31 +4703,25 @@ static PyObject *__pyx_pw_6g2clib_23grib2_addfield(PyObject *__pyx_self, PyObjec
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("grib2_addfield", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 634; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+  __Pyx_RaiseArgtupleInvalid("grib2_addfield", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
   __pyx_L3_error:;
   __Pyx_AddTraceback("g2clib.grib2_addfield", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
   return NULL;
   __pyx_L4_argument_unpacking_done:;
   __pyx_r = __pyx_pf_6g2clib_22grib2_addfield(__pyx_self, __pyx_v_gribmsg, __pyx_v_pdsnum, __pyx_v_pdstmpl, __pyx_v_coordlist, __pyx_v_drsnum, __pyx_v_drstmpl, __pyx_v_field, __pyx_v_ibitmap, __pyx_v_bitmap);
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "g2clib.pyx":634
- * 
- * 
- * def grib2_addfield(gribmsg,pdsnum,object pdstmpl,object coordlist,             # <<<<<<<<<<<<<<
- *                    drsnum,object drstmpl,object field,
- *                    ibitmap,object bitmap):
- */
-
 static PyObject *__pyx_pf_6g2clib_22grib2_addfield(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_gribmsg, PyObject *__pyx_v_pdsnum, PyObject *__pyx_v_pdstmpl, PyObject *__pyx_v_coordlist, PyObject *__pyx_v_drsnum, PyObject *__pyx_v_drstmpl, PyObject *__pyx_v_field, PyObject *__pyx_v_ibitmap, PyObject *__pyx_v_bitmap) {
   g2int __pyx_v_ierr;
   g2int __pyx_v_ipdsnum;
   g2int __pyx_v_numcoord;
-  g2int *__pyx_v_ipdstmpl;
   g2int __pyx_v_idrsnum;
+  g2int *__pyx_v_ipdstmpl;
   g2int *__pyx_v_idrstmpl;
   g2float *__pyx_v_fld;
   g2float *__pyx_v_fcoordlist;
@@ -4392,18 +4739,17 @@ static PyObject *__pyx_pf_6g2clib_22grib2_addfield(CYTHON_UNUSED PyObject *__pyx
   PyObject *__pyx_r = NULL;
   __Pyx_RefNannyDeclarations
   int __pyx_t_1;
-  Py_ssize_t __pyx_t_2;
-  PyObject *__pyx_t_3 = NULL;
-  int __pyx_t_4;
-  int __pyx_t_5;
-  PyObject *__pyx_t_6 = NULL;
+  int __pyx_t_2;
+  Py_ssize_t __pyx_t_3;
+  PyObject *__pyx_t_4 = NULL;
+  PyObject *__pyx_t_5 = NULL;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("grib2_addfield", 0);
   __Pyx_INCREF(__pyx_v_gribmsg);
 
-  /* "g2clib.pyx":712
+  /* "g2clib.pyx":736
  *     cdef Py_ssize_t buflen
  *     cdef unsigned char *cgrib
  *     ipdsnum = <g2int>PyInt_AsLong(pdsnum)             # <<<<<<<<<<<<<<
@@ -4412,7 +4758,7 @@ static PyObject *__pyx_pf_6g2clib_22grib2_addfield(CYTHON_UNUSED PyObject *__pyx
  */
   __pyx_v_ipdsnum = ((g2int)PyInt_AsLong(__pyx_v_pdsnum));
 
-  /* "g2clib.pyx":713
+  /* "g2clib.pyx":737
  *     cdef unsigned char *cgrib
  *     ipdsnum = <g2int>PyInt_AsLong(pdsnum)
  *     PyObject_AsReadBuffer(pdstmpl, &pdtmpldat, &buflen)             # <<<<<<<<<<<<<<
@@ -4421,7 +4767,7 @@ static PyObject *__pyx_pf_6g2clib_22grib2_addfield(CYTHON_UNUSED PyObject *__pyx
  */
   PyObject_AsReadBuffer(__pyx_v_pdstmpl, (&__pyx_v_pdtmpldat), (&__pyx_v_buflen));
 
-  /* "g2clib.pyx":714
+  /* "g2clib.pyx":738
  *     ipdsnum = <g2int>PyInt_AsLong(pdsnum)
  *     PyObject_AsReadBuffer(pdstmpl, &pdtmpldat, &buflen)
  *     ipdstmpl = <g2int *>pdtmpldat             # <<<<<<<<<<<<<<
@@ -4430,7 +4776,7 @@ static PyObject *__pyx_pf_6g2clib_22grib2_addfield(CYTHON_UNUSED PyObject *__pyx
  */
   __pyx_v_ipdstmpl = ((g2int *)__pyx_v_pdtmpldat);
 
-  /* "g2clib.pyx":715
+  /* "g2clib.pyx":739
  *     PyObject_AsReadBuffer(pdstmpl, &pdtmpldat, &buflen)
  *     ipdstmpl = <g2int *>pdtmpldat
  *     idrsnum = <g2int>PyInt_AsLong(drsnum)             # <<<<<<<<<<<<<<
@@ -4439,7 +4785,7 @@ static PyObject *__pyx_pf_6g2clib_22grib2_addfield(CYTHON_UNUSED PyObject *__pyx
  */
   __pyx_v_idrsnum = ((g2int)PyInt_AsLong(__pyx_v_drsnum));
 
-  /* "g2clib.pyx":716
+  /* "g2clib.pyx":740
  *     ipdstmpl = <g2int *>pdtmpldat
  *     idrsnum = <g2int>PyInt_AsLong(drsnum)
  *     PyObject_AsReadBuffer(drstmpl, &drtmpldat, &buflen)             # <<<<<<<<<<<<<<
@@ -4448,7 +4794,7 @@ static PyObject *__pyx_pf_6g2clib_22grib2_addfield(CYTHON_UNUSED PyObject *__pyx
  */
   PyObject_AsReadBuffer(__pyx_v_drstmpl, (&__pyx_v_drtmpldat), (&__pyx_v_buflen));
 
-  /* "g2clib.pyx":717
+  /* "g2clib.pyx":741
  *     idrsnum = <g2int>PyInt_AsLong(drsnum)
  *     PyObject_AsReadBuffer(drstmpl, &drtmpldat, &buflen)
  *     idrstmpl = <g2int *>drtmpldat             # <<<<<<<<<<<<<<
@@ -4457,7 +4803,7 @@ static PyObject *__pyx_pf_6g2clib_22grib2_addfield(CYTHON_UNUSED PyObject *__pyx
  */
   __pyx_v_idrstmpl = ((g2int *)__pyx_v_drtmpldat);
 
-  /* "g2clib.pyx":718
+  /* "g2clib.pyx":742
  *     PyObject_AsReadBuffer(drstmpl, &drtmpldat, &buflen)
  *     idrstmpl = <g2int *>drtmpldat
  *     if coordlist is not None:             # <<<<<<<<<<<<<<
@@ -4465,9 +4811,10 @@ static PyObject *__pyx_pf_6g2clib_22grib2_addfield(CYTHON_UNUSED PyObject *__pyx
  *         fcoordlist = <g2float *>coordlistdat
  */
   __pyx_t_1 = (__pyx_v_coordlist != Py_None);
-  if (__pyx_t_1) {
+  __pyx_t_2 = (__pyx_t_1 != 0);
+  if (__pyx_t_2) {
 
-    /* "g2clib.pyx":719
+    /* "g2clib.pyx":743
  *     idrstmpl = <g2int *>drtmpldat
  *     if coordlist is not None:
  *         PyObject_AsReadBuffer(coordlist, &coordlistdat, &buflen)             # <<<<<<<<<<<<<<
@@ -4476,7 +4823,7 @@ static PyObject *__pyx_pf_6g2clib_22grib2_addfield(CYTHON_UNUSED PyObject *__pyx
  */
     PyObject_AsReadBuffer(__pyx_v_coordlist, (&__pyx_v_coordlistdat), (&__pyx_v_buflen));
 
-    /* "g2clib.pyx":720
+    /* "g2clib.pyx":744
  *     if coordlist is not None:
  *         PyObject_AsReadBuffer(coordlist, &coordlistdat, &buflen)
  *         fcoordlist = <g2float *>coordlistdat             # <<<<<<<<<<<<<<
@@ -4485,20 +4832,20 @@ static PyObject *__pyx_pf_6g2clib_22grib2_addfield(CYTHON_UNUSED PyObject *__pyx
  */
     __pyx_v_fcoordlist = ((g2float *)__pyx_v_coordlistdat);
 
-    /* "g2clib.pyx":721
+    /* "g2clib.pyx":745
  *         PyObject_AsReadBuffer(coordlist, &coordlistdat, &buflen)
  *         fcoordlist = <g2float *>coordlistdat
  *         numcoord = len(coordlist)             # <<<<<<<<<<<<<<
  *     else:
  *         fcoordlist = NULL
  */
-    __pyx_t_2 = PyObject_Length(__pyx_v_coordlist); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_v_numcoord = __pyx_t_2;
+    __pyx_t_3 = PyObject_Length(__pyx_v_coordlist); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_v_numcoord = __pyx_t_3;
     goto __pyx_L3;
   }
   /*else*/ {
 
-    /* "g2clib.pyx":723
+    /* "g2clib.pyx":747
  *         numcoord = len(coordlist)
  *     else:
  *         fcoordlist = NULL             # <<<<<<<<<<<<<<
@@ -4507,7 +4854,7 @@ static PyObject *__pyx_pf_6g2clib_22grib2_addfield(CYTHON_UNUSED PyObject *__pyx
  */
     __pyx_v_fcoordlist = NULL;
 
-    /* "g2clib.pyx":724
+    /* "g2clib.pyx":748
  *     else:
  *         fcoordlist = NULL
  *         numcoord = 0             # <<<<<<<<<<<<<<
@@ -4518,7 +4865,7 @@ static PyObject *__pyx_pf_6g2clib_22grib2_addfield(CYTHON_UNUSED PyObject *__pyx
   }
   __pyx_L3:;
 
-  /* "g2clib.pyx":725
+  /* "g2clib.pyx":749
  *         fcoordlist = NULL
  *         numcoord = 0
  *     PyObject_AsReadBuffer(field, &fielddat, &buflen)             # <<<<<<<<<<<<<<
@@ -4527,7 +4874,7 @@ static PyObject *__pyx_pf_6g2clib_22grib2_addfield(CYTHON_UNUSED PyObject *__pyx
  */
   PyObject_AsReadBuffer(__pyx_v_field, (&__pyx_v_fielddat), (&__pyx_v_buflen));
 
-  /* "g2clib.pyx":726
+  /* "g2clib.pyx":750
  *         numcoord = 0
  *     PyObject_AsReadBuffer(field, &fielddat, &buflen)
  *     fld = <g2float *>fielddat             # <<<<<<<<<<<<<<
@@ -4536,7 +4883,7 @@ static PyObject *__pyx_pf_6g2clib_22grib2_addfield(CYTHON_UNUSED PyObject *__pyx
  */
   __pyx_v_fld = ((g2float *)__pyx_v_fielddat);
 
-  /* "g2clib.pyx":727
+  /* "g2clib.pyx":751
  *     PyObject_AsReadBuffer(field, &fielddat, &buflen)
  *     fld = <g2float *>fielddat
  *     ibmap = <g2int>PyInt_AsLong(ibitmap)             # <<<<<<<<<<<<<<
@@ -4545,37 +4892,39 @@ static PyObject *__pyx_pf_6g2clib_22grib2_addfield(CYTHON_UNUSED PyObject *__pyx
  */
   __pyx_v_ibmap = ((g2int)PyInt_AsLong(__pyx_v_ibitmap));
 
-  /* "g2clib.pyx":728
+  /* "g2clib.pyx":752
  *     fld = <g2float *>fielddat
  *     ibmap = <g2int>PyInt_AsLong(ibitmap)
  *     ngrdpts = len(field)             # <<<<<<<<<<<<<<
  *     if ibitmap == 0 or ibitmap == 254:
  *         PyObject_AsReadBuffer(bitmap, &bitmapdat, &buflen)
  */
-  __pyx_t_2 = PyObject_Length(__pyx_v_field); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_v_ngrdpts = __pyx_t_2;
+  __pyx_t_3 = PyObject_Length(__pyx_v_field); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_v_ngrdpts = __pyx_t_3;
 
-  /* "g2clib.pyx":729
+  /* "g2clib.pyx":753
  *     ibmap = <g2int>PyInt_AsLong(ibitmap)
  *     ngrdpts = len(field)
  *     if ibitmap == 0 or ibitmap == 254:             # <<<<<<<<<<<<<<
  *         PyObject_AsReadBuffer(bitmap, &bitmapdat, &buflen)
  *         bmap  = <g2int *>bitmapdat
  */
-  __pyx_t_3 = PyObject_RichCompare(__pyx_v_ibitmap, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_t_4 = PyObject_RichCompare(__pyx_v_ibitmap, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   if (!__pyx_t_1) {
-    __pyx_t_3 = PyObject_RichCompare(__pyx_v_ibitmap, __pyx_int_254, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_5 = __pyx_t_4;
   } else {
-    __pyx_t_5 = __pyx_t_1;
+    __pyx_t_2 = __pyx_t_1;
+    goto __pyx_L5_bool_binop_done;
   }
-  if (__pyx_t_5) {
+  __pyx_t_4 = PyObject_RichCompare(__pyx_v_ibitmap, __pyx_int_254, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_t_2 = __pyx_t_1;
+  __pyx_L5_bool_binop_done:;
+  if (__pyx_t_2) {
 
-    /* "g2clib.pyx":730
+    /* "g2clib.pyx":754
  *     ngrdpts = len(field)
  *     if ibitmap == 0 or ibitmap == 254:
  *         PyObject_AsReadBuffer(bitmap, &bitmapdat, &buflen)             # <<<<<<<<<<<<<<
@@ -4584,7 +4933,7 @@ static PyObject *__pyx_pf_6g2clib_22grib2_addfield(CYTHON_UNUSED PyObject *__pyx
  */
     PyObject_AsReadBuffer(__pyx_v_bitmap, (&__pyx_v_bitmapdat), (&__pyx_v_buflen));
 
-    /* "g2clib.pyx":731
+    /* "g2clib.pyx":755
  *     if ibitmap == 0 or ibitmap == 254:
  *         PyObject_AsReadBuffer(bitmap, &bitmapdat, &buflen)
  *         bmap  = <g2int *>bitmapdat             # <<<<<<<<<<<<<<
@@ -4596,7 +4945,7 @@ static PyObject *__pyx_pf_6g2clib_22grib2_addfield(CYTHON_UNUSED PyObject *__pyx
   }
   /*else*/ {
 
-    /* "g2clib.pyx":733
+    /* "g2clib.pyx":757
  *         bmap  = <g2int *>bitmapdat
  *     else:
  *         bmap = NULL             # <<<<<<<<<<<<<<
@@ -4607,27 +4956,26 @@ static PyObject *__pyx_pf_6g2clib_22grib2_addfield(CYTHON_UNUSED PyObject *__pyx
   }
   __pyx_L4:;
 
-  /* "g2clib.pyx":734
+  /* "g2clib.pyx":758
  *     else:
  *         bmap = NULL
  *     gribmsg = gribmsg + 4*(len(drstmpl)+ngrdpts+4)*b" "             # <<<<<<<<<<<<<<
  *     cgrib = <unsigned char *>PyBytes_AsString(gribmsg)
  *     ierr = g2_addfield(cgrib,ipdsnum,ipdstmpl,fcoordlist,numcoord,idrsnum,idrstmpl,fld,ngrdpts,ibmap,bmap)
  */
-  __pyx_t_2 = PyObject_Length(__pyx_v_drstmpl); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_3 = PyInt_FromSsize_t((4 * ((__pyx_t_2 + __pyx_v_ngrdpts) + 4))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_6 = PyNumber_Multiply(__pyx_t_3, ((PyObject *)__pyx_kp_b_19)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_6);
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_t_3 = PyNumber_Add(__pyx_v_gribmsg, __pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  __Pyx_DECREF(__pyx_v_gribmsg);
-  __pyx_v_gribmsg = __pyx_t_3;
-  __pyx_t_3 = 0;
+  __pyx_t_3 = PyObject_Length(__pyx_v_drstmpl); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = PyInt_FromSsize_t((4 * ((__pyx_t_3 + __pyx_v_ngrdpts) + 4))); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_5 = PyNumber_Multiply(__pyx_t_4, __pyx_kp_b__4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_t_4 = PyNumber_Add(__pyx_v_gribmsg, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __Pyx_DECREF_SET(__pyx_v_gribmsg, __pyx_t_4);
+  __pyx_t_4 = 0;
 
-  /* "g2clib.pyx":735
+  /* "g2clib.pyx":759
  *         bmap = NULL
  *     gribmsg = gribmsg + 4*(len(drstmpl)+ngrdpts+4)*b" "
  *     cgrib = <unsigned char *>PyBytes_AsString(gribmsg)             # <<<<<<<<<<<<<<
@@ -4636,7 +4984,7 @@ static PyObject *__pyx_pf_6g2clib_22grib2_addfield(CYTHON_UNUSED PyObject *__pyx
  */
   __pyx_v_cgrib = ((unsigned char *)PyBytes_AsString(__pyx_v_gribmsg));
 
-  /* "g2clib.pyx":736
+  /* "g2clib.pyx":760
  *     gribmsg = gribmsg + 4*(len(drstmpl)+ngrdpts+4)*b" "
  *     cgrib = <unsigned char *>PyBytes_AsString(gribmsg)
  *     ierr = g2_addfield(cgrib,ipdsnum,ipdstmpl,fcoordlist,numcoord,idrsnum,idrstmpl,fld,ngrdpts,ibmap,bmap)             # <<<<<<<<<<<<<<
@@ -4645,90 +4993,94 @@ static PyObject *__pyx_pf_6g2clib_22grib2_addfield(CYTHON_UNUSED PyObject *__pyx
  */
   __pyx_v_ierr = g2_addfield(__pyx_v_cgrib, __pyx_v_ipdsnum, __pyx_v_ipdstmpl, __pyx_v_fcoordlist, __pyx_v_numcoord, __pyx_v_idrsnum, __pyx_v_idrstmpl, __pyx_v_fld, __pyx_v_ngrdpts, __pyx_v_ibmap, __pyx_v_bmap);
 
-  /* "g2clib.pyx":737
+  /* "g2clib.pyx":761
  *     cgrib = <unsigned char *>PyBytes_AsString(gribmsg)
  *     ierr = g2_addfield(cgrib,ipdsnum,ipdstmpl,fcoordlist,numcoord,idrsnum,idrstmpl,fld,ngrdpts,ibmap,bmap)
  *     if ierr < 0:             # <<<<<<<<<<<<<<
  *        msg = "error in grib2_addfield, error code = %i" % ierr
  *        raise RuntimeError(msg)
  */
-  __pyx_t_5 = (__pyx_v_ierr < 0);
-  if (__pyx_t_5) {
+  __pyx_t_2 = ((__pyx_v_ierr < 0) != 0);
+  if (__pyx_t_2) {
 
-    /* "g2clib.pyx":738
+    /* "g2clib.pyx":762
  *     ierr = g2_addfield(cgrib,ipdsnum,ipdstmpl,fcoordlist,numcoord,idrsnum,idrstmpl,fld,ngrdpts,ibmap,bmap)
  *     if ierr < 0:
  *        msg = "error in grib2_addfield, error code = %i" % ierr             # <<<<<<<<<<<<<<
  *        raise RuntimeError(msg)
  *     gribmsg = PyBytes_FromStringAndSize(<char *>cgrib, ierr)
  */
-    __pyx_t_3 = __Pyx_PyInt_to_py_int32_t(__pyx_v_ierr); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_6 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_24), __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_6));
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_v_msg = ((PyObject *)__pyx_t_6);
-    __pyx_t_6 = 0;
+    __pyx_t_4 = __Pyx_PyInt_From_int32_t(__pyx_v_ierr); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_error_in_grib2_addfield_error_co, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_v_msg = __pyx_t_5;
+    __pyx_t_5 = 0;
 
-    /* "g2clib.pyx":739
+    /* "g2clib.pyx":763
  *     if ierr < 0:
  *        msg = "error in grib2_addfield, error code = %i" % ierr
  *        raise RuntimeError(msg)             # <<<<<<<<<<<<<<
  *     gribmsg = PyBytes_FromStringAndSize(<char *>cgrib, ierr)
  *     return gribmsg, ierr
  */
-    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
+    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
     __Pyx_INCREF(__pyx_v_msg);
-    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_msg);
+    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_msg);
     __Pyx_GIVEREF(__pyx_v_msg);
-    __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
-    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L5;
+    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
-  __pyx_L5:;
 
-  /* "g2clib.pyx":740
+  /* "g2clib.pyx":764
  *        msg = "error in grib2_addfield, error code = %i" % ierr
  *        raise RuntimeError(msg)
  *     gribmsg = PyBytes_FromStringAndSize(<char *>cgrib, ierr)             # <<<<<<<<<<<<<<
  *     return gribmsg, ierr
  */
-  __pyx_t_3 = PyBytes_FromStringAndSize(((char *)__pyx_v_cgrib), __pyx_v_ierr); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_v_gribmsg);
-  __pyx_v_gribmsg = __pyx_t_3;
-  __pyx_t_3 = 0;
+  __pyx_t_4 = PyBytes_FromStringAndSize(((char *)__pyx_v_cgrib), __pyx_v_ierr); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_DECREF_SET(__pyx_v_gribmsg, __pyx_t_4);
+  __pyx_t_4 = 0;
 
-  /* "g2clib.pyx":741
+  /* "g2clib.pyx":765
  *        raise RuntimeError(msg)
  *     gribmsg = PyBytes_FromStringAndSize(<char *>cgrib, ierr)
  *     return gribmsg, ierr             # <<<<<<<<<<<<<<
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_3 = __Pyx_PyInt_to_py_int32_t(__pyx_v_ierr); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_6);
+  __pyx_t_4 = __Pyx_PyInt_From_int32_t(__pyx_v_ierr); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
   __Pyx_INCREF(__pyx_v_gribmsg);
-  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_gribmsg);
+  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_gribmsg);
   __Pyx_GIVEREF(__pyx_v_gribmsg);
-  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3);
-  __Pyx_GIVEREF(__pyx_t_3);
-  __pyx_t_3 = 0;
-  __pyx_r = ((PyObject *)__pyx_t_6);
-  __pyx_t_6 = 0;
+  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
+  __Pyx_GIVEREF(__pyx_t_4);
+  __pyx_t_4 = 0;
+  __pyx_r = __pyx_t_5;
+  __pyx_t_5 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "g2clib.pyx":650
+ * 
+ * 
+ * def grib2_addfield(gribmsg,pdsnum,object pdstmpl,object coordlist,             # <<<<<<<<<<<<<<
+ *                    drsnum,object drstmpl,object field,
+ *                    ibitmap,object bitmap):
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
   __Pyx_AddTraceback("g2clib.grib2_addfield", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_r = NULL;
   __pyx_L0:;
@@ -4745,9 +5097,13 @@ static PyMethodDef __pyx_methods[] = {
 
 #if PY_MAJOR_VERSION >= 3
 static struct PyModuleDef __pyx_moduledef = {
+  #if PY_VERSION_HEX < 0x03020000
+    { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
+  #else
     PyModuleDef_HEAD_INIT,
-    __Pyx_NAMESTR("g2clib"),
-    __Pyx_DOCSTR(__pyx_k_25), /* m_doc */
+  #endif
+    "g2clib",
+    __pyx_k_Pyrex_code_to_provide_python_int, /* m_doc */
     -1, /* m_size */
     __pyx_methods /* m_methods */,
     NULL, /* m_reload */
@@ -4758,149 +5114,153 @@ static struct PyModuleDef __pyx_moduledef = {
 #endif
 
 static __Pyx_StringTabEntry __pyx_string_tab[] = {
-  {&__pyx_kp_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0},
-  {&__pyx_kp_s_11, __pyx_k_11, sizeof(__pyx_k_11), 0, 0, 1, 0},
-  {&__pyx_kp_s_12, __pyx_k_12, sizeof(__pyx_k_12), 0, 0, 1, 0},
-  {&__pyx_kp_s_13, __pyx_k_13, sizeof(__pyx_k_13), 0, 0, 1, 0},
-  {&__pyx_kp_s_15, __pyx_k_15, sizeof(__pyx_k_15), 0, 0, 1, 0},
-  {&__pyx_kp_s_16, __pyx_k_16, sizeof(__pyx_k_16), 0, 0, 1, 0},
-  {&__pyx_kp_s_17, __pyx_k_17, sizeof(__pyx_k_17), 0, 0, 1, 0},
-  {&__pyx_kp_s_18, __pyx_k_18, sizeof(__pyx_k_18), 0, 0, 1, 0},
-  {&__pyx_kp_b_19, __pyx_k_19, sizeof(__pyx_k_19), 0, 0, 0, 0},
-  {&__pyx_kp_s_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 1, 0},
-  {&__pyx_kp_s_20, __pyx_k_20, sizeof(__pyx_k_20), 0, 0, 1, 0},
-  {&__pyx_kp_b_21, __pyx_k_21, sizeof(__pyx_k_21), 0, 0, 0, 0},
-  {&__pyx_kp_s_22, __pyx_k_22, sizeof(__pyx_k_22), 0, 0, 1, 0},
-  {&__pyx_kp_s_23, __pyx_k_23, sizeof(__pyx_k_23), 0, 0, 1, 0},
-  {&__pyx_kp_s_24, __pyx_k_24, sizeof(__pyx_k_24), 0, 0, 1, 0},
-  {&__pyx_kp_s_28, __pyx_k_28, sizeof(__pyx_k_28), 0, 0, 1, 0},
-  {&__pyx_kp_s_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 0, 1, 0},
-  {&__pyx_kp_s_4, __pyx_k_4, sizeof(__pyx_k_4), 0, 0, 1, 0},
-  {&__pyx_kp_s_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 0, 1, 0},
-  {&__pyx_kp_s_6, __pyx_k_6, sizeof(__pyx_k_6), 0, 0, 1, 0},
-  {&__pyx_kp_s_7, __pyx_k_7, sizeof(__pyx_k_7), 0, 0, 1, 0},
-  {&__pyx_kp_s_8, __pyx_k_8, sizeof(__pyx_k_8), 0, 0, 1, 0},
-  {&__pyx_kp_s_9, __pyx_k_9, sizeof(__pyx_k_9), 0, 0, 1, 0},
-  {&__pyx_n_s__C, __pyx_k__C, sizeof(__pyx_k__C), 0, 0, 1, 1},
-  {&__pyx_n_s__RuntimeError, __pyx_k__RuntimeError, sizeof(__pyx_k__RuntimeError), 0, 0, 1, 1},
-  {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1},
-  {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1},
-  {&__pyx_n_s__bitmap, __pyx_k__bitmap, sizeof(__pyx_k__bitmap), 0, 0, 1, 1},
-  {&__pyx_n_s__bitmapdat, __pyx_k__bitmapdat, sizeof(__pyx_k__bitmapdat), 0, 0, 1, 1},
-  {&__pyx_n_s__bitsofprecision, __pyx_k__bitsofprecision, sizeof(__pyx_k__bitsofprecision), 0, 0, 1, 1},
-  {&__pyx_n_s__bmap, __pyx_k__bmap, sizeof(__pyx_k__bmap), 0, 0, 1, 1},
-  {&__pyx_n_s__buflen, __pyx_k__buflen, sizeof(__pyx_k__buflen), 0, 0, 1, 1},
-  {&__pyx_n_s__bufleni, __pyx_k__bufleni, sizeof(__pyx_k__bufleni), 0, 0, 1, 1},
-  {&__pyx_n_s__buflenr, __pyx_k__buflenr, sizeof(__pyx_k__buflenr), 0, 0, 1, 1},
-  {&__pyx_n_s__ceil, __pyx_k__ceil, sizeof(__pyx_k__ceil), 0, 0, 1, 1},
-  {&__pyx_n_s__cgrib, __pyx_k__cgrib, sizeof(__pyx_k__cgrib), 0, 0, 1, 1},
-  {&__pyx_n_s__coordlist, __pyx_k__coordlist, sizeof(__pyx_k__coordlist), 0, 0, 1, 1},
-  {&__pyx_n_s__coordlistdat, __pyx_k__coordlistdat, sizeof(__pyx_k__coordlistdat), 0, 0, 1, 1},
-  {&__pyx_n_s__data, __pyx_k__data, sizeof(__pyx_k__data), 0, 0, 1, 1},
-  {&__pyx_n_s__deflist, __pyx_k__deflist, sizeof(__pyx_k__deflist), 0, 0, 1, 1},
-  {&__pyx_n_s__deflistdat, __pyx_k__deflistdat, sizeof(__pyx_k__deflistdat), 0, 0, 1, 1},
-  {&__pyx_n_s__defnum, __pyx_k__defnum, sizeof(__pyx_k__defnum), 0, 0, 1, 1},
-  {&__pyx_n_s__digitsofprecision, __pyx_k__digitsofprecision, sizeof(__pyx_k__digitsofprecision), 0, 0, 1, 1},
-  {&__pyx_n_s__drsnum, __pyx_k__drsnum, sizeof(__pyx_k__drsnum), 0, 0, 1, 1},
-  {&__pyx_n_s__drstmpl, __pyx_k__drstmpl, sizeof(__pyx_k__drstmpl), 0, 0, 1, 1},
-  {&__pyx_n_s__drtmpl, __pyx_k__drtmpl, sizeof(__pyx_k__drtmpl), 0, 0, 1, 1},
-  {&__pyx_n_s__drtmpldat, __pyx_k__drtmpldat, sizeof(__pyx_k__drtmpldat), 0, 0, 1, 1},
-  {&__pyx_n_s__drtnum, __pyx_k__drtnum, sizeof(__pyx_k__drtnum), 0, 0, 1, 1},
-  {&__pyx_n_s__dtype, __pyx_k__dtype, sizeof(__pyx_k__dtype), 0, 0, 1, 1},
-  {&__pyx_n_s__f4, __pyx_k__f4, sizeof(__pyx_k__f4), 0, 0, 1, 1},
-  {&__pyx_n_s__fcoordlist, __pyx_k__fcoordlist, sizeof(__pyx_k__fcoordlist), 0, 0, 1, 1},
-  {&__pyx_n_s__field, __pyx_k__field, sizeof(__pyx_k__field), 0, 0, 1, 1},
-  {&__pyx_n_s__fielddat, __pyx_k__fielddat, sizeof(__pyx_k__fielddat), 0, 0, 1, 1},
-  {&__pyx_n_s__fld, __pyx_k__fld, sizeof(__pyx_k__fld), 0, 0, 1, 1},
-  {&__pyx_n_s__fldmax, __pyx_k__fldmax, sizeof(__pyx_k__fldmax), 0, 0, 1, 1},
-  {&__pyx_n_s__fldmin, __pyx_k__fldmin, sizeof(__pyx_k__fldmin), 0, 0, 1, 1},
-  {&__pyx_n_s__float32, __pyx_k__float32, sizeof(__pyx_k__float32), 0, 0, 1, 1},
-  {&__pyx_n_s__format, __pyx_k__format, sizeof(__pyx_k__format), 0, 0, 1, 1},
-  {&__pyx_n_s__g, __pyx_k__g, sizeof(__pyx_k__g), 0, 0, 1, 1},
-  {&__pyx_n_s__g2clib, __pyx_k__g2clib, sizeof(__pyx_k__g2clib), 0, 0, 1, 1},
-  {&__pyx_n_s__gds, __pyx_k__gds, sizeof(__pyx_k__gds), 0, 0, 1, 1},
-  {&__pyx_n_s__gdsdat, __pyx_k__gdsdat, sizeof(__pyx_k__gdsdat), 0, 0, 1, 1},
-  {&__pyx_n_s__gdstmpl, __pyx_k__gdstmpl, sizeof(__pyx_k__gdstmpl), 0, 0, 1, 1},
-  {&__pyx_n_s__gdstmpldat, __pyx_k__gdstmpldat, sizeof(__pyx_k__gdstmpldat), 0, 0, 1, 1},
-  {&__pyx_n_s__gdtmpl, __pyx_k__gdtmpl, sizeof(__pyx_k__gdtmpl), 0, 0, 1, 1},
-  {&__pyx_n_s__gdtmpldat, __pyx_k__gdtmpldat, sizeof(__pyx_k__gdtmpldat), 0, 0, 1, 1},
-  {&__pyx_n_s__gdtnum, __pyx_k__gdtnum, sizeof(__pyx_k__gdtnum), 0, 0, 1, 1},
-  {&__pyx_n_s__grib2_addfield, __pyx_k__grib2_addfield, sizeof(__pyx_k__grib2_addfield), 0, 0, 1, 1},
-  {&__pyx_n_s__grib2_addgrid, __pyx_k__grib2_addgrid, sizeof(__pyx_k__grib2_addgrid), 0, 0, 1, 1},
-  {&__pyx_n_s__grib2_create, __pyx_k__grib2_create, sizeof(__pyx_k__grib2_create), 0, 0, 1, 1},
-  {&__pyx_n_s__grib2_end, __pyx_k__grib2_end, sizeof(__pyx_k__grib2_end), 0, 0, 1, 1},
-  {&__pyx_n_s__gribmsg, __pyx_k__gribmsg, sizeof(__pyx_k__gribmsg), 0, 0, 1, 1},
-  {&__pyx_n_s__i, __pyx_k__i, sizeof(__pyx_k__i), 0, 0, 1, 1},
-  {&__pyx_n_s__i1, __pyx_k__i1, sizeof(__pyx_k__i1), 0, 0, 1, 1},
-  {&__pyx_n_s__i4, __pyx_k__i4, sizeof(__pyx_k__i4), 0, 0, 1, 1},
-  {&__pyx_n_s__iarr, __pyx_k__iarr, sizeof(__pyx_k__iarr), 0, 0, 1, 1},
-  {&__pyx_n_s__ibitmap, __pyx_k__ibitmap, sizeof(__pyx_k__ibitmap), 0, 0, 1, 1},
-  {&__pyx_n_s__ibmap, __pyx_k__ibmap, sizeof(__pyx_k__ibmap), 0, 0, 1, 1},
-  {&__pyx_n_s__icoordlist, __pyx_k__icoordlist, sizeof(__pyx_k__icoordlist), 0, 0, 1, 1},
-  {&__pyx_n_s__idat, __pyx_k__idat, sizeof(__pyx_k__idat), 0, 0, 1, 1},
-  {&__pyx_n_s__idata, __pyx_k__idata, sizeof(__pyx_k__idata), 0, 0, 1, 1},
-  {&__pyx_n_s__ideflist, __pyx_k__ideflist, sizeof(__pyx_k__ideflist), 0, 0, 1, 1},
-  {&__pyx_n_s__idefnum, __pyx_k__idefnum, sizeof(__pyx_k__idefnum), 0, 0, 1, 1},
-  {&__pyx_n_s__idrsnum, __pyx_k__idrsnum, sizeof(__pyx_k__idrsnum), 0, 0, 1, 1},
-  {&__pyx_n_s__idrstmpl, __pyx_k__idrstmpl, sizeof(__pyx_k__idrstmpl), 0, 0, 1, 1},
-  {&__pyx_n_s__ids, __pyx_k__ids, sizeof(__pyx_k__ids), 0, 0, 1, 1},
-  {&__pyx_n_s__idsect, __pyx_k__idsect, sizeof(__pyx_k__idsect), 0, 0, 1, 1},
-  {&__pyx_n_s__idslen, __pyx_k__idslen, sizeof(__pyx_k__idslen), 0, 0, 1, 1},
-  {&__pyx_n_s__ierr, __pyx_k__ierr, sizeof(__pyx_k__ierr), 0, 0, 1, 1},
-  {&__pyx_n_s__igds, __pyx_k__igds, sizeof(__pyx_k__igds), 0, 0, 1, 1},
-  {&__pyx_n_s__igdsnum, __pyx_k__igdsnum, sizeof(__pyx_k__igdsnum), 0, 0, 1, 1},
-  {&__pyx_n_s__igdstmpl, __pyx_k__igdstmpl, sizeof(__pyx_k__igdstmpl), 0, 0, 1, 1},
-  {&__pyx_n_s__int32, __pyx_k__int32, sizeof(__pyx_k__int32), 0, 0, 1, 1},
-  {&__pyx_n_s__iofst, __pyx_k__iofst, sizeof(__pyx_k__iofst), 0, 0, 1, 1},
-  {&__pyx_n_s__ipdsnum, __pyx_k__ipdsnum, sizeof(__pyx_k__ipdsnum), 0, 0, 1, 1},
-  {&__pyx_n_s__ipdstmpl, __pyx_k__ipdstmpl, sizeof(__pyx_k__ipdstmpl), 0, 0, 1, 1},
-  {&__pyx_n_s__ipos, __pyx_k__ipos, sizeof(__pyx_k__ipos), 0, 0, 1, 1},
-  {&__pyx_n_s__isec0, __pyx_k__isec0, sizeof(__pyx_k__isec0), 0, 0, 1, 1},
-  {&__pyx_n_s__isec1, __pyx_k__isec1, sizeof(__pyx_k__isec1), 0, 0, 1, 1},
-  {&__pyx_n_s__itor_ieee, __pyx_k__itor_ieee, sizeof(__pyx_k__itor_ieee), 0, 0, 1, 1},
-  {&__pyx_n_s__lgrib, __pyx_k__lgrib, sizeof(__pyx_k__lgrib), 0, 0, 1, 1},
-  {&__pyx_n_s__listsec0, __pyx_k__listsec0, sizeof(__pyx_k__listsec0), 0, 0, 1, 1},
-  {&__pyx_n_s__listsec0dat, __pyx_k__listsec0dat, sizeof(__pyx_k__listsec0dat), 0, 0, 1, 1},
-  {&__pyx_n_s__listsec1, __pyx_k__listsec1, sizeof(__pyx_k__listsec1), 0, 0, 1, 1},
-  {&__pyx_n_s__listsec1dat, __pyx_k__listsec1dat, sizeof(__pyx_k__listsec1dat), 0, 0, 1, 1},
-  {&__pyx_n_s__log10, __pyx_k__log10, sizeof(__pyx_k__log10), 0, 0, 1, 1},
-  {&__pyx_n_s__mapdrslen, __pyx_k__mapdrslen, sizeof(__pyx_k__mapdrslen), 0, 0, 1, 1},
-  {&__pyx_n_s__mapgridlen, __pyx_k__mapgridlen, sizeof(__pyx_k__mapgridlen), 0, 0, 1, 1},
-  {&__pyx_n_s__mappdslen, __pyx_k__mappdslen, sizeof(__pyx_k__mappdslen), 0, 0, 1, 1},
-  {&__pyx_n_s__math, __pyx_k__math, sizeof(__pyx_k__math), 0, 0, 1, 1},
-  {&__pyx_n_s__minmaxstring, __pyx_k__minmaxstring, sizeof(__pyx_k__minmaxstring), 0, 0, 1, 1},
-  {&__pyx_n_s__msg, __pyx_k__msg, sizeof(__pyx_k__msg), 0, 0, 1, 1},
-  {&__pyx_n_s__n, __pyx_k__n, sizeof(__pyx_k__n), 0, 0, 1, 1},
-  {&__pyx_n_s__ndpts, __pyx_k__ndpts, sizeof(__pyx_k__ndpts), 0, 0, 1, 1},
-  {&__pyx_n_s__ngpts, __pyx_k__ngpts, sizeof(__pyx_k__ngpts), 0, 0, 1, 1},
-  {&__pyx_n_s__ngrdpts, __pyx_k__ngrdpts, sizeof(__pyx_k__ngrdpts), 0, 0, 1, 1},
-  {&__pyx_n_s__numcoord, __pyx_k__numcoord, sizeof(__pyx_k__numcoord), 0, 0, 1, 1},
-  {&__pyx_n_s__order, __pyx_k__order, sizeof(__pyx_k__order), 0, 0, 1, 1},
-  {&__pyx_n_s__pdsnum, __pyx_k__pdsnum, sizeof(__pyx_k__pdsnum), 0, 0, 1, 1},
-  {&__pyx_n_s__pdstmpl, __pyx_k__pdstmpl, sizeof(__pyx_k__pdstmpl), 0, 0, 1, 1},
-  {&__pyx_n_s__pdtmpl, __pyx_k__pdtmpl, sizeof(__pyx_k__pdtmpl), 0, 0, 1, 1},
-  {&__pyx_n_s__pdtmpldat, __pyx_k__pdtmpldat, sizeof(__pyx_k__pdtmpldat), 0, 0, 1, 1},
-  {&__pyx_n_s__pow, __pyx_k__pow, sizeof(__pyx_k__pow), 0, 0, 1, 1},
-  {&__pyx_n_s__printminmax, __pyx_k__printminmax, sizeof(__pyx_k__printminmax), 0, 0, 1, 1},
-  {&__pyx_n_s__r1, __pyx_k__r1, sizeof(__pyx_k__r1), 0, 0, 1, 1},
-  {&__pyx_n_s__rarr, __pyx_k__rarr, sizeof(__pyx_k__rarr), 0, 0, 1, 1},
-  {&__pyx_n_s__rdat, __pyx_k__rdat, sizeof(__pyx_k__rdat), 0, 0, 1, 1},
-  {&__pyx_n_s__rdata, __pyx_k__rdata, sizeof(__pyx_k__rdata), 0, 0, 1, 1},
-  {&__pyx_n_s__rmax, __pyx_k__rmax, sizeof(__pyx_k__rmax), 0, 0, 1, 1},
-  {&__pyx_n_s__rmin, __pyx_k__rmin, sizeof(__pyx_k__rmin), 0, 0, 1, 1},
-  {&__pyx_n_s__rtoi_ieee, __pyx_k__rtoi_ieee, sizeof(__pyx_k__rtoi_ieee), 0, 0, 1, 1},
-  {&__pyx_n_s__storageorder, __pyx_k__storageorder, sizeof(__pyx_k__storageorder), 0, 0, 1, 1},
-  {&__pyx_n_s__unpack1, __pyx_k__unpack1, sizeof(__pyx_k__unpack1), 0, 0, 1, 1},
-  {&__pyx_n_s__unpack3, __pyx_k__unpack3, sizeof(__pyx_k__unpack3), 0, 0, 1, 1},
-  {&__pyx_n_s__unpack4, __pyx_k__unpack4, sizeof(__pyx_k__unpack4), 0, 0, 1, 1},
-  {&__pyx_n_s__unpack5, __pyx_k__unpack5, sizeof(__pyx_k__unpack5), 0, 0, 1, 1},
-  {&__pyx_n_s__unpack6, __pyx_k__unpack6, sizeof(__pyx_k__unpack6), 0, 0, 1, 1},
-  {&__pyx_n_s__unpack7, __pyx_k__unpack7, sizeof(__pyx_k__unpack7), 0, 0, 1, 1},
-  {&__pyx_n_s__zeros, __pyx_k__zeros, sizeof(__pyx_k__zeros), 0, 0, 1, 1},
+  {&__pyx_n_s_C, __pyx_k_C, sizeof(__pyx_k_C), 0, 0, 1, 1},
+  {&__pyx_kp_s_Error_in_grib2_create_error_code, __pyx_k_Error_in_grib2_create_error_code, sizeof(__pyx_k_Error_in_grib2_create_error_code), 0, 0, 1, 0},
+  {&__pyx_kp_s_Error_unpacking_section_1_error, __pyx_k_Error_unpacking_section_1_error, sizeof(__pyx_k_Error_unpacking_section_1_error), 0, 0, 1, 0},
+  {&__pyx_kp_s_Error_unpacking_section_3_error, __pyx_k_Error_unpacking_section_3_error, sizeof(__pyx_k_Error_unpacking_section_3_error), 0, 0, 1, 0},
+  {&__pyx_kp_s_Error_unpacking_section_4_error, __pyx_k_Error_unpacking_section_4_error, sizeof(__pyx_k_Error_unpacking_section_4_error), 0, 0, 1, 0},
+  {&__pyx_kp_s_Error_unpacking_section_5_error, __pyx_k_Error_unpacking_section_5_error, sizeof(__pyx_k_Error_unpacking_section_5_error), 0, 0, 1, 0},
+  {&__pyx_kp_s_Error_unpacking_section_6_error, __pyx_k_Error_unpacking_section_6_error, sizeof(__pyx_k_Error_unpacking_section_6_error), 0, 0, 1, 0},
+  {&__pyx_kp_s_Error_unpacking_section_7_error, __pyx_k_Error_unpacking_section_7_error, sizeof(__pyx_k_Error_unpacking_section_7_error), 0, 0, 1, 0},
+  {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
+  {&__pyx_kp_s_Volumes_User_jwhitaker_python_p, __pyx_k_Volumes_User_jwhitaker_python_p, sizeof(__pyx_k_Volumes_User_jwhitaker_python_p), 0, 0, 1, 0},
+  {&__pyx_kp_s__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 0},
+  {&__pyx_kp_s__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 0, 1, 0},
+  {&__pyx_kp_b__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 0, 0, 0},
+  {&__pyx_kp_b__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 0, 0, 0},
+  {&__pyx_n_s_bitmap, __pyx_k_bitmap, sizeof(__pyx_k_bitmap), 0, 0, 1, 1},
+  {&__pyx_n_s_bitmapdat, __pyx_k_bitmapdat, sizeof(__pyx_k_bitmapdat), 0, 0, 1, 1},
+  {&__pyx_n_s_bitsofprecision, __pyx_k_bitsofprecision, sizeof(__pyx_k_bitsofprecision), 0, 0, 1, 1},
+  {&__pyx_n_s_bmap, __pyx_k_bmap, sizeof(__pyx_k_bmap), 0, 0, 1, 1},
+  {&__pyx_n_s_buflen, __pyx_k_buflen, sizeof(__pyx_k_buflen), 0, 0, 1, 1},
+  {&__pyx_n_s_bufleni, __pyx_k_bufleni, sizeof(__pyx_k_bufleni), 0, 0, 1, 1},
+  {&__pyx_n_s_buflenr, __pyx_k_buflenr, sizeof(__pyx_k_buflenr), 0, 0, 1, 1},
+  {&__pyx_n_s_ceil, __pyx_k_ceil, sizeof(__pyx_k_ceil), 0, 0, 1, 1},
+  {&__pyx_n_s_cgrib, __pyx_k_cgrib, sizeof(__pyx_k_cgrib), 0, 0, 1, 1},
+  {&__pyx_n_s_coordlist, __pyx_k_coordlist, sizeof(__pyx_k_coordlist), 0, 0, 1, 1},
+  {&__pyx_n_s_coordlistdat, __pyx_k_coordlistdat, sizeof(__pyx_k_coordlistdat), 0, 0, 1, 1},
+  {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1},
+  {&__pyx_n_s_deflist, __pyx_k_deflist, sizeof(__pyx_k_deflist), 0, 0, 1, 1},
+  {&__pyx_n_s_deflistdat, __pyx_k_deflistdat, sizeof(__pyx_k_deflistdat), 0, 0, 1, 1},
+  {&__pyx_n_s_defnum, __pyx_k_defnum, sizeof(__pyx_k_defnum), 0, 0, 1, 1},
+  {&__pyx_n_s_digitsofprecision, __pyx_k_digitsofprecision, sizeof(__pyx_k_digitsofprecision), 0, 0, 1, 1},
+  {&__pyx_n_s_drsnum, __pyx_k_drsnum, sizeof(__pyx_k_drsnum), 0, 0, 1, 1},
+  {&__pyx_n_s_drstmpl, __pyx_k_drstmpl, sizeof(__pyx_k_drstmpl), 0, 0, 1, 1},
+  {&__pyx_n_s_drtmpl, __pyx_k_drtmpl, sizeof(__pyx_k_drtmpl), 0, 0, 1, 1},
+  {&__pyx_n_s_drtmpldat, __pyx_k_drtmpldat, sizeof(__pyx_k_drtmpldat), 0, 0, 1, 1},
+  {&__pyx_n_s_drtnum, __pyx_k_drtnum, sizeof(__pyx_k_drtnum), 0, 0, 1, 1},
+  {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1},
+  {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1},
+  {&__pyx_kp_s_error_getting_buffer_for_input_i, __pyx_k_error_getting_buffer_for_input_i, sizeof(__pyx_k_error_getting_buffer_for_input_i), 0, 0, 1, 0},
+  {&__pyx_kp_s_error_getting_buffer_for_input_r, __pyx_k_error_getting_buffer_for_input_r, sizeof(__pyx_k_error_getting_buffer_for_input_r), 0, 0, 1, 0},
+  {&__pyx_kp_s_error_getting_buffer_for_output, __pyx_k_error_getting_buffer_for_output, sizeof(__pyx_k_error_getting_buffer_for_output), 0, 0, 1, 0},
+  {&__pyx_kp_s_error_getting_buffer_for_output_2, __pyx_k_error_getting_buffer_for_output_2, sizeof(__pyx_k_error_getting_buffer_for_output_2), 0, 0, 1, 0},
+  {&__pyx_kp_s_error_in_grib2_addfield_error_co, __pyx_k_error_in_grib2_addfield_error_co, sizeof(__pyx_k_error_in_grib2_addfield_error_co), 0, 0, 1, 0},
+  {&__pyx_kp_s_error_in_grib2_addgrid_error_cod, __pyx_k_error_in_grib2_addgrid_error_cod, sizeof(__pyx_k_error_in_grib2_addgrid_error_cod), 0, 0, 1, 0},
+  {&__pyx_kp_s_error_in_grib2_end_error_code_i, __pyx_k_error_in_grib2_end_error_code_i, sizeof(__pyx_k_error_in_grib2_end_error_code_i), 0, 0, 1, 0},
+  {&__pyx_n_s_f4, __pyx_k_f4, sizeof(__pyx_k_f4), 0, 0, 1, 1},
+  {&__pyx_n_s_fcoordlist, __pyx_k_fcoordlist, sizeof(__pyx_k_fcoordlist), 0, 0, 1, 1},
+  {&__pyx_n_s_field, __pyx_k_field, sizeof(__pyx_k_field), 0, 0, 1, 1},
+  {&__pyx_n_s_fielddat, __pyx_k_fielddat, sizeof(__pyx_k_fielddat), 0, 0, 1, 1},
+  {&__pyx_n_s_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1},
+  {&__pyx_n_s_fld, __pyx_k_fld, sizeof(__pyx_k_fld), 0, 0, 1, 1},
+  {&__pyx_n_s_fldmax, __pyx_k_fldmax, sizeof(__pyx_k_fldmax), 0, 0, 1, 1},
+  {&__pyx_n_s_fldmin, __pyx_k_fldmin, sizeof(__pyx_k_fldmin), 0, 0, 1, 1},
+  {&__pyx_n_s_float32, __pyx_k_float32, sizeof(__pyx_k_float32), 0, 0, 1, 1},
+  {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
+  {&__pyx_n_s_g, __pyx_k_g, sizeof(__pyx_k_g), 0, 0, 1, 1},
+  {&__pyx_n_s_g2clib, __pyx_k_g2clib, sizeof(__pyx_k_g2clib), 0, 0, 1, 1},
+  {&__pyx_n_s_gds, __pyx_k_gds, sizeof(__pyx_k_gds), 0, 0, 1, 1},
+  {&__pyx_n_s_gdsdat, __pyx_k_gdsdat, sizeof(__pyx_k_gdsdat), 0, 0, 1, 1},
+  {&__pyx_n_s_gdstmpl, __pyx_k_gdstmpl, sizeof(__pyx_k_gdstmpl), 0, 0, 1, 1},
+  {&__pyx_n_s_gdstmpldat, __pyx_k_gdstmpldat, sizeof(__pyx_k_gdstmpldat), 0, 0, 1, 1},
+  {&__pyx_n_s_gdtmpl, __pyx_k_gdtmpl, sizeof(__pyx_k_gdtmpl), 0, 0, 1, 1},
+  {&__pyx_n_s_gdtmpldat, __pyx_k_gdtmpldat, sizeof(__pyx_k_gdtmpldat), 0, 0, 1, 1},
+  {&__pyx_n_s_gdtnum, __pyx_k_gdtnum, sizeof(__pyx_k_gdtnum), 0, 0, 1, 1},
+  {&__pyx_n_s_grib2_addfield, __pyx_k_grib2_addfield, sizeof(__pyx_k_grib2_addfield), 0, 0, 1, 1},
+  {&__pyx_n_s_grib2_addgrid, __pyx_k_grib2_addgrid, sizeof(__pyx_k_grib2_addgrid), 0, 0, 1, 1},
+  {&__pyx_n_s_grib2_create, __pyx_k_grib2_create, sizeof(__pyx_k_grib2_create), 0, 0, 1, 1},
+  {&__pyx_n_s_grib2_end, __pyx_k_grib2_end, sizeof(__pyx_k_grib2_end), 0, 0, 1, 1},
+  {&__pyx_n_s_gribmsg, __pyx_k_gribmsg, sizeof(__pyx_k_gribmsg), 0, 0, 1, 1},
+  {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
+  {&__pyx_n_s_i1, __pyx_k_i1, sizeof(__pyx_k_i1), 0, 0, 1, 1},
+  {&__pyx_n_s_i4, __pyx_k_i4, sizeof(__pyx_k_i4), 0, 0, 1, 1},
+  {&__pyx_n_s_iarr, __pyx_k_iarr, sizeof(__pyx_k_iarr), 0, 0, 1, 1},
+  {&__pyx_n_s_ibitmap, __pyx_k_ibitmap, sizeof(__pyx_k_ibitmap), 0, 0, 1, 1},
+  {&__pyx_n_s_ibmap, __pyx_k_ibmap, sizeof(__pyx_k_ibmap), 0, 0, 1, 1},
+  {&__pyx_n_s_icoordlist, __pyx_k_icoordlist, sizeof(__pyx_k_icoordlist), 0, 0, 1, 1},
+  {&__pyx_n_s_idat, __pyx_k_idat, sizeof(__pyx_k_idat), 0, 0, 1, 1},
+  {&__pyx_n_s_idata, __pyx_k_idata, sizeof(__pyx_k_idata), 0, 0, 1, 1},
+  {&__pyx_n_s_ideflist, __pyx_k_ideflist, sizeof(__pyx_k_ideflist), 0, 0, 1, 1},
+  {&__pyx_n_s_idefnum, __pyx_k_idefnum, sizeof(__pyx_k_idefnum), 0, 0, 1, 1},
+  {&__pyx_n_s_idrsnum, __pyx_k_idrsnum, sizeof(__pyx_k_idrsnum), 0, 0, 1, 1},
+  {&__pyx_n_s_idrstmpl, __pyx_k_idrstmpl, sizeof(__pyx_k_idrstmpl), 0, 0, 1, 1},
+  {&__pyx_n_s_ids, __pyx_k_ids, sizeof(__pyx_k_ids), 0, 0, 1, 1},
+  {&__pyx_n_s_idsect, __pyx_k_idsect, sizeof(__pyx_k_idsect), 0, 0, 1, 1},
+  {&__pyx_n_s_idslen, __pyx_k_idslen, sizeof(__pyx_k_idslen), 0, 0, 1, 1},
+  {&__pyx_n_s_ierr, __pyx_k_ierr, sizeof(__pyx_k_ierr), 0, 0, 1, 1},
+  {&__pyx_n_s_igds, __pyx_k_igds, sizeof(__pyx_k_igds), 0, 0, 1, 1},
+  {&__pyx_n_s_igdsnum, __pyx_k_igdsnum, sizeof(__pyx_k_igdsnum), 0, 0, 1, 1},
+  {&__pyx_n_s_igdstmpl, __pyx_k_igdstmpl, sizeof(__pyx_k_igdstmpl), 0, 0, 1, 1},
+  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
+  {&__pyx_n_s_int32, __pyx_k_int32, sizeof(__pyx_k_int32), 0, 0, 1, 1},
+  {&__pyx_kp_s_integer_output_array_must_be_as, __pyx_k_integer_output_array_must_be_as, sizeof(__pyx_k_integer_output_array_must_be_as), 0, 0, 1, 0},
+  {&__pyx_n_s_iofst, __pyx_k_iofst, sizeof(__pyx_k_iofst), 0, 0, 1, 1},
+  {&__pyx_n_s_ipdsnum, __pyx_k_ipdsnum, sizeof(__pyx_k_ipdsnum), 0, 0, 1, 1},
+  {&__pyx_n_s_ipdstmpl, __pyx_k_ipdstmpl, sizeof(__pyx_k_ipdstmpl), 0, 0, 1, 1},
+  {&__pyx_n_s_ipos, __pyx_k_ipos, sizeof(__pyx_k_ipos), 0, 0, 1, 1},
+  {&__pyx_n_s_isec0, __pyx_k_isec0, sizeof(__pyx_k_isec0), 0, 0, 1, 1},
+  {&__pyx_n_s_isec1, __pyx_k_isec1, sizeof(__pyx_k_isec1), 0, 0, 1, 1},
+  {&__pyx_n_s_itor_ieee, __pyx_k_itor_ieee, sizeof(__pyx_k_itor_ieee), 0, 0, 1, 1},
+  {&__pyx_n_s_lgrib, __pyx_k_lgrib, sizeof(__pyx_k_lgrib), 0, 0, 1, 1},
+  {&__pyx_n_s_listsec0, __pyx_k_listsec0, sizeof(__pyx_k_listsec0), 0, 0, 1, 1},
+  {&__pyx_n_s_listsec0dat, __pyx_k_listsec0dat, sizeof(__pyx_k_listsec0dat), 0, 0, 1, 1},
+  {&__pyx_n_s_listsec1, __pyx_k_listsec1, sizeof(__pyx_k_listsec1), 0, 0, 1, 1},
+  {&__pyx_n_s_listsec1dat, __pyx_k_listsec1dat, sizeof(__pyx_k_listsec1dat), 0, 0, 1, 1},
+  {&__pyx_n_s_log10, __pyx_k_log10, sizeof(__pyx_k_log10), 0, 0, 1, 1},
+  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
+  {&__pyx_n_s_mapdrslen, __pyx_k_mapdrslen, sizeof(__pyx_k_mapdrslen), 0, 0, 1, 1},
+  {&__pyx_n_s_mapgridlen, __pyx_k_mapgridlen, sizeof(__pyx_k_mapgridlen), 0, 0, 1, 1},
+  {&__pyx_n_s_mappdslen, __pyx_k_mappdslen, sizeof(__pyx_k_mappdslen), 0, 0, 1, 1},
+  {&__pyx_n_s_math, __pyx_k_math, sizeof(__pyx_k_math), 0, 0, 1, 1},
+  {&__pyx_kp_s_min_max, __pyx_k_min_max, sizeof(__pyx_k_min_max), 0, 0, 1, 0},
+  {&__pyx_n_s_minmaxstring, __pyx_k_minmaxstring, sizeof(__pyx_k_minmaxstring), 0, 0, 1, 1},
+  {&__pyx_n_s_msg, __pyx_k_msg, sizeof(__pyx_k_msg), 0, 0, 1, 1},
+  {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1},
+  {&__pyx_n_s_ndpts, __pyx_k_ndpts, sizeof(__pyx_k_ndpts), 0, 0, 1, 1},
+  {&__pyx_n_s_ngpts, __pyx_k_ngpts, sizeof(__pyx_k_ngpts), 0, 0, 1, 1},
+  {&__pyx_n_s_ngrdpts, __pyx_k_ngrdpts, sizeof(__pyx_k_ngrdpts), 0, 0, 1, 1},
+  {&__pyx_n_s_numcoord, __pyx_k_numcoord, sizeof(__pyx_k_numcoord), 0, 0, 1, 1},
+  {&__pyx_n_s_order, __pyx_k_order, sizeof(__pyx_k_order), 0, 0, 1, 1},
+  {&__pyx_n_s_pdsnum, __pyx_k_pdsnum, sizeof(__pyx_k_pdsnum), 0, 0, 1, 1},
+  {&__pyx_n_s_pdstmpl, __pyx_k_pdstmpl, sizeof(__pyx_k_pdstmpl), 0, 0, 1, 1},
+  {&__pyx_n_s_pdtmpl, __pyx_k_pdtmpl, sizeof(__pyx_k_pdtmpl), 0, 0, 1, 1},
+  {&__pyx_n_s_pdtmpldat, __pyx_k_pdtmpldat, sizeof(__pyx_k_pdtmpldat), 0, 0, 1, 1},
+  {&__pyx_n_s_pow, __pyx_k_pow, sizeof(__pyx_k_pow), 0, 0, 1, 1},
+  {&__pyx_n_s_print, __pyx_k_print, sizeof(__pyx_k_print), 0, 0, 1, 1},
+  {&__pyx_n_s_printminmax, __pyx_k_printminmax, sizeof(__pyx_k_printminmax), 0, 0, 1, 1},
+  {&__pyx_n_s_r1, __pyx_k_r1, sizeof(__pyx_k_r1), 0, 0, 1, 1},
+  {&__pyx_n_s_rarr, __pyx_k_rarr, sizeof(__pyx_k_rarr), 0, 0, 1, 1},
+  {&__pyx_n_s_rdat, __pyx_k_rdat, sizeof(__pyx_k_rdat), 0, 0, 1, 1},
+  {&__pyx_n_s_rdata, __pyx_k_rdata, sizeof(__pyx_k_rdata), 0, 0, 1, 1},
+  {&__pyx_kp_s_real_output_array_must_be_as_lea, __pyx_k_real_output_array_must_be_as_lea, sizeof(__pyx_k_real_output_array_must_be_as_lea), 0, 0, 1, 0},
+  {&__pyx_n_s_rmax, __pyx_k_rmax, sizeof(__pyx_k_rmax), 0, 0, 1, 1},
+  {&__pyx_n_s_rmin, __pyx_k_rmin, sizeof(__pyx_k_rmin), 0, 0, 1, 1},
+  {&__pyx_n_s_rtoi_ieee, __pyx_k_rtoi_ieee, sizeof(__pyx_k_rtoi_ieee), 0, 0, 1, 1},
+  {&__pyx_n_s_storageorder, __pyx_k_storageorder, sizeof(__pyx_k_storageorder), 0, 0, 1, 1},
+  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
+  {&__pyx_kp_s_unknown_array_type_s, __pyx_k_unknown_array_type_s, sizeof(__pyx_k_unknown_array_type_s), 0, 0, 1, 0},
+  {&__pyx_n_s_unpack1, __pyx_k_unpack1, sizeof(__pyx_k_unpack1), 0, 0, 1, 1},
+  {&__pyx_n_s_unpack3, __pyx_k_unpack3, sizeof(__pyx_k_unpack3), 0, 0, 1, 1},
+  {&__pyx_n_s_unpack4, __pyx_k_unpack4, sizeof(__pyx_k_unpack4), 0, 0, 1, 1},
+  {&__pyx_n_s_unpack5, __pyx_k_unpack5, sizeof(__pyx_k_unpack5), 0, 0, 1, 1},
+  {&__pyx_n_s_unpack6, __pyx_k_unpack6, sizeof(__pyx_k_unpack6), 0, 0, 1, 1},
+  {&__pyx_n_s_unpack7, __pyx_k_unpack7, sizeof(__pyx_k_unpack7), 0, 0, 1, 1},
+  {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1},
   {0, 0, 0, 0, 0, 0, 0}
 };
 static int __Pyx_InitCachedBuiltins(void) {
-  __pyx_builtin_RuntimeError = __Pyx_GetName(__pyx_b, __pyx_n_s__RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   return 0;
   __pyx_L1_error:;
   return -1;
@@ -4910,22 +5270,16 @@ static int __Pyx_InitCachedConstants(void) {
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
 
-  /* "g2clib.pyx":232
+  /* "g2clib.pyx":238
  * 
  *     gdtmpl = _toarray(igdstmpl, zeros(mapgridlen, 'i4'))
  *     gds = _toarray(igds, zeros(5, 'i4'))             # <<<<<<<<<<<<<<
  *     deflist = _toarray(ideflist, zeros(idefnum, 'i4'))
  * 
  */
-  __pyx_k_tuple_10 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_10);
-  __Pyx_INCREF(__pyx_int_5);
-  PyTuple_SET_ITEM(__pyx_k_tuple_10, 0, __pyx_int_5);
-  __Pyx_GIVEREF(__pyx_int_5);
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__i4));
-  PyTuple_SET_ITEM(__pyx_k_tuple_10, 1, ((PyObject *)__pyx_n_s__i4));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__i4));
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_10));
+  __pyx_tuple_ = PyTuple_Pack(2, __pyx_int_5, __pyx_n_s_i4); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple_);
+  __Pyx_GIVEREF(__pyx_tuple_);
 
   /* "g2clib.pyx":55
  * # routines for convert to/from IEEE integers.
@@ -4934,667 +5288,142 @@ static int __Pyx_InitCachedConstants(void) {
  *     """
  *  Converts a float32 array into an int32 array of IEEE formatted values
  */
-  __pyx_k_tuple_26 = PyTuple_New(10); if (unlikely(!__pyx_k_tuple_26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_26);
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__rarr));
-  PyTuple_SET_ITEM(__pyx_k_tuple_26, 0, ((PyObject *)__pyx_n_s__rarr));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__rarr));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__iarr));
-  PyTuple_SET_ITEM(__pyx_k_tuple_26, 1, ((PyObject *)__pyx_n_s__iarr));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__iarr));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__rdat));
-  PyTuple_SET_ITEM(__pyx_k_tuple_26, 2, ((PyObject *)__pyx_n_s__rdat));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__rdat));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__idat));
-  PyTuple_SET_ITEM(__pyx_k_tuple_26, 3, ((PyObject *)__pyx_n_s__idat));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__idat));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__rdata));
-  PyTuple_SET_ITEM(__pyx_k_tuple_26, 4, ((PyObject *)__pyx_n_s__rdata));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__rdata));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__r1));
-  PyTuple_SET_ITEM(__pyx_k_tuple_26, 5, ((PyObject *)__pyx_n_s__r1));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__r1));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__idata));
-  PyTuple_SET_ITEM(__pyx_k_tuple_26, 6, ((PyObject *)__pyx_n_s__idata));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__idata));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__i1));
-  PyTuple_SET_ITEM(__pyx_k_tuple_26, 7, ((PyObject *)__pyx_n_s__i1));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__i1));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__bufleni));
-  PyTuple_SET_ITEM(__pyx_k_tuple_26, 8, ((PyObject *)__pyx_n_s__bufleni));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__bufleni));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__buflenr));
-  PyTuple_SET_ITEM(__pyx_k_tuple_26, 9, ((PyObject *)__pyx_n_s__buflenr));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__buflenr));
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_26));
-  __pyx_k_codeobj_27 = (PyObject*)__Pyx_PyCode_New(2, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_26, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_28, __pyx_n_s__rtoi_ieee, 55, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_tuple__6 = PyTuple_Pack(10, __pyx_n_s_rarr, __pyx_n_s_iarr, __pyx_n_s_rdat, __pyx_n_s_idat, __pyx_n_s_rdata, __pyx_n_s_r1, __pyx_n_s_idata, __pyx_n_s_i1, __pyx_n_s_bufleni, __pyx_n_s_buflenr); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__6);
+  __Pyx_GIVEREF(__pyx_tuple__6);
+  __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(2, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Volumes_User_jwhitaker_python_p, __pyx_n_s_rtoi_ieee, 55, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
-  /* "g2clib.pyx":73
+  /* "g2clib.pyx":76
  *     mkieee(rdata, idata, buflenr/4)
  * 
  * def itor_ieee(object iarr, object rarr):             # <<<<<<<<<<<<<<
  *     """
  *  Converts an int32 array of IEEE values into a float32 array.
  */
-  __pyx_k_tuple_29 = PyTuple_New(8); if (unlikely(!__pyx_k_tuple_29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_29);
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__iarr));
-  PyTuple_SET_ITEM(__pyx_k_tuple_29, 0, ((PyObject *)__pyx_n_s__iarr));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__iarr));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__rarr));
-  PyTuple_SET_ITEM(__pyx_k_tuple_29, 1, ((PyObject *)__pyx_n_s__rarr));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__rarr));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__rdat));
-  PyTuple_SET_ITEM(__pyx_k_tuple_29, 2, ((PyObject *)__pyx_n_s__rdat));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__rdat));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__idat));
-  PyTuple_SET_ITEM(__pyx_k_tuple_29, 3, ((PyObject *)__pyx_n_s__idat));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__idat));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__rdata));
-  PyTuple_SET_ITEM(__pyx_k_tuple_29, 4, ((PyObject *)__pyx_n_s__rdata));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__rdata));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__idata));
-  PyTuple_SET_ITEM(__pyx_k_tuple_29, 5, ((PyObject *)__pyx_n_s__idata));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__idata));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__bufleni));
-  PyTuple_SET_ITEM(__pyx_k_tuple_29, 6, ((PyObject *)__pyx_n_s__bufleni));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__bufleni));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__buflenr));
-  PyTuple_SET_ITEM(__pyx_k_tuple_29, 7, ((PyObject *)__pyx_n_s__buflenr));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__buflenr));
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_29));
-  __pyx_k_codeobj_30 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_28, __pyx_n_s__itor_ieee, 73, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "g2clib.pyx":123
+  __pyx_tuple__8 = PyTuple_Pack(8, __pyx_n_s_iarr, __pyx_n_s_rarr, __pyx_n_s_rdat, __pyx_n_s_idat, __pyx_n_s_rdata, __pyx_n_s_idata, __pyx_n_s_bufleni, __pyx_n_s_buflenr); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__8);
+  __Pyx_GIVEREF(__pyx_tuple__8);
+  __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Volumes_User_jwhitaker_python_p, __pyx_n_s_itor_ieee, 76, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+  /* "g2clib.pyx":127
  * # routines for reading grib2 files.
  * 
  * def unpack1(gribmsg, ipos, object zeros):             # <<<<<<<<<<<<<<
  *     """              .      .    .                                       .
  *  Unpacks Section 1 (Identification Section) as defined in GRIB Edition 2.
  */
-  __pyx_k_tuple_31 = PyTuple_New(11); if (unlikely(!__pyx_k_tuple_31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_31);
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__gribmsg));
-  PyTuple_SET_ITEM(__pyx_k_tuple_31, 0, ((PyObject *)__pyx_n_s__gribmsg));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__gribmsg));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__ipos));
-  PyTuple_SET_ITEM(__pyx_k_tuple_31, 1, ((PyObject *)__pyx_n_s__ipos));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ipos));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__zeros));
-  PyTuple_SET_ITEM(__pyx_k_tuple_31, 2, ((PyObject *)__pyx_n_s__zeros));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__zeros));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__cgrib));
-  PyTuple_SET_ITEM(__pyx_k_tuple_31, 3, ((PyObject *)__pyx_n_s__cgrib));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__cgrib));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__i));
-  PyTuple_SET_ITEM(__pyx_k_tuple_31, 4, ((PyObject *)__pyx_n_s__i));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__i));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__iofst));
-  PyTuple_SET_ITEM(__pyx_k_tuple_31, 5, ((PyObject *)__pyx_n_s__iofst));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__iofst));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__ierr));
-  PyTuple_SET_ITEM(__pyx_k_tuple_31, 6, ((PyObject *)__pyx_n_s__ierr));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ierr));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__idslen));
-  PyTuple_SET_ITEM(__pyx_k_tuple_31, 7, ((PyObject *)__pyx_n_s__idslen));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__idslen));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__ids));
-  PyTuple_SET_ITEM(__pyx_k_tuple_31, 8, ((PyObject *)__pyx_n_s__ids));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ids));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__msg));
-  PyTuple_SET_ITEM(__pyx_k_tuple_31, 9, ((PyObject *)__pyx_n_s__msg));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__msg));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__idsect));
-  PyTuple_SET_ITEM(__pyx_k_tuple_31, 10, ((PyObject *)__pyx_n_s__idsect));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__idsect));
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_31));
-  __pyx_k_codeobj_32 = (PyObject*)__Pyx_PyCode_New(3, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_28, __pyx_n_s__unpack1, 123, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_tuple__10 = PyTuple_Pack(11, __pyx_n_s_gribmsg, __pyx_n_s_ipos, __pyx_n_s_zeros, __pyx_n_s_cgrib, __pyx_n_s_i, __pyx_n_s_iofst, __pyx_n_s_ierr, __pyx_n_s_idslen, __pyx_n_s_ids, __pyx_n_s_msg, __pyx_n_s_idsect); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__10);
+  __Pyx_GIVEREF(__pyx_tuple__10);
+  __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(3, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Volumes_User_jwhitaker_python_p, __pyx_n_s_unpack1, 127, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
-  /* "g2clib.pyx":177
+  /* "g2clib.pyx":181
  * 
  * 
  * def unpack3(gribmsg, ipos, object zeros):             # <<<<<<<<<<<<<<
  *     """
  *  Unpacks Section 3 (Grid Definition Section) as defined in GRIB Edition 2.
  */
-  __pyx_k_tuple_33 = PyTuple_New(15); if (unlikely(!__pyx_k_tuple_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_33);
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__gribmsg));
-  PyTuple_SET_ITEM(__pyx_k_tuple_33, 0, ((PyObject *)__pyx_n_s__gribmsg));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__gribmsg));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__ipos));
-  PyTuple_SET_ITEM(__pyx_k_tuple_33, 1, ((PyObject *)__pyx_n_s__ipos));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ipos));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__zeros));
-  PyTuple_SET_ITEM(__pyx_k_tuple_33, 2, ((PyObject *)__pyx_n_s__zeros));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__zeros));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__cgrib));
-  PyTuple_SET_ITEM(__pyx_k_tuple_33, 3, ((PyObject *)__pyx_n_s__cgrib));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__cgrib));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__igds));
-  PyTuple_SET_ITEM(__pyx_k_tuple_33, 4, ((PyObject *)__pyx_n_s__igds));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__igds));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__igdstmpl));
-  PyTuple_SET_ITEM(__pyx_k_tuple_33, 5, ((PyObject *)__pyx_n_s__igdstmpl));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__igdstmpl));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__ideflist));
-  PyTuple_SET_ITEM(__pyx_k_tuple_33, 6, ((PyObject *)__pyx_n_s__ideflist));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ideflist));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__mapgridlen));
-  PyTuple_SET_ITEM(__pyx_k_tuple_33, 7, ((PyObject *)__pyx_n_s__mapgridlen));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__mapgridlen));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__iofst));
-  PyTuple_SET_ITEM(__pyx_k_tuple_33, 8, ((PyObject *)__pyx_n_s__iofst));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__iofst));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__idefnum));
-  PyTuple_SET_ITEM(__pyx_k_tuple_33, 9, ((PyObject *)__pyx_n_s__idefnum));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__idefnum));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__ierr));
-  PyTuple_SET_ITEM(__pyx_k_tuple_33, 10, ((PyObject *)__pyx_n_s__ierr));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ierr));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__msg));
-  PyTuple_SET_ITEM(__pyx_k_tuple_33, 11, ((PyObject *)__pyx_n_s__msg));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__msg));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__gdtmpl));
-  PyTuple_SET_ITEM(__pyx_k_tuple_33, 12, ((PyObject *)__pyx_n_s__gdtmpl));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__gdtmpl));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__gds));
-  PyTuple_SET_ITEM(__pyx_k_tuple_33, 13, ((PyObject *)__pyx_n_s__gds));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__gds));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__deflist));
-  PyTuple_SET_ITEM(__pyx_k_tuple_33, 14, ((PyObject *)__pyx_n_s__deflist));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__deflist));
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_33));
-  __pyx_k_codeobj_34 = (PyObject*)__Pyx_PyCode_New(3, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_28, __pyx_n_s__unpack3, 177, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_tuple__12 = PyTuple_Pack(15, __pyx_n_s_gribmsg, __pyx_n_s_ipos, __pyx_n_s_zeros, __pyx_n_s_cgrib, __pyx_n_s_igds, __pyx_n_s_igdstmpl, __pyx_n_s_ideflist, __pyx_n_s_mapgridlen, __pyx_n_s_iofst, __pyx_n_s_idefnum, __pyx_n_s_ierr, __pyx_n_s_msg, __pyx_n_s_gdtmpl, __pyx_n_s_gds, __pyx_n_s_deflist); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__12);
+  __Pyx_GIVEREF(__pyx_tuple__12);
+  __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(3, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Volumes_User_jwhitaker_python_p, __pyx_n_s_unpack3, 181, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
-  /* "g2clib.pyx":237
+  /* "g2clib.pyx":243
  *     return gds,gdtmpl,deflist,iofst/8
  * 
  * def unpack4(gribmsg,ipos,object zeros):             # <<<<<<<<<<<<<<
  *     """
  *  Unpacks Section 4 (Product Definition Section) as defined in GRIB Edition 2.
  */
-  __pyx_k_tuple_35 = PyTuple_New(14); if (unlikely(!__pyx_k_tuple_35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_35);
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__gribmsg));
-  PyTuple_SET_ITEM(__pyx_k_tuple_35, 0, ((PyObject *)__pyx_n_s__gribmsg));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__gribmsg));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__ipos));
-  PyTuple_SET_ITEM(__pyx_k_tuple_35, 1, ((PyObject *)__pyx_n_s__ipos));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ipos));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__zeros));
-  PyTuple_SET_ITEM(__pyx_k_tuple_35, 2, ((PyObject *)__pyx_n_s__zeros));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__zeros));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__cgrib));
-  PyTuple_SET_ITEM(__pyx_k_tuple_35, 3, ((PyObject *)__pyx_n_s__cgrib));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__cgrib));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__ipdstmpl));
-  PyTuple_SET_ITEM(__pyx_k_tuple_35, 4, ((PyObject *)__pyx_n_s__ipdstmpl));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ipdstmpl));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__icoordlist));
-  PyTuple_SET_ITEM(__pyx_k_tuple_35, 5, ((PyObject *)__pyx_n_s__icoordlist));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__icoordlist));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__mappdslen));
-  PyTuple_SET_ITEM(__pyx_k_tuple_35, 6, ((PyObject *)__pyx_n_s__mappdslen));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__mappdslen));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__iofst));
-  PyTuple_SET_ITEM(__pyx_k_tuple_35, 7, ((PyObject *)__pyx_n_s__iofst));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__iofst));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__ipdsnum));
-  PyTuple_SET_ITEM(__pyx_k_tuple_35, 8, ((PyObject *)__pyx_n_s__ipdsnum));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ipdsnum));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__ierr));
-  PyTuple_SET_ITEM(__pyx_k_tuple_35, 9, ((PyObject *)__pyx_n_s__ierr));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ierr));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__numcoord));
-  PyTuple_SET_ITEM(__pyx_k_tuple_35, 10, ((PyObject *)__pyx_n_s__numcoord));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__numcoord));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__msg));
-  PyTuple_SET_ITEM(__pyx_k_tuple_35, 11, ((PyObject *)__pyx_n_s__msg));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__msg));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__pdtmpl));
-  PyTuple_SET_ITEM(__pyx_k_tuple_35, 12, ((PyObject *)__pyx_n_s__pdtmpl));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__pdtmpl));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__coordlist));
-  PyTuple_SET_ITEM(__pyx_k_tuple_35, 13, ((PyObject *)__pyx_n_s__coordlist));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__coordlist));
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_35));
-  __pyx_k_codeobj_36 = (PyObject*)__Pyx_PyCode_New(3, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_28, __pyx_n_s__unpack4, 237, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_36)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "g2clib.pyx":287
+  __pyx_tuple__14 = PyTuple_Pack(14, __pyx_n_s_gribmsg, __pyx_n_s_ipos, __pyx_n_s_zeros, __pyx_n_s_cgrib, __pyx_n_s_ipdstmpl, __pyx_n_s_icoordlist, __pyx_n_s_mappdslen, __pyx_n_s_iofst, __pyx_n_s_ipdsnum, __pyx_n_s_ierr, __pyx_n_s_numcoord, __pyx_n_s_msg, __pyx_n_s_pdtmpl, __pyx_n_s_coordlist); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__14);
+  __Pyx_GIVEREF(__pyx_tuple__14);
+  __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(3, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Volumes_User_jwhitaker_python_p, __pyx_n_s_unpack4, 243, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+  /* "g2clib.pyx":293
  *     return pdtmpl,ipdsnum,coordlist,iofst/8
  * 
  * def unpack5(gribmsg,ipos,object zeros):             # <<<<<<<<<<<<<<
  *     """
  *  Unpacks Section 5 (Data Representation Section) as defined in GRIB Edition 2.
  */
-  __pyx_k_tuple_37 = PyTuple_New(12); if (unlikely(!__pyx_k_tuple_37)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_37);
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__gribmsg));
-  PyTuple_SET_ITEM(__pyx_k_tuple_37, 0, ((PyObject *)__pyx_n_s__gribmsg));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__gribmsg));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__ipos));
-  PyTuple_SET_ITEM(__pyx_k_tuple_37, 1, ((PyObject *)__pyx_n_s__ipos));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ipos));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__zeros));
-  PyTuple_SET_ITEM(__pyx_k_tuple_37, 2, ((PyObject *)__pyx_n_s__zeros));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__zeros));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__cgrib));
-  PyTuple_SET_ITEM(__pyx_k_tuple_37, 3, ((PyObject *)__pyx_n_s__cgrib));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__cgrib));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__idrstmpl));
-  PyTuple_SET_ITEM(__pyx_k_tuple_37, 4, ((PyObject *)__pyx_n_s__idrstmpl));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__idrstmpl));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__iofst));
-  PyTuple_SET_ITEM(__pyx_k_tuple_37, 5, ((PyObject *)__pyx_n_s__iofst));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__iofst));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__ierr));
-  PyTuple_SET_ITEM(__pyx_k_tuple_37, 6, ((PyObject *)__pyx_n_s__ierr));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ierr));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__ndpts));
-  PyTuple_SET_ITEM(__pyx_k_tuple_37, 7, ((PyObject *)__pyx_n_s__ndpts));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ndpts));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__idrsnum));
-  PyTuple_SET_ITEM(__pyx_k_tuple_37, 8, ((PyObject *)__pyx_n_s__idrsnum));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__idrsnum));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__mapdrslen));
-  PyTuple_SET_ITEM(__pyx_k_tuple_37, 9, ((PyObject *)__pyx_n_s__mapdrslen));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__mapdrslen));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__msg));
-  PyTuple_SET_ITEM(__pyx_k_tuple_37, 10, ((PyObject *)__pyx_n_s__msg));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__msg));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__drtmpl));
-  PyTuple_SET_ITEM(__pyx_k_tuple_37, 11, ((PyObject *)__pyx_n_s__drtmpl));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__drtmpl));
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_37));
-  __pyx_k_codeobj_38 = (PyObject*)__Pyx_PyCode_New(3, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_28, __pyx_n_s__unpack5, 287, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_38)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "g2clib.pyx":331
+  __pyx_tuple__16 = PyTuple_Pack(12, __pyx_n_s_gribmsg, __pyx_n_s_ipos, __pyx_n_s_zeros, __pyx_n_s_cgrib, __pyx_n_s_idrstmpl, __pyx_n_s_iofst, __pyx_n_s_ierr, __pyx_n_s_ndpts, __pyx_n_s_idrsnum, __pyx_n_s_mapdrslen, __pyx_n_s_msg, __pyx_n_s_drtmpl); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__16);
+  __Pyx_GIVEREF(__pyx_tuple__16);
+  __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(3, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Volumes_User_jwhitaker_python_p, __pyx_n_s_unpack5, 293, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+  /* "g2clib.pyx":337
  *     return drtmpl,idrsnum,ndpts,iofst/8
  * 
  * def unpack6(gribmsg,ndpts,ipos,object zeros):             # <<<<<<<<<<<<<<
  *     """
  *  Unpacks Section 6 (Bit-Map Section) as defined in GRIB Edition 2.
  */
-  __pyx_k_tuple_39 = PyTuple_New(12); if (unlikely(!__pyx_k_tuple_39)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_39);
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__gribmsg));
-  PyTuple_SET_ITEM(__pyx_k_tuple_39, 0, ((PyObject *)__pyx_n_s__gribmsg));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__gribmsg));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__ndpts));
-  PyTuple_SET_ITEM(__pyx_k_tuple_39, 1, ((PyObject *)__pyx_n_s__ndpts));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ndpts));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__ipos));
-  PyTuple_SET_ITEM(__pyx_k_tuple_39, 2, ((PyObject *)__pyx_n_s__ipos));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ipos));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__zeros));
-  PyTuple_SET_ITEM(__pyx_k_tuple_39, 3, ((PyObject *)__pyx_n_s__zeros));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__zeros));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__bitmap));
-  PyTuple_SET_ITEM(__pyx_k_tuple_39, 4, ((PyObject *)__pyx_n_s__bitmap));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__bitmap));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__cgrib));
-  PyTuple_SET_ITEM(__pyx_k_tuple_39, 5, ((PyObject *)__pyx_n_s__cgrib));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__cgrib));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__iofst));
-  PyTuple_SET_ITEM(__pyx_k_tuple_39, 6, ((PyObject *)__pyx_n_s__iofst));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__iofst));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__ierr));
-  PyTuple_SET_ITEM(__pyx_k_tuple_39, 7, ((PyObject *)__pyx_n_s__ierr));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ierr));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__ngpts));
-  PyTuple_SET_ITEM(__pyx_k_tuple_39, 8, ((PyObject *)__pyx_n_s__ngpts));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ngpts));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__ibmap));
-  PyTuple_SET_ITEM(__pyx_k_tuple_39, 9, ((PyObject *)__pyx_n_s__ibmap));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ibmap));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__bmap));
-  PyTuple_SET_ITEM(__pyx_k_tuple_39, 10, ((PyObject *)__pyx_n_s__bmap));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__bmap));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__msg));
-  PyTuple_SET_ITEM(__pyx_k_tuple_39, 11, ((PyObject *)__pyx_n_s__msg));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__msg));
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_39));
-  __pyx_k_codeobj_40 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_28, __pyx_n_s__unpack6, 331, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "g2clib.pyx":377
+  __pyx_tuple__18 = PyTuple_Pack(12, __pyx_n_s_gribmsg, __pyx_n_s_ndpts, __pyx_n_s_ipos, __pyx_n_s_zeros, __pyx_n_s_bitmap, __pyx_n_s_cgrib, __pyx_n_s_iofst, __pyx_n_s_ierr, __pyx_n_s_ngpts, __pyx_n_s_ibmap, __pyx_n_s_bmap, __pyx_n_s_msg); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__18);
+  __Pyx_GIVEREF(__pyx_tuple__18);
+  __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Volumes_User_jwhitaker_python_p, __pyx_n_s_unpack6, 337, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+  /* "g2clib.pyx":383
  *     return bitmap,ibmap
  * 
  * def unpack7(gribmsg,gdtnum,object gdtmpl,drtnum,object drtmpl,ndpts,ipos,object zeros,printminmax=False,storageorder='C'):             # <<<<<<<<<<<<<<
  *     """
  *  Unpacks Section 7 (Data Section) as defined in GRIB Edition 2.
  */
-  __pyx_k_tuple_41 = PyTuple_New(33); if (unlikely(!__pyx_k_tuple_41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_41);
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__gribmsg));
-  PyTuple_SET_ITEM(__pyx_k_tuple_41, 0, ((PyObject *)__pyx_n_s__gribmsg));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__gribmsg));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__gdtnum));
-  PyTuple_SET_ITEM(__pyx_k_tuple_41, 1, ((PyObject *)__pyx_n_s__gdtnum));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__gdtnum));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__gdtmpl));
-  PyTuple_SET_ITEM(__pyx_k_tuple_41, 2, ((PyObject *)__pyx_n_s__gdtmpl));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__gdtmpl));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__drtnum));
-  PyTuple_SET_ITEM(__pyx_k_tuple_41, 3, ((PyObject *)__pyx_n_s__drtnum));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__drtnum));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__drtmpl));
-  PyTuple_SET_ITEM(__pyx_k_tuple_41, 4, ((PyObject *)__pyx_n_s__drtmpl));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__drtmpl));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__ndpts));
-  PyTuple_SET_ITEM(__pyx_k_tuple_41, 5, ((PyObject *)__pyx_n_s__ndpts));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ndpts));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__ipos));
-  PyTuple_SET_ITEM(__pyx_k_tuple_41, 6, ((PyObject *)__pyx_n_s__ipos));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ipos));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__zeros));
-  PyTuple_SET_ITEM(__pyx_k_tuple_41, 7, ((PyObject *)__pyx_n_s__zeros));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__zeros));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__printminmax));
-  PyTuple_SET_ITEM(__pyx_k_tuple_41, 8, ((PyObject *)__pyx_n_s__printminmax));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__printminmax));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__storageorder));
-  PyTuple_SET_ITEM(__pyx_k_tuple_41, 9, ((PyObject *)__pyx_n_s__storageorder));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__storageorder));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__cgrib));
-  PyTuple_SET_ITEM(__pyx_k_tuple_41, 10, ((PyObject *)__pyx_n_s__cgrib));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__cgrib));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__iofst));
-  PyTuple_SET_ITEM(__pyx_k_tuple_41, 11, ((PyObject *)__pyx_n_s__iofst));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__iofst));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__ierr));
-  PyTuple_SET_ITEM(__pyx_k_tuple_41, 12, ((PyObject *)__pyx_n_s__ierr));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ierr));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__ngpts));
-  PyTuple_SET_ITEM(__pyx_k_tuple_41, 13, ((PyObject *)__pyx_n_s__ngpts));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ngpts));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__idrsnum));
-  PyTuple_SET_ITEM(__pyx_k_tuple_41, 14, ((PyObject *)__pyx_n_s__idrsnum));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__idrsnum));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__igdsnum));
-  PyTuple_SET_ITEM(__pyx_k_tuple_41, 15, ((PyObject *)__pyx_n_s__igdsnum));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__igdsnum));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__igdstmpl));
-  PyTuple_SET_ITEM(__pyx_k_tuple_41, 16, ((PyObject *)__pyx_n_s__igdstmpl));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__igdstmpl));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__idrstmpl));
-  PyTuple_SET_ITEM(__pyx_k_tuple_41, 17, ((PyObject *)__pyx_n_s__idrstmpl));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__idrstmpl));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__fld));
-  PyTuple_SET_ITEM(__pyx_k_tuple_41, 18, ((PyObject *)__pyx_n_s__fld));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__fld));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__drtmpldat));
-  PyTuple_SET_ITEM(__pyx_k_tuple_41, 19, ((PyObject *)__pyx_n_s__drtmpldat));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__drtmpldat));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__gdtmpldat));
-  PyTuple_SET_ITEM(__pyx_k_tuple_41, 20, ((PyObject *)__pyx_n_s__gdtmpldat));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__gdtmpldat));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__rmin));
-  PyTuple_SET_ITEM(__pyx_k_tuple_41, 21, ((PyObject *)__pyx_n_s__rmin));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__rmin));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__rmax));
-  PyTuple_SET_ITEM(__pyx_k_tuple_41, 22, ((PyObject *)__pyx_n_s__rmax));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__rmax));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__n));
-  PyTuple_SET_ITEM(__pyx_k_tuple_41, 23, ((PyObject *)__pyx_n_s__n));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__n));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__buflen));
-  PyTuple_SET_ITEM(__pyx_k_tuple_41, 24, ((PyObject *)__pyx_n_s__buflen));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__buflen));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__msg));
-  PyTuple_SET_ITEM(__pyx_k_tuple_41, 25, ((PyObject *)__pyx_n_s__msg));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__msg));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__fldmax));
-  PyTuple_SET_ITEM(__pyx_k_tuple_41, 26, ((PyObject *)__pyx_n_s__fldmax));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__fldmax));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__fldmin));
-  PyTuple_SET_ITEM(__pyx_k_tuple_41, 27, ((PyObject *)__pyx_n_s__fldmin));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__fldmin));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__bitsofprecision));
-  PyTuple_SET_ITEM(__pyx_k_tuple_41, 28, ((PyObject *)__pyx_n_s__bitsofprecision));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__bitsofprecision));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__digitsofprecision));
-  PyTuple_SET_ITEM(__pyx_k_tuple_41, 29, ((PyObject *)__pyx_n_s__digitsofprecision));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__digitsofprecision));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__format));
-  PyTuple_SET_ITEM(__pyx_k_tuple_41, 30, ((PyObject *)__pyx_n_s__format));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__format));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__minmaxstring));
-  PyTuple_SET_ITEM(__pyx_k_tuple_41, 31, ((PyObject *)__pyx_n_s__minmaxstring));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__minmaxstring));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__data));
-  PyTuple_SET_ITEM(__pyx_k_tuple_41, 32, ((PyObject *)__pyx_n_s__data));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__data));
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_41));
-  __pyx_k_codeobj_42 = (PyObject*)__Pyx_PyCode_New(10, 0, 33, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_28, __pyx_n_s__unpack7, 377, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_42)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "g2clib.pyx":460
+  __pyx_tuple__20 = PyTuple_Pack(33, __pyx_n_s_gribmsg, __pyx_n_s_gdtnum, __pyx_n_s_gdtmpl, __pyx_n_s_drtnum, __pyx_n_s_drtmpl, __pyx_n_s_ndpts, __pyx_n_s_ipos, __pyx_n_s_zeros, __pyx_n_s_printminmax, __pyx_n_s_storageorder, __pyx_n_s_cgrib, __pyx_n_s_iofst, __pyx_n_s_ierr, __pyx_n_s_ngpts, __pyx_n_s_idrsnum, __pyx_n_s_igdsnum, __pyx_n_s_igdstmpl, __pyx_n_s_idrstmpl, __pyx_n_s_fld, __pyx_n_s_drtmpldat, __pyx_n_s_gdtmpldat, __pyx_n_s_rmin, __pyx_n_s_rmax, __pyx_n_s_n, __pyx_n_s_buflen, __ [...]
+  __Pyx_GOTREF(__pyx_tuple__20);
+  __Pyx_GIVEREF(__pyx_tuple__20);
+  __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(10, 0, 33, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Volumes_User_jwhitaker_python_p, __pyx_n_s_unpack7, 383, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+  /* "g2clib.pyx":468
  * # routines for writing grib2 files.
  * 
  * def grib2_create(object listsec0, object listsec1):             # <<<<<<<<<<<<<<
  *     """
  *  Initializes a new GRIB2 message and packs
  */
-  __pyx_k_tuple_43 = PyTuple_New(12); if (unlikely(!__pyx_k_tuple_43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_43);
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__listsec0));
-  PyTuple_SET_ITEM(__pyx_k_tuple_43, 0, ((PyObject *)__pyx_n_s__listsec0));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__listsec0));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__listsec1));
-  PyTuple_SET_ITEM(__pyx_k_tuple_43, 1, ((PyObject *)__pyx_n_s__listsec1));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__listsec1));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__isec0));
-  PyTuple_SET_ITEM(__pyx_k_tuple_43, 2, ((PyObject *)__pyx_n_s__isec0));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__isec0));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__isec1));
-  PyTuple_SET_ITEM(__pyx_k_tuple_43, 3, ((PyObject *)__pyx_n_s__isec1));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__isec1));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__ierr));
-  PyTuple_SET_ITEM(__pyx_k_tuple_43, 4, ((PyObject *)__pyx_n_s__ierr));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ierr));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__listsec0dat));
-  PyTuple_SET_ITEM(__pyx_k_tuple_43, 5, ((PyObject *)__pyx_n_s__listsec0dat));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__listsec0dat));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__listsec1dat));
-  PyTuple_SET_ITEM(__pyx_k_tuple_43, 6, ((PyObject *)__pyx_n_s__listsec1dat));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__listsec1dat));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__buflen));
-  PyTuple_SET_ITEM(__pyx_k_tuple_43, 7, ((PyObject *)__pyx_n_s__buflen));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__buflen));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__cgrib));
-  PyTuple_SET_ITEM(__pyx_k_tuple_43, 8, ((PyObject *)__pyx_n_s__cgrib));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__cgrib));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__lgrib));
-  PyTuple_SET_ITEM(__pyx_k_tuple_43, 9, ((PyObject *)__pyx_n_s__lgrib));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__lgrib));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__gribmsg));
-  PyTuple_SET_ITEM(__pyx_k_tuple_43, 10, ((PyObject *)__pyx_n_s__gribmsg));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__gribmsg));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__msg));
-  PyTuple_SET_ITEM(__pyx_k_tuple_43, 11, ((PyObject *)__pyx_n_s__msg));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__msg));
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_43));
-  __pyx_k_codeobj_44 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_28, __pyx_n_s__grib2_create, 460, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_44)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_tuple__22 = PyTuple_Pack(12, __pyx_n_s_listsec0, __pyx_n_s_listsec1, __pyx_n_s_isec0, __pyx_n_s_isec1, __pyx_n_s_ierr, __pyx_n_s_listsec0dat, __pyx_n_s_listsec1dat, __pyx_n_s_buflen, __pyx_n_s_cgrib, __pyx_n_s_lgrib, __pyx_n_s_gribmsg, __pyx_n_s_msg); if (unlikely(!__pyx_tuple__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__22);
+  __Pyx_GIVEREF(__pyx_tuple__22);
+  __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Volumes_User_jwhitaker_python_p, __pyx_n_s_grib2_create, 468, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
-  /* "g2clib.pyx":520
+  /* "g2clib.pyx":531
  *     return gribmsg, ierr
  * 
  * def grib2_end(gribmsg):             # <<<<<<<<<<<<<<
  *     """
  * 
  */
-  __pyx_k_tuple_45 = PyTuple_New(4); if (unlikely(!__pyx_k_tuple_45)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_45);
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__gribmsg));
-  PyTuple_SET_ITEM(__pyx_k_tuple_45, 0, ((PyObject *)__pyx_n_s__gribmsg));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__gribmsg));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__ierr));
-  PyTuple_SET_ITEM(__pyx_k_tuple_45, 1, ((PyObject *)__pyx_n_s__ierr));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ierr));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__cgrib));
-  PyTuple_SET_ITEM(__pyx_k_tuple_45, 2, ((PyObject *)__pyx_n_s__cgrib));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__cgrib));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__msg));
-  PyTuple_SET_ITEM(__pyx_k_tuple_45, 3, ((PyObject *)__pyx_n_s__msg));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__msg));
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_45));
-  __pyx_k_codeobj_46 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_28, __pyx_n_s__grib2_end, 520, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_46)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "g2clib.pyx":562
+  __pyx_tuple__24 = PyTuple_Pack(4, __pyx_n_s_gribmsg, __pyx_n_s_ierr, __pyx_n_s_cgrib, __pyx_n_s_msg); if (unlikely(!__pyx_tuple__24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__24);
+  __Pyx_GIVEREF(__pyx_tuple__24);
+  __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Volumes_User_jwhitaker_python_p, __pyx_n_s_grib2_end, 531, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+  /* "g2clib.pyx":573
  *     return gribmsg, ierr
  * 
  * def grib2_addgrid(gribmsg,object gds,object gdstmpl,object deflist=None, defnum = 0):             # <<<<<<<<<<<<<<
  *     """
  *    Packs up a Grid Definition Section (Section 3)
  */
-  __pyx_k_tuple_47 = PyTuple_New(16); if (unlikely(!__pyx_k_tuple_47)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_47);
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__gribmsg));
-  PyTuple_SET_ITEM(__pyx_k_tuple_47, 0, ((PyObject *)__pyx_n_s__gribmsg));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__gribmsg));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__gds));
-  PyTuple_SET_ITEM(__pyx_k_tuple_47, 1, ((PyObject *)__pyx_n_s__gds));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__gds));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__gdstmpl));
-  PyTuple_SET_ITEM(__pyx_k_tuple_47, 2, ((PyObject *)__pyx_n_s__gdstmpl));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__gdstmpl));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__deflist));
-  PyTuple_SET_ITEM(__pyx_k_tuple_47, 3, ((PyObject *)__pyx_n_s__deflist));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__deflist));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__defnum));
-  PyTuple_SET_ITEM(__pyx_k_tuple_47, 4, ((PyObject *)__pyx_n_s__defnum));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__defnum));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__ierr));
-  PyTuple_SET_ITEM(__pyx_k_tuple_47, 5, ((PyObject *)__pyx_n_s__ierr));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ierr));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__idefnum));
-  PyTuple_SET_ITEM(__pyx_k_tuple_47, 6, ((PyObject *)__pyx_n_s__idefnum));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__idefnum));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__igds));
-  PyTuple_SET_ITEM(__pyx_k_tuple_47, 7, ((PyObject *)__pyx_n_s__igds));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__igds));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__igdstmpl));
-  PyTuple_SET_ITEM(__pyx_k_tuple_47, 8, ((PyObject *)__pyx_n_s__igdstmpl));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__igdstmpl));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__ideflist));
-  PyTuple_SET_ITEM(__pyx_k_tuple_47, 9, ((PyObject *)__pyx_n_s__ideflist));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ideflist));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__cgrib));
-  PyTuple_SET_ITEM(__pyx_k_tuple_47, 10, ((PyObject *)__pyx_n_s__cgrib));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__cgrib));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__gdsdat));
-  PyTuple_SET_ITEM(__pyx_k_tuple_47, 11, ((PyObject *)__pyx_n_s__gdsdat));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__gdsdat));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__deflistdat));
-  PyTuple_SET_ITEM(__pyx_k_tuple_47, 12, ((PyObject *)__pyx_n_s__deflistdat));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__deflistdat));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__gdstmpldat));
-  PyTuple_SET_ITEM(__pyx_k_tuple_47, 13, ((PyObject *)__pyx_n_s__gdstmpldat));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__gdstmpldat));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__buflen));
-  PyTuple_SET_ITEM(__pyx_k_tuple_47, 14, ((PyObject *)__pyx_n_s__buflen));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__buflen));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__msg));
-  PyTuple_SET_ITEM(__pyx_k_tuple_47, 15, ((PyObject *)__pyx_n_s__msg));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__msg));
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_47));
-  __pyx_k_codeobj_48 = (PyObject*)__Pyx_PyCode_New(5, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_28, __pyx_n_s__grib2_addgrid, 562, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_48)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "g2clib.pyx":634
+  __pyx_tuple__26 = PyTuple_Pack(16, __pyx_n_s_gribmsg, __pyx_n_s_gds, __pyx_n_s_gdstmpl, __pyx_n_s_deflist, __pyx_n_s_defnum, __pyx_n_s_ierr, __pyx_n_s_idefnum, __pyx_n_s_igds, __pyx_n_s_igdstmpl, __pyx_n_s_ideflist, __pyx_n_s_cgrib, __pyx_n_s_gdsdat, __pyx_n_s_deflistdat, __pyx_n_s_gdstmpldat, __pyx_n_s_buflen, __pyx_n_s_msg); if (unlikely(!__pyx_tuple__26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__26);
+  __Pyx_GIVEREF(__pyx_tuple__26);
+  __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(5, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__26, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Volumes_User_jwhitaker_python_p, __pyx_n_s_grib2_addgrid, 573, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+  /* "g2clib.pyx":650
  * 
  * 
  * def grib2_addfield(gribmsg,pdsnum,object pdstmpl,object coordlist,             # <<<<<<<<<<<<<<
  *                    drsnum,object drstmpl,object field,
  *                    ibitmap,object bitmap):
  */
-  __pyx_k_tuple_49 = PyTuple_New(28); if (unlikely(!__pyx_k_tuple_49)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_49);
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__gribmsg));
-  PyTuple_SET_ITEM(__pyx_k_tuple_49, 0, ((PyObject *)__pyx_n_s__gribmsg));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__gribmsg));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__pdsnum));
-  PyTuple_SET_ITEM(__pyx_k_tuple_49, 1, ((PyObject *)__pyx_n_s__pdsnum));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__pdsnum));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__pdstmpl));
-  PyTuple_SET_ITEM(__pyx_k_tuple_49, 2, ((PyObject *)__pyx_n_s__pdstmpl));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__pdstmpl));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__coordlist));
-  PyTuple_SET_ITEM(__pyx_k_tuple_49, 3, ((PyObject *)__pyx_n_s__coordlist));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__coordlist));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__drsnum));
-  PyTuple_SET_ITEM(__pyx_k_tuple_49, 4, ((PyObject *)__pyx_n_s__drsnum));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__drsnum));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__drstmpl));
-  PyTuple_SET_ITEM(__pyx_k_tuple_49, 5, ((PyObject *)__pyx_n_s__drstmpl));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__drstmpl));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__field));
-  PyTuple_SET_ITEM(__pyx_k_tuple_49, 6, ((PyObject *)__pyx_n_s__field));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__field));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__ibitmap));
-  PyTuple_SET_ITEM(__pyx_k_tuple_49, 7, ((PyObject *)__pyx_n_s__ibitmap));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ibitmap));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__bitmap));
-  PyTuple_SET_ITEM(__pyx_k_tuple_49, 8, ((PyObject *)__pyx_n_s__bitmap));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__bitmap));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__ierr));
-  PyTuple_SET_ITEM(__pyx_k_tuple_49, 9, ((PyObject *)__pyx_n_s__ierr));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ierr));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__ipdsnum));
-  PyTuple_SET_ITEM(__pyx_k_tuple_49, 10, ((PyObject *)__pyx_n_s__ipdsnum));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ipdsnum));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__numcoord));
-  PyTuple_SET_ITEM(__pyx_k_tuple_49, 11, ((PyObject *)__pyx_n_s__numcoord));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__numcoord));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__ipdstmpl));
-  PyTuple_SET_ITEM(__pyx_k_tuple_49, 12, ((PyObject *)__pyx_n_s__ipdstmpl));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ipdstmpl));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__idrsnum));
-  PyTuple_SET_ITEM(__pyx_k_tuple_49, 13, ((PyObject *)__pyx_n_s__idrsnum));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__idrsnum));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__idrstmpl));
-  PyTuple_SET_ITEM(__pyx_k_tuple_49, 14, ((PyObject *)__pyx_n_s__idrstmpl));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__idrstmpl));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__fld));
-  PyTuple_SET_ITEM(__pyx_k_tuple_49, 15, ((PyObject *)__pyx_n_s__fld));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__fld));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__fcoordlist));
-  PyTuple_SET_ITEM(__pyx_k_tuple_49, 16, ((PyObject *)__pyx_n_s__fcoordlist));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__fcoordlist));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__bmap));
-  PyTuple_SET_ITEM(__pyx_k_tuple_49, 17, ((PyObject *)__pyx_n_s__bmap));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__bmap));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__ngrdpts));
-  PyTuple_SET_ITEM(__pyx_k_tuple_49, 18, ((PyObject *)__pyx_n_s__ngrdpts));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ngrdpts));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__ibmap));
-  PyTuple_SET_ITEM(__pyx_k_tuple_49, 19, ((PyObject *)__pyx_n_s__ibmap));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ibmap));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__pdtmpldat));
-  PyTuple_SET_ITEM(__pyx_k_tuple_49, 20, ((PyObject *)__pyx_n_s__pdtmpldat));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__pdtmpldat));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__drtmpldat));
-  PyTuple_SET_ITEM(__pyx_k_tuple_49, 21, ((PyObject *)__pyx_n_s__drtmpldat));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__drtmpldat));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__coordlistdat));
-  PyTuple_SET_ITEM(__pyx_k_tuple_49, 22, ((PyObject *)__pyx_n_s__coordlistdat));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__coordlistdat));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__fielddat));
-  PyTuple_SET_ITEM(__pyx_k_tuple_49, 23, ((PyObject *)__pyx_n_s__fielddat));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__fielddat));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__bitmapdat));
-  PyTuple_SET_ITEM(__pyx_k_tuple_49, 24, ((PyObject *)__pyx_n_s__bitmapdat));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__bitmapdat));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__buflen));
-  PyTuple_SET_ITEM(__pyx_k_tuple_49, 25, ((PyObject *)__pyx_n_s__buflen));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__buflen));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__cgrib));
-  PyTuple_SET_ITEM(__pyx_k_tuple_49, 26, ((PyObject *)__pyx_n_s__cgrib));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__cgrib));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__msg));
-  PyTuple_SET_ITEM(__pyx_k_tuple_49, 27, ((PyObject *)__pyx_n_s__msg));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__msg));
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_49));
-  __pyx_k_codeobj_50 = (PyObject*)__Pyx_PyCode_New(9, 0, 28, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_28, __pyx_n_s__grib2_addfield, 634, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_50)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_tuple__28 = PyTuple_Pack(28, __pyx_n_s_gribmsg, __pyx_n_s_pdsnum, __pyx_n_s_pdstmpl, __pyx_n_s_coordlist, __pyx_n_s_drsnum, __pyx_n_s_drstmpl, __pyx_n_s_field, __pyx_n_s_ibitmap, __pyx_n_s_bitmap, __pyx_n_s_ierr, __pyx_n_s_ipdsnum, __pyx_n_s_numcoord, __pyx_n_s_idrsnum, __pyx_n_s_ipdstmpl, __pyx_n_s_idrstmpl, __pyx_n_s_fld, __pyx_n_s_fcoordlist, __pyx_n_s_bmap, __pyx_n_s_ngrdpts, __pyx_n_s_ibmap, __pyx_n_s_pdtmpldat, __pyx_n_s_drtmpldat, __pyx_n_s_coordlistdat, __pyx_n_s_fielddat [...]
+  __Pyx_GOTREF(__pyx_tuple__28);
+  __Pyx_GIVEREF(__pyx_tuple__28);
+  __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(9, 0, 28, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Volumes_User_jwhitaker_python_p, __pyx_n_s_grib2_addfield, 650, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_RefNannyFinishContext();
   return 0;
   __pyx_L1_error:;
@@ -5604,14 +5433,14 @@ static int __Pyx_InitCachedConstants(void) {
 
 static int __Pyx_InitGlobals(void) {
   if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __pyx_int_8 = PyInt_FromLong(8); if (unlikely(!__pyx_int_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __pyx_int_254 = PyInt_FromLong(254); if (unlikely(!__pyx_int_254)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __pyx_int_260 = PyInt_FromLong(260); if (unlikely(!__pyx_int_260)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_int_8 = PyInt_FromLong(8); if (unlikely(!__pyx_int_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_int_254 = PyInt_FromLong(254); if (unlikely(!__pyx_int_254)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_int_260 = PyInt_FromLong(260); if (unlikely(!__pyx_int_260)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   return 0;
   __pyx_L1_error:;
   return -1;
@@ -5626,6 +5455,9 @@ PyMODINIT_FUNC PyInit_g2clib(void)
 #endif
 {
   PyObject *__pyx_t_1 = NULL;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
   __Pyx_RefNannyDeclarations
   #if CYTHON_REFNANNY
   __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
@@ -5658,11 +5490,26 @@ PyMODINIT_FUNC PyInit_g2clib(void)
   #endif
   /*--- Module creation code ---*/
   #if PY_MAJOR_VERSION < 3
-  __pyx_m = Py_InitModule4(__Pyx_NAMESTR("g2clib"), __pyx_methods, __Pyx_DOCSTR(__pyx_k_25), 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
+  __pyx_m = Py_InitModule4("g2clib", __pyx_methods, __pyx_k_Pyrex_code_to_provide_python_int, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
   #else
   __pyx_m = PyModule_Create(&__pyx_moduledef);
   #endif
   if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  Py_INCREF(__pyx_d);
+  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  #if CYTHON_COMPILING_IN_PYPY
+  Py_INCREF(__pyx_b);
+  #endif
+  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+  /*--- Initialize various global constants etc. ---*/
+  if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
+  if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  #endif
+  if (__pyx_module_is_main_g2clib) {
+    if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+  }
   #if PY_MAJOR_VERSION >= 3
   {
     PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
@@ -5671,16 +5518,6 @@ PyMODINIT_FUNC PyInit_g2clib(void)
     }
   }
   #endif
-  __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  #if CYTHON_COMPILING_IN_PYPY
-  Py_INCREF(__pyx_b);
-  #endif
-  if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  /*--- Initialize various global constants etc. ---*/
-  if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__pyx_module_is_main_g2clib) {
-    if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  }
   /*--- Builtin init code ---*/
   if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   /*--- Constants init code ---*/
@@ -5701,9 +5538,9 @@ PyMODINIT_FUNC PyInit_g2clib(void)
  * 
  * # Some helper routines from the Python API
  */
-  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__math), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_math, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__math, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_math, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
   /* "g2clib.pyx":55
@@ -5713,146 +5550,141 @@ PyMODINIT_FUNC PyInit_g2clib(void)
  *     """
  *  Converts a float32 array into an int32 array of IEEE formatted values
  */
-  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6g2clib_1rtoi_ieee, NULL, __pyx_n_s__g2clib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6g2clib_1rtoi_ieee, NULL, __pyx_n_s_g2clib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__rtoi_ieee, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_rtoi_ieee, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "g2clib.pyx":73
+  /* "g2clib.pyx":76
  *     mkieee(rdata, idata, buflenr/4)
  * 
  * def itor_ieee(object iarr, object rarr):             # <<<<<<<<<<<<<<
  *     """
  *  Converts an int32 array of IEEE values into a float32 array.
  */
-  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6g2clib_3itor_ieee, NULL, __pyx_n_s__g2clib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6g2clib_3itor_ieee, NULL, __pyx_n_s_g2clib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__itor_ieee, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_itor_ieee, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "g2clib.pyx":123
+  /* "g2clib.pyx":127
  * # routines for reading grib2 files.
  * 
  * def unpack1(gribmsg, ipos, object zeros):             # <<<<<<<<<<<<<<
  *     """              .      .    .                                       .
  *  Unpacks Section 1 (Identification Section) as defined in GRIB Edition 2.
  */
-  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6g2clib_5unpack1, NULL, __pyx_n_s__g2clib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6g2clib_5unpack1, NULL, __pyx_n_s_g2clib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__unpack1, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_unpack1, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "g2clib.pyx":177
+  /* "g2clib.pyx":181
  * 
  * 
  * def unpack3(gribmsg, ipos, object zeros):             # <<<<<<<<<<<<<<
  *     """
  *  Unpacks Section 3 (Grid Definition Section) as defined in GRIB Edition 2.
  */
-  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6g2clib_7unpack3, NULL, __pyx_n_s__g2clib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6g2clib_7unpack3, NULL, __pyx_n_s_g2clib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__unpack3, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_unpack3, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "g2clib.pyx":237
+  /* "g2clib.pyx":243
  *     return gds,gdtmpl,deflist,iofst/8
  * 
  * def unpack4(gribmsg,ipos,object zeros):             # <<<<<<<<<<<<<<
  *     """
  *  Unpacks Section 4 (Product Definition Section) as defined in GRIB Edition 2.
  */
-  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6g2clib_9unpack4, NULL, __pyx_n_s__g2clib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6g2clib_9unpack4, NULL, __pyx_n_s_g2clib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__unpack4, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_unpack4, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "g2clib.pyx":287
+  /* "g2clib.pyx":293
  *     return pdtmpl,ipdsnum,coordlist,iofst/8
  * 
  * def unpack5(gribmsg,ipos,object zeros):             # <<<<<<<<<<<<<<
  *     """
  *  Unpacks Section 5 (Data Representation Section) as defined in GRIB Edition 2.
  */
-  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6g2clib_11unpack5, NULL, __pyx_n_s__g2clib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6g2clib_11unpack5, NULL, __pyx_n_s_g2clib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__unpack5, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_unpack5, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "g2clib.pyx":331
+  /* "g2clib.pyx":337
  *     return drtmpl,idrsnum,ndpts,iofst/8
  * 
  * def unpack6(gribmsg,ndpts,ipos,object zeros):             # <<<<<<<<<<<<<<
  *     """
  *  Unpacks Section 6 (Bit-Map Section) as defined in GRIB Edition 2.
  */
-  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6g2clib_13unpack6, NULL, __pyx_n_s__g2clib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6g2clib_13unpack6, NULL, __pyx_n_s_g2clib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__unpack6, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_unpack6, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "g2clib.pyx":377
+  /* "g2clib.pyx":383
  *     return bitmap,ibmap
  * 
  * def unpack7(gribmsg,gdtnum,object gdtmpl,drtnum,object drtmpl,ndpts,ipos,object zeros,printminmax=False,storageorder='C'):             # <<<<<<<<<<<<<<
  *     """
  *  Unpacks Section 7 (Data Section) as defined in GRIB Edition 2.
  */
-  __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_k_14 = __pyx_t_1;
-  __Pyx_GIVEREF(__pyx_t_1);
-  __pyx_t_1 = 0;
-  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6g2clib_15unpack7, NULL, __pyx_n_s__g2clib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6g2clib_15unpack7, NULL, __pyx_n_s_g2clib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__unpack7, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_unpack7, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "g2clib.pyx":460
+  /* "g2clib.pyx":468
  * # routines for writing grib2 files.
  * 
  * def grib2_create(object listsec0, object listsec1):             # <<<<<<<<<<<<<<
  *     """
  *  Initializes a new GRIB2 message and packs
  */
-  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6g2clib_17grib2_create, NULL, __pyx_n_s__g2clib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6g2clib_17grib2_create, NULL, __pyx_n_s_g2clib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__grib2_create, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_grib2_create, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "g2clib.pyx":520
+  /* "g2clib.pyx":531
  *     return gribmsg, ierr
  * 
  * def grib2_end(gribmsg):             # <<<<<<<<<<<<<<
  *     """
  * 
  */
-  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6g2clib_19grib2_end, NULL, __pyx_n_s__g2clib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6g2clib_19grib2_end, NULL, __pyx_n_s_g2clib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__grib2_end, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_grib2_end, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "g2clib.pyx":562
+  /* "g2clib.pyx":573
  *     return gribmsg, ierr
  * 
  * def grib2_addgrid(gribmsg,object gds,object gdstmpl,object deflist=None, defnum = 0):             # <<<<<<<<<<<<<<
  *     """
  *    Packs up a Grid Definition Section (Section 3)
  */
-  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6g2clib_21grib2_addgrid, NULL, __pyx_n_s__g2clib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6g2clib_21grib2_addgrid, NULL, __pyx_n_s_g2clib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__grib2_addgrid, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_grib2_addgrid, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "g2clib.pyx":634
+  /* "g2clib.pyx":650
  * 
  * 
  * def grib2_addfield(gribmsg,pdsnum,object pdstmpl,object coordlist,             # <<<<<<<<<<<<<<
  *                    drsnum,object drstmpl,object field,
  *                    ibitmap,object bitmap):
  */
-  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6g2clib_23grib2_addfield, NULL, __pyx_n_s__g2clib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6g2clib_23grib2_addfield, NULL, __pyx_n_s_g2clib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__grib2_addfield, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_grib2_addfield, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
   /* "g2clib.pyx":1
@@ -5861,14 +5693,19 @@ PyMODINIT_FUNC PyInit_g2clib(void)
  * c-wrappers that Pyrex generates."""
  */
   __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+  /*--- Wrapped vars code ---*/
+
   goto __pyx_L0;
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   if (__pyx_m) {
-    __Pyx_AddTraceback("init g2clib", __pyx_clineno, __pyx_lineno, __pyx_filename);
+    if (__pyx_d) {
+      __Pyx_AddTraceback("init g2clib", __pyx_clineno, __pyx_lineno, __pyx_filename);
+    }
     Py_DECREF(__pyx_m); __pyx_m = 0;
   } else if (!PyErr_Occurred()) {
     PyErr_SetString(PyExc_ImportError, "init g2clib");
@@ -5897,19 +5734,17 @@ end:
     Py_XDECREF(m);
     return (__Pyx_RefNannyAPIStruct *)r;
 }
-#endif /* CYTHON_REFNANNY */
+#endif
 
-static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
-    PyObject *result;
-    result = PyObject_GetAttr(dict, name);
-    if (!result) {
-        if (dict != __pyx_b) {
-            PyErr_Clear();
-            result = PyObject_GetAttr(__pyx_b, name);
-        }
-        if (!result) {
-            PyErr_SetObject(PyExc_NameError, name);
-        }
+static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
+    PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
+    if (unlikely(!result)) {
+        PyErr_Format(PyExc_NameError,
+#if PY_MAJOR_VERSION >= 3
+            "name '%U' is not defined", name);
+#else
+            "name '%.200s' is not defined", PyString_AS_STRING(name));
+#endif
     }
     return result;
 }
@@ -5934,7 +5769,7 @@ static void __Pyx_RaiseArgtupleInvalid(
         more_or_less = "exactly";
     }
     PyErr_Format(PyExc_TypeError,
-                 "%s() takes %s %" CYTHON_FORMAT_SSIZE_T "d positional argument%s (%" CYTHON_FORMAT_SSIZE_T "d given)",
+                 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
                  func_name, more_or_less, num_expected,
                  (num_expected == 1) ? "" : "s", num_found);
 }
@@ -6038,12 +5873,12 @@ arg_passed_twice:
     goto bad;
 invalid_keyword_type:
     PyErr_Format(PyExc_TypeError,
-        "%s() keywords must be strings", function_name);
+        "%.200s() keywords must be strings", function_name);
     goto bad;
 invalid_keyword:
     PyErr_Format(PyExc_TypeError,
     #if PY_MAJOR_VERSION < 3
-        "%s() got an unexpected keyword argument '%s'",
+        "%.200s() got an unexpected keyword argument '%.200s'",
         function_name, PyString_AsString(key));
     #else
         "%s() got an unexpected keyword argument '%U'",
@@ -6102,11 +5937,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
             goto raise_error;
         }
     }
-    #if PY_VERSION_HEX < 0x02050000
-    if (PyClass_Check(type)) {
-    #else
     if (PyType_Check(type)) {
-    #endif
 #if CYTHON_COMPILING_IN_PYPY
         if (!value) {
             Py_INCREF(Py_None);
@@ -6121,26 +5952,13 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
             goto raise_error;
         }
         value = type;
-        #if PY_VERSION_HEX < 0x02050000
-            if (PyInstance_Check(type)) {
-                type = (PyObject*) ((PyInstanceObject*)type)->in_class;
-                Py_INCREF(type);
-            }
-            else {
-                type = 0;
-                PyErr_SetString(PyExc_TypeError,
-                    "raise: exception must be an old-style class or instance");
-                goto raise_error;
-            }
-        #else
-            type = (PyObject*) Py_TYPE(type);
-            Py_INCREF(type);
-            if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
-                PyErr_SetString(PyExc_TypeError,
-                    "raise: exception class must be a subclass of BaseException");
-                goto raise_error;
-            }
-        #endif
+        type = (PyObject*) Py_TYPE(type);
+        Py_INCREF(type);
+        if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
+            PyErr_SetString(PyExc_TypeError,
+                "raise: exception class must be a subclass of BaseException");
+            goto raise_error;
+        }
     }
     __Pyx_ErrRestore(type, value, tb);
     return;
@@ -6150,7 +5968,7 @@ raise_error:
     Py_XDECREF(tb);
     return;
 }
-#else /* Python 3+ */
+#else
 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
     PyObject* owned_instance = NULL;
     if (tb == Py_None) {
@@ -6171,46 +5989,62 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject
         value = type;
         type = (PyObject*) Py_TYPE(value);
     } else if (PyExceptionClass_Check(type)) {
-        PyObject *args;
-        if (!value)
-            args = PyTuple_New(0);
-        else if (PyTuple_Check(value)) {
-            Py_INCREF(value);
-            args = value;
+        PyObject *instance_class = NULL;
+        if (value && PyExceptionInstance_Check(value)) {
+            instance_class = (PyObject*) Py_TYPE(value);
+            if (instance_class != type) {
+                if (PyObject_IsSubclass(instance_class, type)) {
+                    type = instance_class;
+                } else {
+                    instance_class = NULL;
+                }
+            }
         }
-        else
-            args = PyTuple_Pack(1, value);
-        if (!args)
-            goto bad;
-        owned_instance = PyEval_CallObject(type, args);
-        Py_DECREF(args);
-        if (!owned_instance)
-            goto bad;
-        value = owned_instance;
-        if (!PyExceptionInstance_Check(value)) {
-            PyErr_Format(PyExc_TypeError,
-                         "calling %R should have returned an instance of "
-                         "BaseException, not %R",
-                         type, Py_TYPE(value));
-            goto bad;
+        if (!instance_class) {
+            PyObject *args;
+            if (!value)
+                args = PyTuple_New(0);
+            else if (PyTuple_Check(value)) {
+                Py_INCREF(value);
+                args = value;
+            } else
+                args = PyTuple_Pack(1, value);
+            if (!args)
+                goto bad;
+            owned_instance = PyObject_Call(type, args, NULL);
+            Py_DECREF(args);
+            if (!owned_instance)
+                goto bad;
+            value = owned_instance;
+            if (!PyExceptionInstance_Check(value)) {
+                PyErr_Format(PyExc_TypeError,
+                             "calling %R should have returned an instance of "
+                             "BaseException, not %R",
+                             type, Py_TYPE(value));
+                goto bad;
+            }
         }
     } else {
         PyErr_SetString(PyExc_TypeError,
             "raise: exception class must be a subclass of BaseException");
         goto bad;
     }
+#if PY_VERSION_HEX >= 0x03030000
+    if (cause) {
+#else
     if (cause && cause != Py_None) {
+#endif
         PyObject *fixed_cause;
-        if (PyExceptionClass_Check(cause)) {
+        if (cause == Py_None) {
+            fixed_cause = NULL;
+        } else if (PyExceptionClass_Check(cause)) {
             fixed_cause = PyObject_CallObject(cause, NULL);
             if (fixed_cause == NULL)
                 goto bad;
-        }
-        else if (PyExceptionInstance_Check(cause)) {
+        } else if (PyExceptionInstance_Check(cause)) {
             fixed_cause = cause;
             Py_INCREF(fixed_cause);
-        }
-        else {
+        } else {
             PyErr_SetString(PyExc_TypeError,
                             "exception causes must derive from "
                             "BaseException");
@@ -6220,6 +6054,13 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject
     }
     PyErr_SetObject(type, value);
     if (tb) {
+#if CYTHON_COMPILING_IN_PYPY
+        PyObject *tmp_type, *tmp_value, *tmp_tb;
+        PyErr_Fetch(tmp_type, tmp_value, tmp_tb);
+        Py_INCREF(tb);
+        PyErr_Restore(tmp_type, tmp_value, tb);
+        Py_XDECREF(tmp_tb);
+#else
         PyThreadState *tstate = PyThreadState_GET();
         PyObject* tmp_tb = tstate->curexc_traceback;
         if (tb != tmp_tb) {
@@ -6227,6 +6068,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject
             tstate->curexc_traceback = tb;
             Py_XDECREF(tmp_tb);
         }
+#endif
     }
 bad:
     Py_XDECREF(owned_instance);
@@ -6241,6 +6083,145 @@ static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b)
     return q;
 }
 
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
+    PyObject *result;
+    ternaryfunc call = func->ob_type->tp_call;
+    if (unlikely(!call))
+        return PyObject_Call(func, arg, kw);
+    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
+        return NULL;
+    result = (*call)(func, arg, kw);
+    Py_LeaveRecursiveCall();
+    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
+        PyErr_SetString(
+            PyExc_SystemError,
+            "NULL result without error in PyObject_Call");
+    }
+    return result;
+}
+#endif
+
+static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
+#if CYTHON_COMPILING_IN_PYPY
+    return PyObject_RichCompareBool(s1, s2, equals);
+#else
+    if (s1 == s2) {
+        return (equals == Py_EQ);
+    } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
+        const char *ps1, *ps2;
+        Py_ssize_t length = PyBytes_GET_SIZE(s1);
+        if (length != PyBytes_GET_SIZE(s2))
+            return (equals == Py_NE);
+        ps1 = PyBytes_AS_STRING(s1);
+        ps2 = PyBytes_AS_STRING(s2);
+        if (ps1[0] != ps2[0]) {
+            return (equals == Py_NE);
+        } else if (length == 1) {
+            return (equals == Py_EQ);
+        } else {
+            int result = memcmp(ps1, ps2, (size_t)length);
+            return (equals == Py_EQ) ? (result == 0) : (result != 0);
+        }
+    } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
+        return (equals == Py_NE);
+    } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
+        return (equals == Py_NE);
+    } else {
+        int result;
+        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
+        if (!py_result)
+            return -1;
+        result = __Pyx_PyObject_IsTrue(py_result);
+        Py_DECREF(py_result);
+        return result;
+    }
+#endif
+}
+
+static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
+#if CYTHON_COMPILING_IN_PYPY
+    return PyObject_RichCompareBool(s1, s2, equals);
+#else
+#if PY_MAJOR_VERSION < 3
+    PyObject* owned_ref = NULL;
+#endif
+    int s1_is_unicode, s2_is_unicode;
+    if (s1 == s2) {
+        goto return_eq;
+    }
+    s1_is_unicode = PyUnicode_CheckExact(s1);
+    s2_is_unicode = PyUnicode_CheckExact(s2);
+#if PY_MAJOR_VERSION < 3
+    if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
+        owned_ref = PyUnicode_FromObject(s2);
+        if (unlikely(!owned_ref))
+            return -1;
+        s2 = owned_ref;
+        s2_is_unicode = 1;
+    } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
+        owned_ref = PyUnicode_FromObject(s1);
+        if (unlikely(!owned_ref))
+            return -1;
+        s1 = owned_ref;
+        s1_is_unicode = 1;
+    } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
+        return __Pyx_PyBytes_Equals(s1, s2, equals);
+    }
+#endif
+    if (s1_is_unicode & s2_is_unicode) {
+        Py_ssize_t length;
+        int kind;
+        void *data1, *data2;
+        if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
+            return -1;
+        length = __Pyx_PyUnicode_GET_LENGTH(s1);
+        if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
+            goto return_ne;
+        }
+        kind = __Pyx_PyUnicode_KIND(s1);
+        if (kind != __Pyx_PyUnicode_KIND(s2)) {
+            goto return_ne;
+        }
+        data1 = __Pyx_PyUnicode_DATA(s1);
+        data2 = __Pyx_PyUnicode_DATA(s2);
+        if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
+            goto return_ne;
+        } else if (length == 1) {
+            goto return_eq;
+        } else {
+            int result = memcmp(data1, data2, (size_t)(length * kind));
+            #if PY_MAJOR_VERSION < 3
+            Py_XDECREF(owned_ref);
+            #endif
+            return (equals == Py_EQ) ? (result == 0) : (result != 0);
+        }
+    } else if ((s1 == Py_None) & s2_is_unicode) {
+        goto return_ne;
+    } else if ((s2 == Py_None) & s1_is_unicode) {
+        goto return_ne;
+    } else {
+        int result;
+        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
+        if (!py_result)
+            return -1;
+        result = __Pyx_PyObject_IsTrue(py_result);
+        Py_DECREF(py_result);
+        return result;
+    }
+return_eq:
+    #if PY_MAJOR_VERSION < 3
+    Py_XDECREF(owned_ref);
+    #endif
+    return (equals == Py_EQ);
+return_ne:
+    #if PY_MAJOR_VERSION < 3
+    Py_XDECREF(owned_ref);
+    #endif
+    return (equals == Py_NE);
+#endif
+}
+
 static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
     long q = a / b;
     long r = a - q*b;
@@ -6248,16 +6229,321 @@ static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
     return q;
 }
 
-static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, long level) {
-    PyObject *py_import = 0;
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
+    PyObject *r;
+    if (!j) return NULL;
+    r = PyObject_GetItem(o, j);
+    Py_DECREF(j);
+    return r;
+}
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
+                                                              int wraparound, int boundscheck) {
+#if CYTHON_COMPILING_IN_CPYTHON
+    if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o);
+    if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
+        PyObject *r = PyList_GET_ITEM(o, i);
+        Py_INCREF(r);
+        return r;
+    }
+    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
+#else
+    return PySequence_GetItem(o, i);
+#endif
+}
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
+                                                              int wraparound, int boundscheck) {
+#if CYTHON_COMPILING_IN_CPYTHON
+    if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o);
+    if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
+        PyObject *r = PyTuple_GET_ITEM(o, i);
+        Py_INCREF(r);
+        return r;
+    }
+    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
+#else
+    return PySequence_GetItem(o, i);
+#endif
+}
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
+                                                     int is_list, int wraparound, int boundscheck) {
+#if CYTHON_COMPILING_IN_CPYTHON
+    if (is_list || PyList_CheckExact(o)) {
+        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
+        if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) {
+            PyObject *r = PyList_GET_ITEM(o, n);
+            Py_INCREF(r);
+            return r;
+        }
+    }
+    else if (PyTuple_CheckExact(o)) {
+        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
+        if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
+            PyObject *r = PyTuple_GET_ITEM(o, n);
+            Py_INCREF(r);
+            return r;
+        }
+    } else {
+        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
+        if (likely(m && m->sq_item)) {
+            if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
+                Py_ssize_t l = m->sq_length(o);
+                if (likely(l >= 0)) {
+                    i += l;
+                } else {
+                    if (PyErr_ExceptionMatches(PyExc_OverflowError))
+                        PyErr_Clear();
+                    else
+                        return NULL;
+                }
+            }
+            return m->sq_item(o, i);
+        }
+    }
+#else
+    if (is_list || PySequence_Check(o)) {
+        return PySequence_GetItem(o, i);
+    }
+#endif
+    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
+}
+
+static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
+    PyObject *result;
+#if CYTHON_COMPILING_IN_CPYTHON
+    result = PyDict_GetItem(__pyx_d, name);
+    if (likely(result)) {
+        Py_INCREF(result);
+    } else {
+#else
+    result = PyObject_GetItem(__pyx_d, name);
+    if (!result) {
+        PyErr_Clear();
+#endif
+        result = __Pyx_GetBuiltinName(name);
+    }
+    return result;
+}
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
+    PyObject *self, *result;
+    PyCFunction cfunc;
+    cfunc = PyCFunction_GET_FUNCTION(func);
+    self = PyCFunction_GET_SELF(func);
+    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
+        return NULL;
+    result = cfunc(self, arg);
+    Py_LeaveRecursiveCall();
+    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
+        PyErr_SetString(
+            PyExc_SystemError,
+            "NULL result without error in PyObject_Call");
+    }
+    return result;
+}
+#endif
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
+    PyObject *result;
+    PyObject *args = PyTuple_New(1);
+    if (unlikely(!args)) return NULL;
+    Py_INCREF(arg);
+    PyTuple_SET_ITEM(args, 0, arg);
+    result = __Pyx_PyObject_Call(func, args, NULL);
+    Py_DECREF(args);
+    return result;
+}
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
+#ifdef __Pyx_CyFunction_USED
+    if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
+#else
+    if (likely(PyCFunction_Check(func))) {
+#endif
+        if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
+            return __Pyx_PyObject_CallMethO(func, arg);
+        }
+    }
+    return __Pyx__PyObject_CallOneArg(func, arg);
+}
+#else
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
+    PyObject* args = PyTuple_Pack(1, arg);
+    return (likely(args)) ? __Pyx_PyObject_Call(func, args, NULL) : NULL;
+}
+#endif
+
+static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
+    int start = 0, mid = 0, end = count - 1;
+    if (end >= 0 && code_line > entries[end].code_line) {
+        return count;
+    }
+    while (start < end) {
+        mid = (start + end) / 2;
+        if (code_line < entries[mid].code_line) {
+            end = mid;
+        } else if (code_line > entries[mid].code_line) {
+             start = mid + 1;
+        } else {
+            return mid;
+        }
+    }
+    if (code_line <= entries[mid].code_line) {
+        return mid;
+    } else {
+        return mid + 1;
+    }
+}
+static PyCodeObject *__pyx_find_code_object(int code_line) {
+    PyCodeObject* code_object;
+    int pos;
+    if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
+        return NULL;
+    }
+    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
+    if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
+        return NULL;
+    }
+    code_object = __pyx_code_cache.entries[pos].code_object;
+    Py_INCREF(code_object);
+    return code_object;
+}
+static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
+    int pos, i;
+    __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
+    if (unlikely(!code_line)) {
+        return;
+    }
+    if (unlikely(!entries)) {
+        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
+        if (likely(entries)) {
+            __pyx_code_cache.entries = entries;
+            __pyx_code_cache.max_count = 64;
+            __pyx_code_cache.count = 1;
+            entries[0].code_line = code_line;
+            entries[0].code_object = code_object;
+            Py_INCREF(code_object);
+        }
+        return;
+    }
+    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
+    if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
+        PyCodeObject* tmp = entries[pos].code_object;
+        entries[pos].code_object = code_object;
+        Py_DECREF(tmp);
+        return;
+    }
+    if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
+        int new_max = __pyx_code_cache.max_count + 64;
+        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
+            __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
+        if (unlikely(!entries)) {
+            return;
+        }
+        __pyx_code_cache.entries = entries;
+        __pyx_code_cache.max_count = new_max;
+    }
+    for (i=__pyx_code_cache.count; i>pos; i--) {
+        entries[i] = entries[i-1];
+    }
+    entries[pos].code_line = code_line;
+    entries[pos].code_object = code_object;
+    __pyx_code_cache.count++;
+    Py_INCREF(code_object);
+}
+
+#include "compile.h"
+#include "frameobject.h"
+#include "traceback.h"
+static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
+            const char *funcname, int c_line,
+            int py_line, const char *filename) {
+    PyCodeObject *py_code = 0;
+    PyObject *py_srcfile = 0;
+    PyObject *py_funcname = 0;
+    #if PY_MAJOR_VERSION < 3
+    py_srcfile = PyString_FromString(filename);
+    #else
+    py_srcfile = PyUnicode_FromString(filename);
+    #endif
+    if (!py_srcfile) goto bad;
+    if (c_line) {
+        #if PY_MAJOR_VERSION < 3
+        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
+        #else
+        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
+        #endif
+    }
+    else {
+        #if PY_MAJOR_VERSION < 3
+        py_funcname = PyString_FromString(funcname);
+        #else
+        py_funcname = PyUnicode_FromString(funcname);
+        #endif
+    }
+    if (!py_funcname) goto bad;
+    py_code = __Pyx_PyCode_New(
+        0,
+        0,
+        0,
+        0,
+        0,
+        __pyx_empty_bytes, /*PyObject *code,*/
+        __pyx_empty_tuple, /*PyObject *consts,*/
+        __pyx_empty_tuple, /*PyObject *names,*/
+        __pyx_empty_tuple, /*PyObject *varnames,*/
+        __pyx_empty_tuple, /*PyObject *freevars,*/
+        __pyx_empty_tuple, /*PyObject *cellvars,*/
+        py_srcfile,   /*PyObject *filename,*/
+        py_funcname,  /*PyObject *name,*/
+        py_line,
+        __pyx_empty_bytes  /*PyObject *lnotab*/
+    );
+    Py_DECREF(py_srcfile);
+    Py_DECREF(py_funcname);
+    return py_code;
+bad:
+    Py_XDECREF(py_srcfile);
+    Py_XDECREF(py_funcname);
+    return NULL;
+}
+static void __Pyx_AddTraceback(const char *funcname, int c_line,
+                               int py_line, const char *filename) {
+    PyCodeObject *py_code = 0;
+    PyFrameObject *py_frame = 0;
+    py_code = __pyx_find_code_object(c_line ? c_line : py_line);
+    if (!py_code) {
+        py_code = __Pyx_CreateCodeObjectForTraceback(
+            funcname, c_line, py_line, filename);
+        if (!py_code) goto bad;
+        __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
+    }
+    py_frame = PyFrame_New(
+        PyThreadState_GET(), /*PyThreadState *tstate,*/
+        py_code,             /*PyCodeObject *code,*/
+        __pyx_d,      /*PyObject *globals,*/
+        0                    /*PyObject *locals*/
+    );
+    if (!py_frame) goto bad;
+    py_frame->f_lineno = py_line;
+    PyTraceBack_Here(py_frame);
+bad:
+    Py_XDECREF(py_code);
+    Py_XDECREF(py_frame);
+}
+
+static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
     PyObject *empty_list = 0;
     PyObject *module = 0;
     PyObject *global_dict = 0;
     PyObject *empty_dict = 0;
     PyObject *list;
-    py_import = __Pyx_GetAttrString(__pyx_b, "__import__");
+    #if PY_VERSION_HEX < 0x03030000
+    PyObject *py_import;
+    py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
     if (!py_import)
         goto bad;
+    #endif
     if (from_list)
         list = from_list;
     else {
@@ -6272,76 +6558,221 @@ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, long level) {
     empty_dict = PyDict_New();
     if (!empty_dict)
         goto bad;
-    #if PY_VERSION_HEX >= 0x02050000
     {
         #if PY_MAJOR_VERSION >= 3
         if (level == -1) {
             if (strchr(__Pyx_MODULE_NAME, '.')) {
-                /* try package relative import first */
+                #if PY_VERSION_HEX < 0x03030000
                 PyObject *py_level = PyInt_FromLong(1);
                 if (!py_level)
                     goto bad;
                 module = PyObject_CallFunctionObjArgs(py_import,
                     name, global_dict, empty_dict, list, py_level, NULL);
                 Py_DECREF(py_level);
+                #else
+                module = PyImport_ImportModuleLevelObject(
+                    name, global_dict, empty_dict, list, 1);
+                #endif
                 if (!module) {
                     if (!PyErr_ExceptionMatches(PyExc_ImportError))
                         goto bad;
                     PyErr_Clear();
                 }
             }
-            level = 0; /* try absolute import on failure */
+            level = 0;
         }
         #endif
         if (!module) {
+            #if PY_VERSION_HEX < 0x03030000
             PyObject *py_level = PyInt_FromLong(level);
             if (!py_level)
                 goto bad;
             module = PyObject_CallFunctionObjArgs(py_import,
                 name, global_dict, empty_dict, list, py_level, NULL);
             Py_DECREF(py_level);
+            #else
+            module = PyImport_ImportModuleLevelObject(
+                name, global_dict, empty_dict, list, level);
+            #endif
         }
     }
-    #else
-    if (level>0) {
-        PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4.");
-        goto bad;
-    }
-    module = PyObject_CallFunctionObjArgs(py_import,
-        name, global_dict, empty_dict, list, NULL);
-    #endif
 bad:
-    Py_XDECREF(empty_list);
+    #if PY_VERSION_HEX < 0x03030000
     Py_XDECREF(py_import);
+    #endif
+    Py_XDECREF(empty_list);
     Py_XDECREF(empty_dict);
     return module;
 }
 
-static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_int32_t(int32_t val) {
-    const int32_t neg_one = (int32_t)-1, const_zero = (int32_t)0;
-    const int is_unsigned = const_zero < neg_one;
-    if ((sizeof(int32_t) == sizeof(char))  ||
-        (sizeof(int32_t) == sizeof(short))) {
-        return PyInt_FromLong((long)val);
-    } else if ((sizeof(int32_t) == sizeof(int)) ||
-               (sizeof(int32_t) == sizeof(long))) {
-        if (is_unsigned)
-            return PyLong_FromUnsignedLong((unsigned long)val);
-        else
-            return PyInt_FromLong((long)val);
-    } else if (sizeof(int32_t) == sizeof(PY_LONG_LONG)) {
-        if (is_unsigned)
-            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)val);
-        else
-            return PyLong_FromLongLong((PY_LONG_LONG)val);
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int32_t(int32_t value) {
+    const int32_t neg_one = (int32_t) -1, const_zero = 0;
+    const int is_unsigned = neg_one > const_zero;
+    if (is_unsigned) {
+        if (sizeof(int32_t) < sizeof(long)) {
+            return PyInt_FromLong((long) value);
+        } else if (sizeof(int32_t) <= sizeof(unsigned long)) {
+            return PyLong_FromUnsignedLong((unsigned long) value);
+        } else if (sizeof(int32_t) <= sizeof(unsigned long long)) {
+            return PyLong_FromUnsignedLongLong((unsigned long long) value);
+        }
     } else {
+        if (sizeof(int32_t) <= sizeof(long)) {
+            return PyInt_FromLong((long) value);
+        } else if (sizeof(int32_t) <= sizeof(long long)) {
+            return PyLong_FromLongLong((long long) value);
+        }
+    }
+    {
         int one = 1; int little = (int)*(unsigned char *)&one;
-        unsigned char *bytes = (unsigned char *)&val;
+        unsigned char *bytes = (unsigned char *)&value;
         return _PyLong_FromByteArray(bytes, sizeof(int32_t),
                                      little, !is_unsigned);
     }
 }
 
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
+    const long neg_one = (long) -1, const_zero = 0;
+    const int is_unsigned = neg_one > const_zero;
+    if (is_unsigned) {
+        if (sizeof(long) < sizeof(long)) {
+            return PyInt_FromLong((long) value);
+        } else if (sizeof(long) <= sizeof(unsigned long)) {
+            return PyLong_FromUnsignedLong((unsigned long) value);
+        } else if (sizeof(long) <= sizeof(unsigned long long)) {
+            return PyLong_FromUnsignedLongLong((unsigned long long) value);
+        }
+    } else {
+        if (sizeof(long) <= sizeof(long)) {
+            return PyInt_FromLong((long) value);
+        } else if (sizeof(long) <= sizeof(long long)) {
+            return PyLong_FromLongLong((long long) value);
+        }
+    }
+    {
+        int one = 1; int little = (int)*(unsigned char *)&one;
+        unsigned char *bytes = (unsigned char *)&value;
+        return _PyLong_FromByteArray(bytes, sizeof(long),
+                                     little, !is_unsigned);
+    }
+}
+
+#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)       \
+    {                                                                     \
+        func_type value = func_value;                                     \
+        if (sizeof(target_type) < sizeof(func_type)) {                    \
+            if (unlikely(value != (func_type) (target_type) value)) {     \
+                func_type zero = 0;                                       \
+                if (is_unsigned && unlikely(value < zero))                \
+                    goto raise_neg_overflow;                              \
+                else                                                      \
+                    goto raise_overflow;                                  \
+            }                                                             \
+        }                                                                 \
+        return (target_type) value;                                       \
+    }
+
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+  #include "longintrepr.h"
+ #endif
+#endif
+
+static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
+    const int neg_one = (int) -1, const_zero = 0;
+    const int is_unsigned = neg_one > const_zero;
+#if PY_MAJOR_VERSION < 3
+    if (likely(PyInt_Check(x))) {
+        if (sizeof(int) < sizeof(long)) {
+            __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
+        } else {
+            long val = PyInt_AS_LONG(x);
+            if (is_unsigned && unlikely(val < 0)) {
+                goto raise_neg_overflow;
+            }
+            return (int) val;
+        }
+    } else
+#endif
+    if (likely(PyLong_Check(x))) {
+        if (is_unsigned) {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+            switch (Py_SIZE(x)) {
+                case  0: return 0;
+                case  1: __PYX_VERIFY_RETURN_INT(int, digit, ((PyLongObject*)x)->ob_digit[0]);
+            }
+ #endif
+#endif
+            if (unlikely(Py_SIZE(x) < 0)) {
+                goto raise_neg_overflow;
+            }
+            if (sizeof(int) <= sizeof(unsigned long)) {
+                __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong(x))
+            } else if (sizeof(int) <= sizeof(unsigned long long)) {
+                __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong(x))
+            }
+        } else {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+            switch (Py_SIZE(x)) {
+                case  0: return 0;
+                case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +(((PyLongObject*)x)->ob_digit[0]));
+                case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
+            }
+ #endif
+#endif
+            if (sizeof(int) <= sizeof(long)) {
+                __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong(x))
+            } else if (sizeof(int) <= sizeof(long long)) {
+                __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong(x))
+            }
+        }
+        {
+#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
+            PyErr_SetString(PyExc_RuntimeError,
+                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
+#else
+            int val;
+            PyObject *v = __Pyx_PyNumber_Int(x);
+ #if PY_MAJOR_VERSION < 3
+            if (likely(v) && !PyLong_Check(v)) {
+                PyObject *tmp = v;
+                v = PyNumber_Long(tmp);
+                Py_DECREF(tmp);
+            }
+ #endif
+            if (likely(v)) {
+                int one = 1; int is_little = (int)*(unsigned char *)&one;
+                unsigned char *bytes = (unsigned char *)&val;
+                int ret = _PyLong_AsByteArray((PyLongObject *)v,
+                                              bytes, sizeof(val),
+                                              is_little, !is_unsigned);
+                Py_DECREF(v);
+                if (likely(!ret))
+                    return val;
+            }
+#endif
+            return (int) -1;
+        }
+    } else {
+        int val;
+        PyObject *tmp = __Pyx_PyNumber_Int(x);
+        if (!tmp) return (int) -1;
+        val = __Pyx_PyInt_As_int(tmp);
+        Py_DECREF(tmp);
+        return val;
+    }
+raise_overflow:
+    PyErr_SetString(PyExc_OverflowError,
+        "value too large to convert to int");
+    return (int) -1;
+raise_neg_overflow:
+    PyErr_SetString(PyExc_OverflowError,
+        "can't convert negative value to int");
+    return (int) -1;
+}
+
 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3
 static PyObject *__Pyx_GetStdout(void) {
     PyObject *f = PySys_GetObject((char *)"stdout");
@@ -6369,10 +6800,15 @@ static int __Pyx_Print(PyObject* f, PyObject *arg_tuple, int newline) {
         if (PyString_Check(v)) {
             char *s = PyString_AsString(v);
             Py_ssize_t len = PyString_Size(v);
-            if (len > 0 &&
-                isspace(Py_CHARMASK(s[len-1])) &&
-                s[len-1] != ' ')
-                    PyFile_SoftSpace(f, 0);
+            if (len > 0) {
+                switch (s[len-1]) {
+                    case ' ': break;
+                    case '\f': case '\r': case '\n': case '\t': case '\v':
+                        PyFile_SoftSpace(f, 0);
+                        break;
+                    default:  break;
+                }
+            }
         }
     }
     if (newline) {
@@ -6386,13 +6822,13 @@ error:
     Py_DECREF(f);
     return -1;
 }
-#else /* Python 3 has a print function */
+#else
 static int __Pyx_Print(PyObject* stream, PyObject *arg_tuple, int newline) {
     PyObject* kwargs = 0;
     PyObject* result = 0;
     PyObject* end_string;
     if (unlikely(!__pyx_print)) {
-        __pyx_print = __Pyx_GetAttrString(__pyx_b, "print");
+        __pyx_print = PyObject_GetAttr(__pyx_b, __pyx_n_s_print);
         if (!__pyx_print)
             return -1;
     }
@@ -6400,13 +6836,13 @@ static int __Pyx_Print(PyObject* stream, PyObject *arg_tuple, int newline) {
         kwargs = PyDict_New();
         if (unlikely(!kwargs))
             return -1;
-        if (unlikely(PyDict_SetItemString(kwargs, "file", stream) < 0))
+        if (unlikely(PyDict_SetItem(kwargs, __pyx_n_s_file, stream) < 0))
             goto bad;
         if (!newline) {
             end_string = PyUnicode_FromStringAndSize(" ", 1);
             if (unlikely(!end_string))
                 goto bad;
-            if (PyDict_SetItemString(kwargs, "end", end_string) < 0) {
+            if (PyDict_SetItem(kwargs, __pyx_n_s_end, end_string) < 0) {
                 Py_DECREF(end_string);
                 goto bad;
             }
@@ -6420,7 +6856,7 @@ static int __Pyx_Print(PyObject* stream, PyObject *arg_tuple, int newline) {
             end_string = PyUnicode_FromStringAndSize(" ", 1);
             if (unlikely(!end_string))
                 return -1;
-            if (PyDict_SetItemString(__pyx_print_kwargs, "end", end_string) < 0) {
+            if (PyDict_SetItem(__pyx_print_kwargs, __pyx_n_s_end, end_string) < 0) {
                 Py_DECREF(end_string);
                 return -1;
             }
@@ -6466,416 +6902,111 @@ error:
      * warnings about unused functions */
     return __Pyx_Print(f, NULL, 0);
 }
-#else /* Python 3 has a print function */
+#else
 static int __Pyx_PrintOne(PyObject* stream, PyObject *o) {
     int res;
     PyObject* arg_tuple = PyTuple_Pack(1, o);
-    if (unlikely(!arg_tuple))
-        return -1;
-    res = __Pyx_Print(stream, arg_tuple, 1);
-    Py_DECREF(arg_tuple);
-    return res;
-}
-#endif
-
-static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) {
-    const unsigned char neg_one = (unsigned char)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(unsigned char) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(unsigned char)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to unsigned char" :
-                    "value too large to convert to unsigned char");
-            }
-            return (unsigned char)-1;
-        }
-        return (unsigned char)val;
-    }
-    return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x);
-}
-
-static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) {
-    const unsigned short neg_one = (unsigned short)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(unsigned short) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(unsigned short)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to unsigned short" :
-                    "value too large to convert to unsigned short");
-            }
-            return (unsigned short)-1;
-        }
-        return (unsigned short)val;
-    }
-    return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x);
-}
-
-static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) {
-    const unsigned int neg_one = (unsigned int)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(unsigned int) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(unsigned int)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to unsigned int" :
-                    "value too large to convert to unsigned int");
-            }
-            return (unsigned int)-1;
-        }
-        return (unsigned int)val;
-    }
-    return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x);
-}
-
-static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) {
-    const char neg_one = (char)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(char) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(char)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to char" :
-                    "value too large to convert to char");
-            }
-            return (char)-1;
-        }
-        return (char)val;
-    }
-    return (char)__Pyx_PyInt_AsLong(x);
-}
-
-static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) {
-    const short neg_one = (short)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(short) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(short)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to short" :
-                    "value too large to convert to short");
-            }
-            return (short)-1;
-        }
-        return (short)val;
-    }
-    return (short)__Pyx_PyInt_AsLong(x);
-}
-
-static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) {
-    const int neg_one = (int)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(int) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(int)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to int" :
-                    "value too large to convert to int");
-            }
-            return (int)-1;
-        }
-        return (int)val;
-    }
-    return (int)__Pyx_PyInt_AsLong(x);
-}
-
-static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) {
-    const signed char neg_one = (signed char)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(signed char) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(signed char)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to signed char" :
-                    "value too large to convert to signed char");
-            }
-            return (signed char)-1;
-        }
-        return (signed char)val;
-    }
-    return (signed char)__Pyx_PyInt_AsSignedLong(x);
-}
-
-static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) {
-    const signed short neg_one = (signed short)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(signed short) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(signed short)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to signed short" :
-                    "value too large to convert to signed short");
-            }
-            return (signed short)-1;
-        }
-        return (signed short)val;
-    }
-    return (signed short)__Pyx_PyInt_AsSignedLong(x);
-}
-
-static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) {
-    const signed int neg_one = (signed int)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(signed int) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(signed int)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to signed int" :
-                    "value too large to convert to signed int");
-            }
-            return (signed int)-1;
-        }
-        return (signed int)val;
-    }
-    return (signed int)__Pyx_PyInt_AsSignedLong(x);
-}
-
-static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) {
-    const int neg_one = (int)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(int) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(int)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to int" :
-                    "value too large to convert to int");
-            }
-            return (int)-1;
-        }
-        return (int)val;
-    }
-    return (int)__Pyx_PyInt_AsLong(x);
-}
-
-static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) {
-    const unsigned long neg_one = (unsigned long)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-#if PY_VERSION_HEX < 0x03000000
-    if (likely(PyInt_Check(x))) {
-        long val = PyInt_AS_LONG(x);
-        if (is_unsigned && unlikely(val < 0)) {
-            PyErr_SetString(PyExc_OverflowError,
-                            "can't convert negative value to unsigned long");
-            return (unsigned long)-1;
-        }
-        return (unsigned long)val;
-    } else
-#endif
-    if (likely(PyLong_Check(x))) {
-        if (is_unsigned) {
-            if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to unsigned long");
-                return (unsigned long)-1;
-            }
-            return (unsigned long)PyLong_AsUnsignedLong(x);
-        } else {
-            return (unsigned long)PyLong_AsLong(x);
-        }
-    } else {
-        unsigned long val;
-        PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (unsigned long)-1;
-        val = __Pyx_PyInt_AsUnsignedLong(tmp);
-        Py_DECREF(tmp);
-        return val;
-    }
-}
-
-static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) {
-    const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-#if PY_VERSION_HEX < 0x03000000
-    if (likely(PyInt_Check(x))) {
-        long val = PyInt_AS_LONG(x);
-        if (is_unsigned && unlikely(val < 0)) {
-            PyErr_SetString(PyExc_OverflowError,
-                            "can't convert negative value to unsigned PY_LONG_LONG");
-            return (unsigned PY_LONG_LONG)-1;
-        }
-        return (unsigned PY_LONG_LONG)val;
-    } else
-#endif
-    if (likely(PyLong_Check(x))) {
-        if (is_unsigned) {
-            if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to unsigned PY_LONG_LONG");
-                return (unsigned PY_LONG_LONG)-1;
-            }
-            return (unsigned PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
-        } else {
-            return (unsigned PY_LONG_LONG)PyLong_AsLongLong(x);
-        }
-    } else {
-        unsigned PY_LONG_LONG val;
-        PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (unsigned PY_LONG_LONG)-1;
-        val = __Pyx_PyInt_AsUnsignedLongLong(tmp);
-        Py_DECREF(tmp);
-        return val;
-    }
+    if (unlikely(!arg_tuple))
+        return -1;
+    res = __Pyx_Print(stream, arg_tuple, 1);
+    Py_DECREF(arg_tuple);
+    return res;
 }
+#endif
 
-static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) {
-    const long neg_one = (long)-1, const_zero = 0;
+static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
+    const long neg_one = (long) -1, const_zero = 0;
     const int is_unsigned = neg_one > const_zero;
-#if PY_VERSION_HEX < 0x03000000
+#if PY_MAJOR_VERSION < 3
     if (likely(PyInt_Check(x))) {
-        long val = PyInt_AS_LONG(x);
-        if (is_unsigned && unlikely(val < 0)) {
-            PyErr_SetString(PyExc_OverflowError,
-                            "can't convert negative value to long");
-            return (long)-1;
+        if (sizeof(long) < sizeof(long)) {
+            __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
+        } else {
+            long val = PyInt_AS_LONG(x);
+            if (is_unsigned && unlikely(val < 0)) {
+                goto raise_neg_overflow;
+            }
+            return (long) val;
         }
-        return (long)val;
     } else
 #endif
     if (likely(PyLong_Check(x))) {
         if (is_unsigned) {
-            if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to long");
-                return (long)-1;
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+            switch (Py_SIZE(x)) {
+                case  0: return 0;
+                case  1: __PYX_VERIFY_RETURN_INT(long, digit, ((PyLongObject*)x)->ob_digit[0]);
             }
-            return (long)PyLong_AsUnsignedLong(x);
-        } else {
-            return (long)PyLong_AsLong(x);
-        }
-    } else {
-        long val;
-        PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (long)-1;
-        val = __Pyx_PyInt_AsLong(tmp);
-        Py_DECREF(tmp);
-        return val;
-    }
-}
-
-static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) {
-    const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-#if PY_VERSION_HEX < 0x03000000
-    if (likely(PyInt_Check(x))) {
-        long val = PyInt_AS_LONG(x);
-        if (is_unsigned && unlikely(val < 0)) {
-            PyErr_SetString(PyExc_OverflowError,
-                            "can't convert negative value to PY_LONG_LONG");
-            return (PY_LONG_LONG)-1;
-        }
-        return (PY_LONG_LONG)val;
-    } else
+ #endif
 #endif
-    if (likely(PyLong_Check(x))) {
-        if (is_unsigned) {
             if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to PY_LONG_LONG");
-                return (PY_LONG_LONG)-1;
+                goto raise_neg_overflow;
+            }
+            if (sizeof(long) <= sizeof(unsigned long)) {
+                __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong(x))
+            } else if (sizeof(long) <= sizeof(unsigned long long)) {
+                __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong(x))
             }
-            return (PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
         } else {
-            return (PY_LONG_LONG)PyLong_AsLongLong(x);
-        }
-    } else {
-        PY_LONG_LONG val;
-        PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (PY_LONG_LONG)-1;
-        val = __Pyx_PyInt_AsLongLong(tmp);
-        Py_DECREF(tmp);
-        return val;
-    }
-}
-
-static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) {
-    const signed long neg_one = (signed long)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-#if PY_VERSION_HEX < 0x03000000
-    if (likely(PyInt_Check(x))) {
-        long val = PyInt_AS_LONG(x);
-        if (is_unsigned && unlikely(val < 0)) {
-            PyErr_SetString(PyExc_OverflowError,
-                            "can't convert negative value to signed long");
-            return (signed long)-1;
-        }
-        return (signed long)val;
-    } else
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+            switch (Py_SIZE(x)) {
+                case  0: return 0;
+                case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +(((PyLongObject*)x)->ob_digit[0]));
+                case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
+            }
+ #endif
 #endif
-    if (likely(PyLong_Check(x))) {
-        if (is_unsigned) {
-            if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to signed long");
-                return (signed long)-1;
+            if (sizeof(long) <= sizeof(long)) {
+                __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong(x))
+            } else if (sizeof(long) <= sizeof(long long)) {
+                __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong(x))
             }
-            return (signed long)PyLong_AsUnsignedLong(x);
-        } else {
-            return (signed long)PyLong_AsLong(x);
-        }
-    } else {
-        signed long val;
-        PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (signed long)-1;
-        val = __Pyx_PyInt_AsSignedLong(tmp);
-        Py_DECREF(tmp);
-        return val;
-    }
-}
-
-static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) {
-    const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-#if PY_VERSION_HEX < 0x03000000
-    if (likely(PyInt_Check(x))) {
-        long val = PyInt_AS_LONG(x);
-        if (is_unsigned && unlikely(val < 0)) {
-            PyErr_SetString(PyExc_OverflowError,
-                            "can't convert negative value to signed PY_LONG_LONG");
-            return (signed PY_LONG_LONG)-1;
         }
-        return (signed PY_LONG_LONG)val;
-    } else
-#endif
-    if (likely(PyLong_Check(x))) {
-        if (is_unsigned) {
-            if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to signed PY_LONG_LONG");
-                return (signed PY_LONG_LONG)-1;
+        {
+#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
+            PyErr_SetString(PyExc_RuntimeError,
+                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
+#else
+            long val;
+            PyObject *v = __Pyx_PyNumber_Int(x);
+ #if PY_MAJOR_VERSION < 3
+            if (likely(v) && !PyLong_Check(v)) {
+                PyObject *tmp = v;
+                v = PyNumber_Long(tmp);
+                Py_DECREF(tmp);
             }
-            return (signed PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
-        } else {
-            return (signed PY_LONG_LONG)PyLong_AsLongLong(x);
+ #endif
+            if (likely(v)) {
+                int one = 1; int is_little = (int)*(unsigned char *)&one;
+                unsigned char *bytes = (unsigned char *)&val;
+                int ret = _PyLong_AsByteArray((PyLongObject *)v,
+                                              bytes, sizeof(val),
+                                              is_little, !is_unsigned);
+                Py_DECREF(v);
+                if (likely(!ret))
+                    return val;
+            }
+#endif
+            return (long) -1;
         }
     } else {
-        signed PY_LONG_LONG val;
+        long val;
         PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (signed PY_LONG_LONG)-1;
-        val = __Pyx_PyInt_AsSignedLongLong(tmp);
+        if (!tmp) return (long) -1;
+        val = __Pyx_PyInt_As_long(tmp);
         Py_DECREF(tmp);
         return val;
     }
+raise_overflow:
+    PyErr_SetString(PyExc_OverflowError,
+        "value too large to convert to long");
+    return (long) -1;
+raise_neg_overflow:
+    PyErr_SetString(PyExc_OverflowError,
+        "can't convert negative value to long");
+    return (long) -1;
 }
 
 static int __Pyx_check_binary_version(void) {
@@ -6888,177 +7019,11 @@ static int __Pyx_check_binary_version(void) {
                       "compiletime version %s of module '%.100s' "
                       "does not match runtime version %s",
                       ctversion, __Pyx_MODULE_NAME, rtversion);
-        #if PY_VERSION_HEX < 0x02050000
-        return PyErr_Warn(NULL, message);
-        #else
         return PyErr_WarnEx(NULL, message, 1);
-        #endif
     }
     return 0;
 }
 
-static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
-    int start = 0, mid = 0, end = count - 1;
-    if (end >= 0 && code_line > entries[end].code_line) {
-        return count;
-    }
-    while (start < end) {
-        mid = (start + end) / 2;
-        if (code_line < entries[mid].code_line) {
-            end = mid;
-        } else if (code_line > entries[mid].code_line) {
-             start = mid + 1;
-        } else {
-            return mid;
-        }
-    }
-    if (code_line <= entries[mid].code_line) {
-        return mid;
-    } else {
-        return mid + 1;
-    }
-}
-static PyCodeObject *__pyx_find_code_object(int code_line) {
-    PyCodeObject* code_object;
-    int pos;
-    if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
-        return NULL;
-    }
-    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
-    if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
-        return NULL;
-    }
-    code_object = __pyx_code_cache.entries[pos].code_object;
-    Py_INCREF(code_object);
-    return code_object;
-}
-static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
-    int pos, i;
-    __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
-    if (unlikely(!code_line)) {
-        return;
-    }
-    if (unlikely(!entries)) {
-        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
-        if (likely(entries)) {
-            __pyx_code_cache.entries = entries;
-            __pyx_code_cache.max_count = 64;
-            __pyx_code_cache.count = 1;
-            entries[0].code_line = code_line;
-            entries[0].code_object = code_object;
-            Py_INCREF(code_object);
-        }
-        return;
-    }
-    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
-    if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
-        PyCodeObject* tmp = entries[pos].code_object;
-        entries[pos].code_object = code_object;
-        Py_DECREF(tmp);
-        return;
-    }
-    if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
-        int new_max = __pyx_code_cache.max_count + 64;
-        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
-            __pyx_code_cache.entries, new_max*sizeof(__Pyx_CodeObjectCacheEntry));
-        if (unlikely(!entries)) {
-            return;
-        }
-        __pyx_code_cache.entries = entries;
-        __pyx_code_cache.max_count = new_max;
-    }
-    for (i=__pyx_code_cache.count; i>pos; i--) {
-        entries[i] = entries[i-1];
-    }
-    entries[pos].code_line = code_line;
-    entries[pos].code_object = code_object;
-    __pyx_code_cache.count++;
-    Py_INCREF(code_object);
-}
-
-#include "compile.h"
-#include "frameobject.h"
-#include "traceback.h"
-static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
-            const char *funcname, int c_line,
-            int py_line, const char *filename) {
-    PyCodeObject *py_code = 0;
-    PyObject *py_srcfile = 0;
-    PyObject *py_funcname = 0;
-    #if PY_MAJOR_VERSION < 3
-    py_srcfile = PyString_FromString(filename);
-    #else
-    py_srcfile = PyUnicode_FromString(filename);
-    #endif
-    if (!py_srcfile) goto bad;
-    if (c_line) {
-        #if PY_MAJOR_VERSION < 3
-        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
-        #else
-        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
-        #endif
-    }
-    else {
-        #if PY_MAJOR_VERSION < 3
-        py_funcname = PyString_FromString(funcname);
-        #else
-        py_funcname = PyUnicode_FromString(funcname);
-        #endif
-    }
-    if (!py_funcname) goto bad;
-    py_code = __Pyx_PyCode_New(
-        0,            /*int argcount,*/
-        0,            /*int kwonlyargcount,*/
-        0,            /*int nlocals,*/
-        0,            /*int stacksize,*/
-        0,            /*int flags,*/
-        __pyx_empty_bytes, /*PyObject *code,*/
-        __pyx_empty_tuple, /*PyObject *consts,*/
-        __pyx_empty_tuple, /*PyObject *names,*/
-        __pyx_empty_tuple, /*PyObject *varnames,*/
-        __pyx_empty_tuple, /*PyObject *freevars,*/
-        __pyx_empty_tuple, /*PyObject *cellvars,*/
-        py_srcfile,   /*PyObject *filename,*/
-        py_funcname,  /*PyObject *name,*/
-        py_line,      /*int firstlineno,*/
-        __pyx_empty_bytes  /*PyObject *lnotab*/
-    );
-    Py_DECREF(py_srcfile);
-    Py_DECREF(py_funcname);
-    return py_code;
-bad:
-    Py_XDECREF(py_srcfile);
-    Py_XDECREF(py_funcname);
-    return NULL;
-}
-static void __Pyx_AddTraceback(const char *funcname, int c_line,
-                               int py_line, const char *filename) {
-    PyCodeObject *py_code = 0;
-    PyObject *py_globals = 0;
-    PyFrameObject *py_frame = 0;
-    py_code = __pyx_find_code_object(c_line ? c_line : py_line);
-    if (!py_code) {
-        py_code = __Pyx_CreateCodeObjectForTraceback(
-            funcname, c_line, py_line, filename);
-        if (!py_code) goto bad;
-        __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
-    }
-    py_globals = PyModule_GetDict(__pyx_m);
-    if (!py_globals) goto bad;
-    py_frame = PyFrame_New(
-        PyThreadState_GET(), /*PyThreadState *tstate,*/
-        py_code,             /*PyCodeObject *code,*/
-        py_globals,          /*PyObject *globals,*/
-        0                    /*PyObject *locals*/
-    );
-    if (!py_frame) goto bad;
-    py_frame->f_lineno = py_line;
-    PyTraceBack_Here(py_frame);
-bad:
-    Py_XDECREF(py_code);
-    Py_XDECREF(py_frame);
-}
-
 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
     while (t->p) {
         #if PY_MAJOR_VERSION < 3
@@ -7069,7 +7034,7 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
         } else {
             *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
         }
-        #else  /* Python 3+ has unicode identifiers */
+        #else
         if (t->is_unicode | t->is_str) {
             if (t->intern) {
                 *t->p = PyUnicode_InternFromString(t->s);
@@ -7089,27 +7054,88 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
     return 0;
 }
 
-
-/* Type Conversion Functions */
-
+static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
+    return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
+}
+static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
+    Py_ssize_t ignore;
+    return __Pyx_PyObject_AsStringAndSize(o, &ignore);
+}
+static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
+#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
+    if (
+#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+            __Pyx_sys_getdefaultencoding_not_ascii &&
+#endif
+            PyUnicode_Check(o)) {
+#if PY_VERSION_HEX < 0x03030000
+        char* defenc_c;
+        PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
+        if (!defenc) return NULL;
+        defenc_c = PyBytes_AS_STRING(defenc);
+#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+        {
+            char* end = defenc_c + PyBytes_GET_SIZE(defenc);
+            char* c;
+            for (c = defenc_c; c < end; c++) {
+                if ((unsigned char) (*c) >= 128) {
+                    PyUnicode_AsASCIIString(o);
+                    return NULL;
+                }
+            }
+        }
+#endif
+        *length = PyBytes_GET_SIZE(defenc);
+        return defenc_c;
+#else
+        if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
+#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+        if (PyUnicode_IS_ASCII(o)) {
+            *length = PyUnicode_GET_LENGTH(o);
+            return PyUnicode_AsUTF8(o);
+        } else {
+            PyUnicode_AsASCIIString(o);
+            return NULL;
+        }
+#else
+        return PyUnicode_AsUTF8AndSize(o, length);
+#endif
+#endif
+    } else
+#endif
+#if !CYTHON_COMPILING_IN_PYPY
+    if (PyByteArray_Check(o)) {
+        *length = PyByteArray_GET_SIZE(o);
+        return PyByteArray_AS_STRING(o);
+    } else
+#endif
+    {
+        char* result;
+        int r = PyBytes_AsStringAndSize(o, &result, length);
+        if (unlikely(r < 0)) {
+            return NULL;
+        } else {
+            return result;
+        }
+    }
+}
 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
    int is_true = x == Py_True;
    if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
    else return PyObject_IsTrue(x);
 }
-
 static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
   PyNumberMethods *m;
   const char *name = NULL;
   PyObject *res = NULL;
-#if PY_VERSION_HEX < 0x03000000
+#if PY_MAJOR_VERSION < 3
   if (PyInt_Check(x) || PyLong_Check(x))
 #else
   if (PyLong_Check(x))
 #endif
     return Py_INCREF(x), x;
   m = Py_TYPE(x)->tp_as_number;
-#if PY_VERSION_HEX < 0x03000000
+#if PY_MAJOR_VERSION < 3
   if (m && m->nb_int) {
     name = "int";
     res = PyNumber_Int(x);
@@ -7125,13 +7151,13 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
   }
 #endif
   if (res) {
-#if PY_VERSION_HEX < 0x03000000
+#if PY_MAJOR_VERSION < 3
     if (!PyInt_Check(res) && !PyLong_Check(res)) {
 #else
     if (!PyLong_Check(res)) {
 #endif
       PyErr_Format(PyExc_TypeError,
-                   "__%s__ returned non-%s (type %.200s)",
+                   "__%.4s__ returned non-%.4s (type %.200s)",
                    name, name, Py_TYPE(res)->tp_name);
       Py_DECREF(res);
       return NULL;
@@ -7143,40 +7169,33 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
   }
   return res;
 }
-
 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
   Py_ssize_t ival;
-  PyObject* x = PyNumber_Index(b);
+  PyObject *x;
+#if PY_MAJOR_VERSION < 3
+  if (likely(PyInt_CheckExact(b)))
+      return PyInt_AS_LONG(b);
+#endif
+  if (likely(PyLong_CheckExact(b))) {
+    #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+     #if CYTHON_USE_PYLONG_INTERNALS
+       switch (Py_SIZE(b)) {
+       case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0];
+       case  0: return 0;
+       case  1: return ((PyLongObject*)b)->ob_digit[0];
+       }
+     #endif
+    #endif
+    return PyLong_AsSsize_t(b);
+  }
+  x = PyNumber_Index(b);
   if (!x) return -1;
   ival = PyInt_AsSsize_t(x);
   Py_DECREF(x);
   return ival;
 }
-
 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
-#if PY_VERSION_HEX < 0x02050000
-   if (ival <= LONG_MAX)
-       return PyInt_FromLong((long)ival);
-   else {
-       unsigned char *bytes = (unsigned char *) &ival;
-       int one = 1; int little = (int)*(unsigned char*)&one;
-       return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0);
-   }
-#else
-   return PyInt_FromSize_t(ival);
-#endif
-}
-
-static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) {
-   unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x);
-   if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) {
-       return (size_t)-1;
-   } else if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) {
-       PyErr_SetString(PyExc_OverflowError,
-                       "value too large to convert to size_t");
-       return (size_t)-1;
-   }
-   return (size_t)val;
+    return PyInt_FromSize_t(ival);
 }
 
 
diff --git a/g2clib.pyx b/g2clib.pyx
index 44a4f57..a36721c 100755
--- a/g2clib.pyx
+++ b/g2clib.pyx
@@ -56,9 +56,12 @@ def rtoi_ieee(object rarr, object iarr):
     """
  Converts a float32 array into an int32 array of IEEE formatted values
     """
-    cdef void *rdat, *idat
-    cdef g2float *rdata, r1
-    cdef g2int *idata, i1
+    cdef void *rdat
+    cdef void *idat
+    cdef g2float *rdata
+    cdef g2float r1
+    cdef g2int *idata
+    cdef g2int i1
     cdef Py_ssize_t bufleni, buflenr
     if PyObject_AsReadBuffer(rarr, &rdat, &buflenr) <> 0:
         raise RuntimeError, 'error getting buffer for input real array'
@@ -74,7 +77,8 @@ def itor_ieee(object iarr, object rarr):
     """
  Converts an int32 array of IEEE values into a float32 array.
     """
-    cdef void *rdat, *idat
+    cdef void *rdat
+    cdef void *idat
     cdef g2float *rdata
     cdef g2int *idata
     cdef Py_ssize_t bufleni, buflenr
@@ -219,7 +223,9 @@ def unpack3(gribmsg, ipos, object zeros):
                 6 = memory allocation error
     """
     cdef unsigned char *cgrib
-    cdef g2int *igds, *igdstmpl, *ideflist
+    cdef g2int *igds
+    cdef g2int *igdstmpl
+    cdef g2int *ideflist
     cdef g2int mapgridlen, iofst, idefnum, ierr
     cgrib = <unsigned char *>PyBytes_AsString(gribmsg)
     iofst = <g2int>PyInt_AsLong(ipos*8)
@@ -416,9 +422,11 @@ def unpack7(gribmsg,gdtnum,object gdtmpl,drtnum,object drtmpl,ndpts,ipos,object
     """
     cdef unsigned char *cgrib
     cdef g2int iofst, ierr, ngpts, idrsnum, igdsnum
-    cdef g2int *igdstmpl, *idrstmpl
+    cdef g2int *igdstmpl
+    cdef g2int *idrstmpl
     cdef g2float *fld
-    cdef void *drtmpldat, *gdtmpldat
+    cdef void *drtmpldat
+    cdef void *gdtmpldat
     cdef float rmin, rmax
     cdef int n
     cdef Py_ssize_t buflen
@@ -498,8 +506,11 @@ def grib2_create(object listsec0, object listsec1):
               > 0 = Current size of new GRIB2 message
                -1 = Tried to use for version other than GRIB Edition 2
     """
-    cdef g2int *isec0, *isec1, ierr
-    cdef void *listsec0dat, *listsec1dat
+    cdef g2int *isec0
+    cdef g2int *isec1
+    cdef g2int ierr
+    cdef void *listsec0dat
+    cdef void *listsec1dat
     cdef Py_ssize_t buflen
     cdef unsigned char *cgrib
     # cgrib needs to be big enough to hold sec0 and sec1.
@@ -606,9 +617,14 @@ def grib2_addgrid(gribmsg,object gds,object gdstmpl,object deflist=None, defnum
                -4 = Previous Section was not 1, 2 or 7.
                -5 = Could not find requested Grid Definition Template.
     """
-    cdef g2int ierr, idefnum, *igds, *igdstmpl, *ideflist
+    cdef g2int ierr, idefnum
+    cdef g2int *igds
+    cdef g2int *igdstmpl
+    cdef g2int *ideflist
     cdef unsigned char  *cgrib
-    cdef void *gdsdat, *deflistdat, *gdstmpldat
+    cdef void *gdsdat
+    cdef void *deflistdat
+    cdef void *gdstmpldat
     cdef Py_ssize_t buflen
     PyObject_AsReadBuffer(gds, &gdsdat, &buflen) 
     PyObject_AsReadBuffer(gdstmpl, &gdstmpldat, &buflen) 
@@ -703,10 +719,18 @@ def grib2_addfield(gribmsg,pdsnum,object pdstmpl,object coordlist,
                     using DRT 5.51.
               -10 = Error packing data field. 
     """
-    cdef g2int ierr,ipdsnum,numcoord,*ipdstmpl,idrsnum,*idrstmpl
-    cdef g2float *fld, *fcoordlist
-    cdef g2int *bmap, ngrdpts, ibmap
-    cdef void *pdtmpldat, *drtmpldat, *coordlistdat, *fielddat, *bitmapdat
+    cdef g2int ierr,ipdsnum,numcoord,idrsnum
+    cdef g2int *ipdstmpl
+    cdef g2int *idrstmpl
+    cdef g2float *fld
+    cdef g2float *fcoordlist
+    cdef g2int *bmap
+    cdef g2int ngrdpts, ibmap
+    cdef void *pdtmpldat
+    cdef void *drtmpldat
+    cdef void *coordlistdat
+    cdef void *fielddat
+    cdef void *bitmapdat
     cdef Py_ssize_t buflen
     cdef unsigned char *cgrib
     ipdsnum = <g2int>PyInt_AsLong(pdsnum)
diff --git a/g2clib_src/CHANGES b/g2clib_src/CHANGES
new file mode 100644
index 0000000..e6beba8
--- /dev/null
+++ b/g2clib_src/CHANGES
@@ -0,0 +1,68 @@
+glib-1.0   - August 2003 - Original version
+
+g2libc-1.0.1 - May 2004 - Changed the library name from "libg2c.a" to 
+                          "libgrib2c.a" to avoid conflict with the g77 libg2c
+                          library.
+                        - Added support for Grid Definition Template 3.31,
+                          Albers Equal Area.
+                        - Changed most PDT templates in module pdstemplates to
+                          allow negative surface values.
+                        - Many minor changes to help get clean compiles.
+
+g2libc-1.0.2 - December 2004 - WMO approved the JPEG2000 and PNG Data
+                             Representation Templates ( 5.40000 and 5.40010,
+                             respectively ) for operational use.  The templates
+                             were assigned WMO values of 5.40 and 5.41,
+                             respectively.  Changes were made to the source to
+                             recognize either template number.
+                           - Fixed bug encountered when packing a near constant
+                             field with DRT 5.40 or 5.40000 (JPEG2000).
+                           - Added consistency check, provided by 
+                             Arthur Taylor/MDL, used when unpacking Data 
+                             Templates 7.2 and 7.3.
+                           - Added functionality to support encoding of
+                             "Missing" data values within the data field when
+                             using Data Representation Templates 5.2
+                             (complex packing) and 5.3 (complex packing and
+                             spatial differencing).  See octets 23 - 31 in DRTs
+                             5.2 and 5.3 for more info on missing value
+                             management.
+                           - Increased the packing efficiency of Data
+                             Representation Templates 5.2 and 5.3 by adding
+                             MDL/Glahn algorithm for determining effective
+                             groupings.
+
+g2libc-1.0.3 - December 2005 - Two bug fixes:  1) Error encoding constant
+                               data field.  2)  Error encoding grid with
+                               large bitmap using DRT 5.40 - JPEG2000.
+
+g2libc-1.0.5 - August   2007 - Added GDT 3.204  Curvilinear Orthogonal Grid
+
+g2libc-1.1.7 - August   2008 - Added GDT 3.32768 Rot Lat/Lon E-grid (Arakawa)
+
+g2libc-1.1.8 - January  2009 - Initialize variable lencsec2 in routine g2_unpack2.c
+                               variable ndpts in routine g2_unpack7.c
+                             - Changed the structure name template to gtemplate to avoid 
+                               of reserved word in C++ 
+                             - Change routine seekgb.c to use 4 bytes instead of sizeof(g2int)
+
+g2libc-1.1.9 - June     2009 - Updated version jasper-1.900.1, libpng-1.2.35 and zlib-1.2.3
+                             - Fixed bug causing seg fault when using PNG 1.2.35
+
+g2libc-1.2.0 - March    2010 - Added PDT 4.31 Satellite Product
+                             - Added PDT 4.15 WAFS Product
+
+g2libc-1.2.1 - August   2010 - Added PDT 4.40,4.41,4.42,4.43 for Atmospheric Chemical Constituents
+                             - Added GDT 3.32769 Rot Lat/Lon None E-grid (Arakawa)
+                             - If section 2 has zero length, return IERR=0
+
+g2libc-1.2.2 - March    2011 - Corrected PDT 4.42,4.43 for Atmospheric Chemical Constituents
+
+g2libc-1.2.3 - November 2011 - Fixed bugs in routines dec_png.c and enc_png.c
+
+g2libc-1.4.0 - May      2012 - Added PDT 4.44,4.45,4.46,4.47,4.48 for Aerosol products
+                             - PDT 4.50,4.51,4.52 iand 4.91 for Categorical forecast at a horizonal
+
+g2libc-1.5.0 - Sept.    2013 - Added PDT 4.33,4.34,4.53,4.54,4.50
+                             - Added GDT 3.4,3.5,3.12,3.101,3.140
+                             - Free up memory igds
diff --git a/g2clib_src/README b/g2clib_src/README
new file mode 100644
index 0000000..ed64281
--- /dev/null
+++ b/g2clib_src/README
@@ -0,0 +1,68 @@
+                                                           August 06, 2013
+                                                           W/SIB:VUONG
+
+
+g2clib Library.
+
+This library contains "C" decoder/encoder
+routines for GRIB edition 2.  The user API for the GRIB2 routines
+is described in file "grib2c.doc".
+
+This "C" source code conatins many uses of the C++
+comment style "//".  Please make sure you include the
+appropriate compiler option in the CFLAGS variable in the
+makefile to allow the use of "//" comment indicators.
+
+
+We have added support for PNG and JPEG2000 image compression
+algorithms within the GRIB2 standard.  If you would like
+to compile this library to utilize these GRIB2 Templates,
+make sure that -DUSE_PNG and -DUSE_JPEG2000 are specified
+in the DEFS variable in the makefile.  You will also need
+to download and install the external libraries listed below,
+if they are not already installed on your system.
+
+If you do not wish to bother with the external libs and
+don't need PNG and JPEG2000 support, you can remove the
+-DUSE_PNG and -DUSE_JPEG2000 flags from the DEFS variable 
+in the makefile.
+
+
+-------------------------------------------------------------------------------
+
+     External Libraries:
+
+libjasper.a - This library is a C implementation of the JPEG-2000 Part-1 
+              standard (i.e., ISO/IEC 15444-1).  This library is required
+              if JPEG2000 support in GRIB2 is desired.  If not, remove
+              the -DUSE_JPEG2000 option from the DEFS variable 
+              in the makefile.
+
+              Download version jasper-1.900.1 from the JasPer Project's
+              home page, http://www.ece.uvic.ca/~mdadams/jasper/.
+        
+              More information about JPEG2000 can be found at 
+              http://www.jpeg.org/JPEG2000.html.
+
+libpng.a      This library is a C implementation of the Portable Network
+              Graphics PNG image compression format.  This library is required
+              if PNG support in GRIB2 is desired.  If not, remove
+              the -DUSE_PNG option from the DEFS variable
+              in the makefile.
+
+              If not already installed on your system, download version 
+              libpng-1.2.44 from http://www.libpng.org/pub/png/libpng.html.
+
+              More information about PNG can be found at 
+              http://www.libpng.org/pub/png/.
+
+libz.a        This library contains compression/decompression routines
+              used by libpng.a for PNG image compression support. 
+              This library is required if PNG support in GRIB2 is desired.  
+              If not, remove the -DUSE_PNG option from the DEFS variable
+              in g2lib/makefile.
+
+              If not already installed on your system, download version 
+              zlib-1.2.6 from http://www.gzip.org/zlib/.
+
+
diff --git a/g2clib_src/cmplxpack.c b/g2clib_src/cmplxpack.c
new file mode 100755
index 0000000..4d9908c
--- /dev/null
+++ b/g2clib_src/cmplxpack.c
@@ -0,0 +1,75 @@
+#include "grib2.h"
+
+void cmplxpack(g2float *fld,g2int ndpts, g2int idrsnum,g2int *idrstmpl,
+               unsigned char *cpack, g2int *lcpack)
+//$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    cmplxpack
+//   PRGMMR: Gilbert          ORG: W/NP11    DATE: 2004-08-27
+//
+// ABSTRACT: This subroutine packs up a data field using a complex
+//   packing algorithm as defined in the GRIB2 documention.  It
+//   supports GRIB2 complex packing templates with or without
+//   spatial differences (i.e. DRTs 5.2 and 5.3).
+//   It also fills in GRIB2 Data Representation Template 5.2 or 5.3 
+//   with the appropriate values.
+//
+// PROGRAM HISTORY LOG:
+// 2004-08-27  Gilbert
+//
+// USAGE:    cmplxpack(g2float *fld,g2int ndpts, g2int idrsnum,g2int *idrstmpl,
+//             unsigned char *cpack, g2int *lcpack)
+//   INPUT ARGUMENT LIST:
+//     fld[]    - Contains the data values to pack
+//     ndpts    - The number of data values in array fld[]
+//     idrsnum  - Data Representation Template number 5.N
+//                Must equal 2 or 3.
+//     idrstmpl - Contains the array of values for Data Representation
+//                Template 5.2 or 5.3
+//                [0] = Reference value - ignored on input
+//                [1] = Binary Scale Factor
+//                [2] = Decimal Scale Factor
+//                    .
+//                    .
+//                [6] = Missing value management
+//                [7] = Primary missing value
+//                [8] = Secondary missing value
+//                    .
+//                    .
+//               [16] = Order of Spatial Differencing  ( 1 or 2 )
+//                    .
+//                    .
+//
+//   OUTPUT ARGUMENT LIST: 
+//     idrstmpl - Contains the array of values for Data Representation
+//                Template 5.3
+//                [0] = Reference value - set by compack routine.
+//                [1] = Binary Scale Factor - unchanged from input
+//                [2] = Decimal Scale Factor - unchanged from input
+//                    .
+//                    .
+//     cpack    - The packed data field (character*1 array)
+//     lcpack   - length of packed field cpack[].
+//
+// REMARKS: None
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE:  IBM SP
+//
+//$$$
+{
+      
+
+      if ( idrstmpl[6] == 0 ) {       // No internal missing values
+         compack(fld,ndpts,idrsnum,idrstmpl,cpack,lcpack);
+      }
+      else if ( idrstmpl[6] == 1  ||  idrstmpl[6] == 2) {
+         misspack(fld,ndpts,idrsnum,idrstmpl,cpack,lcpack);
+      }
+      else {
+         printf("cmplxpack: Don:t recognize Missing value option.");
+         *lcpack=-1;
+      }
+
+}
diff --git a/g2clib_src/compack.c b/g2clib_src/compack.c
new file mode 100755
index 0000000..50fb01f
--- /dev/null
+++ b/g2clib_src/compack.c
@@ -0,0 +1,416 @@
+#include <stdlib.h>
+#include <math.h>
+#include "grib2.h"
+
+
+void compack(g2float *fld,g2int ndpts,g2int idrsnum,g2int *idrstmpl,
+             unsigned char *cpack,g2int *lcpack)
+//$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    compack
+//   PRGMMR: Gilbert          ORG: W/NP11    DATE: 2002-11-07
+//
+// ABSTRACT: This subroutine packs up a data field using a complex
+//   packing algorithm as defined in the GRIB2 documention.  It
+//   supports GRIB2 complex packing templates with or without
+//   spatial differences (i.e. DRTs 5.2 and 5.3).
+//   It also fills in GRIB2 Data Representation Template 5.2 or 5.3 
+//   with the appropriate values.
+//
+// PROGRAM HISTORY LOG:
+// 2002-11-07  Gilbert
+//
+// USAGE:    void compack(g2float *fld,g2int ndpts,g2int idrsnum,
+//                g2int *idrstmpl,unsigned char *cpack,g2int *lcpack)
+//
+//   INPUT ARGUMENTS:
+//     fld[]    - Contains the data values to pack
+//     ndpts    - The number of data values in array fld[]
+//     idrsnum  - Data Representation Template number 5.N
+//                Must equal 2 or 3.
+//     idrstmpl - Contains the array of values for Data Representation
+//                Template 5.2 or 5.3
+//                [0] = Reference value - ignored on input
+//                [1] = Binary Scale Factor
+//                [2] = Decimal Scale Factor
+//                    .
+//                    .
+//                [6] = Missing value management
+//                [7] = Primary missing value
+//                [8] = Secondary missing value
+//                    .
+//                    .
+//               [16] = Order of Spatial Differencing  ( 1 or 2 )
+//                    .
+//                    .
+//
+//   OUTPUT ARGUMENTS: 
+//     idrstmpl - Contains the array of values for Data Representation
+//                Template 5.3
+//                [0] = Reference value - set by compack routine.
+//                [1] = Binary Scale Factor - unchanged from input
+//                [2] = Decimal Scale Factor - unchanged from input
+//                    .
+//                    .
+//     cpack    - The packed data field
+//     lcpack   - length of packed field cpack.
+//
+// REMARKS: None
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE:
+//
+//$$$
+{
+
+      static g2int zero=0;
+      g2int  *ifld,*gref,*glen,*gwidth;
+      g2int  *jmin, *jmax, *lbit;
+      g2int  i,j,n,nbits,imin,imax,left;
+      g2int  isd,itemp,ilmax,ngwidthref=0,nbitsgwidth=0;
+      g2int  nglenref=0,nglenlast=0,iofst,ival1,ival2;
+      g2int  minsd,nbitsd=0,maxorig,nbitorig,ngroups;
+      g2int  lg,ng,igmax,iwmax,nbitsgref;
+      g2int  glength,grpwidth,nbitsglen=0;
+      g2int  kfildo, minpk, inc, maxgrps, ibit, jbit, kbit, novref, lbitref;
+      g2int  missopt, miss1, miss2, ier;
+      g2float  bscale,dscale,rmax,rmin,temp;
+      static g2int simple_alg = 0;
+      static g2float alog2=0.69314718;       //  ln(2.0)
+      static g2int one=1;
+
+      bscale=int_power(2.0,-idrstmpl[1]);
+      dscale=int_power(10.0,idrstmpl[2]);
+//
+//  Find max and min values in the data
+//
+      rmax=fld[0];
+      rmin=fld[0];
+      for (j=1;j<ndpts;j++) {
+        if (fld[j] > rmax) rmax=fld[j];
+        if (fld[j] < rmin) rmin=fld[j];
+      }
+
+//
+//  If max and min values are not equal, pack up field.
+//  If they are equal, we have a constant field, and the reference
+//  value (rmin) is the value for each point in the field and
+//  set nbits to 0.
+//
+      if (rmin != rmax) {
+        iofst=0;
+        ifld=calloc(ndpts,sizeof(g2int));
+        gref=calloc(ndpts,sizeof(g2int));
+        gwidth=calloc(ndpts,sizeof(g2int));
+        glen=calloc(ndpts,sizeof(g2int));
+        //
+        //  Scale original data
+        //
+        if (idrstmpl[1] == 0) {        //  No binary scaling
+           imin=(g2int)rint(rmin*dscale);
+           //imax=(g2int)rint(rmax*dscale);
+           rmin=(g2float)imin;
+           for (j=0;j<ndpts;j++) 
+              ifld[j]=(g2int)rint(fld[j]*dscale)-imin;
+        }
+        else {                             //  Use binary scaling factor
+           rmin=rmin*dscale;
+           //rmax=rmax*dscale;
+           for (j=0;j<ndpts;j++) 
+             ifld[j]=(g2int)rint(((fld[j]*dscale)-rmin)*bscale);
+        }
+        //
+        //  Calculate Spatial differences, if using DRS Template 5.3
+        //
+        if (idrsnum == 3) {        // spatial differences
+           if (idrstmpl[16]!=1 && idrstmpl[16]!=2) idrstmpl[16]=1;
+           if (idrstmpl[16] == 1) {      // first order
+              ival1=ifld[0];
+              for (j=ndpts-1;j>0;j--) 
+                 ifld[j]=ifld[j]-ifld[j-1];
+              ifld[0]=0;
+           }
+           else if (idrstmpl[16] == 2) {      // second order
+              ival1=ifld[0];
+              ival2=ifld[1];
+              for (j=ndpts-1;j>1;j--) 
+                 ifld[j]=ifld[j]-(2*ifld[j-1])+ifld[j-2];
+              ifld[0]=0;
+              ifld[1]=0;
+           }
+           //
+           //  subtract min value from spatial diff field
+           //
+           isd=idrstmpl[16];
+           minsd=ifld[isd];
+           for (j=isd;j<ndpts;j++)  if ( ifld[j] < minsd ) minsd=ifld[j];
+           for (j=isd;j<ndpts;j++)  ifld[j]=ifld[j]-minsd;
+           //
+           //   find num of bits need to store minsd and add 1 extra bit
+           //   to indicate sign
+           //
+           temp=log((double)(abs(minsd)+1))/alog2;
+           nbitsd=(g2int)ceil(temp)+1;
+           //
+           //   find num of bits need to store ifld[0] ( and ifld[1]
+           //   if using 2nd order differencing )
+           //
+           maxorig=ival1;
+           if (idrstmpl[16]==2 && ival2>ival1) maxorig=ival2;
+           temp=log((double)(maxorig+1))/alog2;
+           nbitorig=(g2int)ceil(temp)+1;
+           if (nbitorig > nbitsd) nbitsd=nbitorig;
+           //   increase number of bits to even multiple of 8 ( octet )
+           if ( (nbitsd%8) != 0) nbitsd=nbitsd+(8-(nbitsd%8));
+           //
+           //  Store extra spatial differencing info into the packed
+           //  data section.
+           //
+           if (nbitsd != 0) {
+              //   pack first original value
+              if (ival1 >= 0) {
+                 sbit(cpack,&ival1,iofst,nbitsd);
+                 iofst=iofst+nbitsd;
+              }
+              else {
+                 sbit(cpack,&one,iofst,1);
+                 iofst=iofst+1;
+                 itemp=abs(ival1);
+                 sbit(cpack,&itemp,iofst,nbitsd-1);
+                 iofst=iofst+nbitsd-1;
+              }
+              if (idrstmpl[16] == 2) {
+               //  pack second original value
+                 if (ival2 >= 0) {
+                    sbit(cpack,&ival2,iofst,nbitsd);
+                    iofst=iofst+nbitsd;
+                 }
+                 else {
+                    sbit(cpack,&one,iofst,1);
+                    iofst=iofst+1;
+                    itemp=abs(ival2);
+                    sbit(cpack,&itemp,iofst,nbitsd-1);
+                    iofst=iofst+nbitsd-1;
+                 }
+              }
+              //  pack overall min of spatial differences
+              if (minsd >= 0) {
+                 sbit(cpack,&minsd,iofst,nbitsd);
+                 iofst=iofst+nbitsd;
+              }
+              else {
+                 sbit(cpack,&one,iofst,1);
+                 iofst=iofst+1;
+                 itemp=abs(minsd);
+                 sbit(cpack,&itemp,iofst,nbitsd-1);
+                 iofst=iofst+nbitsd-1;
+              }
+           }
+           //printf("SDp %ld %ld %ld %ld\n",ival1,ival2,minsd,nbitsd);
+        }     //  end of spatial diff section
+        //
+        //   Determine Groups to be used.
+        //
+        if ( simple_alg == 1 ) {
+           //  set group length to 10;  calculate number of groups
+           //  and length of last group
+           ngroups=ndpts/10;
+           for (j=0;j<ngroups;j++) glen[j]=10;
+           itemp=ndpts%10;
+           if (itemp != 0) {
+              ngroups=ngroups+1;
+              glen[ngroups-1]=itemp;
+           }
+        }
+        else {
+           // Use Dr. Glahn's algorithm for determining grouping.
+           //
+           kfildo=6;
+           minpk=10;
+           inc=1;
+           maxgrps=(ndpts/minpk)+1;
+           jmin = calloc(maxgrps,sizeof(g2int));
+           jmax = calloc(maxgrps,sizeof(g2int));
+           lbit = calloc(maxgrps,sizeof(g2int));
+           missopt=0;
+           pack_gp(&kfildo,ifld,&ndpts,&missopt,&minpk,&inc,&miss1,&miss2,
+                        jmin,jmax,lbit,glen,&maxgrps,&ngroups,&ibit,&jbit,
+                        &kbit,&novref,&lbitref,&ier);
+           //print *,'SAGier = ',ier,ibit,jbit,kbit,novref,lbitref
+           for ( ng=0; ng<ngroups; ng++) glen[ng]=glen[ng]+novref;
+           free(jmin);
+           free(jmax);
+           free(lbit);
+        }
+        //  
+        //  For each group, find the group's reference value
+        //  and the number of bits needed to hold the remaining values
+        //
+        n=0;
+        for (ng=0;ng<ngroups;ng++) {
+           //    find max and min values of group
+           gref[ng]=ifld[n];
+           imax=ifld[n];
+           j=n+1;
+           for (lg=1;lg<glen[ng];lg++) {
+              if (ifld[j] < gref[ng]) gref[ng]=ifld[j]; 
+              if (ifld[j] > imax) imax=ifld[j];
+              j++;
+           }
+           //   calc num of bits needed to hold data
+           if ( gref[ng] != imax ) {
+              temp=log((double)(imax-gref[ng]+1))/alog2;
+              gwidth[ng]=(g2int)ceil(temp);
+           }
+           else 
+              gwidth[ng]=0;
+           //   Subtract min from data
+           j=n;
+           for (lg=0;lg<glen[ng];lg++) {
+              ifld[j]=ifld[j]-gref[ng];
+              j++;
+           }
+           //   increment fld array counter
+           n=n+glen[ng];
+        }
+        //  
+        //  Find max of the group references and calc num of bits needed 
+        //  to pack each groups reference value, then
+        //  pack up group reference values
+        //
+        igmax=gref[0];
+        for (j=1;j<ngroups;j++) if (gref[j] > igmax) igmax=gref[j];
+        if (igmax != 0) {
+           temp=log((double)(igmax+1))/alog2;
+           nbitsgref=(g2int)ceil(temp);
+           sbits(cpack,gref,iofst,nbitsgref,0,ngroups);
+           itemp=nbitsgref*ngroups;
+           iofst=iofst+itemp;
+           //         Pad last octet with Zeros, if necessary,
+           if ( (itemp%8) != 0) {
+              left=8-(itemp%8);
+              sbit(cpack,&zero,iofst,left);
+              iofst=iofst+left;
+           }
+        }
+        else
+           nbitsgref=0;
+        //
+        //  Find max/min of the group widths and calc num of bits needed
+        //  to pack each groups width value, then
+        //  pack up group width values
+        //
+        iwmax=gwidth[0];
+        ngwidthref=gwidth[0];
+        for (j=1;j<ngroups;j++) {
+           if (gwidth[j] > iwmax) iwmax=gwidth[j];
+           if (gwidth[j] < ngwidthref) ngwidthref=gwidth[j];
+        }
+        if (iwmax != ngwidthref) {
+           temp=log((double)(iwmax-ngwidthref+1))/alog2;
+           nbitsgwidth=(g2int)ceil(temp);
+           for (i=0;i<ngroups;i++) 
+              gwidth[i]=gwidth[i]-ngwidthref;
+           sbits(cpack,gwidth,iofst,nbitsgwidth,0,ngroups);
+           itemp=nbitsgwidth*ngroups;
+           iofst=iofst+itemp;
+           //         Pad last octet with Zeros, if necessary,
+           if ( (itemp%8) != 0) {
+              left=8-(itemp%8);
+              sbit(cpack,&zero,iofst,left);
+              iofst=iofst+left;
+           }
+        }
+        else {
+           nbitsgwidth=0;
+           for (i=0;i<ngroups;i++) gwidth[i]=0;
+        }
+        //
+        //  Find max/min of the group lengths and calc num of bits needed
+        //  to pack each groups length value, then
+        //  pack up group length values
+        //
+        //write(77,*)'GLENS: ',(glen(j),j=1,ngroups)
+        ilmax=glen[0];
+        nglenref=glen[0];
+        for (j=1;j<ngroups-1;j++) {
+           if (glen[j] > ilmax) ilmax=glen[j];
+           if (glen[j] < nglenref) nglenref=glen[j];
+        }
+        nglenlast=glen[ngroups-1];
+        if (ilmax != nglenref) {
+           temp=log((double)(ilmax-nglenref+1))/alog2;
+           nbitsglen=(g2int)ceil(temp);
+           for (i=0;i<ngroups-1;i++)  glen[i]=glen[i]-nglenref;
+           sbits(cpack,glen,iofst,nbitsglen,0,ngroups);
+           itemp=nbitsglen*ngroups;
+           iofst=iofst+itemp;
+           //         Pad last octet with Zeros, if necessary,
+           if ( (itemp%8) != 0) {
+              left=8-(itemp%8);
+              sbit(cpack,&zero,iofst,left);
+              iofst=iofst+left;
+           }
+        }
+        else {
+           nbitsglen=0;
+           for (i=0;i<ngroups;i++) glen[i]=0;
+        }
+        //
+        //  For each group, pack data values
+        //
+        n=0;
+        for (ng=0;ng<ngroups;ng++) {
+           glength=glen[ng]+nglenref;
+           if (ng == (ngroups-1) ) glength=nglenlast;
+           grpwidth=gwidth[ng]+ngwidthref;
+           if ( grpwidth != 0 ) {
+              sbits(cpack,ifld+n,iofst,grpwidth,0,glength);
+              iofst=iofst+(grpwidth*glength);
+           }
+           n=n+glength;
+        }
+        //         Pad last octet with Zeros, if necessary,
+        if ( (iofst%8) != 0) {
+           left=8-(iofst%8);
+           sbit(cpack,&zero,iofst,left);
+           iofst=iofst+left;
+        }
+        *lcpack=iofst/8;
+        //
+        if ( ifld!=0 ) free(ifld);
+        if ( gref!=0 ) free(gref);
+        if ( gwidth!=0 ) free(gwidth);
+        if ( glen!=0 ) free(glen);
+      }
+      else {          //   Constant field ( max = min )
+        nbits=0;
+        *lcpack=0;
+        nbitsgref=0;
+        ngroups=0;
+      }
+
+//
+//  Fill in ref value and number of bits in Template 5.2
+//
+      mkieee(&rmin,idrstmpl+0,1);   // ensure reference value is IEEE format
+      idrstmpl[3]=nbitsgref;
+      idrstmpl[4]=0;         // original data were reals
+      idrstmpl[5]=1;         // general group splitting
+      idrstmpl[6]=0;         // No internal missing values
+      idrstmpl[7]=0;         // Primary missing value
+      idrstmpl[8]=0;         // secondary missing value
+      idrstmpl[9]=ngroups;          // Number of groups
+      idrstmpl[10]=ngwidthref;       // reference for group widths
+      idrstmpl[11]=nbitsgwidth;      // num bits used for group widths
+      idrstmpl[12]=nglenref;         // Reference for group lengths
+      idrstmpl[13]=1;                // length increment for group lengths
+      idrstmpl[14]=nglenlast;        // True length of last group
+      idrstmpl[15]=nbitsglen;        // num bits used for group lengths
+      if (idrsnum == 3) {
+         idrstmpl[17]=nbitsd/8;      // num bits used for extra spatial
+                                     // differencing values
+      }
+
+}
diff --git a/g2clib_src/comunpack.c b/g2clib_src/comunpack.c
new file mode 100755
index 0000000..1a0b0e0
--- /dev/null
+++ b/g2clib_src/comunpack.c
@@ -0,0 +1,336 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include "grib2.h"
+
+
+int comunpack(unsigned char *cpack,g2int lensec,g2int idrsnum,g2int *idrstmpl,g2int ndpts,g2float *fld)
+////$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    comunpack
+//   PRGMMR: Gilbert          ORG: W/NP11    DATE: 2002-10-29
+//
+// ABSTRACT: This subroutine unpacks a data field that was packed using a
+//   complex packing algorithm as defined in the GRIB2 documention,
+//   using info from the GRIB2 Data Representation Template 5.2 or 5.3.
+//   Supports GRIB2 complex packing templates with or without
+//   spatial differences (i.e. DRTs 5.2 and 5.3).
+//
+// PROGRAM HISTORY LOG:
+// 2002-10-29  Gilbert
+// 2004-12-16  Gilbert  -  Added test ( provided by Arthur Taylor/MDL )
+//                         to verify that group widths and lengths are
+//                         consistent with section length.
+//
+// USAGE:    int comunpack(unsigned char *cpack,g2int lensec,g2int idrsnum,
+//                         g2int *idrstmpl, g2int ndpts,g2float *fld)
+//   INPUT ARGUMENT LIST:
+//     cpack    - pointer to the packed data field.
+//     lensec   - length of section 7 (used for error checking).
+//     idrsnum  - Data Representation Template number 5.N
+//                Must equal 2 or 3.
+//     idrstmpl - pointer to the array of values for Data Representation
+//                Template 5.2 or 5.3
+//     ndpts    - The number of data values to unpack
+//
+//   OUTPUT ARGUMENT LIST:
+//     fld      - Contains the unpacked data values.  fld must be allocated
+//                with at least ndpts*sizeof(g2float) bytes before
+//                calling this routine.
+//
+// REMARKS: None
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE: 
+//
+//$$$//
+{
+
+      g2int   nbitsd=0,isign;
+      g2int  j,iofst,ival1,ival2,minsd,itemp,l,k,n,non=0;
+      g2int  *ifld,*ifldmiss=0;
+      g2int  *gref,*gwidth,*glen;
+      g2int  itype,ngroups,nbitsgref,nbitsgwidth,nbitsglen;
+      g2int  msng1,msng2;
+      g2float ref,bscale,dscale,rmiss1,rmiss2;
+      g2int totBit, totLen;
+
+      //printf('IDRSTMPL: ',(idrstmpl(j),j=1,16)
+      rdieee(idrstmpl+0,&ref,1);
+//      printf("SAGTref: %f\n",ref);
+      bscale = (g2float)int_power(2.0,idrstmpl[1]);
+      dscale = (g2float)int_power(10.0,-idrstmpl[2]);
+      nbitsgref = idrstmpl[3];
+      itype = idrstmpl[4];
+      ngroups = idrstmpl[9];
+      nbitsgwidth = idrstmpl[11];
+      nbitsglen = idrstmpl[15];
+      if (idrsnum == 3)
+         nbitsd=idrstmpl[17]*8;
+
+      //   Constant field
+
+      if (ngroups == 0) {
+         for (j=0;j<ndpts;j++) fld[j]=ref;
+         return(0);
+      }
+
+      iofst=0;
+      ifld=(g2int *)calloc(ndpts,sizeof(g2int));
+      //printf("ALLOC ifld: %d %x\n",(int)ndpts,ifld);
+      gref=(g2int *)calloc(ngroups,sizeof(g2int));
+      //printf("ALLOC gref: %d %x\n",(int)ngroups,gref);
+      gwidth=(g2int *)calloc(ngroups,sizeof(g2int));
+      //printf("ALLOC gwidth: %d %x\n",(int)ngroups,gwidth);
+//
+//  Get missing values, if supplied
+//
+      if ( idrstmpl[6] == 1 ) {
+         if (itype == 0) 
+            rdieee(idrstmpl+7,&rmiss1,1);
+         else 
+            rmiss1=(g2float)idrstmpl[7];
+      }
+      if ( idrstmpl[6] == 2 ) {
+         if (itype == 0) {
+            rdieee(idrstmpl+7,&rmiss1,1);
+            rdieee(idrstmpl+8,&rmiss2,1);
+         }
+         else {
+            rmiss1=(g2float)idrstmpl[7];
+            rmiss2=(g2float)idrstmpl[8];
+         }
+      }
+      
+      //printf("RMISSs: %f %f %f \n",rmiss1,rmiss2,ref);
+// 
+//  Extract Spatial differencing values, if using DRS Template 5.3
+//
+      if (idrsnum == 3) {
+         if (nbitsd != 0) {
+// wne mistake here shoujld be unsigned int
+              gbit(cpack,&ival1,iofst,nbitsd);
+              iofst=iofst+nbitsd;
+//              gbit(cpack,&isign,iofst,1);
+//              iofst=iofst+1;
+//              gbit(cpack,&ival1,iofst,nbitsd-1);
+//              iofst=iofst+nbitsd-1;
+//              if (isign == 1) ival1=-ival1;
+              if (idrstmpl[16] == 2) {
+// wne mistake here shoujld be unsigned int
+                 gbit(cpack,&ival2,iofst,nbitsd);
+                 iofst=iofst+nbitsd;
+//                 gbit(cpack,&isign,iofst,1);
+//                 iofst=iofst+1;
+//                 gbit(cpack,&ival2,iofst,nbitsd-1);
+//                 iofst=iofst+nbitsd-1;
+//                 if (isign == 1) ival2=-ival2;
+              }
+              gbit(cpack,&isign,iofst,1);
+              iofst=iofst+1;
+              gbit(cpack,&minsd,iofst,nbitsd-1);
+              iofst=iofst+nbitsd-1;
+              if (isign == 1) minsd=-minsd;
+         }
+         else {
+              ival1=0;
+              ival2=0;
+              minsd=0;
+         }
+       //printf("SDu %ld %ld %ld %ld \n",ival1,ival2,minsd,nbitsd);
+      }
+//
+//  Extract Each Group's reference value
+//
+      //printf("SAG1: %ld %ld %ld \n",nbitsgref,ngroups,iofst);
+      if (nbitsgref != 0) {
+         gbits(cpack,gref+0,iofst,nbitsgref,0,ngroups);
+         itemp=nbitsgref*ngroups;
+         iofst=iofst+itemp;
+         if (itemp%8 != 0) iofst=iofst+(8-(itemp%8));
+      }
+      else {
+         for (j=0;j<ngroups;j++)
+              gref[j]=0;
+      }
+//
+//  Extract Each Group's bit width
+//
+      //printf("SAG2: %ld %ld %ld %ld \n",nbitsgwidth,ngroups,iofst,idrstmpl[10]);
+      if (nbitsgwidth != 0) {
+         gbits(cpack,gwidth+0,iofst,nbitsgwidth,0,ngroups);
+         itemp=nbitsgwidth*ngroups;
+         iofst=iofst+itemp;
+         if (itemp%8 != 0) iofst=iofst+(8-(itemp%8));
+      }
+      else {
+         for (j=0;j<ngroups;j++)
+                gwidth[j]=0;
+      }
+
+      for (j=0;j<ngroups;j++)
+          gwidth[j]=gwidth[j]+idrstmpl[10];
+      
+//
+//  Extract Each Group's length (number of values in each group)
+//
+      glen=(g2int *)calloc(ngroups,sizeof(g2int));
+      //printf("ALLOC glen: %d %x\n",(int)ngroups,glen);
+      //printf("SAG3: %ld %ld %ld %ld %ld \n",nbitsglen,ngroups,iofst,idrstmpl[13],idrstmpl[12]);
+      if (nbitsglen != 0) {
+         gbits(cpack,glen,iofst,nbitsglen,0,ngroups);
+         itemp=nbitsglen*ngroups;
+         iofst=iofst+itemp;
+         if (itemp%8 != 0) iofst=iofst+(8-(itemp%8));
+      }
+      else {
+         for (j=0;j<ngroups;j++)
+              glen[j]=0;
+      }
+      for (j=0;j<ngroups;j++) 
+           glen[j]=(glen[j]*idrstmpl[13])+idrstmpl[12];
+      glen[ngroups-1]=idrstmpl[14];
+//
+//  Test to see if the group widths and lengths are consistent with number of
+//  values, and length of section 7.
+//
+      totBit = 0;
+      totLen = 0;
+      for (j=0;j<ngroups;j++) {
+        totBit += (gwidth[j]*glen[j]);
+        totLen += glen[j];
+      }
+      if (totLen != ndpts) {
+        return 1;
+      }
+      if (totBit / 8. > lensec) {
+        return 1;
+      }
+//
+//  For each group, unpack data values
+//
+      if ( idrstmpl[6] == 0 ) {        // no missing values
+         n=0;
+         for (j=0;j<ngroups;j++) {
+           if (gwidth[j] != 0) {
+             gbits(cpack,ifld+n,iofst,gwidth[j],0,glen[j]);
+             for (k=0;k<glen[j];k++) {
+               ifld[n]=ifld[n]+gref[j];
+               n=n+1;
+             }
+           }
+           else {
+             for (l=n;l<n+glen[j];l++) ifld[l]=gref[j];
+             n=n+glen[j];
+           }
+           iofst=iofst+(gwidth[j]*glen[j]);
+         }
+      }
+      else if ( idrstmpl[6]==1 || idrstmpl[6]==2 ) {
+         // missing values included
+         ifldmiss=(g2int *)malloc(ndpts*sizeof(g2int));
+         //printf("ALLOC ifldmiss: %d %x\n",(int)ndpts,ifldmiss);
+         for (j=0;j<ndpts;j++) ifldmiss[j]=0;
+         n=0;
+         non=0;
+         for (j=0;j<ngroups;j++) {
+           //printf(" SAGNGP %d %d %d %d\n",j,gwidth[j],glen[j],gref[j]);
+           if (gwidth[j] != 0) {
+             msng1=(g2int)int_power(2.0,gwidth[j])-1;
+             msng2=msng1-1;
+             gbits(cpack,ifld+n,iofst,gwidth[j],0,glen[j]);
+             iofst=iofst+(gwidth[j]*glen[j]);
+             for (k=0;k<glen[j];k++) {
+               if (ifld[n] == msng1) {
+                  ifldmiss[n]=1;
+                  //ifld[n]=0;
+               }
+               else if (idrstmpl[6]==2 && ifld[n]==msng2) {
+                  ifldmiss[n]=2;
+                  //ifld[n]=0;
+               }
+               else {
+                  ifldmiss[n]=0;
+                  ifld[non++]=ifld[n]+gref[j];
+               }
+               n++;
+             }
+           }
+           else {
+             msng1=(g2int)int_power(2.0,nbitsgref)-1;
+             msng2=msng1-1;
+             if (gref[j] == msng1) {
+                for (l=n;l<n+glen[j];l++) ifldmiss[l]=1;
+             }
+             else if (idrstmpl[6]==2 && gref[j]==msng2) {
+                for (l=n;l<n+glen[j];l++) ifldmiss[l]=2;
+             }
+             else {
+                for (l=n;l<n+glen[j];l++) ifldmiss[l]=0;
+                for (l=non;l<non+glen[j];l++) ifld[l]=gref[j];
+                non += glen[j];
+             }
+             n=n+glen[j];
+           }
+         }
+      }
+
+      if ( gref != 0 ) free(gref);
+      if ( gwidth != 0 ) free(gwidth);
+      if ( glen != 0 ) free(glen);
+//
+//  If using spatial differences, add overall min value, and
+//  sum up recursively
+//
+      //printf("SAGod: %ld %ld\n",idrsnum,idrstmpl[16]);
+      if (idrsnum == 3) {         // spatial differencing
+         if (idrstmpl[16] == 1) {      // first order
+            ifld[0]=ival1;
+            if ( idrstmpl[6] == 0 ) itemp=ndpts;        // no missing values
+            else  itemp=non;
+            for (n=1;n<itemp;n++) {
+               ifld[n]=ifld[n]+minsd;
+               ifld[n]=ifld[n]+ifld[n-1];
+            }
+         }
+         else if (idrstmpl[16] == 2) {    // second order
+            ifld[0]=ival1;
+            ifld[1]=ival2;
+            if ( idrstmpl[6] == 0 ) itemp=ndpts;        // no missing values
+            else  itemp=non;
+            for (n=2;n<itemp;n++) {
+               ifld[n]=ifld[n]+minsd;
+               ifld[n]=ifld[n]+(2*ifld[n-1])-ifld[n-2];
+            }
+         }
+      }
+//
+//  Scale data back to original form
+//
+      //printf("SAGT: %f %f %f\n",ref,bscale,dscale);
+      if ( idrstmpl[6] == 0 ) {        // no missing values
+         for (n=0;n<ndpts;n++) {
+            fld[n]=(((g2float)ifld[n]*bscale)+ref)*dscale;
+         }
+      }
+      else if ( idrstmpl[6]==1 || idrstmpl[6]==2 ) {
+         // missing values included
+         non=0;
+         for (n=0;n<ndpts;n++) {
+            if ( ifldmiss[n] == 0 ) {
+               fld[n]=(((g2float)ifld[non++]*bscale)+ref)*dscale;
+               //printf(" SAG %d %f %d %f %f %f\n",n,fld[n],ifld[non-1],bscale,ref,dscale);
+            }
+            else if ( ifldmiss[n] == 1 ) 
+               fld[n]=rmiss1;
+            else if ( ifldmiss[n] == 2 ) 
+               fld[n]=rmiss2;
+         }
+         if ( ifldmiss != 0 ) free(ifldmiss);
+      }
+
+      if ( ifld != 0 ) free(ifld);
+
+      return(0);
+      
+}
diff --git a/g2clib_src/dec_jpeg2000.c b/g2clib_src/dec_jpeg2000.c
new file mode 100644
index 0000000..5aa87cc
--- /dev/null
+++ b/g2clib_src/dec_jpeg2000.c
@@ -0,0 +1,142 @@
+#ifndef USE_JPEG2000
+ void dummy_dec_jpeg200(void) {}
+#else   /* USE_JPEG2000 */
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "grib2.h"
+#include "jasper/jasper.h"
+#define JAS_1_700_2
+
+
+   int dec_jpeg2000(char *injpc,g2int bufsize,g2int *outfld)
+/*$$$  SUBPROGRAM DOCUMENTATION BLOCK
+*                .      .    .                                       .
+* SUBPROGRAM:    dec_jpeg2000      Decodes JPEG2000 code stream
+*   PRGMMR: Gilbert          ORG: W/NP11     DATE: 2002-12-02
+*
+* ABSTRACT: This Function decodes a JPEG2000 code stream specified in the
+*   JPEG2000 Part-1 standard (i.e., ISO/IEC 15444-1) using JasPer 
+*   Software version 1.500.4 (or 1.700.2) written by the University of British
+*   Columbia and Image Power Inc, and others.
+*   JasPer is available at http://www.ece.uvic.ca/~mdadams/jasper/.
+*
+* PROGRAM HISTORY LOG:
+* 2002-12-02  Gilbert
+*
+* USAGE:     int dec_jpeg2000(char *injpc,g2int bufsize,g2int *outfld)
+*
+*   INPUT ARGUMENTS:
+*      injpc - Input JPEG2000 code stream.
+*    bufsize - Length (in bytes) of the input JPEG2000 code stream.
+*
+*   OUTPUT ARGUMENTS:
+*     outfld - Output matrix of grayscale image values.
+*
+*   RETURN VALUES :
+*          0 = Successful decode
+*         -3 = Error decode jpeg2000 code stream.
+*         -5 = decoded image had multiple color components.
+*              Only grayscale is expected.
+*
+* REMARKS:
+*
+*      Requires JasPer Software version 1.500.4 or 1.700.2
+*
+* ATTRIBUTES:
+*   LANGUAGE: C
+*   MACHINE:  IBM SP
+*
+*$$$*/
+
+{
+    int ier;
+    g2int i,j,k;
+    jas_image_t *image=0;
+    jas_stream_t *jpcstream;
+    jas_image_cmpt_t *pcmpt;
+    char *opts=0;
+    jas_matrix_t *data;
+
+//    jas_init();
+
+    ier=0;
+//   
+//     Create jas_stream_t containing input JPEG200 codestream in memory.
+//       
+
+    jpcstream=jas_stream_memopen(injpc,bufsize);
+
+//   
+//     Decode JPEG200 codestream into jas_image_t structure.
+//       
+    image=jpc_decode(jpcstream,opts);
+    if ( image == 0 ) {
+       printf(" jpc_decode return\n");
+       return -3;
+    }
+    
+    pcmpt=image->cmpts_[0];
+/*
+    printf(" SAGOUT DECODE:\n");
+    printf(" tlx %d \n",image->tlx_);
+    printf(" tly %d \n",image->tly_);
+    printf(" brx %d \n",image->brx_);
+    printf(" bry %d \n",image->bry_);
+    printf(" numcmpts %d \n",image->numcmpts_);
+    printf(" maxcmpts %d \n",image->maxcmpts_);
+#ifdef JAS_1_500_4
+    printf(" colormodel %d \n",image->colormodel_);
+#endif
+#ifdef JAS_1_700_2
+    printf(" colorspace %d \n",image->clrspc_);
+#endif
+    printf(" inmem %d \n",image->inmem_);
+    printf(" COMPONENT:\n");
+    printf(" tlx %d \n",pcmpt->tlx_);
+    printf(" tly %d \n",pcmpt->tly_);
+    printf(" hstep %d \n",pcmpt->hstep_);
+    printf(" vstep %d \n",pcmpt->vstep_);
+    printf(" width %d \n",pcmpt->width_);
+    printf(" height %d \n",pcmpt->height_);
+    printf(" prec %d \n",pcmpt->prec_);
+    printf(" sgnd %d \n",pcmpt->sgnd_);
+    printf(" cps %d \n",pcmpt->cps_);
+#ifdef JAS_1_700_2
+    printf(" type %d \n",pcmpt->type_);
+#endif
+*/
+
+//   Expecting jpeg2000 image to be grayscale only.
+//   No color components.
+//
+    if (image->numcmpts_ != 1 ) {
+       printf("dec_jpeg2000: Found color image.  Grayscale expected.\n");
+       return (-5);
+    }
+
+// 
+//    Create a data matrix of grayscale image values decoded from
+//    the jpeg2000 codestream.
+//
+    data=jas_matrix_create(jas_image_height(image), jas_image_width(image));
+    jas_image_readcmpt(image,0,0,0,jas_image_width(image),
+                       jas_image_height(image),data);
+//
+//    Copy data matrix to output integer array.
+//
+    k=0;
+    for (i=0;i<pcmpt->height_;i++) 
+      for (j=0;j<pcmpt->width_;j++) 
+        outfld[k++]=data->rows_[i][j];
+//
+//     Clean up JasPer work structures.
+//
+    jas_matrix_destroy(data);
+    ier=jas_stream_close(jpcstream);
+    jas_image_destroy(image);
+
+    return 0;
+
+}
+#endif   /* USE_JPEG2000 */
diff --git a/g2clib_src/dec_png.c b/g2clib_src/dec_png.c
new file mode 100644
index 0000000..16f01b5
--- /dev/null
+++ b/g2clib_src/dec_png.c
@@ -0,0 +1,144 @@
+#ifndef USE_PNG
+ void dummy_dec_png(void) {}
+#else   /* USE_PNG */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <png.h>
+#include "grib2.h"
+
+
+struct png_stream {
+   unsigned char *stream_ptr;     /*  location to write PNG stream  */
+   g2int stream_len;               /*  number of bytes written       */
+};
+typedef struct png_stream png_stream;
+
+void user_read_data(png_structp , png_bytep , png_uint_32 );
+
+void user_read_data(png_structp png_ptr,png_bytep data, png_uint_32 length)
+/*
+        Custom read function used so that libpng will read a PNG stream
+        from memory instead of a file on disk.
+*/
+{
+     char *ptr;
+     g2int offset;
+     png_stream *mem;
+
+     mem=(png_stream *)png_get_io_ptr(png_ptr);
+     ptr=(void *)mem->stream_ptr;
+     offset=mem->stream_len;
+/*     printf("SAGrd %ld %ld %x\n",offset,length,ptr);  */
+     memcpy(data,ptr+offset,length);
+     mem->stream_len += length;
+}
+
+
+
+int dec_png(unsigned char *pngbuf,g2int *width,g2int *height,char *cout)
+{
+    int interlace,color,compres,filter,bit_depth;
+    g2int j,k,n,bytes,clen;
+    png_structp png_ptr;
+    png_infop info_ptr,end_info;
+    png_bytepp row_pointers;
+    png_stream read_io_ptr;
+    png_uint_32 h32, w32;
+
+/*  check if stream is a valid PNG format   */
+
+    if ( png_sig_cmp(pngbuf,0,8) != 0) 
+       return (-3);
+
+/* create and initialize png_structs  */
+
+    png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, (png_voidp)NULL, 
+                                      NULL, NULL);
+    if (!png_ptr)
+       return (-1);
+
+    info_ptr = png_create_info_struct(png_ptr);
+    if (!info_ptr)
+    {
+       png_destroy_read_struct(&png_ptr,(png_infopp)NULL,(png_infopp)NULL);
+       return (-2);
+    }
+
+    end_info = png_create_info_struct(png_ptr);
+    if (!end_info)
+    {
+       png_destroy_read_struct(&png_ptr,(png_infopp)info_ptr,(png_infopp)NULL);
+       return (-2);
+    }
+
+/*     Set Error callback   */
+
+    if (setjmp(png_jmpbuf(png_ptr)))
+    {
+       png_destroy_read_struct(&png_ptr, &info_ptr,&end_info);
+       return (-3);
+    }
+
+/*    Initialize info for reading PNG stream from memory   */
+
+    read_io_ptr.stream_ptr=(png_voidp)pngbuf;
+    read_io_ptr.stream_len=0;
+
+/*    Set new custom read function    */
+
+    png_set_read_fn(png_ptr,(png_voidp)&read_io_ptr,(png_rw_ptr)user_read_data);
+/*     png_init_io(png_ptr, fptr);   */
+
+/*     Read and decode PNG stream   */
+
+    png_read_png(png_ptr, info_ptr, PNG_TRANSFORM_IDENTITY, NULL);
+
+/*     Get pointer to each row of image data   */
+
+    row_pointers = png_get_rows(png_ptr, info_ptr);
+
+/*     Get image info, such as size, depth, colortype, etc...   */
+
+    /*printf("SAGT:png %d %d %d\n",info_ptr->width,info_ptr->height,info_ptr->bit_depth);*/
+    // (void)png_get_IHDR(png_ptr, info_ptr, (png_uint_32 *)width, (png_uint_32 *)height,
+    (void)png_get_IHDR(png_ptr, info_ptr, &w32, &h32,
+               &bit_depth, &color, &interlace, &compres, &filter);
+
+    *height = h32;
+    *width = w32;
+
+/*     Check if image was grayscale      */
+
+/*
+    if (color != PNG_COLOR_TYPE_GRAY ) {
+       fprintf(stderr,"dec_png: Grayscale image was expected. \n");
+    }
+*/
+    if ( color == PNG_COLOR_TYPE_RGB ) {
+       bit_depth=24;
+    }
+    else if ( color == PNG_COLOR_TYPE_RGB_ALPHA ) {
+       bit_depth=32;
+    }
+/*     Copy image data to output string   */
+
+    n=0;
+    bytes=bit_depth/8;
+    clen=(*width)*bytes;
+    for (j=0;j<*height;j++) {
+      for (k=0;k<clen;k++) {
+        cout[n]=*(row_pointers[j]+k);
+        n++;
+      }
+    }
+
+/*      Clean up   */
+
+    png_destroy_read_struct(&png_ptr, &info_ptr, &end_info);
+    return 0;
+
+}
+
+#endif   /* USE_PNG */
diff --git a/g2clib_src/drstemplates.c b/g2clib_src/drstemplates.c
new file mode 100755
index 0000000..fad7983
--- /dev/null
+++ b/g2clib_src/drstemplates.c
@@ -0,0 +1,157 @@
+#include <stdlib.h>
+#include "grib2.h"
+#include "drstemplates.h"
+
+g2int getdrsindex(g2int number)
+/*!$$$  SUBPROGRAM DOCUMENTATION BLOCK
+!                .      .    .                                       .
+! SUBPROGRAM:    getdrsindex 
+!   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2001-06-28
+!
+! ABSTRACT: This function returns the index of specified Data 
+!   Representation Template 5.NN (NN=number) in array templates.
+!
+! PROGRAM HISTORY LOG:
+! 2001-06-28  Gilbert
+! 2009-01-14  Vuong     Changed structure name template to gtemplate
+!
+! USAGE:    index=getdrsindex(number)
+!   INPUT ARGUMENT LIST:
+!     number   - NN, indicating the number of the Data Representation 
+!                Template 5.NN that is being requested.
+!
+! RETURNS:  Index of DRT 5.NN in array gtemplates, if gtemplate exists.
+!           = -1, otherwise.
+!
+! REMARKS: None
+!
+! ATTRIBUTES:
+!   LANGUAGE: C
+!   MACHINE:  IBM SP
+!
+!$$$*/
+{
+           g2int j,getdrsindex=-1;
+
+           for (j=0;j<MAXDRSTEMP;j++) {
+              if (number == templatesdrs[j].template_num) {
+                 getdrsindex=j;
+                 return(getdrsindex);
+              }
+           }
+
+           return(getdrsindex);
+}
+
+
+gtemplate *getdrstemplate(g2int number)
+/*!$$$  SUBPROGRAM DOCUMENTATION BLOCK
+!                .      .    .                                       .
+! SUBPROGRAM:    getdrstemplate 
+!   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2000-05-11
+!
+! ABSTRACT: This subroutine returns DRS template information for a 
+!   specified Data Representation Template 5.NN.
+!   The number of entries in the template is returned along with a map
+!   of the number of octets occupied by each entry.  Also, a flag is
+!   returned to indicate whether the template would need to be extended.
+!
+! PROGRAM HISTORY LOG:
+! 2000-05-11  Gilbert
+! 2009-01-14  Vuong     Changed structure name template to gtemplate
+!
+! USAGE:    new=getdrstemplate(number);
+!   INPUT ARGUMENT LIST:
+!     number   - NN, indicating the number of the Data Representation 
+!                Template 5.NN that is being requested.
+!
+!   RETURN VALUE:      
+!        - Pointer to the returned template struct. 
+!          Returns NULL pointer, if template not found.
+!
+! REMARKS: None
+!
+! ATTRIBUTES:
+!   LANGUAGE: C
+!   MACHINE:  IBM SP
+!
+!$$$*/
+{
+           g2int index;
+           gtemplate *new;
+
+           index=getdrsindex(number);
+
+           if (index != -1) {
+              new=(gtemplate *)malloc(sizeof(gtemplate));
+              new->type=5;
+              new->num=templatesdrs[index].template_num;
+              new->maplen=templatesdrs[index].mapdrslen;
+              new->needext=templatesdrs[index].needext;
+              new->map=(g2int *)templatesdrs[index].mapdrs;
+              new->extlen=0;
+              new->ext=0;        //NULL
+              return(new);
+           }
+           else {
+             printf("getdrstemplate: DRS Template 5.%d not defined.\n",(int)number);
+             return(0);        //NULL
+           }
+
+         return(0);        //NULL
+}
+
+gtemplate *extdrstemplate(g2int number,g2int *list)
+/*!$$$  SUBPROGRAM DOCUMENTATION BLOCK
+!                .      .    .                                       .
+! SUBPROGRAM:    extdrstemplate 
+!   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2000-05-11
+!
+! ABSTRACT: This subroutine generates the remaining octet map for a
+!   given Data Representation Template, if required.  Some Templates can
+!   vary depending on data values given in an earlier part of the 
+!   Template, and it is necessary to know some of the earlier entry
+!   values to generate the full octet map of the Template.
+!
+! PROGRAM HISTORY LOG:
+! 2000-05-11  Gilbert
+! 2009-01-14  Vuong     Changed structure name template to gtemplate
+!
+! USAGE:    new=extdrstemplate(number,list);
+!   INPUT ARGUMENT LIST:
+!     number   - NN, indicating the number of the Data Representation 
+!                Template 5.NN that is being requested.
+!     list()   - The list of values for each entry in the 
+!                the Data Representation Template 5.NN.
+!
+!   RETURN VALUE:      
+!        - Pointer to the returned template struct. 
+!          Returns NULL pointer, if template not found.
+!
+! ATTRIBUTES:
+!   LANGUAGE: C
+!   MACHINE:  IBM SP
+!
+!$$$*/
+{
+           gtemplate *new;
+           g2int index,i;
+
+           index=getdrsindex(number);
+           if (index == -1) return(0);
+
+           new=getdrstemplate(number);
+
+           if ( ! new->needext ) return(new);
+
+           if ( number == 1 ) {
+              new->extlen=list[10]+list[12];
+              new->ext=(g2int *)malloc(sizeof(g2int)*new->extlen);
+              for (i=0;i<new->extlen;i++) {
+                new->ext[i]=4;
+              }
+           }
+           return(new);
+
+}
+
diff --git a/g2clib_src/drstemplates.h b/g2clib_src/drstemplates.h
new file mode 100755
index 0000000..5e4c733
--- /dev/null
+++ b/g2clib_src/drstemplates.h
@@ -0,0 +1,69 @@
+#ifndef _drstemplates_H
+#define _drstemplates_H
+#include "grib2.h"
+
+//   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2002-10-26
+//
+// ABSTRACT: This Fortran Module contains info on all the available 
+//   GRIB2 Data Representation Templates used in Section 5 (DRS).
+//   The information decribing each template is stored in the
+//   drstemplate structure defined below.
+//
+//   Each Template has three parts: The number of entries in the template
+//   (mapdrslen);  A map of the template (mapdrs), which contains the
+//   number of octets in which to pack each of the template values; and
+//   a logical value (needext) that indicates whether the Template needs 
+//   to be extended.  In some cases the number of entries in a template 
+//   can vary depending upon values specified in the "static" part of 
+//   the template.  ( See Template 5.1 as an example )
+//
+//   NOTE:  Array mapdrs contains the number of octets in which the 
+//   corresponding template values will be stored.  A negative value in
+//   mapdrs is used to indicate that the corresponding template entry can
+//   contain negative values.  This information is used later when packing
+//   (or unpacking) the template data values.  Negative data values in GRIB
+//   are stored with the left most bit set to one, and a negative number
+//   of octets value in mapdrs[] indicates that this possibility should
+//   be considered.  The number of octets used to store the data value
+//   in this case would be the absolute value of the negative value in 
+//   mapdrs[].
+//  
+//
+///////////////////////////////////////////////////////////////////////
+
+      #define MAXDRSTEMP 9              // maximum number of templates
+      #define MAXDRSMAPLEN 200          // maximum template map length
+
+      struct drstemplate
+      {
+          g2int template_num;
+          g2int mapdrslen;
+          g2int needext;
+          g2int mapdrs[MAXDRSMAPLEN];
+      };
+
+      const struct drstemplate templatesdrs[MAXDRSTEMP] = {
+             // 5.0: Grid point data - Simple Packing
+         { 0, 5, 0, {4,-2,-2,1,1} },
+             // 5.2: Grid point data - Complex Packing
+         { 2, 16, 0, {4,-2,-2,1,1,1,1,4,4,4,1,1,4,1,4,1} },
+             // 5.3: Grid point data - Complex Packing and spatial differencing
+         { 3, 18, 0, {4,-2,-2,1,1,1,1,4,4,4,1,1,4,1,4,1,1,1} },
+             // 5.50: Spectral Data - Simple Packing
+         { 50, 5, 0, {4,-2,-2,1,4} },
+             // 5.51: Spherical Harmonics data - Complex packing 
+         { 51, 10, 0, {4,-2,-2,1,-4,2,2,2,4,1} },
+//           // 5.1: Matrix values at gridpoint - Simple packing
+//         { 1, 15, 1, {4,-2,-2,1,1,1,4,2,2,1,1,1,1,1,1} },
+             // 5.40: Grid point data - JPEG2000 encoding
+         { 40, 7, 0, {4,-2,-2,1,1,1,1} },
+             // 5.41: Grid point data - PNG encoding
+         { 41, 5, 0, {4,-2,-2,1,1} },
+             // 5.40000: Grid point data - JPEG2000 encoding
+         { 40000, 7, 0, {4,-2,-2,1,1,1,1} },
+             // 5.40010: Grid point data - PNG encoding
+         { 40010, 5, 0, {4,-2,-2,1,1} }
+      } ;
+
+
+#endif  /*  _drstemplates_H  */
diff --git a/g2clib_src/enc_jpeg2000.c b/g2clib_src/enc_jpeg2000.c
new file mode 100644
index 0000000..ef5d4d7
--- /dev/null
+++ b/g2clib_src/enc_jpeg2000.c
@@ -0,0 +1,179 @@
+#ifndef USE_JPEG2000
+ void dummy_enc_jpeg2000(void) {}
+#else   /* USE_JPEG2000 */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include "grib2.h"
+#include "jasper/jasper.h"
+#define JAS_1_700_2
+
+
+int enc_jpeg2000(unsigned char *cin,g2int width,g2int height,g2int nbits,
+                 g2int ltype, g2int ratio, g2int retry, char *outjpc, 
+                 g2int jpclen)
+/*$$$  SUBPROGRAM DOCUMENTATION BLOCK
+*                .      .    .                                       .
+* SUBPROGRAM:    enc_jpeg2000      Encodes JPEG2000 code stream
+*   PRGMMR: Gilbert          ORG: W/NP11     DATE: 2002-12-02
+*
+* ABSTRACT: This Function encodes a grayscale image into a JPEG2000 code stream
+*   specified in the JPEG2000 Part-1 standard (i.e., ISO/IEC 15444-1) 
+*   using JasPer Software version 1.500.4 (or 1.700.2 ) written by the 
+*   University of British Columbia, Image Power Inc, and others.
+*   JasPer is available at http://www.ece.uvic.ca/~mdadams/jasper/.
+*
+* PROGRAM HISTORY LOG:
+* 2002-12-02  Gilbert
+* 2004-12-16  Gilbert - Added retry argument/option to allow option of
+*                       increasing the maximum number of guard bits to the
+*                       JPEG2000 algorithm.
+*
+* USAGE:    int enc_jpeg2000(unsigned char *cin,g2int width,g2int height,
+*                            g2int nbits, g2int ltype, g2int ratio, 
+*                            g2int retry, char *outjpc, g2int jpclen)
+*
+*   INPUT ARGUMENTS:
+*      cin   - Packed matrix of Grayscale image values to encode.
+*     width  - width of image
+*     height - height of image
+*     nbits  - depth (in bits) of image.  i.e number of bits
+*              used to hold each data value
+*    ltype   - indicator of lossless or lossy compression
+*              = 1, for lossy compression
+*              != 1, for lossless compression
+*    ratio   - target compression ratio.  (ratio:1)
+*              Used only when ltype == 1.
+*    retry   - Pointer to option type.
+*              1 = try increasing number of guard bits
+*              otherwise, no additional options
+*    jpclen  - Number of bytes allocated for new JPEG2000 code stream in
+*              outjpc.
+*
+*   INPUT ARGUMENTS:
+*     outjpc - Output encoded JPEG2000 code stream
+*
+*   RETURN VALUES :
+*        > 0 = Length in bytes of encoded JPEG2000 code stream
+*         -3 = Error decode jpeg2000 code stream.
+*         -5 = decoded image had multiple color components.
+*              Only grayscale is expected.
+*
+* REMARKS:
+*
+*      Requires JasPer Software version 1.500.4 or 1.700.2
+*
+* ATTRIBUTES:
+*   LANGUAGE: C
+*   MACHINE:  IBM SP
+*
+*$$$*/
+{
+    int ier,rwcnt;
+    jas_image_t image;
+    jas_stream_t *jpcstream,*istream;
+    jas_image_cmpt_t cmpt,*pcmpt;
+#define MAXOPTSSIZE 1024
+    char opts[MAXOPTSSIZE];
+
+/*
+    printf(" enc_jpeg2000:width %ld\n",width);
+    printf(" enc_jpeg2000:height %ld\n",height);
+    printf(" enc_jpeg2000:nbits %ld\n",nbits);
+    printf(" enc_jpeg2000:jpclen %ld\n",jpclen);
+*/
+//    jas_init();
+
+//
+//    Set lossy compression options, if requested.
+//
+    if ( ltype != 1 ) {
+       opts[0]=(char)0;
+    }
+    else {
+       snprintf(opts,MAXOPTSSIZE,"mode=real\nrate=%f",1.0/(float)ratio);
+    }
+    if ( retry == 1 ) {             // option to increase number of guard bits
+       strcat(opts,"\nnumgbits=4");
+    }
+    //printf("SAGopts: %s\n",opts);
+    
+//
+//     Initialize the JasPer image structure describing the grayscale
+//     image to encode into the JPEG2000 code stream.
+//
+    image.tlx_=0;
+    image.tly_=0;
+#ifdef JAS_1_500_4 
+    image.brx_=(uint_fast32_t)width;
+    image.bry_=(uint_fast32_t)height;
+#endif 
+#ifdef JAS_1_700_2
+    image.brx_=(jas_image_coord_t)width;
+    image.bry_=(jas_image_coord_t)height;
+#endif
+    image.numcmpts_=1;
+    image.maxcmpts_=1;
+#ifdef JAS_1_500_4
+    image.colormodel_=JAS_IMAGE_CM_GRAY;         /* grayscale Image */
+#endif
+#ifdef JAS_1_700_2
+    image.clrspc_=JAS_CLRSPC_SGRAY;         /* grayscale Image */
+    image.cmprof_=0; 
+#endif
+    image.inmem_=1;
+
+    cmpt.tlx_=0;
+    cmpt.tly_=0;
+    cmpt.hstep_=1;
+    cmpt.vstep_=1;
+#ifdef JAS_1_500_4
+    cmpt.width_=(uint_fast32_t)width;
+    cmpt.height_=(uint_fast32_t)height;
+#endif
+#ifdef JAS_1_700_2
+    cmpt.width_=(jas_image_coord_t)width;
+    cmpt.height_=(jas_image_coord_t)height;
+    cmpt.type_=JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_GRAY_Y);
+#endif
+    cmpt.prec_=nbits;
+    cmpt.sgnd_=0;
+    cmpt.cps_=(nbits+7)/8;
+
+    pcmpt=&cmpt;
+    image.cmpts_=&pcmpt;
+
+//
+//    Open a JasPer stream containing the input grayscale values
+//
+    istream=jas_stream_memopen((char *)cin,height*width*cmpt.cps_);
+    cmpt.stream_=istream;
+
+//
+//    Open an output stream that will contain the encoded jpeg2000
+//    code stream.
+//
+    jpcstream=jas_stream_memopen(outjpc,(int)jpclen);
+
+//
+//     Encode image.
+//
+    ier=jpc_encode(&image,jpcstream,opts);
+    if ( ier != 0 ) {
+       printf(" jpc_encode return = %d \n",ier);
+       return -3;
+    }
+//
+//     Clean up JasPer work structures.
+//    
+    rwcnt=jpcstream->rwcnt_;
+    ier=jas_stream_close(istream);
+    ier=jas_stream_close(jpcstream);
+//
+//      Return size of jpeg2000 code stream
+//
+    return (rwcnt);
+
+}
+
+#endif   /* USE_JPEG2000 */
diff --git a/g2clib_src/enc_png.c b/g2clib_src/enc_png.c
new file mode 100644
index 0000000..a800183
--- /dev/null
+++ b/g2clib_src/enc_png.c
@@ -0,0 +1,134 @@
+#ifndef USE_PNG
+ void dummy_enc_png(void) {}
+#else   /* USE_PNG */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <png.h>
+#include "grib2.h"
+
+
+struct png_stream {
+   unsigned char *stream_ptr;     /*  location to write PNG stream  */
+   g2int stream_len;               /*  number of bytes written       */
+};
+typedef struct png_stream png_stream;
+
+void user_write_data(png_structp ,png_bytep , png_uint_32 );
+void user_flush_data(png_structp );
+
+void user_write_data(png_structp png_ptr,png_bytep data, png_uint_32 length)
+/*
+        Custom write function used to that libpng will write
+        to memory location instead of a file on disk
+*/
+{
+     unsigned char *ptr;
+     g2int offset;
+     png_stream *mem;
+
+     mem=(png_stream *)png_get_io_ptr(png_ptr);
+     ptr=mem->stream_ptr;
+     offset=mem->stream_len;
+/*     printf("SAGwr %ld %ld %x\n",offset,length,ptr);    */
+     /*for (j=offset,k=0;k<length;j++,k++) ptr[j]=data[k];*/
+     memcpy(ptr+offset,data,length);
+     mem->stream_len += length;
+}
+
+
+void user_flush_data(png_structp png_ptr)
+/*
+        Dummy Custom flush function
+*/
+{
+   int *do_nothing;
+   do_nothing=NULL;
+}
+
+
+int enc_png(char *data,g2int width,g2int height,g2int nbits,char *pngbuf)
+{
+ 
+    int color_type;
+    g2int j,bytes,pnglen,bit_depth;
+    png_structp png_ptr;
+    png_infop info_ptr;
+//    png_bytep *row_pointers[height];
+    png_bytep **row_pointers;
+    png_stream write_io_ptr;
+
+/* create and initialize png_structs  */
+
+    png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, (png_voidp)NULL, 
+                                      NULL, NULL);
+    if (!png_ptr)
+       return (-1);
+
+    info_ptr = png_create_info_struct(png_ptr);
+    if (!info_ptr)
+    {
+       png_destroy_write_struct(&png_ptr,(png_infopp)NULL);
+       return (-2);
+    }
+
+/*     Set Error callback   */
+
+    if (setjmp(png_jmpbuf(png_ptr)))
+    {
+       png_destroy_write_struct(&png_ptr, &info_ptr);
+       return (-3);
+    }
+
+/*    Initialize info for writing PNG stream to memory   */
+
+    write_io_ptr.stream_ptr=(png_voidp)pngbuf;
+    write_io_ptr.stream_len=0;
+
+/*    Set new custom write functions    */
+
+    png_set_write_fn(png_ptr,(png_voidp)&write_io_ptr,(png_rw_ptr)user_write_data,
+                    (png_flush_ptr)user_flush_data);
+/*    png_init_io(png_ptr, fptr);   */
+/*    png_set_compression_level(png_ptr, Z_BEST_COMPRESSION);  */
+
+/*     Set the image size, colortype, filter type, etc...      */
+
+/*    printf("SAGTsettingIHDR %d %d %d\n",width,height,bit_depth); */
+    bit_depth=nbits;
+    color_type=PNG_COLOR_TYPE_GRAY;
+    if (nbits == 24 ) {
+        bit_depth=8;
+        color_type=PNG_COLOR_TYPE_RGB;
+    }
+    else if (nbits == 32 ) {
+        bit_depth=8;
+        color_type=PNG_COLOR_TYPE_RGB_ALPHA;
+    }
+    png_set_IHDR(png_ptr, info_ptr, width, height,
+       bit_depth, color_type, PNG_INTERLACE_NONE,
+       PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT);
+
+/*     Put image data into the PNG info structure    */
+
+    /*bytes=bit_depth/8;*/
+    bytes=nbits/8;
+    row_pointers=malloc(height*sizeof(png_bytep));
+    for (j=0;j<height;j++) row_pointers[j]=(png_bytep *)(data+(j*width*bytes));
+    png_set_rows(png_ptr, info_ptr, (png_bytepp)row_pointers);
+
+/*     Do the PNG encoding, and write out PNG stream  */
+
+    png_write_png(png_ptr, info_ptr, PNG_TRANSFORM_IDENTITY, NULL);
+
+/*     Clean up   */
+
+    png_destroy_write_struct(&png_ptr, &info_ptr);
+    free(row_pointers);
+    pnglen=write_io_ptr.stream_len;
+    return pnglen;
+
+}
+
+#endif   /* USE_PNG */
diff --git a/g2clib_src/g2_addfield.c b/g2clib_src/g2_addfield.c
new file mode 100755
index 0000000..db2853a
--- /dev/null
+++ b/g2clib_src/g2_addfield.c
@@ -0,0 +1,511 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include "grib2.h"
+
+g2int getdim(unsigned char *,g2int *,g2int *,g2int *);
+g2int getpoly(unsigned char *,g2int *,g2int *,g2int *);
+void simpack(g2float *, g2int, g2int *, unsigned char *, g2int *);
+void cmplxpack(g2float *, g2int, g2int, g2int *, unsigned char *, g2int *);
+void specpack(g2float *,g2int,g2int,g2int,g2int,g2int *,unsigned char *,
+              g2int *);
+#ifdef USE_PNG
+  void pngpack(g2float *,g2int,g2int,g2int *,unsigned char *,g2int *);
+#endif  /* USE_PNG */
+#ifdef USE_JPEG2000
+  void jpcpack(g2float *,g2int,g2int,g2int *,unsigned char *,g2int *);
+#endif  /* USE_JPEG2000 */
+
+
+g2int g2_addfield(unsigned char *cgrib,g2int ipdsnum,g2int *ipdstmpl,
+                g2float *coordlist,g2int numcoord,g2int idrsnum,g2int *idrstmpl,
+                g2float *fld,g2int ngrdpts,g2int ibmap,g2int *bmap)
+//$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    g2_addfield 
+//   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2002-11-05
+//
+// ABSTRACT: This routine packs up Sections 4 through 7 for a given field
+//   and adds them to a GRIB2 message.  They are Product Definition Section,
+//   Data Representation Section, Bit-Map Section and Data Section, 
+//   respectively.
+//   This routine is used with routines "g2_create", "g2_addlocal", 
+//   "g2_addgrid", and "g2_gribend" to create a complete GRIB2 message.  
+//   g2_create must be called first to initialize a new GRIB2 message.
+//   Also, routine g2_addgrid must be called after g2_create and
+//   before this routine to add the appropriate grid description to
+//   the GRIB2 message.   Also, a call to g2_gribend is required to complete 
+//   GRIB2 message after all fields have been added.
+//
+// PROGRAM HISTORY LOG:
+// 2002-11-05  Gilbert
+// 2002-12-23  Gilbert  -  Added complex spherical harmonic packing
+// 2003-08-27  Gilbert  - Added support for new templates using
+//                        PNG and JPEG2000 algorithms/templates.
+// 2004-11-29  Gilbert  - JPEG2000 now allowed to use WMO Template no. 5.40
+//                        PNG now allowed to use WMO Template no. 5.41
+//                      - Added check to determine if packing algorithm failed.
+// 2005-05-10  Gilbert -  Imposed minimum size on cpack, used to hold encoded
+//                        bit string.
+// 2009-01-14  Vuong     Changed structure name template to gtemplate
+//
+// USAGE:    int g2_addfield(unsigned char *cgrib,g2int ipdsnum,g2int *ipdstmpl,
+//              g2float *coordlist,g2int numcoord,g2int idrsnum,g2int *idrstmpl,
+//              g2float *fld,g2int ngrdpts,g2int ibmap,g2int *bmap)
+//   INPUT ARGUMENT LIST:
+//     cgrib    - Char array that contains the GRIB2 message to which sections
+//                4 through 7 should be added.
+//     ipdsnum  - Product Definition Template Number ( see Code Table 4.0)
+//     ipdstmpl - Contains the data values for the specified Product Definition
+//                Template ( N=ipdsnum ).  Each element of this integer 
+//                array contains an entry (in the order specified) of Product
+//                Defintion Template 4.N
+//     coordlist- Array containg floating point values intended to document
+//                the vertical discretisation associated to model data
+//                on hybrid coordinate vertical levels.
+//     numcoord - number of values in array coordlist.
+//     idrsnum  - Data Representation Template Number ( see Code Table 5.0 )
+//     idrstmpl - Contains the data values for the specified Data Representation
+//                Template ( N=idrsnum ).  Each element of this integer 
+//                array contains an entry (in the order specified) of Data
+//                Representation Template 5.N
+//                Note that some values in this template (eg. reference
+//                values, number of bits, etc...) may be changed by the
+//                data packing algorithms.
+//                Use this to specify scaling factors and order of
+//                spatial differencing, if desired.
+//     fld[]    - Array of data points to pack.
+//     ngrdpts  - Number of data points in grid.
+//                i.e.  size of fld and bmap.
+//     ibmap    - Bitmap indicator ( see Code Table 6.0 )
+//                0 = bitmap applies and is included in Section 6.
+//                1-253 = Predefined bitmap applies
+//                254 = Previously defined bitmap applies to this field
+//                255 = Bit map does not apply to this product.
+//     bmap[]   - Integer array containing bitmap to be added. ( if ibmap=0 )
+//
+//   OUTPUT ARGUMENT LIST:      
+//     cgrib    - Character array to contain the updated GRIB2 message.
+//                Must be allocated large enough to store the entire
+//                GRIB2 message.
+//
+//   RETURN VALUES:
+//     ierr     - Return code.
+//              > 0 = Current size of updated GRIB2 message
+//               -1 = GRIB message was not initialized.  Need to call
+//                    routine g2_create first.
+//               -2 = GRIB message already complete.  Cannot add new section.
+//               -3 = Sum of Section byte counts doesn't add to total byte count
+//               -4 = Previous Section was not 3 or 7.
+//               -5 = Could not find requested Product Definition Template.
+//               -6 = Section 3 (GDS) not previously defined in message
+//               -7 = Tried to use unsupported Data Representationi Template
+//               -8 = Specified use of a previously defined bitmap, but one
+//                    does not exist in the GRIB message.
+//               -9 = GDT of one of 5.50 through 5.53 required to pack field
+//                    using DRT 5.51.
+//              -10 = Error packing data field.
+//
+// REMARKS: Note that the Sections 4 through 7 can only follow
+//          Section 3 or Section 7 in a GRIB2 message.
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE:  
+//
+//$$$
+{
+      g2int ierr;
+      static unsigned char G=0x47;       // 'G'
+      static unsigned char R=0x52;       // 'R'
+      static unsigned char I=0x49;       // 'I'
+      static unsigned char B=0x42;       // 'B'
+      static unsigned char s7=0x37;   // '7'
+
+      unsigned char *cpack;
+      static g2int  zero=0,one=1,four=4,five=5,six=6,seven=7;
+      const g2int  minsize=50000;
+      g2int   iofst,ibeg,lencurr,len,nsize;
+      g2int   ilen,isecnum,i,nbits,temp,left;
+      g2int   ibmprev,j,lcpack,ioctet,newlen,ndpts;
+      g2int   lensec4,lensec5,lensec6,lensec7;
+      g2int   issec3,isprevbmap,lpos3=0,JJ,KK,MM;
+      g2int   *coordieee;
+      g2int   width,height,iscan,itemp;
+      g2float *pfld;
+      gtemplate  *mappds,*mapdrs;
+      unsigned int allones=4294967295u;
+ 
+      ierr=0;
+//
+//  Check to see if beginning of GRIB message exists
+//
+      if ( cgrib[0]!=G || cgrib[1]!=R || cgrib[2]!=I || cgrib[3]!=B ) {
+        printf("g2_addfield: GRIB not found in given message.\n");
+        printf("g2_addfield: Call to routine g2_create required to initialize GRIB messge.\n");
+        ierr=-1;
+        return(ierr);
+      }
+//
+//  Get current length of GRIB message
+//  
+      gbit(cgrib,&lencurr,96,32);
+//
+//  Check to see if GRIB message is already complete
+//  
+      if ( cgrib[lencurr-4]==s7 && cgrib[lencurr-3]==s7 &&
+           cgrib[lencurr-2]==s7 && cgrib[lencurr-1]==s7 ) {
+        printf("g2_addfield: GRIB message already complete.  Cannot add new section.\n");
+        ierr=-2;
+        return(ierr);
+      }
+//
+//  Loop through all current sections of the GRIB message to
+//  find the last section number.
+//
+      issec3=0;
+      isprevbmap=0;
+      len=16;    // length of Section 0
+      for (;;) { 
+      //    Get number and length of next section
+        iofst=len*8;
+        gbit(cgrib,&ilen,iofst,32);
+        iofst=iofst+32;
+        gbit(cgrib,&isecnum,iofst,8);
+        iofst=iofst+8;
+      //  Check if previous Section 3 exists
+        if (isecnum == 3) {
+            issec3=1;
+            lpos3=len;
+        }
+      //  Check if a previous defined bitmap exists
+        if (isecnum == 6) {
+          gbit(cgrib,&ibmprev,iofst,8);
+          iofst=iofst+8;
+          if ((ibmprev >= 0) && (ibmprev <= 253)) isprevbmap=1;
+        }
+        len=len+ilen;
+      //    Exit loop if last section reached
+        if ( len == lencurr ) break;
+      //    If byte count for each section doesn't match current
+      //    total length, then there is a problem.
+        if ( len > lencurr ) {
+          printf("g2_addfield: Section byte counts don''t add to total.\n");
+          printf("g2_addfield: Sum of section byte counts = %ld\n",len);
+          printf("g2_addfield: Total byte count in Section 0 = %ld\n",lencurr);
+          ierr=-3;
+          return(ierr);
+        }
+      }
+//
+//  Sections 4 through 7 can only be added after section 3 or 7.
+//
+      if ( (isecnum != 3) && (isecnum != 7) ) {
+        printf("g2_addfield: Sections 4-7 can only be added after Section 3 or 7.\n");
+        printf("g2_addfield: Section ',isecnum,' was the last found in given GRIB message.\n");
+        ierr=-4;
+        return(ierr);
+//
+//  Sections 4 through 7 can only be added if section 3 was previously defined.
+//
+      }
+      else if ( ! issec3) {
+        printf("g2_addfield: Sections 4-7 can only be added if Section 3 was previously included.\n");
+        printf("g2_addfield: Section 3 was not found in given GRIB message.\n");
+        printf("g2_addfield: Call to routine addgrid required to specify Grid definition.\n");
+        ierr=-6;
+        return(ierr);
+      }
+//
+//  Add Section 4  - Product Definition Section
+//
+      ibeg=lencurr*8;        //   Calculate offset for beginning of section 4
+      iofst=ibeg+32;         //   leave space for length of section
+      sbit(cgrib,&four,iofst,8);     // Store section number ( 4 )
+      iofst=iofst+8;
+      sbit(cgrib,&numcoord,iofst,16);   // Store num of coordinate values
+      iofst=iofst+16;
+      sbit(cgrib,&ipdsnum,iofst,16);    // Store Prod Def Template num.
+      iofst=iofst+16;
+      //
+      //   Get Product Definition Template
+      //
+      mappds=getpdstemplate(ipdsnum);
+      if (mappds == 0) {          // undefined template
+        ierr=-5;
+        return(ierr);
+      }
+      //
+      //   Extend the Product Definition Template, if necessary.
+      //   The number of values in a specific template may vary
+      //   depending on data specified in the "static" part of the
+      //   template.
+      //
+      if ( mappds->needext ) {
+        free(mappds);
+        mappds=extpdstemplate(ipdsnum,ipdstmpl);
+      }
+      //
+      //   Pack up each input value in array ipdstmpl into the
+      //   the appropriate number of octets, which are specified in
+      //   corresponding entries in array mappds.
+      //
+      for (i=0;i<mappds->maplen;i++) {
+        nbits=abs(mappds->map[i])*8;
+        if ( (mappds->map[i] >= 0) || (ipdstmpl[i] >= 0) )
+          sbit(cgrib,ipdstmpl+i,iofst,nbits);
+        else {
+          sbit(cgrib,&one,iofst,1);
+          temp=abs(ipdstmpl[i]);
+          sbit(cgrib,&temp,iofst+1,nbits-1);
+        }
+        iofst=iofst+nbits;
+      }
+      //  Pack template extension, if appropriate
+      j=mappds->maplen;
+      if ( mappds->needext && (mappds->extlen > 0) ) {
+         for (i=0;i<mappds->extlen;i++) {
+           nbits=abs(mappds->ext[i])*8;
+           if ( (mappds->ext[i] >= 0) || (ipdstmpl[j] >= 0) )
+             sbit(cgrib,ipdstmpl+j,iofst,nbits);
+           else {
+             sbit(cgrib,&one,iofst,1);
+             temp=abs(ipdstmpl[j]);
+             sbit(cgrib,&temp,iofst+1,nbits-1);
+           }
+           iofst=iofst+nbits;
+           j++;
+         }
+      }
+      free(mappds);
+      //
+      //   Add Optional list of vertical coordinate values
+      //   after the Product Definition Template, if necessary.
+      //
+      if ( numcoord != 0 ) {
+        coordieee=(g2int *)calloc(numcoord,sizeof(g2int));
+        mkieee(coordlist,coordieee,numcoord);
+        sbits(cgrib,coordieee,iofst,32,0,numcoord);
+        iofst=iofst+(32*numcoord);
+        free(coordieee);
+      }
+      //
+      //   Calculate length of section 4 and store it in octets
+      //   1-4 of section 4.
+      //
+      lensec4=(iofst-ibeg)/8;
+      sbit(cgrib,&lensec4,ibeg,32);
+//
+//  Pack Data using appropriate algorithm
+//
+      //
+      //   Get Data Representation Template
+      //
+      mapdrs=getdrstemplate(idrsnum);
+      if (mapdrs == 0) {
+        ierr=-5;
+        return(ierr);
+      }
+      //
+      //  contract data field, removing data at invalid grid points,
+      //  if bit-map is provided with field.
+      //
+      if ( ibmap == 0 || ibmap==254 ) {
+         pfld=(g2float *)malloc(ngrdpts*sizeof(g2float));
+         ndpts=0;
+         for (j=0;j<ngrdpts;j++) {
+             if ( bmap[j]==1 ) pfld[ndpts++]=fld[j];
+         }
+      }
+      else {
+         ndpts=ngrdpts;
+         pfld=fld;
+      }
+      nsize=ndpts*4;
+      if ( nsize < minsize ) nsize=minsize;
+      cpack=malloc(nsize);
+      if (idrsnum == 0)           //  Simple Packing
+        simpack(pfld,ndpts,idrstmpl,cpack,&lcpack);
+      else if (idrsnum==2 || idrsnum==3)           //  Complex Packing
+        cmplxpack(pfld,ndpts,idrsnum,idrstmpl,cpack,&lcpack);
+      else if (idrsnum == 50) {         //  Sperical Harmonic Simple Packing 
+        simpack(pfld+1,ndpts-1,idrstmpl,cpack,&lcpack);
+        mkieee(pfld+0,idrstmpl+4,1);  // ensure RE(0,0) value is IEEE format
+      }
+      else if (idrsnum == 51) {         //  Sperical Harmonic Complex Packing 
+        getpoly(cgrib+lpos3,&JJ,&KK,&MM);
+        if ( JJ!=0 && KK!=0 && MM!=0 )
+           specpack(pfld,ndpts,JJ,KK,MM,idrstmpl,cpack,&lcpack);
+        else {
+           printf("g2_addfield: Cannot pack DRT 5.51.\n");
+           return (-9);
+        }
+      }
+#ifdef USE_JPEG2000
+      else if (idrsnum == 40 || idrsnum == 40000) {    /*  JPEG2000 encoding  */
+        if (ibmap == 255) {
+           getdim(cgrib+lpos3,&width,&height,&iscan);
+           if ( width==0 || height==0 ) {
+              width=ndpts;
+              height=1;
+           }
+           else if ( width==allones || height==allones ) {
+              width=ndpts;
+              height=1;
+           }
+           else if ( (iscan&32) == 32) {   /* Scanning mode: bit 3  */
+              itemp=width;
+              width=height;
+              height=itemp;
+           }
+        }
+        else {
+           width=ndpts;
+           height=1;
+        }
+        lcpack=nsize;
+        jpcpack(pfld,width,height,idrstmpl,cpack,&lcpack);
+      }
+#endif  /* USE_JPEG2000 */
+#ifdef USE_PNG
+      else if (idrsnum == 41 || idrsnum == 40010) {      /*  PNG encoding   */
+        if (ibmap == 255) {
+           getdim(cgrib+lpos3,&width,&height,&iscan);
+           if ( width==0 || height==0 ) {
+              width=ndpts;
+              height=1;
+           }
+           else if ( width==allones || height==allones ) {
+              width=ndpts;
+              height=1;
+           }
+           else if ( (iscan&32) == 32) {   /* Scanning mode: bit 3  */
+              itemp=width;
+              width=height;
+              height=itemp;
+           }
+        }
+        else {
+           width=ndpts;
+           height=1;
+        }
+        pngpack(pfld,width,height,idrstmpl,cpack,&lcpack);
+      }
+#endif  /* USE_PNG */
+      else {
+        printf("g2_addfield: Data Representation Template 5.%ld not yet implemented.\n",idrsnum);
+        ierr=-7;
+        return(ierr);
+      }
+      if ( ibmap == 0 || ibmap==254 ) {      // free temp space
+         if (fld != pfld) free(pfld);
+      }
+      if ( lcpack < 0 ) {
+        if( cpack != 0 ) free(cpack);
+        ierr=-10;
+        return(ierr);
+      }
+
+//
+//  Add Section 5  - Data Representation Section
+//
+      ibeg=iofst;            //   Calculate offset for beginning of section 5
+      iofst=ibeg+32;         //   leave space for length of section
+      sbit(cgrib,&five,iofst,8);     // Store section number ( 5 )
+      iofst=iofst+8;
+      sbit(cgrib,&ndpts,iofst,32);    // Store num of actual data points
+      iofst=iofst+32;
+      sbit(cgrib,&idrsnum,iofst,16);    // Store Data Repr. Template num.
+      iofst=iofst+16;
+      //
+      //   Pack up each input value in array idrstmpl into the
+      //   the appropriate number of octets, which are specified in
+      //   corresponding entries in array mapdrs.
+      //
+      for (i=0;i<mapdrs->maplen;i++) {
+        nbits=abs(mapdrs->map[i])*8;
+        if ( (mapdrs->map[i] >= 0) || (idrstmpl[i] >= 0) )
+          sbit(cgrib,idrstmpl+i,iofst,nbits);
+        else {
+          sbit(cgrib,&one,iofst,1);
+          temp=abs(idrstmpl[i]);
+          sbit(cgrib,&temp,iofst+1,nbits-1);
+        }
+        iofst=iofst+nbits;
+      }
+      free(mapdrs);
+      //
+      //   Calculate length of section 5 and store it in octets
+      //   1-4 of section 5.
+      //
+      lensec5=(iofst-ibeg)/8;
+      sbit(cgrib,&lensec5,ibeg,32);
+
+//
+//  Add Section 6  - Bit-Map Section
+//
+      ibeg=iofst;            //   Calculate offset for beginning of section 6
+      iofst=ibeg+32;         //   leave space for length of section
+      sbit(cgrib,&six,iofst,8);     // Store section number ( 6 )
+      iofst=iofst+8;
+      sbit(cgrib,&ibmap,iofst,8);    // Store Bit Map indicator
+      iofst=iofst+8;
+      //
+      //  Store bitmap, if supplied
+      //
+      if (ibmap == 0) {
+        sbits(cgrib,bmap,iofst,1,0,ngrdpts);    // Store BitMap
+        iofst=iofst+ngrdpts;
+      }
+      //
+      //  If specifying a previously defined bit-map, make sure
+      //  one already exists in the current GRIB message.
+      //
+      if ((ibmap==254) && ( ! isprevbmap)) {
+        printf("g2_addfield: Requested previously defined bitmap,");
+        printf(" but one does not exist in the current GRIB message.\n");
+        ierr=-8;
+        return(ierr);
+      }
+      //
+      //   Calculate length of section 6 and store it in octets
+      //   1-4 of section 6.  Pad to end of octect, if necessary.
+      //
+      left=8-(iofst%8);
+      if (left != 8) {
+        sbit(cgrib,&zero,iofst,left);     // Pad with zeros to fill Octet
+        iofst=iofst+left;
+      }
+      lensec6=(iofst-ibeg)/8;
+      sbit(cgrib,&lensec6,ibeg,32);
+
+//
+//  Add Section 7  - Data Section
+//
+      ibeg=iofst;            //   Calculate offset for beginning of section 7
+      iofst=ibeg+32;        //   leave space for length of section
+      sbit(cgrib,&seven,iofst,8);    // Store section number ( 7 )
+      iofst=iofst+8;
+      //      Store Packed Binary Data values, if non-constant field
+      if (lcpack != 0) {
+        ioctet=iofst/8;
+        //cgrib(ioctet+1:ioctet+lcpack)=cpack(1:lcpack)
+        for (j=0;j<lcpack;j++) cgrib[ioctet+j]=cpack[j];
+        iofst=iofst+(8*lcpack);
+      }
+      //
+      //   Calculate length of section 7 and store it in octets
+      //   1-4 of section 7.  
+      //
+      lensec7=(iofst-ibeg)/8;
+      sbit(cgrib,&lensec7,ibeg,32);
+
+      if( cpack != 0 ) free(cpack);
+//
+//  Update current byte total of message in Section 0
+//
+      newlen=lencurr+lensec4+lensec5+lensec6+lensec7;
+      sbit(cgrib,&newlen,96,32);
+
+      return(newlen);
+
+}
diff --git a/g2clib_src/g2_addgrid.c b/g2clib_src/g2_addgrid.c
new file mode 100755
index 0000000..55fb8f7
--- /dev/null
+++ b/g2clib_src/g2_addgrid.c
@@ -0,0 +1,244 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include "grib2.h"
+
+
+g2int g2_addgrid(unsigned char *cgrib,g2int *igds,g2int *igdstmpl,g2int *ideflist,g2int idefnum)
+//$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    g2_addgrid 
+//   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2002-11-01
+//
+// ABSTRACT: This routine packs up a Grid Definition Section (Section 3) 
+//   and adds it to a GRIB2 message.  It is used with routines "g2_create",
+//   "g2_addlocal", "g2_addfield",
+//   and "g2_gribend" to create a complete GRIB2 message.
+//   g2_create must be called first to initialize a new GRIB2 message.
+//
+// PROGRAM HISTORY LOG:
+// 2002-11-01  Gilbert
+// 2009-01-14  Vuong     Changed structure name template to gtemplate
+//
+// USAGE:    int g2_addgrid(unsigned char *cgrib,g2int *igds,g2int *igdstmpl,
+//                          g2int *ideflist,g2int idefnum)
+//   INPUT ARGUMENTS:
+//     cgrib    - Char array that contains the GRIB2 message to which
+//                section should be added.
+//     igds     - Contains information needed for GRIB Grid Definition Section 3
+//                Must be dimensioned >= 5.
+//                igds[0]=Source of grid definition (see Code Table 3.0)
+//                igds[1]=Number of grid points in the defined grid.
+//                igds[2]=Number of octets needed for each 
+//                            additional grid points definition.  
+//                            Used to define number of
+//                            points in each row ( or column ) for
+//                            non-regular grids.  
+//                            = 0, if using regular grid.
+//                igds[3]=Interpretation of list for optional points 
+//                            definition.  (Code Table 3.11)
+//                igds[4]=Grid Definition Template Number (Code Table 3.1)
+//     igdstmpl - Contains the data values for the specified Grid Definition
+//                Template ( NN=igds[4] ).  Each element of this integer 
+//                array contains an entry (in the order specified) of Grid
+//                Defintion Template 3.NN
+//     ideflist - (Used if igds[2] != 0)  This array contains the
+//                number of grid points contained in each row ( or column )
+//      idefnum - (Used if igds[2] != 0)  The number of entries
+//                in array ideflist.  i.e. number of rows ( or columns )
+//                for which optional grid points are defined.
+//
+//   OUTPUT ARGUMENTS:      
+//     cgrib    - Char array to contain the updated GRIB2 message.
+//                Must be allocated large enough to store the entire
+//                GRIB2 message.
+//
+//   RETURN VALUES:
+//     ierr     - Return code.
+//              > 0 = Current size of updated GRIB2 message
+//               -1 = GRIB message was not initialized.  Need to call
+//                    routine gribcreate first.
+//               -2 = GRIB message already complete.  Cannot add new section.
+//               -3 = Sum of Section byte counts doesn't add to total byte count
+//               -4 = Previous Section was not 1, 2 or 7.
+//               -5 = Could not find requested Grid Definition Template.
+//
+// REMARKS: Note that the Grid Def Section ( Section 3 ) can only follow
+//          Section 1, 2 or Section 7 in a GRIB2 message.
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE:  
+//
+//$$$
+{
+
+      g2int ierr;
+      static unsigned char G=0x47;       // 'G'
+      static unsigned char R=0x52;       // 'R'
+      static unsigned char I=0x49;       // 'I'
+      static unsigned char B=0x42;       // 'B'
+      static unsigned char seven=0x37;   // '7'
+
+      static g2int one=1,three=3,miss=65535;
+      g2int   lensec3,iofst,ibeg,lencurr,len;
+      g2int   i,j,temp,ilen,isecnum,nbits;
+      gtemplate *mapgrid=0;
+ 
+      ierr=0;
+//
+//  Check to see if beginning of GRIB message exists
+//
+      if ( cgrib[0]!=G || cgrib[1]!=R || cgrib[2]!=I || cgrib[3]!=B ) {
+        printf("g2_addgrid: GRIB not found in given message.\n");
+        printf("g2_addgrid: Call to routine gribcreate required to initialize GRIB messge.\n");
+        ierr=-1;
+        return(ierr);
+      }
+//
+//  Get current length of GRIB message
+//  
+      gbit(cgrib,&lencurr,96,32);
+//
+//  Check to see if GRIB message is already complete
+//  
+      if ( cgrib[lencurr-4]==seven && cgrib[lencurr-3]==seven &&
+           cgrib[lencurr-2]==seven && cgrib[lencurr-1]==seven ) {
+        printf("g2_addgrid: GRIB message already complete.  Cannot add new section.\n");
+        ierr=-2;
+        return(ierr);
+      }
+//
+//  Loop through all current sections of the GRIB message to
+//  find the last section number.
+//
+      len=16;    // length of Section 0
+      for (;;) { 
+      //    Get section number and length of next section
+        iofst=len*8;
+        gbit(cgrib,&ilen,iofst,32);
+        iofst=iofst+32;
+        gbit(cgrib,&isecnum,iofst,8);
+        len=len+ilen;
+      //    Exit loop if last section reached
+        if ( len == lencurr ) break;
+      //    If byte count for each section doesn't match current
+      //    total length, then there is a problem.
+        if ( len > lencurr ) {
+          printf("g2_addgrid: Section byte counts don''t add to total.\n");
+          printf("g2_addgrid: Sum of section byte counts = %ld\n",len);
+          printf("g2_addgrid: Total byte count in Section 0 = %ld\n",lencurr);
+          ierr=-3;
+          return(ierr);
+        }
+      }
+//
+//  Section 3 can only be added after sections 1, 2 and 7.
+//
+      if ( (isecnum!=1) && (isecnum!=2) && (isecnum!=7) ) {
+        printf("g2_addgrid: Section 3 can only be added after Section 1, 2 or 7.\n");
+        printf("g2_addgrid: Section ',isecnum,' was the last found in given GRIB message.\n");
+        ierr=-4;
+        return(ierr);
+      }
+//
+//  Add Section 3  - Grid Definition Section
+//
+      ibeg=lencurr*8;        //   Calculate offset for beginning of section 3
+      iofst=ibeg+32;         //   leave space for length of section
+      sbit(cgrib,&three,iofst,8);     // Store section number ( 3 )
+      iofst=iofst+8;
+      sbit(cgrib,igds+0,iofst,8);     // Store source of Grid def.
+      iofst=iofst+8;
+      sbit(cgrib,igds+1,iofst,32);    // Store number of data pts.
+      iofst=iofst+32;
+      sbit(cgrib,igds+2,iofst,8);     // Store number of extra octets.
+      iofst=iofst+8;
+      sbit(cgrib,igds+3,iofst,8);     // Store interp. of extra octets.
+      iofst=iofst+8;
+      //   if Octet 6 is not equal to zero, Grid Definition Template may
+      //   not be supplied.
+      if ( igds[0] == 0 )
+        sbit(cgrib,igds+4,iofst,16);  // Store Grid Def Template num.
+      else
+        sbit(cgrib,&miss,iofst,16);   // Store missing value as Grid Def Template num.
+      iofst=iofst+16;
+      //
+      //   Get Grid Definition Template
+      //
+      if (igds[0] == 0) {
+        mapgrid=getgridtemplate(igds[4]);
+        if (mapgrid == 0) {       // undefined template
+          ierr=-5;
+          return(ierr);
+        }
+        //
+        //   Extend the Grid Definition Template, if necessary.
+        //   The number of values in a specific template may vary
+        //   depending on data specified in the "static" part of the
+        //   template.
+        //
+        if ( mapgrid->needext ) {
+          free(mapgrid);
+          mapgrid=extgridtemplate(igds[4],igdstmpl);
+        }
+      }
+      //
+      //   Pack up each input value in array igdstmpl into the
+      //   the appropriate number of octets, which are specified in
+      //   corresponding entries in array mapgrid.
+      //
+      for (i=0;i<mapgrid->maplen;i++) {
+        nbits=abs(mapgrid->map[i])*8;
+        if ( (mapgrid->map[i] >= 0) || (igdstmpl[i] >= 0) )
+          sbit(cgrib,igdstmpl+i,iofst,nbits);
+        else {
+          sbit(cgrib,&one,iofst,1);
+          temp=abs(igdstmpl[i]);
+          sbit(cgrib,&temp,iofst+1,nbits-1);
+        }
+        iofst=iofst+nbits;
+      }
+      //  Pack template extension, if appropriate
+      j=mapgrid->maplen;
+      if ( mapgrid->needext && (mapgrid->extlen > 0) ) {
+         for (i=0;i<mapgrid->extlen;i++) {
+           nbits=abs(mapgrid->ext[i])*8;
+           if ( (mapgrid->ext[i] >= 0) || (igdstmpl[j] >= 0) )
+             sbit(cgrib,igdstmpl+j,iofst,nbits);
+           else {
+             sbit(cgrib,&one,iofst,1);
+             temp=abs(igdstmpl[j]);
+             sbit(cgrib,&temp,iofst+1,nbits-1);
+           }
+           iofst=iofst+nbits;
+           j++;
+         }
+      }
+      free(mapgrid);
+      //
+      //   If requested,
+      //   Insert optional list of numbers defining number of points
+      //   in each row or column.  This is used for non regular
+      //   grids.
+      //
+      if ( igds[2] != 0 ) {
+         nbits=igds[2]*8;
+         sbits(cgrib,ideflist,iofst,nbits,0,idefnum);
+         iofst=iofst+(nbits*idefnum);
+      }
+      //
+      //   Calculate length of section 3 and store it in octets
+      //   1-4 of section 3.
+      //
+      lensec3=(iofst-ibeg)/8;
+      sbit(cgrib,&lensec3,ibeg,32);
+
+//
+//  Update current byte total of message in Section 0
+//
+      lencurr+=lensec3;
+      sbit(cgrib,&lencurr,96,32);
+
+      return(lencurr);
+
+}
diff --git a/g2clib_src/g2_addlocal.c b/g2clib_src/g2_addlocal.c
new file mode 100755
index 0000000..c291367
--- /dev/null
+++ b/g2clib_src/g2_addlocal.c
@@ -0,0 +1,147 @@
+#include <stdio.h>
+#include "grib2.h"
+
+g2int g2_addlocal(unsigned char *cgrib,unsigned char *csec2,g2int lcsec2)
+//$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    g2_addlocal 
+//   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2002-11-01
+//
+// ABSTRACT: This routine adds a Local Use Section (Section 2) to 
+//   a GRIB2 message.  It is used with routines "g2_create", 
+//   "g2_addgrid", "g2_addfield",
+//   and "g2_gribend" to create a complete GRIB2 message.  
+//   g2_create must be called first to initialize a new GRIB2 message.
+//
+// PROGRAM HISTORY LOG:
+// 2002-11-01  Gilbert
+//
+// USAGE:    int g2_addlocal(unsigned char *cgrib,unsigned char *csec2,
+//                           g2int lcsec2)
+//   INPUT ARGUMENTS:
+//     cgrib    - Char array that contains the GRIB2 message to which section
+//                2 should be added.
+//     csec2    - Character array containing information to be added in
+//                Section 2.
+//     lcsec2   - Number of bytes of character array csec2 to be added to
+//                Section 2.
+//
+//   OUTPUT ARGUMENT:      
+//     cgrib    - Char array to contain the updated GRIB2 message.
+//                Must be allocated large enough to store the entire
+//                GRIB2 message.
+//
+//   RETURN VALUES:
+//     ierr     - Return code.
+//              > 0 = Current size of updated GRIB2 message
+//               -1 = GRIB message was not initialized.  Need to call
+//                    routine gribcreate first.
+//               -2 = GRIB message already complete.  Cannot add new section.
+//               -3 = Sum of Section byte counts doesn't add to total byte count
+//               -4 = Previous Section was not 1 or 7.
+//
+// REMARKS: Note that the Local Use Section ( Section 2 ) can only follow
+//          Section 1 or Section 7 in a GRIB2 message.
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE: 
+//
+//$$$
+{
+
+      g2int ierr; 
+      static unsigned char G=0x47;       // 'G'
+      static unsigned char R=0x52;       // 'R'
+      static unsigned char I=0x49;       // 'I'
+      static unsigned char B=0x42;       // 'B'
+      static unsigned char seven=0x37;   // '7'
+
+      static g2int two=2;
+      g2int   j,k,lensec2,iofst,ibeg,lencurr,ilen,len,istart;
+      g2int   isecnum;
+ 
+      ierr=0;
+//
+//  Check to see if beginning of GRIB message exists
+//
+      if ( cgrib[0]!=G || cgrib[1]!=R || cgrib[2]!=I || cgrib[3]!=B ) {
+        printf("g2_addlocal: GRIB not found in given message.\n");
+        printf("g2_addlocal: Call to routine g2_create required to initialize GRIB messge.\n");
+        ierr=-1;
+        return(ierr);
+      }
+//
+//  Get current length of GRIB message
+//  
+      gbit(cgrib,&lencurr,96,32);
+//
+//  Check to see if GRIB message is already complete
+//  
+      if ( cgrib[lencurr-4]==seven && cgrib[lencurr-3]==seven && 
+           cgrib[lencurr-2]==seven && cgrib[lencurr-1]==seven ) {
+        printf("g2_addlocal: GRIB message already complete.  Cannot add new section.\n");
+        ierr=-2;
+        return(ierr);
+      }
+//
+//  Loop through all current sections of the GRIB message to
+//  find the last section number.
+//
+      len=16;    // length of Section 0
+      for (;;) { 
+      //    Get section number and length of next section
+        iofst=len*8;
+        gbit(cgrib,&ilen,iofst,32);
+        iofst=iofst+32;
+        gbit(cgrib,&isecnum,iofst,8);
+        len=len+ilen;
+      //    Exit loop if last section reached
+        if ( len == lencurr ) break;
+      //    If byte count for each section doesn't match current
+      //    total length, then there is a problem.
+        if ( len > lencurr ) {
+          printf("g2_addlocal: Section byte counts don't add to total.\n");
+          printf("g2_addlocal: Sum of section byte counts = %ld\n",len);
+          printf("g2_addlocal: Total byte count in Section 0 = %ld\n",lencurr);
+          ierr=-3;
+          return(ierr);
+        }
+      }
+//
+//  Section 2 can only be added after sections 1 and 7.
+//
+      if ( (isecnum!=1) && (isecnum!=7) ) {
+        printf("g2_addlocal: Section 2 can only be added after Section 1 or Section 7.\n");
+        printf("g2_addlocal: Section %ld was the last found in given GRIB message.\n",isecnum);
+        ierr=-4;
+        return(ierr);
+      }
+//
+//  Add Section 2  - Local Use Section
+//
+      ibeg=lencurr*8;        //   Calculate offset for beginning of section 2
+      iofst=ibeg+32;         //   leave space for length of section
+      sbit(cgrib,&two,iofst,8);     // Store section number ( 2 )
+      istart=lencurr+5;
+      //cgrib(istart+1:istart+lcsec2)=csec2(1:lcsec2)
+      k=0;
+      for (j=istart;j<istart+lcsec2;j++) {
+         cgrib[j]=csec2[k++];
+      }
+      //
+      //   Calculate length of section 2 and store it in octets
+      //   1-4 of section 2.
+      //
+      lensec2=lcsec2+5;      // bytes
+      sbit(cgrib,&lensec2,ibeg,32);
+
+//
+//  Update current byte total of message in Section 0
+//
+      lencurr+=lensec2;
+      sbit(cgrib,&lencurr,96,32);
+
+      return(lencurr);
+
+}
diff --git a/g2clib_src/g2_create.c b/g2clib_src/g2_create.c
new file mode 100755
index 0000000..5791485
--- /dev/null
+++ b/g2clib_src/g2_create.c
@@ -0,0 +1,127 @@
+#include <stdio.h>
+#include "grib2.h"
+
+#define MAPSEC1LEN 13
+
+g2int g2_create(unsigned char *cgrib,g2int *listsec0,g2int *listsec1)
+//$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    g2_create 
+//   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2002-10-31
+//
+// ABSTRACT: This routine initializes a new GRIB2 message and packs
+//   GRIB2 sections 0 (Indicator Section) and 1 (Identification Section).
+//   This routine is used with routines "g2_addlocal", "g2_addgrid", 
+//   "g2_addfield", and "g2_gribend" to create a complete GRIB2 message.  
+//   g2_create must be called first to initialize a new GRIB2 message.
+//   Also, a call to g2_gribend is required to complete GRIB2 message
+//   after all fields have been added.
+//
+// PROGRAM HISTORY LOG:
+// 2002-10-31  Gilbert
+//
+// USAGE:    int g2_create(unsigned char *cgrib,g2int *listsec0,g2int *listsec1)
+//   INPUT ARGUMENTS:
+//     cgrib    - Character array to contain the GRIB2 message
+//     listsec0 - Contains information needed for GRIB Indicator Section 0.
+//                Must be dimensioned >= 2.
+//                listsec0[0]=Discipline-GRIB Master Table Number
+//                            (see Code Table 0.0)
+//                listsec0[1]=GRIB Edition Number (currently 2)
+//     listsec1 - Contains information needed for GRIB Identification Section 1.
+//                Must be dimensioned >= 13.
+//                listsec1[0]=Id of orginating centre (Common Code Table C-1)
+//                listsec1[1]=Id of orginating sub-centre (local table)
+//                listsec1[2]=GRIB Master Tables Version Number (Code Table 1.0)
+//                listsec1[3]=GRIB Local Tables Version Number (Code Table 1.1)
+//                listsec1[4]=Significance of Reference Time (Code Table 1.2)
+//                listsec1[5]=Reference Time - Year (4 digits)
+//                listsec1[6]=Reference Time - Month
+//                listsec1[7]=Reference Time - Day
+//                listsec1[8]=Reference Time - Hour
+//                listsec1[9]=Reference Time - Minute
+//                listsec1[10]=Reference Time - Second
+//                listsec1[11]=Production status of data (Code Table 1.3)
+//                listsec1[12]=Type of processed data (Code Table 1.4)
+//
+//   OUTPUT ARGUMENTS:      
+//     cgrib    - Char array to contain the new GRIB2 message.
+//                Must be allocated large enough to store the entire
+//                GRIB2 message.
+//
+//   RETURN VALUES:
+//     ierr     - return code.
+//              > 0 = Current size of new GRIB2 message
+//               -1 = Tried to use for version other than GRIB Edition 2
+//
+// REMARKS: This routine is intended for use with routines "g2_addlocal", 
+//          "g2_addgrid", "g2_addfield", and "g2_gribend" to create a complete 
+//          GRIB2 message.
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE:  
+//
+//$$$
+{
+
+      g2int  ierr;
+      g2int   zero=0,one=1;
+      g2int   mapsec1len=MAPSEC1LEN;
+      g2int   mapsec1[MAPSEC1LEN]={ 2,2,1,1,1,2,1,1,1,1,1,1,1 };
+      g2int   i,lensec0,lensec1,iofst,ibeg,nbits,len;
+
+      ierr=0;
+//
+//  Currently handles only GRIB Edition 2.
+//  
+      if (listsec0[1] != 2) {
+        printf("g2_create: can only code GRIB edition 2.");
+        ierr=-1;
+        return (ierr);
+      }
+//
+//  Pack Section 0 - Indicator Section 
+//  ( except for total length of GRIB message )
+//
+      cgrib[0]=0x47;   // 'G'            // Beginning of GRIB message
+      cgrib[1]=0x52;   // 'R'
+      cgrib[2]=0x49;   // 'I'
+      cgrib[3]=0x42;   // 'B'
+      sbit(cgrib,&zero,32,16);           // reserved for future use
+      sbit(cgrib,listsec0+0,48,8);       // Discipline
+      sbit(cgrib,listsec0+1,56,8);       // GRIB edition number
+      lensec0=16;      // bytes (octets)
+//
+//  Pack Section 1 - Identification Section
+//
+      ibeg=lensec0*8;        //   Calculate offset for beginning of section 1
+      iofst=ibeg+32;         //   leave space for length of section
+      sbit(cgrib,&one,iofst,8);     // Store section number ( 1 )
+      iofst=iofst+8;
+      //
+      //   Pack up each input value in array listsec1 into the
+      //   the appropriate number of octets, which are specified in
+      //   corresponding entries in array mapsec1.
+      //
+      for (i=0;i<mapsec1len;i++) {
+        nbits=mapsec1[i]*8;
+        sbit(cgrib,listsec1+i,iofst,nbits);
+        iofst=iofst+nbits;
+      }
+      //
+      //   Calculate length of section 1 and store it in octets
+      //   1-4 of section 1.
+      //
+      lensec1=(iofst-ibeg)/8;
+      sbit(cgrib,&lensec1,ibeg,32);
+//
+//  Put current byte total of message into Section 0
+//
+      sbit(cgrib,&zero,64,32);
+      len=lensec0+lensec1;
+      sbit(cgrib,&len,96,32);
+
+      return (len);
+
+}
diff --git a/g2clib_src/g2_free.c b/g2clib_src/g2_free.c
new file mode 100755
index 0000000..04a1792
--- /dev/null
+++ b/g2clib_src/g2_free.c
@@ -0,0 +1,44 @@
+#include <stdlib.h>
+#include  "grib2.h"
+
+void g2_free(gribfield *gfld)
+//$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    g2_free 
+//   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2002-10-28
+//
+// ABSTRACT: This routine frees up memory that was allocated for
+//   struct gribfield.
+//
+// PROGRAM HISTORY LOG:
+// 2002-10-28  Gilbert
+//
+// USAGE:    g2_free(gribfield *gfld)
+//   ARGUMENT:
+//     gfld - pointer to gribfield structure (defined in include file grib2.h)
+//            returned from routine g2_getfld.
+//
+// REMARKS:  This routine must be called to free up memory used by
+//           the decode routine, g2_getfld, when user no longer needs to
+//           reference this data.
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE:  
+//
+//$$$
+{ 
+
+      if (gfld->idsect != 0 ) free(gfld->idsect);
+      if (gfld->local != 0 ) free(gfld->local);
+      if (gfld->list_opt != 0 ) free(gfld->list_opt);
+      if (gfld->igdtmpl != 0 ) free(gfld->igdtmpl);
+      if (gfld->ipdtmpl != 0 ) free(gfld->ipdtmpl);
+      if (gfld->coord_list != 0 ) free(gfld->coord_list);
+      if (gfld->idrtmpl != 0 ) free(gfld->idrtmpl);
+      if (gfld->bmap != 0 ) free(gfld->bmap);
+      if (gfld->fld != 0 ) free(gfld->fld);
+      free(gfld);
+
+      return;
+}
diff --git a/g2clib_src/g2_getfld.c b/g2clib_src/g2_getfld.c
new file mode 100755
index 0000000..239c2f7
--- /dev/null
+++ b/g2clib_src/g2_getfld.c
@@ -0,0 +1,552 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include "grib2.h"
+
+g2int g2_unpack1(unsigned char *,g2int *,g2int **,g2int *);
+g2int g2_unpack2(unsigned char *,g2int *,g2int *,unsigned char **);
+g2int g2_unpack3(unsigned char *,g2int *,g2int **,g2int **,
+                         g2int *,g2int **,g2int *);
+g2int g2_unpack4(unsigned char *,g2int *,g2int *,g2int **,
+                         g2int *,g2float **,g2int *);
+g2int g2_unpack5(unsigned char *,g2int *,g2int *,g2int *, g2int **,g2int *);
+g2int g2_unpack6(unsigned char *,g2int *,g2int ,g2int *, g2int **);
+g2int g2_unpack7(unsigned char *,g2int *,g2int ,g2int *,
+                         g2int ,g2int *,g2int ,g2float **);
+
+g2int g2_getfld(unsigned char *cgrib,g2int ifldnum,g2int unpack,g2int expand,
+                gribfield **gfld)
+//$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    g2_getfld 
+//   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2002-10-28
+//
+// ABSTRACT: This subroutine returns all the metadata, template values, 
+//   Bit-map ( if applicable ), and the unpacked data for a given data
+//   field.  All of the information returned is stored in a gribfield
+//   structure, which is defined in file grib2.h.
+//   Users of this routine will need to include "grib2.h" in their source
+//   code that calls this routine.  Each component of the gribfield
+//   struct is also described in the OUTPUT ARGUMENTS section below.
+//
+//   Since there can be multiple data fields packed into a GRIB2
+//   message, the calling routine indicates which field is being requested
+//   with the ifldnum argument.
+//
+// PROGRAM HISTORY LOG:
+// 2002-10-28  Gilbert
+// 2013-08-08  Vuong    Free up memory in array igds - free(igds)
+//
+// USAGE:    #include "grib2.h"
+//           int g2_getfld(unsigned char *cgrib,g2int ifldnum,g2int unpack,
+//                         g2int expand,gribfield **gfld)
+//   INPUT ARGUMENTS:
+//     cgrib    - Character pointer to the GRIB2 message
+//     ifldnum  - Specifies which field in the GRIB2 message to return.
+//     unpack   - Boolean value indicating whether to unpack bitmap/data field
+//                1 = unpack bitmap (if present) and data values
+//                0 = do not unpack bitmap and data values
+//     expand   - Boolean value indicating whether the data points should be 
+//                expanded to the correspond grid, if a bit-map is present.
+//                1 = if possible, expand data field to grid, inserting zero 
+//                    values at gridpoints that are bitmapped out. 
+//                    (SEE REMARKS2)
+//                0 = do not expand data field, leaving it an array of
+//                    consecutive data points for each "1" in the bitmap.
+//                This argument is ignored if unpack == 0 OR if the
+//                returned field does not contain a bit-map.
+//
+//   OUTPUT ARGUMENT:      
+//     gribfield gfld; - pointer to structure gribfield containing
+//                       all decoded data for the data field.
+// 
+//        gfld->version = GRIB edition number ( currently 2 )
+//        gfld->discipline = Message Discipline ( see Code Table 0.0 )
+//        gfld->idsect = Contains the entries in the Identification
+//                        Section ( Section 1 )
+//                        This element is a pointer to an array
+//                        that holds the data.
+//            gfld->idsect[0]  = Identification of originating Centre
+//                                    ( see Common Code Table C-1 )
+//                             7 - US National Weather Service
+//            gfld->idsect[1]  = Identification of originating Sub-centre
+//            gfld->idsect[2]  = GRIB Master Tables Version Number
+//                                    ( see Code Table 1.0 )
+//                             0 - Experimental
+//                             1 - Initial operational version number
+//            gfld->idsect[3]  = GRIB Local Tables Version Number
+//                                    ( see Code Table 1.1 )
+//                             0     - Local tables not used
+//                             1-254 - Number of local tables version used
+//            gfld->idsect[4]  = Significance of Reference Time (Code Table 1.2)
+//                             0 - Analysis
+//                             1 - Start of forecast
+//                             2 - Verifying time of forecast
+//                             3 - Observation time
+//            gfld->idsect[5]  = Year ( 4 digits )
+//            gfld->idsect[6]  = Month
+//            gfld->idsect[7)  = Day
+//            gfld->idsect[8]  = Hour
+//            gfld->idsect[9]  = Minute
+//            gfld->idsect[10]  = Second
+//            gfld->idsect[11]  = Production status of processed data
+//                                    ( see Code Table 1.3 )
+//                              0 - Operational products
+//                              1 - Operational test products
+//                              2 - Research products
+//                              3 - Re-analysis products
+//            gfld->idsect[12]  = Type of processed data ( see Code Table 1.4 )
+//                              0  - Analysis products
+//                              1  - Forecast products
+//                              2  - Analysis and forecast products
+//                              3  - Control forecast products
+//                              4  - Perturbed forecast products
+//                              5  - Control and perturbed forecast products
+//                              6  - Processed satellite observations
+//                              7  - Processed radar observations
+//        gfld->idsectlen = Number of elements in gfld->idsect[].
+//        gfld->local   = Pointer to character array containing contents
+//                       of Local Section 2, if included
+//        gfld->locallen = length of array gfld->local[]
+//        gfld->ifldnum = field number within GRIB message
+//        gfld->griddef = Source of grid definition (see Code Table 3.0)
+//                      0 - Specified in Code table 3.1
+//                      1 - Predetermined grid Defined by originating centre
+//        gfld->ngrdpts = Number of grid points in the defined grid.
+//        gfld->numoct_opt = Number of octets needed for each
+//                          additional grid points definition.
+//                          Used to define number of
+//                          points in each row ( or column ) for
+//                          non-regular grids.
+//                          = 0, if using regular grid.
+//        gfld->interp_opt = Interpretation of list for optional points
+//                          definition.  (Code Table 3.11)
+//        gfld->igdtnum = Grid Definition Template Number (Code Table 3.1)
+//        gfld->igdtmpl  = Contains the data values for the specified Grid
+//                         Definition Template ( NN=gfld->igdtnum ).  Each
+//                         element of this integer array contains an entry (in
+//                         the order specified) of Grid Defintion Template 3.NN
+//                         This element is a pointer to an array
+//                         that holds the data.
+//        gfld->igdtlen = Number of elements in gfld->igdtmpl[].  i.e. number of
+//                       entries in Grid Defintion Template 3.NN
+//                       ( NN=gfld->igdtnum ).
+//        gfld->list_opt  = (Used if gfld->numoct_opt .ne. 0)  This array
+//                          contains the number of grid points contained in
+//                          each row ( or column ).  (part of Section 3)
+//                          This element is a pointer to an array
+//                          that holds the data.  This pointer is nullified
+//                          if gfld->numoct_opt=0.
+//        gfld->num_opt = (Used if gfld->numoct_opt .ne. 0) 
+//                        The number of entries
+//                       in array ideflist.  i.e. number of rows ( or columns )
+//                       for which optional grid points are defined.  This value
+//                       is set to zero, if gfld->numoct_opt=0.
+//        gfdl->ipdtnum = Product Definition Template Number(see Code Table 4.0)
+//        gfld->ipdtmpl  = Contains the data values for the specified Product
+//                         Definition Template ( N=gfdl->ipdtnum ). Each element
+//                         of this integer array contains an entry (in the
+//                         order specified) of Product Defintion Template 4.N.
+//                         This element is a pointer to an array
+//                         that holds the data.
+//        gfld->ipdtlen = Number of elements in gfld->ipdtmpl[].  i.e. number of
+//                       entries in Product Defintion Template 4.N
+//                       ( N=gfdl->ipdtnum ).
+//        gfld->coord_list  = Real array containing floating point values
+//                            intended to document the vertical discretisation
+//                            associated to model data on hybrid coordinate
+//                            vertical levels.  (part of Section 4)
+//                            This element is a pointer to an array
+//                            that holds the data.
+//        gfld->num_coord = number of values in array gfld->coord_list[].
+//        gfld->ndpts = Number of data points unpacked and returned.
+//        gfld->idrtnum = Data Representation Template Number
+//                       ( see Code Table 5.0)
+//        gfld->idrtmpl  = Contains the data values for the specified Data
+//                         Representation Template ( N=gfld->idrtnum ).  Each
+//                         element of this integer array contains an entry
+//                         (in the order specified) of Product Defintion
+//                         Template 5.N.
+//                         This element is a pointer to an array
+//                         that holds the data.
+//        gfld->idrtlen = Number of elements in gfld->idrtmpl[].  i.e. number
+//                       of entries in Data Representation Template 5.N
+//                       ( N=gfld->idrtnum ).
+//        gfld->unpacked = logical value indicating whether the bitmap and
+//                        data values were unpacked.  If false,
+//                        gfld->bmap and gfld->fld pointers are nullified.
+//        gfld->expanded = Logical value indicating whether the data field 
+//                         was expanded to the grid in the case where a 
+//                         bit-map is present.  If true, the data points in
+//                         gfld->fld match the grid points and zeros were 
+//                         inserted at grid points where data was bit-mapped
+//                         out.  If false, the data values in gfld->fld were
+//                         not expanded to the grid and are just a consecutive
+//                         array of data points corresponding to each value of
+//                         "1" in gfld->bmap.
+//        gfld->ibmap = Bitmap indicator ( see Code Table 6.0 )
+//                     0 = bitmap applies and is included in Section 6.
+//                     1-253 = Predefined bitmap applies
+//                     254 = Previously defined bitmap applies to this field
+//                     255 = Bit map does not apply to this product.
+//        gfld->bmap  = integer array containing decoded bitmap,
+//                      if gfld->ibmap=0 or gfld->ibap=254.  Otherwise nullified
+//                      This element is a pointer to an array
+//                      that holds the data.
+//        gfld->fld  = Array of gfld->ndpts unpacked data points.
+//                     This element is a pointer to an array
+//                     that holds the data.
+//
+// 
+//   RETURN VALUES:
+//     ierr     - Error return code.
+//                0 = no error
+//                1 = Beginning characters "GRIB" not found.
+//                2 = GRIB message is not Edition 2.
+//                3 = The data field request number was not positive.
+//                4 = End string "7777" found, but not where expected.
+//                6 = GRIB message did not contain the requested number of
+//                    data fields.
+//                7 = End string "7777" not found at end of message.
+//                8 = Unrecognized Section encountered.
+//                9 = Data Representation Template 5.NN not yet implemented.
+//               15 = Error unpacking Section 1.
+//               16 = Error unpacking Section 2.
+//               10 = Error unpacking Section 3.
+//               11 = Error unpacking Section 4.
+//               12 = Error unpacking Section 5.
+//               13 = Error unpacking Section 6.
+//               14 = Error unpacking Section 7.
+//               17 = Previous bitmap specified, yet none exists.
+//
+// REMARKS: Note that struct gribfield is allocated by this routine and it
+//          also contains pointers to many arrays of data that were allocated
+//          during decoding.  Users are encouraged to free up this memory, 
+//          when it is no longer needed, by an explicit call to routine g2_free.
+//          EXAMPLE:
+//              #include "grib2.h"
+//              gribfield *gfld;
+//              ret=g2_getfld(cgrib,1,1,1,&gfld);
+//                ...
+//              g2_free(gfld);
+//
+//          Routine g2_info can be used to first determine
+//          how many data fields exist in a given GRIB message.
+//
+// REMARKS2: It may not always be possible to expand a bit-mapped data field.
+//           If a pre-defined bit-map is used and not included in the GRIB2
+//           message itself, this routine would not have the necessary 
+//           information to expand the data.  In this case, gfld->expanded would
+//           would be set to 0 (false), regardless of the value of input 
+//           argument expand.
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE:  
+//
+//$$$
+{
+    
+      g2int have3,have4,have5,have6,have7,ierr,jerr;
+      g2int numfld,j,n,istart,iofst,ipos;
+      g2int disc,ver,lensec0,lengrib,lensec,isecnum;
+      g2int  *igds;
+      g2int *bmpsave;
+      g2float *newfld;
+      gribfield  *lgfld;
+
+      have3=0;
+      have4=0;
+      have5=0;
+      have6=0;
+      have7=0;
+      ierr=0;
+      numfld=0;
+
+      lgfld=(gribfield *)malloc(sizeof(gribfield));
+      *gfld=lgfld;
+
+      lgfld->locallen=0;
+      lgfld->idsect=0;
+      lgfld->local=0;
+      lgfld->list_opt=0;
+      lgfld->igdtmpl=0;
+      lgfld->ipdtmpl=0;
+      lgfld->idrtmpl=0;
+      lgfld->coord_list=0;
+      lgfld->bmap=0;
+      lgfld->fld=0;
+//
+//  Check for valid request number
+//  
+      if (ifldnum <= 0) {
+        printf("g2_getfld: Request for field number must be positive.\n");
+        ierr=3;
+        return(ierr);
+      }
+//
+//  Check for beginning of GRIB message in the first 100 bytes
+//
+      istart=-1;
+      for (j=0;j<100;j++) {
+        if (cgrib[j]=='G' && cgrib[j+1]=='R' &&cgrib[j+2]=='I' && 
+            cgrib[j+3]=='B') {
+          istart=j;
+          break;
+        }
+      }
+      if (istart == -1) {
+        printf("g2_getfld:  Beginning characters GRIB not found.\n");
+        ierr=1;
+        return(ierr);
+      }
+//
+//  Unpack Section 0 - Indicator Section 
+//
+      iofst=8*(istart+6);
+      gbit(cgrib,&disc,iofst,8);     // Discipline
+      iofst=iofst+8;
+      gbit(cgrib,&ver,iofst,8);     // GRIB edition number
+      iofst=iofst+8;
+      iofst=iofst+32;
+      gbit(cgrib,&lengrib,iofst,32);        // Length of GRIB message
+      iofst=iofst+32;
+      lensec0=16;
+      ipos=istart+lensec0;
+//
+//  Currently handles only GRIB Edition 2.
+//  
+      if (ver != 2) {
+        printf("g2_getfld: can only decode GRIB edition 2.\n");
+        ierr=2;
+        return(ierr);
+      }
+//
+//  Loop through the remaining sections keeping track of the 
+//  length of each.  Also keep the latest Grid Definition Section info.
+//  Unpack the requested field number.
+//
+      for (;;) {
+        //    Check to see if we are at end of GRIB message
+        if (cgrib[ipos]=='7' && cgrib[ipos+1]=='7' && cgrib[ipos+2]=='7' && 
+            cgrib[ipos+3]=='7') {
+          ipos=ipos+4;
+          //    If end of GRIB message not where expected, issue error
+          if (ipos != (istart+lengrib)) {
+            printf("g2_getfld: '7777' found, but not where expected.\n");
+            ierr=4;
+            return(ierr);
+          }
+          break;
+        }
+        //     Get length of Section and Section number
+        iofst=(ipos-1)*8;
+        iofst=ipos*8;
+        gbit(cgrib,&lensec,iofst,32);        // Get Length of Section
+        iofst=iofst+32;
+        gbit(cgrib,&isecnum,iofst,8);         // Get Section number
+        iofst=iofst+8;
+        //printf(" lensec= %ld    secnum= %ld \n",lensec,isecnum);
+        //
+        //  Check to see if section number is valid
+        //
+        if ( isecnum<1 || isecnum>7 ) {
+          printf("g2_getfld: Unrecognized Section Encountered=%ld\n",isecnum);
+          ierr=8;
+          return(ierr);
+        }
+        //
+        //   If found Section 1, decode elements in Identification Section
+        //
+        if (isecnum == 1) {
+          iofst=iofst-40;       // reset offset to beginning of section
+          jerr=g2_unpack1(cgrib,&iofst,&lgfld->idsect,&lgfld->idsectlen);
+          if (jerr !=0 ) {
+            ierr=15;
+            return(ierr);
+          }
+        }
+        //
+        //   If found Section 2, Grab local section
+        //   Save in case this is the latest one before the requested field.
+        //
+        if (isecnum == 2) {
+          iofst=iofst-40;       // reset offset to beginning of section
+          if (lgfld->local!=0) free(lgfld->local);
+          jerr=g2_unpack2(cgrib,&iofst,&lgfld->locallen,&lgfld->local);
+          if (jerr != 0) {
+            ierr=16;
+            return(ierr);
+          }
+        }
+        //
+        //   If found Section 3, unpack the GDS info using the 
+        //   appropriate template.  Save in case this is the latest
+        //   grid before the requested field.
+        //
+        if (isecnum == 3) {
+          iofst=iofst-40;       // reset offset to beginning of section
+          if (lgfld->igdtmpl!=0) free(lgfld->igdtmpl);
+          if (lgfld->list_opt!=0) free(lgfld->list_opt);
+          jerr=g2_unpack3(cgrib,&iofst,&igds,&lgfld->igdtmpl,
+                          &lgfld->igdtlen,&lgfld->list_opt,&lgfld->num_opt);
+          if (jerr == 0) {
+            have3=1;
+            lgfld->griddef=igds[0];
+            lgfld->ngrdpts=igds[1];
+            lgfld->numoct_opt=igds[2];
+            lgfld->interp_opt=igds[3];
+            lgfld->igdtnum=igds[4];
+            free(igds);
+          }
+          else {
+            ierr=10;
+            return(ierr);
+          }
+        }
+        //
+        //   If found Section 4, check to see if this field is the
+        //   one requested.
+        //
+        if (isecnum == 4) {
+          numfld=numfld+1;
+          if (numfld == ifldnum) {
+            lgfld->discipline=disc;
+            lgfld->version=ver;
+            lgfld->ifldnum=ifldnum;
+            lgfld->unpacked=unpack;
+            lgfld->expanded=0;
+            iofst=iofst-40;       // reset offset to beginning of section
+            jerr=g2_unpack4(cgrib,&iofst,&lgfld->ipdtnum,
+                            &lgfld->ipdtmpl,&lgfld->ipdtlen,&lgfld->coord_list,
+                            &lgfld->num_coord);
+            if (jerr == 0)
+              have4=1;
+            else {
+              ierr=11;
+              return(ierr);
+            }
+          }
+        }
+        //
+        //   If found Section 5, check to see if this field is the
+        //   one requested.
+        //
+        if (isecnum == 5 && numfld == ifldnum) {
+          iofst=iofst-40;       // reset offset to beginning of section
+          jerr=g2_unpack5(cgrib,&iofst,&lgfld->ndpts,&lgfld->idrtnum,
+                          &lgfld->idrtmpl,&lgfld->idrtlen);
+          if (jerr == 0)
+            have5=1;
+          else {
+            ierr=12;
+            return(ierr);
+          }
+        }
+        //
+        //   If found Section 6, Unpack bitmap.
+        //   Save in case this is the latest
+        //   bitmap before the requested field.
+        //
+        if (isecnum == 6) {
+          if (unpack) {   // unpack bitmap
+            iofst=iofst-40;           // reset offset to beginning of section
+            bmpsave=lgfld->bmap;      // save pointer to previous bitmap
+            jerr=g2_unpack6(cgrib,&iofst,lgfld->ngrdpts,&lgfld->ibmap,
+                         &lgfld->bmap);
+            if (jerr == 0) {
+              have6=1;
+              if (lgfld->ibmap == 254)     // use previously specified bitmap
+                 if( bmpsave!=0 ) 
+                    lgfld->bmap=bmpsave;
+                 else {
+                    printf("g2_getfld: Prev bit-map specified, but none exist.\n");
+                    ierr=17;
+                    return(ierr);
+                 }
+              else                         // get rid of it
+                 if( bmpsave!=0 ) free(bmpsave);
+            }
+            else {
+              ierr=13;
+              return(ierr);
+            }
+          }
+          else {    // do not unpack bitmap
+            gbit(cgrib,&lgfld->ibmap,iofst,8);      // Get BitMap Indicator
+            have6=1;
+          }
+        }
+        //
+        //   If found Section 7, check to see if this field is the
+        //   one requested.
+        //
+        if (isecnum==7 && numfld==ifldnum && unpack) {
+          iofst=iofst-40;       // reset offset to beginning of section
+          jerr=g2_unpack7(cgrib,&iofst,lgfld->igdtnum,lgfld->igdtmpl,
+                          lgfld->idrtnum,lgfld->idrtmpl,lgfld->ndpts,
+                          &lgfld->fld);
+          if (jerr == 0) {
+            have7=1;
+            //  If bitmap is used with this field, expand data field 
+            //  to grid, if possible.
+            if ( lgfld->ibmap != 255 && lgfld->bmap != 0 ) {
+               if ( expand == 1 ) {
+                  n=0;
+                  newfld=(g2float *)calloc(lgfld->ngrdpts,sizeof(g2float));
+                  for (j=0;j<lgfld->ngrdpts;j++) {
+                      if (lgfld->bmap[j]==1) newfld[j]=lgfld->fld[n++];
+                  }
+                  free(lgfld->fld);
+                  lgfld->fld=newfld;
+                  lgfld->expanded=1;
+               }
+               else {
+                  lgfld->expanded=0;
+               }
+            }
+            else {
+               lgfld->expanded=1;
+            }
+          }
+          else {
+            printf("g2_getfld: return from g2_unpack7 = %d \n",(int)jerr);
+            ierr=14;
+            return(ierr);
+          }
+        }
+        //
+        //   Check to see if we read pass the end of the GRIB
+        //   message and missed the terminator string '7777'.
+        //
+        ipos=ipos+lensec;                // Update beginning of section pointer
+        if (ipos > (istart+lengrib)) {
+          printf("g2_getfld: '7777'  not found at end of GRIB message.\n");
+          ierr=7;
+          return(ierr);
+        }
+        //
+        //  If unpacking requested, return when all sections have been
+        //  processed
+        //
+        if (unpack && have3 && have4 && have5 && have6 && have7)
+            return(ierr);
+        //
+        //  If unpacking is not requested, return when sections 
+        //  3 through 6 have been processed
+        //
+        if ((! unpack) && have3 && have4 && have5 && have6)
+            return(ierr);
+        
+      }
+
+//
+//  If exited from above loop, the end of the GRIB message was reached
+//  before the requested field was found.
+//
+      printf("g2_getfld: GRIB message contained %ld different fields.\n",numfld);
+      printf("g2_getfld: The request was for field %ld.\n",ifldnum);
+      ierr=6;
+
+      return(ierr);
+
+}
diff --git a/g2clib_src/g2_gribend.c b/g2clib_src/g2_gribend.c
new file mode 100755
index 0000000..5373aaa
--- /dev/null
+++ b/g2clib_src/g2_gribend.c
@@ -0,0 +1,122 @@
+#include <stdio.h>
+#include "grib2.h"
+
+g2int g2_gribend(unsigned char *cgrib)
+//$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    g2_gribend 
+//   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2002-10-31
+//
+// ABSTRACT: This routine finalizes a GRIB2 message after all grids
+//   and fields have been added.  It adds the End Section ( "7777" )
+//   to the end of the GRIB message and calculates the length and stores
+//   it in the appropriate place in Section 0.
+//   This routine is used with routines "g2_create", "g2_addlocal", 
+//   "g2_addgrid", and "g2_addfield" to create a complete GRIB2 message.
+//   g2_create must be called first to initialize a new GRIB2 message.
+//
+// PROGRAM HISTORY LOG:
+// 2002-10-31  Gilbert
+//
+// USAGE:    int g2_gribend(unsigned char *cgrib)
+//   INPUT ARGUMENT:
+//     cgrib    - Char array containing all the data sections added
+//                be previous calls to g2_create, g2_addlocal, g2_addgrid,
+//                and g2_addfield.
+//
+//   OUTPUT ARGUMENTS:      
+//     cgrib    - Char array containing the finalized GRIB2 message
+//
+//   RETURN VALUES:
+//     ierr     - Return code.
+//              > 0 = Length of the final GRIB2 message in bytes.
+//               -1 = GRIB message was not initialized.  Need to call
+//                    routine g2_create first.
+//               -2 = GRIB message already complete.  
+//               -3 = Sum of Section byte counts doesn't add to total byte count
+//               -4 = Previous Section was not 7.
+//
+// REMARKS: This routine is intended for use with routines "g2_create", 
+//          "g2_addlocal", "g2_addgrid", and "g2_addfield" to create a complete 
+//          GRIB2 message.
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE:
+//
+//$$$
+{
+
+      g2int iofst,lencurr,len,ilen,isecnum;
+      g2int   ierr,lengrib;
+      static unsigned char G=0x47;       // 'G'
+      static unsigned char R=0x52;       // 'R'
+      static unsigned char I=0x49;       // 'I'
+      static unsigned char B=0x42;       // 'B'
+      static unsigned char seven=0x37;   // '7'
+ 
+      ierr=0;
+//
+//  Check to see if beginning of GRIB message exists
+//
+      if ( cgrib[0]!=G || cgrib[1]!=R || cgrib[2]!=I || cgrib[3]!=B ) {
+        printf("g2_gribend: GRIB not found in given message.\n");
+        ierr=-1;
+        return (ierr);
+      }
+//
+//  Get current length of GRIB message
+//  
+      gbit(cgrib,&lencurr,96,32);
+//
+//  Loop through all current sections of the GRIB message to
+//  find the last section number.
+//
+      len=16;    // Length of Section 0
+      for (;;) { 
+      //    Get number and length of next section
+        iofst=len*8;
+        gbit(cgrib,&ilen,iofst,32);
+        iofst=iofst+32;
+        gbit(cgrib,&isecnum,iofst,8);
+        len=len+ilen;
+      //    Exit loop if last section reached
+        if ( len == lencurr ) break;
+      //    If byte count for each section doesn't match current
+      //    total length, then there is a problem.
+        if ( len > lencurr ) {
+          printf("g2_gribend: Section byte counts don''t add to total.\n");
+          printf("g2_gribend: Sum of section byte counts = %d\n",(int)len);
+          printf("g2_gribend: Total byte count in Section 0 = %d\n",(int)lencurr);
+          ierr=-3;
+          return (ierr);
+        }
+      }
+//
+//  Can only add End Section (Section 8) after Section 7.
+//
+      if ( isecnum != 7 ) {
+        printf("g2_gribend: Section 8 can only be added after Section 7.\n");
+        printf("g2_gribend: Section %ld was the last found in given GRIB message.\n",isecnum);
+        ierr=-4;
+        return (ierr);
+      }
+//
+//  Add Section 8  - End Section
+//
+      //cgrib(lencurr+1:lencurr+4)=c7777
+      cgrib[lencurr]=seven;
+      cgrib[lencurr+1]=seven;
+      cgrib[lencurr+2]=seven;
+      cgrib[lencurr+3]=seven;
+
+//
+//  Update current byte total of message in Section 0
+//
+      lengrib=lencurr+4;
+      sbit(cgrib,&lengrib,96,32);
+
+      return (lengrib);
+
+}
+
diff --git a/g2clib_src/g2_info.c b/g2clib_src/g2_info.c
new file mode 100755
index 0000000..443a5b8
--- /dev/null
+++ b/g2clib_src/g2_info.c
@@ -0,0 +1,190 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include "grib2.h"
+
+g2int g2_info(unsigned char *cgrib,g2int *listsec0,g2int *listsec1,
+            g2int *numfields,g2int *numlocal)
+//$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    g2_info 
+//   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2002-10-28
+//
+// ABSTRACT: This subroutine searches through a GRIB2 message and
+//   returns the number of gridded fields found in the message and
+//   the number (and maximum size) of Local Use Sections.
+//   Also various checks  are performed
+//   to see if the message is a valid GRIB2 message.
+//
+// PROGRAM HISTORY LOG:
+// 2002-10-28  Gilbert
+//
+// USAGE:   int g2_info(unsigned char *cgrib,g2int *listsec0,g2int *listsec1,
+//            g2int *numfields,g2int *numlocal)
+//   INPUT ARGUMENT:
+//     cgrib    - Character pointer to the GRIB2 message
+//
+//   OUTPUT ARGUMENTS:      
+//     listsec0 - pointer to an array containing information decoded from 
+//                GRIB Indicator Section 0.
+//                Must be allocated with >= 3 elements.
+//                listsec0[0]=Discipline-GRIB Master Table Number
+//                            (see Code Table 0.0)
+//                listsec0[1]=GRIB Edition Number (currently 2)
+//                listsec0[2]=Length of GRIB message
+//     listsec1 - pointer to an array containing information read from GRIB 
+//                Identification Section 1.
+//                Must be allocated with >= 13 elements.
+//                listsec1[0]=Id of orginating centre (Common Code Table C-1)
+//                listsec1[1]=Id of orginating sub-centre (local table)
+//                listsec1[2]=GRIB Master Tables Version Number (Code Table 1.0)
+//                listsec1[3]=GRIB Local Tables Version Number 
+//                listsec1[4]=Significance of Reference Time (Code Table 1.1)
+//                listsec1[5]=Reference Time - Year (4 digits)
+//                listsec1[6]=Reference Time - Month
+//                listsec1[7]=Reference Time - Day
+//                listsec1[8]=Reference Time - Hour
+//                listsec1[9]=Reference Time - Minute
+//                listsec1[10]=Reference Time - Second
+//                listsec1[11]=Production status of data (Code Table 1.2)
+//                listsec1[12]=Type of processed data (Code Table 1.3)
+//     numfields- The number of gridded fields found in the GRIB message.
+//                That is, the number of occurences of Sections 4 - 7.
+//     numlocal - The number of Local Use Sections ( Section 2 ) found in 
+//                the GRIB message.
+//
+//     RETURN VALUES:
+//     ierr     - Error return code.
+//                0 = no error
+//                1 = Beginning characters "GRIB" not found.
+//                2 = GRIB message is not Edition 2.
+//                3 = Could not find Section 1, where expected.
+//                4 = End string "7777" found, but not where expected.
+//                5 = End string "7777" not found at end of message.
+//                6 = Invalid section number found.
+//
+// REMARKS: None
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE:  
+//
+//$$$
+{
+ 
+      g2int ierr,mapsec1len=13;
+      g2int mapsec1[13]={2,2,1,1,1,2,1,1,1,1,1,1,1};
+      g2int  i,j,istart,iofst,lengrib,lensec0,lensec1;
+      g2int ipos,isecnum,nbits,lensec;
+
+      ierr=0;
+      *numlocal=0;
+      *numfields=0;
+//
+//  Check for beginning of GRIB message in the first 100 bytes
+//
+      istart=-1;
+      for (j=0;j<100;j++) {
+        if (cgrib[j]=='G' && cgrib[j+1]=='R' &&cgrib[j+2]=='I' &&
+            cgrib[j+3]=='B') {
+          istart=j;
+          break;
+        }
+      }
+      if (istart == -1) {
+        printf("g2_info:  Beginning characters GRIB not found.");
+        ierr=1;
+        return(ierr);
+      }
+//
+//  Unpack Section 0 - Indicator Section 
+//
+      iofst=8*(istart+6);
+      gbit(cgrib,listsec0+0,iofst,8);     // Discipline
+      iofst=iofst+8;
+      gbit(cgrib,listsec0+1,iofst,8);     // GRIB edition number
+      iofst=iofst+8;
+      iofst=iofst+32;
+      gbit(cgrib,&lengrib,iofst,32);        // Length of GRIB message
+      iofst=iofst+32;
+      listsec0[2]=lengrib;
+      lensec0=16;
+      ipos=istart+lensec0;
+//
+//  Currently handles only GRIB Edition 2.
+//  
+      if (listsec0[1] != 2) {
+        printf("g2_info: can only decode GRIB edition 2.");
+        ierr=2;
+        return(ierr);
+      }
+//
+//  Unpack Section 1 - Identification Section
+//
+      gbit(cgrib,&lensec1,iofst,32);        // Length of Section 1
+      iofst=iofst+32;
+      gbit(cgrib,&isecnum,iofst,8);         // Section number ( 1 )
+      iofst=iofst+8;
+      if (isecnum != 1) {
+        printf("g2_info: Could not find section 1.");
+        ierr=3;
+        return(ierr);
+      }
+      //
+      //   Unpack each input value in array listsec1 into the
+      //   the appropriate number of octets, which are specified in
+      //   corresponding entries in array mapsec1.
+      //
+      for (i=0;i<mapsec1len;i++) {
+        nbits=mapsec1[i]*8;
+        gbit(cgrib,listsec1+i,iofst,nbits);
+        iofst=iofst+nbits;
+      }
+      ipos=ipos+lensec1;
+//
+//  Loop through the remaining sections to see if they are valid.
+//  Also count the number of times Section 2
+//  and Section 4 appear.
+//
+      for (;;) {
+        if (cgrib[ipos]=='7' && cgrib[ipos+1]=='7' && cgrib[ipos+2]=='7' &&
+            cgrib[ipos+3]=='7') {
+          ipos=ipos+4;
+          if (ipos != (istart+lengrib)) {
+            printf("g2_info: '7777' found, but not where expected.\n");
+            ierr=4;
+            return(ierr);
+          }
+          break;
+        }
+        
+        iofst=ipos*8;
+        gbit(cgrib,&lensec,iofst,32);        // Get Length of Section
+        iofst=iofst+32;
+        gbit(cgrib,&isecnum,iofst,8);         // Get Section number
+        iofst=iofst+8;
+        ipos=ipos+lensec;                 // Update beginning of section pointer
+        if (ipos > (istart+lengrib)) {
+          printf("g2_info: '7777'  not found at end of GRIB message.\n");
+          ierr=5;
+          return(ierr);
+        }
+        if ( isecnum>=2 && isecnum<=7 ) {
+           if (isecnum == 2)      // Local Section 2
+              //   increment counter for total number of local sections found
+              (*numlocal)++;
+            
+           else if (isecnum == 4)
+              //   increment counter for total number of fields found
+              (*numfields)++;
+        }
+        else {
+           printf("g2_info: Invalid section number found in GRIB message: %ld\n"                   ,isecnum);
+           ierr=6;
+           return(ierr);
+        }
+        
+      }
+
+      return(0);
+
+}
diff --git a/g2clib_src/g2_miss.c b/g2clib_src/g2_miss.c
new file mode 100644
index 0000000..3dab744
--- /dev/null
+++ b/g2clib_src/g2_miss.c
@@ -0,0 +1,69 @@
+#include "grib2.h"
+
+void g2_miss( gribfield *gfld, float *rmiss, int *nmiss )
+//$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    g2_miss 
+//   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2004-12-16
+//
+// ABSTRACT: This routine checks the Data Representation Template to see if
+// missing value management is used, and returns the missing value(s) 
+// in the data field.
+//
+// PROGRAM HISTORY LOG:
+// 2004-12-16  Gilbert
+//
+// USAGE:    g2_miss( gribfield *gfld, float *rmiss, int *nmiss )
+//                   
+//   INPUT ARGUMENT LIST:
+//     *gfld    - pointer to gribfield structure (defined in include file 
+//                   grib2.h)
+//
+//   OUTPUT ARGUMENT LIST:      
+//     rmiss    - List of the missing values used
+//     nmiss    - NUmber of the missing values included in the field
+//
+// REMARKS:  rmiss must be allocated in the calling program with enough space 
+//           hold all the missing values.
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE:  IBM SP
+//
+//$$$
+{
+    g2int     itype;    
+
+    /*
+     *  Missing value management currnetly only used in
+     *  DRT's 5.2 and 5.3.
+     */
+    if ( gfld->idrtnum != 2  &&  gfld->idrtnum != 3 ) {
+       *nmiss=0;
+       return;
+    }
+                                                                                
+    itype = gfld->idrtmpl[4];
+    if ( gfld->idrtmpl[6] == 1 ) {
+         *nmiss=1;
+         if (itype == 0)
+            rdieee(gfld->idrtmpl+7,rmiss+0,1);
+         else
+            rmiss[0]=(float)gfld->idrtmpl[7];
+    }
+    else if ( gfld->idrtmpl[6] == 2 ) {
+         *nmiss=2;
+         if (itype == 0) {
+            rdieee(gfld->idrtmpl+7,rmiss+0,1);
+            rdieee(gfld->idrtmpl+8,rmiss+1,1);
+         }
+         else {
+            rmiss[0]=(float)gfld->idrtmpl[7];
+            rmiss[1]=(float)gfld->idrtmpl[8];
+         }
+    }
+    else {
+       *nmiss=0;
+    }
+
+}
diff --git a/g2clib_src/g2_unpack1.c b/g2clib_src/g2_unpack1.c
new file mode 100755
index 0000000..02114e9
--- /dev/null
+++ b/g2clib_src/g2_unpack1.c
@@ -0,0 +1,99 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include "grib2.h"
+
+g2int g2_unpack1(unsigned char *cgrib,g2int *iofst,g2int **ids,g2int *idslen)
+/*//$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    g2_unpack1 
+//   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2002-10-29
+//
+// ABSTRACT: This subroutine unpacks Section 1 (Identification Section)
+//           as defined in GRIB Edition 2.
+//
+// PROGRAM HISTORY LOG:
+// 2002-10-29  Gilbert
+//
+// USAGE:    int g2_unpack1(unsigned char *cgrib,g2int *iofst,g2int **ids,
+//                          g2int *idslen)
+//   INPUT ARGUMENTS:
+//     cgrib    - char array containing Section 1 of the GRIB2 message
+//     iofst    - Bit offset for the beginning of Section 1 in cgrib.
+//
+//   OUTPUT ARGUMENTS:      
+//     iofst    - Bit offset at the end of Section 1, returned.
+//     ids      - address of pointer to integer array containing information 
+//                read from Section 1, the Identification section.
+//            ids[0]  = Identification of originating Centre
+//                                 ( see Common Code Table C-1 )
+//            ids[1]  = Identification of originating Sub-centre
+//            ids[2]  = GRIB Master Tables Version Number
+//                                 ( see Code Table 1.0 )
+//            ids[3]  = GRIB Local Tables Version Number
+//                                 ( see Code Table 1.1 )
+//            ids[4]  = Significance of Reference Time (Code Table 1.2)
+//            ids[5]  = Year ( 4 digits )
+//            ids[6]  = Month
+//            ids[7]  = Day
+//            ids[8]  = Hour
+//            ids[9]  = Minute
+//            ids[10]  = Second
+//            ids[11]  = Production status of processed data
+//                                 ( see Code Table 1.3 )
+//            ids[12]  = Type of processed data ( see Code Table 1.4 )
+//     idslen   - Number of elements in ids[].
+//
+//   RETURN VALUES:
+//     ierr     - Error return code.
+//                0 = no error
+//                2 = Array passed is not section 1
+//                6 = memory allocation error
+//
+// REMARKS: 
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE:
+//
+//$$$
+*/
+{
+
+      g2int i,lensec,nbits,ierr,isecnum;
+      g2int mapid[13]={2,2,1,1,1,2,1,1,1,1,1,1,1};
+
+      ierr=0;
+      *idslen=13;
+      *ids=0;
+
+      gbit(cgrib,&lensec,*iofst,32);        // Get Length of Section
+      *iofst=*iofst+32;
+      gbit(cgrib,&isecnum,*iofst,8);         // Get Section Number
+      *iofst=*iofst+8;
+
+      if ( isecnum != 1 ) {
+         ierr=2;
+         *idslen=13;
+         fprintf(stderr,"g2_unpack1: Not Section 1 data.\n");
+         return(ierr);
+      }
+
+      //
+      //   Unpack each value into array ids from the
+      //   the appropriate number of octets, which are specified in
+      //   corresponding entries in array mapid.
+      //
+      *ids=(g2int *)calloc(*idslen,sizeof(g2int));
+      if (*ids == 0) {
+         ierr=6;
+         return(ierr);
+      }
+      
+      for (i=0;i<*idslen;i++) {
+        nbits=mapid[i]*8;
+        gbit(cgrib,*ids+i,*iofst,nbits);
+        *iofst=*iofst+nbits;
+      }
+      
+      return(ierr);    // End of Section 1 processing
+}
diff --git a/g2clib_src/g2_unpack2.c b/g2clib_src/g2_unpack2.c
new file mode 100755
index 0000000..08d9ef5
--- /dev/null
+++ b/g2clib_src/g2_unpack2.c
@@ -0,0 +1,86 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include "grib2.h"
+
+g2int g2_unpack2(unsigned char *cgrib,g2int *iofst,g2int *lencsec2,unsigned char **csec2)
+////$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    g2_unpack2 
+//   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2002-10-31
+//
+// ABSTRACT: This subroutine unpacks Section 2 (Local Use Section)
+//           as defined in GRIB Edition 2.
+//
+// PROGRAM HISTORY LOG:
+// 2002-10-31  Gilbert
+// 2008-12-23  Wesley   - Initialize lencsec2 Length of Local Use data
+// 2010-08-05  Vuong    - If section 2 has zero length, ierr=0
+//
+// USAGE:    int g2_unpack2(unsigned char *cgrib,g2int *iofst,g2int *lencsec2,
+//                          unsigned char **csec2)
+//   INPUT ARGUMENT LIST:
+//     cgrib    - char array containing Section 2 of the GRIB2 message
+//     iofst    - Bit offset for the beginning of Section 2 in cgrib.
+//
+//   OUTPUT ARGUMENT LIST:      
+//     iofst    - Bit offset at the end of Section 2, returned.
+//     lencsec2 - Length (in octets) of Local Use data
+//     csec2    - Pointer to a char array containing local use data
+//
+//   RETURN VALUES:
+//     ierr     - Error return code.
+//                0 = no error
+//                2 = Array passed is not section 2
+//                6 = memory allocation error
+//
+// REMARKS: None
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE: 
+//
+//$$$//
+{
+
+      g2int ierr,isecnum;
+      g2int lensec,ipos,j;
+
+      ierr=0;
+      *lencsec2=0;
+      *csec2=0;    // NULL
+
+      gbit(cgrib,&lensec,*iofst,32);        // Get Length of Section
+      *iofst=*iofst+32;
+      *lencsec2=lensec-5;
+      gbit(cgrib,&isecnum,*iofst,8);         // Get Section Number
+      *iofst=*iofst+8;
+      ipos=(*iofst/8);
+
+      if ( isecnum != 2 ) {
+         ierr=2;
+         *lencsec2=0;
+         fprintf(stderr,"g2_unpack2: Not Section 2 data.\n");
+         return(ierr);
+      }
+
+      if (*lencsec2 == 0) {
+         ierr = 0;
+         return(ierr);
+      }
+
+      *csec2=(unsigned char *)malloc(*lencsec2+1);
+      if (*csec2 == 0) {
+         ierr=6;
+         *lencsec2=0;
+         return(ierr);
+      }
+      
+      //printf(" SAGIPO %d \n",(int)ipos);
+      for (j=0;j<*lencsec2;j++) {
+         *(*csec2+j)=cgrib[ipos+j];
+      }
+      *iofst=*iofst+(*lencsec2*8);
+
+      return(ierr);    // End of Section 2 processing
+
+}
diff --git a/g2clib_src/g2_unpack3.c b/g2clib_src/g2_unpack3.c
new file mode 100755
index 0000000..0b69112
--- /dev/null
+++ b/g2clib_src/g2_unpack3.c
@@ -0,0 +1,214 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include "grib2.h"
+
+
+g2int g2_unpack3(unsigned char *cgrib,g2int *iofst,g2int **igds,g2int **igdstmpl,
+                         g2int *mapgridlen,g2int **ideflist,g2int *idefnum)
+////$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    g2_unpack3 
+//   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2002-10-31
+//
+// ABSTRACT: This routine unpacks Section 3 (Grid Definition Section)
+//           as defined in GRIB Edition 2.
+//
+// PROGRAM HISTORY LOG:
+// 2002-10-31  Gilbert
+// 2009-01-14  Vuong     Changed structure name template to gtemplate
+//
+// USAGE:    int g2_unpack3(unsigned char *cgrib,g2int *iofst,g2int **igds,
+//                          g2int **igdstmpl,g2int *mapgridlen,
+//                          g2int **ideflist,g2int *idefnum)
+//   INPUT ARGUMENTS:
+//     cgrib    - Char array ontaining Section 3 of the GRIB2 message
+//     iofst    - Bit offset for the beginning of Section 3 in cgrib.
+//
+//   OUTPUT ARGUMENTS:      
+//     iofst    - Bit offset at the end of Section 3, returned.
+//     igds     - Contains information read from the appropriate GRIB Grid 
+//                Definition Section 3 for the field being returned.
+//                igds[0]=Source of grid definition (see Code Table 3.0)
+//                igds[1]=Number of grid points in the defined grid.
+//                igds[2]=Number of octets needed for each 
+//                            additional grid points definition.  
+//                            Used to define number of
+//                            points in each row ( or column ) for
+//                            non-regular grids.  
+//                            = 0, if using regular grid.
+//                igds[3]=Interpretation of list for optional points 
+//                            definition.  (Code Table 3.11)
+//                igds[4]=Grid Definition Template Number (Code Table 3.1)
+//     igdstmpl - Pointer to integer array containing the data values for 
+//                the specified Grid Definition
+//                Template ( NN=igds[4] ).  Each element of this integer 
+//                array contains an entry (in the order specified) of Grid
+//                Defintion Template 3.NN
+//     mapgridlen- Number of elements in igdstmpl[].  i.e. number of entries
+//                in Grid Defintion Template 3.NN  ( NN=igds[4] ).
+//     ideflist - (Used if igds[2] .ne. 0)  Pointer to integer array containing
+//                the number of grid points contained in each row ( or column ).
+//                (part of Section 3)
+//     idefnum  - (Used if igds[2] .ne. 0)  The number of entries
+//                in array ideflist.  i.e. number of rows ( or columns )
+//                for which optional grid points are defined.
+//     ierr     - Error return code.
+//                0 = no error
+//                2 = Not Section 3
+//                5 = "GRIB" message contains an undefined Grid Definition
+//                    Template.
+//                6 = memory allocation error
+//
+// REMARKS: 
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE:
+//
+//$$$
+
+{
+      g2int ierr,i,j,nbits,isecnum;
+      g2int lensec,ibyttem=0,isign,newlen;
+      g2int *ligds,*ligdstmpl=0,*lideflist=0;
+      gtemplate *mapgrid;
+
+      ierr=0;
+      *igds=0;       // NULL
+      *igdstmpl=0;       // NULL
+      *ideflist=0;       // NULL
+
+      gbit(cgrib,&lensec,*iofst,32);        // Get Length of Section
+      *iofst=*iofst+32;
+      gbit(cgrib,&isecnum,*iofst,8);         // Get Section Number
+      *iofst=*iofst+8;
+
+      if ( isecnum != 3 ) {
+         ierr=2;
+         *idefnum=0;
+         *mapgridlen=0;
+        // fprintf(stderr,"g2_unpack3: Not Section 3 data.\n");
+         return(ierr);
+      }
+
+      ligds=(g2int *)calloc(5,sizeof(g2int));
+      *igds=ligds;
+
+      gbit(cgrib,ligds+0,*iofst,8);     // Get source of Grid def.
+      *iofst=*iofst+8;
+      gbit(cgrib,ligds+1,*iofst,32);    // Get number of grid pts.
+      *iofst=*iofst+32;
+      gbit(cgrib,ligds+2,*iofst,8);     // Get num octets for opt. list
+      *iofst=*iofst+8;
+      gbit(cgrib,ligds+3,*iofst,8);     // Get interpret. for opt. list
+      *iofst=*iofst+8;
+      gbit(cgrib,ligds+4,*iofst,16);    // Get Grid Def Template num.
+      *iofst=*iofst+16;
+
+      if (ligds[4] != 65535) {
+        //   Get Grid Definition Template
+        mapgrid=getgridtemplate(ligds[4]);
+        if (mapgrid == 0) {         // undefined template
+          ierr=5;
+          return(ierr);
+        }
+        *mapgridlen=mapgrid->maplen;
+        //
+        //   Unpack each value into array igdstmpl from the
+        //   the appropriate number of octets, which are specified in
+        //   corresponding entries in array mapgrid.
+        //
+        if (*mapgridlen > 0) {
+           ligdstmpl=0;
+           ligdstmpl=(g2int *)calloc(*mapgridlen,sizeof(g2int));
+           if (ligdstmpl == 0) {
+              ierr=6;
+              *mapgridlen=0;
+              *igdstmpl=0;    //NULL
+              if( mapgrid != 0 ) free(mapgrid);
+              return(ierr);
+           }
+           else {
+              *igdstmpl=ligdstmpl;
+           }
+        }
+        ibyttem=0;
+        for (i=0;i<*mapgridlen;i++) {
+          nbits=abs(mapgrid->map[i])*8;
+          if ( mapgrid->map[i] >= 0 ) {
+            gbit(cgrib,ligdstmpl+i,*iofst,nbits);
+          }
+          else {
+            gbit(cgrib,&isign,*iofst,1);
+            gbit(cgrib,ligdstmpl+i,*iofst+1,nbits-1);
+            if (isign == 1) ligdstmpl[i]=-1*ligdstmpl[i];
+          }
+          *iofst=*iofst+nbits;
+          ibyttem=ibyttem+abs(mapgrid->map[i]);
+        }
+        //
+        //   Check to see if the Grid Definition Template needs to be
+        //   extended.
+        //   The number of values in a specific template may vary
+        //   depending on data specified in the "static" part of the
+        //   gtemplate.
+        //
+        if ( mapgrid->needext == 1 ) {
+          free(mapgrid);
+          mapgrid=extgridtemplate(ligds[4],ligdstmpl);
+          //   Unpack the rest of the Grid Definition Template
+          newlen=mapgrid->maplen+mapgrid->extlen;
+          ligdstmpl=(g2int *)realloc(ligdstmpl,newlen*sizeof(g2int));
+          *igdstmpl=ligdstmpl;
+          j=0;
+          for (i=*mapgridlen;i<newlen;i++) {
+            nbits=abs(mapgrid->ext[j])*8;
+            if ( mapgrid->ext[j] >= 0 ) {
+              gbit(cgrib,ligdstmpl+i,*iofst,nbits);
+            }
+            else {
+              gbit(cgrib,&isign,*iofst,1);
+              gbit(cgrib,ligdstmpl+i,*iofst+1,nbits-1);
+              if (isign == 1) ligdstmpl[i]=-1*ligdstmpl[i];
+            }
+            *iofst=*iofst+nbits;
+            ibyttem=ibyttem+abs(mapgrid->ext[j]);
+            j++;
+          }
+          *mapgridlen=newlen;
+        }
+        if( mapgrid->ext != 0 ) free(mapgrid->ext);
+        if( mapgrid != 0 ) free(mapgrid);
+      }
+      else {              // No Grid Definition Template
+        *mapgridlen=0;
+        *igdstmpl=0;
+      }
+      //
+      //   Unpack optional list of numbers defining number of points
+      //   in each row or column, if included.  This is used for non regular
+      //   grids.
+      //
+      if ( ligds[2] != 0 ) {
+         nbits=ligds[2]*8;
+         *idefnum=(lensec-14-ibyttem)/ligds[2];
+         if (*idefnum > 0) lideflist=(g2int *)calloc(*idefnum,sizeof(g2int));
+         if (lideflist == 0) {
+            ierr=6;
+            *idefnum=0;
+            *ideflist=0;   //NULL
+            return(ierr);
+         }
+         else {
+            *ideflist=lideflist;
+         }
+         gbits(cgrib,lideflist,*iofst,nbits,0,*idefnum);
+         *iofst=*iofst+(nbits*(*idefnum));
+      }
+      else {
+         *idefnum=0;
+         *ideflist=0;    // NULL
+      }
+      
+      return(ierr);    // End of Section 3 processing
+}
diff --git a/g2clib_src/g2_unpack4.c b/g2clib_src/g2_unpack4.c
new file mode 100755
index 0000000..524549d
--- /dev/null
+++ b/g2clib_src/g2_unpack4.c
@@ -0,0 +1,185 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include "grib2.h"
+
+
+g2int g2_unpack4(unsigned char *cgrib,g2int *iofst,g2int *ipdsnum,g2int **ipdstmpl,
+               g2int *mappdslen,g2float **coordlist,g2int *numcoord)
+////$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    g2_unpack4 
+//   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2002-10-31
+//
+// ABSTRACT: This subroutine unpacks Section 4 (Product Definition Section)
+//           as defined in GRIB Edition 2.
+//
+// PROGRAM HISTORY LOG:
+// 2002-10-31  Gilbert
+// 2009-01-14  Vuong     Changed structure name template to gtemplate
+//
+// USAGE:    int g2_unpack4(unsigned char *cgrib,g2int *iofst,g2int *ipdsnum,
+//                          g2int **ipdstmpl,g2int *mappdslen,
+//                          g2float **coordlist,g2int *numcoord)
+//   INPUT ARGUMENTS:
+//     cgrib    - Char array containing Section 4 of the GRIB2 message
+//     iofst    - Bit offset of the beginning of Section 4 in cgrib.
+//
+//   OUTPUT ARGUMENTS:      
+//     iofst    - Bit offset of the end of Section 4, returned.
+//     ipdsnum  - Product Definition Template Number ( see Code Table 4.0)
+//     ipdstmpl - Pointer to integer array containing the data values for 
+//                the specified Product Definition
+//                Template ( N=ipdsnum ).  Each element of this integer
+//                array contains an entry (in the order specified) of Product
+//                Defintion Template 4.N
+//     mappdslen- Number of elements in ipdstmpl[].  i.e. number of entries
+//                in Product Defintion Template 4.N  ( N=ipdsnum ).
+//     coordlist- Pointer to real array containing floating point values 
+//                intended to document
+//                the vertical discretisation associated to model data
+//                on hybrid coordinate vertical levels.  (part of Section 4)
+//     numcoord - number of values in array coordlist.
+//
+//   RETURN VALUES:
+//     ierr     - Error return code.
+//                0 = no error
+//                2 = Not section 4
+//                5 = "GRIB" message contains an undefined Product Definition
+//                    Template.
+//                6 = memory allocation error
+//
+// REMARKS: 
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE:  
+//
+//$$$//
+{
+
+      g2int ierr,needext,i,j,nbits,isecnum;
+      g2int lensec,isign,newlen;
+      g2int *coordieee;
+      g2int *lipdstmpl=0;
+      g2float *lcoordlist;
+      gtemplate *mappds;
+
+      ierr=0;
+      *ipdstmpl=0;    // NULL
+      *coordlist=0;    // NULL
+
+      gbit(cgrib,&lensec,*iofst,32);        // Get Length of Section
+      *iofst=*iofst+32;
+      gbit(cgrib,&isecnum,*iofst,8);         // Get Section Number
+      *iofst=*iofst+8;
+
+      if ( isecnum != 4 ) {
+         ierr=2;
+         *numcoord=0;
+         *mappdslen=0;
+        // fprintf(stderr,"g2_unpack4: Not Section 4 data.\n");
+         return(ierr);
+      }
+
+      gbit(cgrib,numcoord,*iofst,16);    // Get num of coordinate values
+      *iofst=*iofst+16;
+      gbit(cgrib,ipdsnum,*iofst,16);    // Get Prod. Def Template num.
+      *iofst=*iofst+16;
+
+      //   Get Product Definition Template
+      mappds=getpdstemplate(*ipdsnum);
+      if (mappds == 0) {       // undefine template
+        ierr=5;
+        *mappdslen=0;
+        return(ierr);
+      }
+      *mappdslen=mappds->maplen;
+      needext=mappds->needext;
+      //
+      //   Unpack each value into array ipdstmpl from the
+      //   the appropriate number of octets, which are specified in
+      //   corresponding entries in array mappds.
+      //
+      if (*mappdslen > 0) lipdstmpl=(g2int *)calloc(*mappdslen,sizeof(g2int));
+      if (lipdstmpl == 0) {
+         ierr=6;
+         *mappdslen=0;
+         *ipdstmpl=0;     //NULL
+         if ( mappds != 0 ) free(mappds);
+         return(ierr);
+      }
+      else {
+         *ipdstmpl=lipdstmpl;
+      }
+      for (i=0;i<mappds->maplen;i++) {
+        nbits=abs(mappds->map[i])*8;
+        if ( mappds->map[i] >= 0 ) {
+          gbit(cgrib,lipdstmpl+i,*iofst,nbits);
+        }
+        else {
+          gbit(cgrib,&isign,*iofst,1);
+          gbit(cgrib,lipdstmpl+i,*iofst+1,nbits-1);
+          if (isign == 1) lipdstmpl[i]=-1*lipdstmpl[i];
+        }
+        *iofst=*iofst+nbits;
+      }
+      //
+      //   Check to see if the Product Definition Template needs to be
+      //   extended.
+      //   The number of values in a specific template may vary
+      //   depending on data specified in the "static" part of the
+      //   gtemplate.
+      //
+      if ( needext ==1 ) {
+        free(mappds);
+        mappds=extpdstemplate(*ipdsnum,lipdstmpl);
+        newlen=mappds->maplen+mappds->extlen;
+        lipdstmpl=(g2int *)realloc(lipdstmpl,newlen*sizeof(g2int));
+        *ipdstmpl=lipdstmpl;
+        //   Unpack the rest of the Product Definition Template
+        j=0;
+        for (i=*mappdslen;i<newlen;i++) {
+          nbits=abs(mappds->ext[j])*8;
+          if ( mappds->ext[j] >= 0 ) {
+            gbit(cgrib,lipdstmpl+i,*iofst,nbits);
+          }
+          else {
+            gbit(cgrib,&isign,*iofst,1);
+            gbit(cgrib,lipdstmpl+i,*iofst+1,nbits-1);
+            if (isign == 1) lipdstmpl[i]=-1*lipdstmpl[i];
+          }
+          *iofst=*iofst+nbits;
+          j++;
+        }
+        *mappdslen=newlen;
+      }
+      if( mappds->ext != 0 ) free(mappds->ext);
+      if( mappds != 0 ) free(mappds);
+      //
+      //   Get Optional list of vertical coordinate values
+      //   after the Product Definition Template, if necessary.
+      //
+      *coordlist=0;    // NULL
+      if ( *numcoord != 0 ) {
+         coordieee=(g2int *)calloc(*numcoord,sizeof(g2int));
+         lcoordlist=(g2float *)calloc(*numcoord,sizeof(g2float));
+         if (coordieee == 0 || lcoordlist == 0) {
+            ierr=6;
+            *numcoord=0;
+            *coordlist=0;    // NULL
+            if( coordieee != 0 ) free(coordieee);
+            if( lcoordlist != 0 ) free(lcoordlist);
+            return(ierr);
+         }
+         else {
+            *coordlist=lcoordlist;
+         }
+        gbits(cgrib,coordieee,*iofst,32,0,*numcoord);
+        rdieee(coordieee,*coordlist,*numcoord);
+        free(coordieee);
+        *iofst=*iofst+(32*(*numcoord));
+      }
+      
+      return(ierr);    // End of Section 4 processing
+
+}
diff --git a/g2clib_src/g2_unpack5.c b/g2clib_src/g2_unpack5.c
new file mode 100755
index 0000000..978c128
--- /dev/null
+++ b/g2clib_src/g2_unpack5.c
@@ -0,0 +1,152 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include "grib2.h"
+
+
+g2int g2_unpack5(unsigned char *cgrib,g2int *iofst,g2int *ndpts,g2int *idrsnum,
+               g2int **idrstmpl,g2int *mapdrslen)
+////$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    g2_unpack5 
+//   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2002-10-31
+//
+// ABSTRACT: This subroutine unpacks Section 5 (Data Representation Section)
+//           as defined in GRIB Edition 2.
+//
+// PROGRAM HISTORY LOG:
+// 2002-10-31  Gilbert
+// 2009-01-14  Vuong     Changed structure name template to gtemplate
+//
+// USAGE:    int g2_unpack5(unsigned char *cgrib,g2int *iofst,g2int *ndpts,
+//                          g2int *idrsnum,g2int **idrstmpl,g2int *mapdrslen)
+//   INPUT ARGUMENTS:
+//     cgrib    - char array containing Section 5 of the GRIB2 message
+//     iofst    - Bit offset for the beginning of Section 5 in cgrib.
+//
+//   OUTPUT ARGUMENTS:      
+//     iofst    - Bit offset at the end of Section 5, returned.
+//     ndpts    - Number of data points unpacked and returned.
+//     idrsnum  - Data Representation Template Number ( see Code Table 5.0)
+//     idrstmpl - Pointer to an integer array containing the data values for 
+//                the specified Data Representation
+//                Template ( N=idrsnum ).  Each element of this integer
+//                array contains an entry (in the order specified) of Data
+//                Representation Template 5.N
+//     mapdrslen- Number of elements in idrstmpl[].  i.e. number of entries
+//                in Data Representation Template 5.N  ( N=idrsnum ).
+//
+//   RETURN VALUES:
+//     ierr     - Error return code.
+//                0 = no error
+//                2 = Not Section 5
+//                6 = memory allocation error
+//                7 = "GRIB" message contains an undefined Data
+//                    Representation Template.
+//
+// REMARKS: None
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE:  
+//
+//$$$//
+{
+      g2int ierr,needext,i,j,nbits,isecnum;
+      g2int lensec,isign,newlen;
+      g2int *lidrstmpl=0;
+      gtemplate *mapdrs;
+
+      ierr=0;
+      *idrstmpl=0;       //NULL
+
+      gbit(cgrib,&lensec,*iofst,32);        // Get Length of Section
+      *iofst=*iofst+32;
+      gbit(cgrib,&isecnum,*iofst,8);         // Get Section Number
+      *iofst=*iofst+8;
+
+      if ( isecnum != 5 ) {
+         ierr=2;
+         *ndpts=0;
+         *mapdrslen=0;
+        // fprintf(stderr,"g2_unpack5: Not Section 5 data.\n");
+         return(ierr);
+      }
+
+      gbit(cgrib,ndpts,*iofst,32);    // Get num of data points
+      *iofst=*iofst+32;
+      gbit(cgrib,idrsnum,*iofst,16);     // Get Data Rep Template Num.
+      *iofst=*iofst+16;
+
+      //   Gen Data Representation Template
+      mapdrs=getdrstemplate(*idrsnum);
+      if (mapdrs == 0) {
+        ierr=7;
+        *mapdrslen=0;
+        return(ierr);
+      }
+      *mapdrslen=mapdrs->maplen;
+      needext=mapdrs->needext;
+      //
+      //   Unpack each value into array ipdstmpl from the
+      //   the appropriate number of octets, which are specified in
+      //   corresponding entries in array mapdrs.
+      //
+      if (*mapdrslen > 0) lidrstmpl=(g2int *)calloc(*mapdrslen,sizeof(g2int));
+      if (lidrstmpl == 0) {
+         ierr=6;
+         *mapdrslen=0;
+         *idrstmpl=0;     //NULL
+         if ( mapdrs != 0 ) free(mapdrs);
+         return(ierr);
+      }
+      else {
+         *idrstmpl=lidrstmpl;
+      }
+      for (i=0;i<mapdrs->maplen;i++) {
+        nbits=abs(mapdrs->map[i])*8;
+        if ( mapdrs->map[i] >= 0 ) {
+          gbit(cgrib,lidrstmpl+i,*iofst,nbits);
+        }
+        else {
+          gbit(cgrib,&isign,*iofst,1);
+          gbit(cgrib,lidrstmpl+i,*iofst+1,nbits-1);
+          if (isign == 1) lidrstmpl[i]=-1*lidrstmpl[i];
+        }
+        *iofst=*iofst+nbits;
+      }
+      //
+      //   Check to see if the Data Representation Template needs to be
+      //   extended.
+      //   The number of values in a specific gtemplate may vary
+      //   depending on data specified in the "static" part of the
+      //   gtemplate.
+      //
+      if ( needext == 1 ) {
+        free(mapdrs);
+        mapdrs=extdrstemplate(*idrsnum,lidrstmpl);
+        newlen=mapdrs->maplen+mapdrs->extlen;
+        lidrstmpl=(g2int *)realloc(lidrstmpl,newlen*sizeof(g2int));
+        *idrstmpl=lidrstmpl;
+        //   Unpack the rest of the Data Representation Template
+        j=0;
+        for (i=*mapdrslen;i<newlen;i++) {
+          nbits=abs(mapdrs->ext[j])*8;
+          if ( mapdrs->ext[j] >= 0 ) {
+            gbit(cgrib,lidrstmpl+i,*iofst,nbits);
+          }
+          else {
+            gbit(cgrib,&isign,*iofst,1);
+            gbit(cgrib,lidrstmpl+i,*iofst+1,nbits-1);
+            if (isign == 1) lidrstmpl[i]=-1*lidrstmpl[i];
+          }
+          *iofst=*iofst+nbits;
+          j++;
+        }
+        *mapdrslen=newlen;
+      }
+      if( mapdrs->ext != 0 ) free(mapdrs->ext);
+      if( mapdrs != 0 ) free(mapdrs);
+
+      return(ierr);    // End of Section 5 processing
+
+}
diff --git a/g2clib_src/g2_unpack6.c b/g2clib_src/g2_unpack6.c
new file mode 100755
index 0000000..9f6da7e
--- /dev/null
+++ b/g2clib_src/g2_unpack6.c
@@ -0,0 +1,97 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include "grib2.h"
+
+g2int g2_unpack6(unsigned char *cgrib,g2int *iofst,g2int ngpts,g2int *ibmap,
+               g2int **bmap)
+//$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    g2_unpack6 
+//   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2002-10-31
+//
+// ABSTRACT: This subroutine unpacks Section 6 (Bit-Map Section)
+//           as defined in GRIB Edition 2.
+//
+// PROGRAM HISTORY LOG:
+// 2002-10-31  Gilbert
+//
+// USAGE:    int g2_unpack6(unsigned char *cgrib,g2int *iofst,g2int ngpts,
+//                          g2int *ibmap,g2int **bmap)
+//   INPUT ARGUMENTS:
+//     cgrib    - char array containing Section 6 of the GRIB2 message
+//     iofst    - Bit offset of the beginning of Section 6 in cgrib.
+//     ngpts    - Number of grid points specified in the bit-map
+//
+//   OUTPUT ARGUMENTS:      
+//     iofst    - Bit offset at the end of Section 6, returned.
+//     ibmap    - Bitmap indicator ( see Code Table 6.0 )
+//                0 = bitmap applies and is included in Section 6.
+//                1-253 = Predefined bitmap applies
+//                254 = Previously defined bitmap applies to this field
+//                255 = Bit map does not apply to this product.
+//     bmap     - Pointer to an integer array containing decoded bitmap. 
+//                ( if ibmap=0 )
+//
+//   RETURN VALUES:
+//     ierr     - Error return code.
+//                0 = no error
+//                2 = Not Section 6
+//                4 = Unrecognized pre-defined bit-map.
+//                6 = memory allocation error
+//
+// REMARKS: None
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE:
+//
+//$$$//
+{
+      g2int j,ierr,isecnum;
+      g2int *lbmap=0;
+      g2int *intbmap;
+
+      ierr=0;
+      *bmap=0;    //NULL
+
+      *iofst=*iofst+32;    // skip Length of Section
+      gbit(cgrib,&isecnum,*iofst,8);         // Get Section Number
+      *iofst=*iofst+8; 
+
+      if ( isecnum != 6 ) {
+         ierr=2;
+         fprintf(stderr,"g2_unpack6: Not Section 6 data.\n");
+         return(ierr);
+      }
+
+      gbit(cgrib,ibmap,*iofst,8);    // Get bit-map indicator
+      *iofst=*iofst+8;
+
+      if (*ibmap == 0) {               // Unpack bitmap
+         if (ngpts > 0) lbmap=(g2int *)calloc(ngpts,sizeof(g2int));
+         if (lbmap == 0) {
+            ierr=6;
+            return(ierr);
+         }
+         else {
+            *bmap=lbmap;
+         }
+         intbmap=(g2int *)calloc(ngpts,sizeof(g2int));  
+         gbits(cgrib,intbmap,*iofst,1,0,ngpts);
+         *iofst=*iofst+ngpts;
+         for (j=0;j<ngpts;j++) {
+           lbmap[j]=(g2int)intbmap[j];
+         }
+         free(intbmap);
+//      else if (*ibmap.eq.254)               ! Use previous bitmap
+//        return(ierr);
+//      else if (*ibmap.eq.255)               ! No bitmap in message
+//        bmap(1:ngpts)=.true.
+//      else {
+//        print *,'gf_unpack6: Predefined bitmap ',*ibmap,' not recognized.'
+//        ierr=4;
+      }
+      
+      return(ierr);    // End of Section 6 processing
+
+}
diff --git a/g2clib_src/g2_unpack7.c b/g2clib_src/g2_unpack7.c
new file mode 100755
index 0000000..372fea2
--- /dev/null
+++ b/g2clib_src/g2_unpack7.c
@@ -0,0 +1,152 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <memory.h>
+#include <string.h>
+#include "grib2.h"
+
+g2int simunpack(unsigned char *,g2int *, g2int,g2float *);
+int comunpack(unsigned char *,g2int,g2int,g2int *,g2int,g2float *);
+g2int specunpack(unsigned char *,g2int *,g2int,g2int,g2int, g2int, g2float *);
+#ifdef USE_PNG
+  g2int pngunpack(unsigned char *,g2int,g2int *,g2int, g2float *);
+#endif  /* USE_PNG */
+#ifdef USE_JPEG2000
+  g2int jpcunpack(unsigned char *,g2int,g2int *,g2int, g2float *);
+#endif  /* USE_JPEG2000 */
+
+g2int g2_unpack7(unsigned char *cgrib,g2int *iofst,g2int igdsnum,g2int *igdstmpl,
+               g2int idrsnum,g2int *idrstmpl,g2int ndpts,g2float **fld)
+//$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    g2_unpack7 
+//   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2002-10-31
+//
+// ABSTRACT: This subroutine unpacks Section 7 (Data Section)
+//           as defined in GRIB Edition 2.
+//
+// PROGRAM HISTORY LOG:
+// 2002-10-31  Gilbert
+// 2002-12-20  Gilbert - Added GDT info to arguments
+//                       and added 5.51 processing.
+// 2003-08-29  Gilbert  - Added support for new templates using
+//                        PNG and JPEG2000 algorithms/templates.
+// 2004-11-29  Gilbert  - JPEG2000 now allowed to use WMO Template no. 5.40
+//                        PNG now allowed to use WMO Template no. 5.41
+// 2004-12-16  Taylor   - Added check on comunpack return code.
+// 2008-12-23  Wesley   - Initialize Number of data points unpacked
+//
+// USAGE:    int g2_unpack7(unsigned char *cgrib,g2int *iofst,g2int igdsnum,
+//                          g2int *igdstmpl, g2int idrsnum,
+//                          g2int *idrstmpl, g2int ndpts,g2float **fld)
+//   INPUT ARGUMENTS:
+//     cgrib    - char array containing Section 7 of the GRIB2 message
+//     iofst    - Bit offset of the beginning of Section 7 in cgrib.
+//     igdsnum  - Grid Definition Template Number ( see Code Table 3.0)
+//                ( Only used for DRS Template 5.51 )
+//     igdstmpl - Pointer to an integer array containing the data values for
+//                the specified Grid Definition
+//                Template ( N=igdsnum ).  Each element of this integer
+//                array contains an entry (in the order specified) of Grid
+//                Definition Template 3.N
+//                ( Only used for DRS Template 5.51 )
+//     idrsnum  - Data Representation Template Number ( see Code Table 5.0)
+//     idrstmpl - Pointer to an integer array containing the data values for
+//                the specified Data Representation
+//                Template ( N=idrsnum ).  Each element of this integer
+//                array contains an entry (in the order specified) of Data
+//                Representation Template 5.N
+//     ndpts    - Number of data points unpacked and returned.
+//
+//   OUTPUT ARGUMENTS:      
+//     iofst    - Bit offset at the end of Section 7, returned.
+//     fld      - Pointer to a float array containing the unpacked data field.
+//
+//   RETURN VALUES:
+//     ierr     - Error return code.
+//                0 = no error
+//                2 = Not section 7
+//                4 = Unrecognized Data Representation Template
+//                5 = need one of GDT 3.50 through 3.53 to decode DRT 5.51
+//                6 = memory allocation error
+//                7 = corrupt section 7.
+//
+// REMARKS: None
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE:
+//
+//$$$//
+{
+      g2int ierr,isecnum;
+      g2int ipos,lensec;
+      g2float *lfld;
+
+      ierr=0;
+      *fld=0;     //NULL
+
+      gbit(cgrib,&lensec,*iofst,32);        // Get Length of Section
+      *iofst=*iofst+32;    
+      gbit(cgrib,&isecnum,*iofst,8);         // Get Section Number
+      *iofst=*iofst+8;
+
+      if ( isecnum != 7 ) {
+         ierr=2;
+         //fprintf(stderr,"g2_unpack7: Not Section 7 data.\n");
+         return(ierr);
+      }
+
+      ipos=(*iofst/8);
+      lfld=(g2float *)calloc(ndpts ? ndpts : 1,sizeof(g2float));
+      if (lfld == 0) {
+         ierr=6;
+         return(ierr);
+      }
+      else {
+         *fld=lfld;
+      }
+
+      if (idrsnum == 0) 
+        simunpack(cgrib+ipos,idrstmpl,ndpts,lfld);
+      else if (idrsnum == 2 || idrsnum == 3) {
+        if (comunpack(cgrib+ipos,lensec,idrsnum,idrstmpl,ndpts,lfld) != 0) {
+          return 7;
+        }
+      }
+      else if (idrsnum == 50) {            // Spectral Simple
+        simunpack(cgrib+ipos,idrstmpl,ndpts-1,lfld+1);
+        rdieee(idrstmpl+4,lfld+0,1);
+      }
+      else if (idrsnum == 51)              //  Spectral complex
+        if ( igdsnum>=50 && igdsnum <=53 ) 
+          specunpack(cgrib+ipos,idrstmpl,ndpts,igdstmpl[0],igdstmpl[2],igdstmpl[2],lfld);
+        else {
+          fprintf(stderr,"g2_unpack7: Cannot use GDT 3.%d to unpack Data Section 5.51.\n",(int)igdsnum);
+          ierr=5;
+          if ( lfld != 0 ) free(lfld);
+          *fld=0;     //NULL
+          return(ierr);
+        }
+#ifdef USE_JPEG2000
+      else if (idrsnum == 40 || idrsnum == 40000) {
+        jpcunpack(cgrib+ipos,lensec-5,idrstmpl,ndpts,lfld);
+        }
+#endif  /* USE_JPEG2000 */
+#ifdef USE_PNG
+      else if (idrsnum == 41 || idrsnum == 40010) {
+        pngunpack(cgrib+ipos,lensec-5,idrstmpl,ndpts,lfld);
+        }
+#endif  /* USE_PNG */
+      else {
+        fprintf(stderr,"g2_unpack7: Data Representation Template 5.%d not yet implemented.\n",(int)idrsnum);
+        ierr=4;
+        if ( lfld != 0 ) free(lfld);
+        *fld=0;     //NULL
+        return(ierr);
+      }
+
+      *iofst=*iofst+(8*lensec);
+      
+      return(ierr);    // End of Section 7 processing
+
+}
diff --git a/g2clib_src/gbits.c b/g2clib_src/gbits.c
new file mode 100755
index 0000000..34709da
--- /dev/null
+++ b/g2clib_src/gbits.c
@@ -0,0 +1,124 @@
+#include "grib2.h"
+
+void gbit(unsigned char *in,g2int *iout,g2int iskip,g2int nbyte)
+{
+      gbits(in,iout,iskip,nbyte,(g2int)0,(g2int)1);
+}
+
+void sbit(unsigned char *out,g2int *in,g2int iskip,g2int nbyte)
+{
+      sbits(out,in,iskip,nbyte,(g2int)0,(g2int)1);
+}
+
+
+void gbits(unsigned char *in,g2int *iout,g2int iskip,g2int nbyte,g2int nskip,
+           g2int n)
+/*          Get bits - unpack bits:  Extract arbitrary size values from a
+/          packed bit string, right justifying each value in the unpacked
+/          iout array.
+/           *in    = pointer to character array input
+/           *iout  = pointer to unpacked array output
+/            iskip = initial number of bits to skip
+/            nbyte = number of bits to take
+/            nskip = additional number of bits to skip on each iteration
+/            n     = number of iterations
+/ v1.1
+*/
+{
+      g2int i,tbit,bitcnt,ibit,itmp;
+      g2int nbit,index;
+      static g2int ones[]={1,3,7,15,31,63,127,255};
+
+//     nbit is the start position of the field in bits
+      nbit = iskip;
+      for (i=0;i<n;i++) {
+         bitcnt = nbyte;
+         index=nbit/8;
+         ibit=nbit%8;
+         nbit = nbit + nbyte + nskip;
+
+//        first byte
+         tbit= ( bitcnt < (8-ibit) ) ? bitcnt : 8-ibit;  // find min
+         itmp = (int)*(in+index) & ones[7-ibit];
+         if (tbit != 8-ibit) itmp >>= (8-ibit-tbit);
+         index++;
+         bitcnt = bitcnt - tbit;
+
+//        now transfer whole bytes
+         while (bitcnt >= 8) {
+             itmp = itmp<<8 | (int)*(in+index);
+             bitcnt = bitcnt - 8;
+             index++;
+         }
+
+//        get data from last byte
+         if (bitcnt > 0) {
+             itmp = ( itmp << bitcnt ) | ( ((int)*(in+index) >> (8-bitcnt)) & ones[bitcnt-1] );
+         }
+
+         *(iout+i) = itmp;
+      }
+}
+
+
+void sbits(unsigned char *out,g2int *in,g2int iskip,g2int nbyte,g2int nskip,
+           g2int n)
+/*C          Store bits - pack bits:  Put arbitrary size values into a
+/          packed bit string, taking the low order bits from each value
+/          in the unpacked array.
+/           *iout  = pointer to packed array output
+/           *in    = pointer to unpacked array input
+/            iskip = initial number of bits to skip
+/            nbyte = number of bits to pack
+/            nskip = additional number of bits to skip on each iteration
+/            n     = number of iterations
+/ v1.1
+*/
+{
+      g2int i,bitcnt,tbit,ibit,itmp,imask,itmp2,itmp3;
+      g2int nbit,index;
+      static g2int ones[]={1,3,7,15,31,63,127,255};
+
+//     number bits from zero to ...
+//     nbit is the last bit of the field to be filled
+
+      nbit = iskip + nbyte - 1;
+      for (i=0;i<n;i++) {
+         itmp = *(in+i);
+         bitcnt = nbyte;
+         index=nbit/8;
+         ibit=nbit%8;
+         nbit = nbit + nbyte + nskip;
+
+//        make byte aligned 
+         if (ibit != 7) {
+             tbit= ( bitcnt < (ibit+1) ) ? bitcnt : ibit+1;  // find min
+             imask = ones[tbit-1] << (7-ibit);
+             itmp2 = (itmp << (7-ibit)) & imask;
+             itmp3 = (int)*(out+index) & (255-imask);
+             out[index] = (unsigned char)(itmp2 | itmp3);
+             bitcnt = bitcnt - tbit;
+             itmp = itmp >> tbit;
+             index--;
+         }
+
+//        now byte aligned
+
+//        do by bytes
+         while (bitcnt >= 8) {
+             out[index] = (unsigned char)(itmp & 255);
+             itmp = itmp >> 8;
+             bitcnt = bitcnt - 8;
+             index--;
+         }
+
+//        do last byte
+
+         if (bitcnt > 0) {
+             itmp2 = itmp & ones[bitcnt-1];
+             itmp3 = (int)*(out+index) & (255-ones[bitcnt-1]);
+             out[index] = (unsigned char)(itmp2 | itmp3);
+         }
+      }
+
+}
diff --git a/g2clib_src/getdim.c b/g2clib_src/getdim.c
new file mode 100644
index 0000000..c86228f
--- /dev/null
+++ b/g2clib_src/getdim.c
@@ -0,0 +1,127 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include "grib2.h"
+
+g2int g2_unpack3(unsigned char *,g2int *,g2int **,g2int **,
+                         g2int *,g2int **,g2int *);
+
+g2int getdim(unsigned char *csec3,g2int *width,g2int *height,g2int *iscan)
+//$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    getdim 
+//   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2002-12-11
+//
+// ABSTRACT: This subroutine returns the dimensions and scanning mode of 
+//   a grid definition packed in GRIB2 Grid Definition Section 3 format.
+//
+// PROGRAM HISTORY LOG:
+// 2002-12-11  Gilbert
+//
+// USAGE:    int getdim(unsigned char *csec3,g2int *width,
+//                      g2int *height, g2int *iscan)
+//   INPUT ARGUMENT LIST:
+//     csec3    - Character array that contains the packed GRIB2 GDS
+//
+//   OUTPUT ARGUMENT LIST:      
+//     width    - x (or i) dimension of the grid.
+//     height   - y (or j) dimension of the grid.
+//     iscan    - Scanning mode ( see Code Table 3.4 )
+//
+// REMARKS:  Returns width and height set to zero, if grid template
+//           not recognized.
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE:  IBM SP
+//
+//$$$
+{
+    
+      g2int  *igdstmpl,*list_opt;
+      g2int  *igds;
+      g2int  iofst,igdtlen,num_opt,jerr;
+
+      igdstmpl=0;
+      list_opt=0;
+      igds=0;
+      iofst=0;       // set offset to beginning of section
+      jerr= g2_unpack3(csec3,&iofst,&igds,&igdstmpl,
+                       &igdtlen,&list_opt,&num_opt);
+      if (jerr == 0) {
+         switch ( igds[4] )     //  Template number
+         {
+           case 0:    // Lat/Lon
+           case 1:
+           case 2:
+           case 3:
+           {
+              *width=igdstmpl[7];
+              *height=igdstmpl[8];
+              *iscan=igdstmpl[18];
+              break;
+           }
+           case 10:   // Mercator
+           {
+              *width=igdstmpl[7];
+              *height=igdstmpl[8];
+              *iscan=igdstmpl[15];
+              break;
+           }
+           case 20:   // Polar Stereographic
+           {
+              *width=igdstmpl[7];
+              *height=igdstmpl[8];
+              *iscan=igdstmpl[17];
+              break;
+           }
+           case 30:   // Lambert Conformal
+           {
+              *width=igdstmpl[7];
+              *height=igdstmpl[8];
+              *iscan=igdstmpl[17];
+              break;
+           }
+           case 40:   // Gaussian
+           case 41:
+           case 42:
+           case 43:
+           {
+              *width=igdstmpl[7];
+              *height=igdstmpl[8];
+              *iscan=igdstmpl[18];
+              break;
+           }
+           case 90:   // Space View/Orthographic
+           {
+              *width=igdstmpl[7];
+              *height=igdstmpl[8];
+              *iscan=igdstmpl[16];
+              break;
+           }
+           case 110:   // Equatorial Azimuthal
+           {
+              *width=igdstmpl[7];
+              *height=igdstmpl[8];
+              *iscan=igdstmpl[15];
+              break;
+           }
+           default:
+           {
+              *width=0;
+              *height=0;
+              *iscan=0;
+              break;
+           }
+         }  // end switch
+      }
+      else {
+         *width=0;
+         *height=0;
+      }
+
+      if (igds != 0) free(igds);
+      if (igdstmpl != 0) free(igdstmpl);
+      if (list_opt != 0) free(list_opt);
+
+      return 0;
+}
diff --git a/g2clib_src/getpoly.c b/g2clib_src/getpoly.c
new file mode 100644
index 0000000..9e2a5a6
--- /dev/null
+++ b/g2clib_src/getpoly.c
@@ -0,0 +1,80 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include "grib2.h"
+
+g2int g2_unpack3(unsigned char *,g2int *,g2int **,g2int **,
+                         g2int *,g2int **,g2int *);
+
+g2int getpoly(unsigned char *csec3,g2int *jj,g2int *kk,g2int *mm)
+//$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    getpoly 
+//   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2002-12-11
+//
+// ABSTRACT: This subroutine returns the J, K, and M pentagonal resolution
+//   parameters specified in a GRIB Grid Definition Section used
+//   spherical harmonic coefficients using GDT 5.50 through 5.53
+//
+// PROGRAM HISTORY LOG:
+// 2002-12-11  Gilbert
+//
+// USAGE:    int getpoly(unsigned char *csec3,g2int *jj,g2int *kk,g2int *mm)
+//   INPUT ARGUMENTS:
+//     csec3    - Character array that contains the packed GRIB2 GDS
+//
+//   OUTPUT ARGUMENTS:      
+//         JJ   = J - pentagonal resolution parameter
+//         KK   = K - pentagonal resolution parameter
+//         MM   = M - pentagonal resolution parameter
+//
+// REMARKS:  Returns JJ, KK, and MM set to zero, if grid template
+//           not recognized.
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE:  IBM SP
+//
+//$$$
+{
+    
+      g2int   *igdstmpl,*list_opt;
+      g2int   *igds;
+      g2int   iofst,igdtlen,num_opt,jerr;
+
+      iofst=0;       // set offset to beginning of section
+      jerr=g2_unpack3(csec3,&iofst,&igds,&igdstmpl,
+                      &igdtlen,&list_opt,&num_opt);
+      if (jerr == 0) {
+         switch ( igds[4] )     //  Template number
+         {
+           case 50:     // Spherical harmonic coefficients
+           case 51:
+           case 52:
+           case 53:
+           {
+              *jj=igdstmpl[0];
+              *kk=igdstmpl[1];
+              *mm=igdstmpl[2];
+              break;
+           }
+           default:
+           {
+              *jj=0;
+              *kk=0;
+              *mm=0;
+              break;
+           }
+         }     // end switch
+      }
+      else {
+         *jj=0;
+         *kk=0;
+         *mm=0;
+      }
+        
+      if (igds != 0) free(igds);
+      if (igdstmpl != 0) free(igdstmpl);
+      if (list_opt != 0) free(list_opt);
+
+      return 0;
+}
diff --git a/g2clib_src/grib2.h b/g2clib_src/grib2.h
new file mode 100755
index 0000000..432a11f
--- /dev/null
+++ b/g2clib_src/grib2.h
@@ -0,0 +1,249 @@
+#ifndef _grib2_H
+#define _grib2_H
+#include<stdio.h>
+
+#define G2_VERSION "g2clib-1.5.0"
+/*                .      .    .                                       .
+//   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2002-10-25
+//
+// PROGRAM HISTORY LOG:
+// 2002-10-25  Gilbert
+// 2009-01-14  Vuong     Changed struct template to gtemplate
+//
+//   Each element of structure gribfield is defined as:
+//   
+//   gribfield gfld;
+//
+//        gfld->version = GRIB edition number ( currently 2 )
+//        gfld->discipline = Message Discipline ( see Code Table 0.0 )
+//        gfld->idsect = Contains the entries in the Identification
+//                        Section ( Section 1 )
+//                        This element is a pointer to an array
+//                        that holds the data.
+//            gfld->idsect[0]  = Identification of originating Centre
+//                                    ( see Common Code Table C-1 )
+//                             7 - US National Weather Service
+//            gfld->idsect[1]  = Identification of originating Sub-centre
+//            gfld->idsect[2]  = GRIB Master Tables Version Number
+//                                    ( see Code Table 1.0 )
+//                             0 - Experimental
+//                             1 - Initial operational version number
+//            gfld->idsect[3]  = GRIB Local Tables Version Number
+//                                    ( see Code Table 1.1 )
+//                             0     - Local tables not used
+//                             1-254 - Number of local tables version used
+//            gfld->idsect[4]  = Significance of Reference Time (Code Table 1.2)
+//                             0 - Analysis
+//                             1 - Start of forecast
+//                             2 - Verifying time of forecast
+//                             3 - Observation time
+//            gfld->idsect[5]  = Year ( 4 digits )
+//            gfld->idsect[6]  = Month
+//            gfld->idsect[7)  = Day
+//            gfld->idsect[8]  = Hour
+//            gfld->idsect[9]  = Minute
+//            gfld->idsect[10]  = Second
+//            gfld->idsect[11]  = Production status of processed data
+//                                    ( see Code Table 1.3 )
+//                              0 - Operational products
+//                              1 - Operational test products
+//                              2 - Research products
+//                              3 - Re-analysis products
+//            gfld->idsect[12]  = Type of processed data ( see Code Table 1.4 )
+//                              0  - Analysis products
+//                              1  - Forecast products
+//                              2  - Analysis and forecast products
+//                              3  - Control forecast products
+//                              4  - Perturbed forecast products
+//                              5  - Control and perturbed forecast products
+//                              6  - Processed satellite observations
+//                              7  - Processed radar observations
+//        gfld->idsectlen = Number of elements in gfld->idsect[].
+//        gfld->local   = Pointer to character array containing contents
+//                       of Local Section 2, if included
+//        gfld->locallen = length of array gfld->local[]
+//        gfld->ifldnum = field number within GRIB message
+//        gfld->griddef = Source of grid definition (see Code Table 3.0)
+//                      0 - Specified in Code table 3.1
+//                      1 - Predetermined grid Defined by originating centre
+//        gfld->ngrdpts = Number of grid points in the defined grid.
+//        gfld->numoct_opt = Number of octets needed for each
+//                          additional grid points definition.
+//                          Used to define number of
+//                          points in each row ( or column ) for
+//                          non-regular grids.
+//                          = 0, if using regular grid.
+//        gfld->interp_opt = Interpretation of list for optional points
+//                          definition.  (Code Table 3.11)
+//        gfld->igdtnum = Grid Definition Template Number (Code Table 3.1)
+//        gfld->igdtmpl  = Contains the data values for the specified Grid
+//                         Definition Template ( NN=gfld->igdtnum ).  Each
+//                         element of this integer array contains an entry (in
+//                         the order specified) of Grid Defintion Template 3.NN
+//                         This element is a pointer to an array
+//                         that holds the data.
+//        gfld->igdtlen = Number of elements in gfld->igdtmpl[].  i.e. number of
+//                       entries in Grid Defintion Template 3.NN
+//                       ( NN=gfld->igdtnum ).
+//        gfld->list_opt  = (Used if gfld->numoct_opt .ne. 0)  This array
+//                          contains the number of grid points contained in
+//                          each row ( or column ).  (part of Section 3)
+//                          This element is a pointer to an array
+//                          that holds the data.  This pointer is nullified
+//                          if gfld->numoct_opt=0.
+//        gfld->num_opt = (Used if gfld->numoct_opt .ne. 0)  The number of entries
+//                       in array ideflist.  i.e. number of rows ( or columns )
+//                       for which optional grid points are defined.  This value
+//                       is set to zero, if gfld->numoct_opt=0.
+//        gfdl->ipdtnum = Product Definition Template Number (see Code Table 4.0)
+//        gfld->ipdtmpl  = Contains the data values for the specified Product
+//                         Definition Template ( N=gfdl->ipdtnum ).  Each element
+//                         of this integer array contains an entry (in the
+//                         order specified) of Product Defintion Template 4.N.
+//                         This element is a pointer to an array
+//                         that holds the data.
+//        gfld->ipdtlen = Number of elements in gfld->ipdtmpl[].  i.e. number of
+//                       entries in Product Defintion Template 4.N
+//                       ( N=gfdl->ipdtnum ).
+//        gfld->coord_list  = Real array containing floating point values
+//                            intended to document the vertical discretisation
+//                            associated to model data on hybrid coordinate
+//                            vertical levels.  (part of Section 4)
+//                            This element is a pointer to an array
+//                            that holds the data.
+//        gfld->num_coord = number of values in array gfld->coord_list[].
+//        gfld->ndpts = Number of data points unpacked and returned.
+//        gfld->idrtnum = Data Representation Template Number
+//                       ( see Code Table 5.0)
+//        gfld->idrtmpl  = Contains the data values for the specified Data
+//                         Representation Template ( N=gfld->idrtnum ).  Each
+//                         element of this integer array contains an entry
+//                         (in the order specified) of Product Defintion
+//                         Template 5.N.
+//                         This element is a pointer to an array
+//                         that holds the data.
+//        gfld->idrtlen = Number of elements in gfld->idrtmpl[].  i.e. number
+//                       of entries in Data Representation Template 5.N
+//                       ( N=gfld->idrtnum ).
+//        gfld->unpacked = logical value indicating whether the bitmap and
+//                        data values were unpacked.  If false,
+//                        gfld->bmap and gfld->fld pointers are nullified.
+//        gfld->expanded = Logical value indicating whether the data field 
+//                         was expanded to the grid in the case where a 
+//                         bit-map is present.  If true, the data points in
+//                         gfld->fld match the grid points and zeros were 
+//                         inserted at grid points where data was bit-mapped
+//                         out.  If false, the data values in gfld->fld were
+//                         not expanded to the grid and are just a consecutive
+//                         array of data points corresponding to each value of
+//                         "1" in gfld->bmap.
+//        gfld->ibmap = Bitmap indicator ( see Code Table 6.0 )
+//                     0 = bitmap applies and is included in Section 6.
+//                     1-253 = Predefined bitmap applies
+//                     254 = Previously defined bitmap applies to this field
+//                     255 = Bit map does not apply to this product.
+//        gfld->bmap  = integer array containing decoded bitmap,
+//                      if gfld->ibmap=0 or gfld->ibap=254.  Otherwise nullified.
+//                      This element is a pointer to an array
+//                      that holds the data.
+//        gfld->fld  = Array of gfld->ndpts unpacked data points.
+//                     This element is a pointer to an array
+//                     that holds the data.
+*/
+
+#ifdef __64BIT__
+typedef int g2int;
+typedef unsigned int g2intu;
+#else
+typedef long g2int;
+typedef unsigned long g2intu;
+#endif
+typedef float g2float;
+
+struct gtemplate {
+   g2int type;           /* 3=Grid Defintion Template.                       */
+                         /* 4=Product Defintion Template.                    */
+                         /* 5=Data Representation Template.                  */
+   g2int num;            /* template number.                                 */
+   g2int maplen;         /* number of entries in the static part             */
+                         /*                    of the template.              */
+   g2int *map;           /* num of octets of each entry in the               */
+                         /*         static part of the template.             */
+   g2int needext;        /* indicates whether or not the template needs      */
+                         /*     to be extended.                              */
+   g2int extlen;         /* number of entries in the template extension.     */
+   g2int *ext;           /* num of octets of each entry in the extension     */
+                         /*                      part of the template.       */
+};
+
+typedef struct gtemplate gtemplate;
+
+struct gribfield {
+   g2int   version,discipline;
+   g2int   *idsect;
+   g2int   idsectlen;
+   unsigned char *local;
+   g2int   locallen;
+   g2int   ifldnum;
+   g2int   griddef,ngrdpts;
+   g2int   numoct_opt,interp_opt,num_opt;
+   g2int   *list_opt;
+   g2int   igdtnum,igdtlen;
+   g2int   *igdtmpl;
+   g2int   ipdtnum,ipdtlen;
+   g2int   *ipdtmpl;
+   g2int   num_coord;
+   g2float *coord_list;
+   g2int   ndpts,idrtnum,idrtlen;
+   g2int   *idrtmpl;
+   g2int   unpacked;
+   g2int   expanded;
+   g2int   ibmap;
+   g2int   *bmap;
+   g2float *fld;
+};
+
+typedef struct gribfield gribfield;
+
+
+/*  Prototypes for unpacking API  */
+void seekgb(FILE *,g2int ,g2int ,g2int *,g2int *);
+g2int g2_info(unsigned char *,g2int *,g2int *,g2int *,g2int *);
+g2int g2_getfld(unsigned char *,g2int ,g2int ,g2int ,gribfield **);
+void g2_free(gribfield *);
+
+/*  Prototypes for packing API  */
+g2int g2_create(unsigned char *,g2int *,g2int *);
+g2int g2_addlocal(unsigned char *,unsigned char *,g2int );
+g2int g2_addgrid(unsigned char *,g2int *,g2int *,g2int *,g2int ); 
+g2int g2_addfield(unsigned char *,g2int ,g2int *,
+                       g2float *,g2int ,g2int ,g2int *,
+                       g2float *,g2int ,g2int ,g2int *);
+g2int g2_gribend(unsigned char *);
+
+/*  Prototypes for supporting routines  */
+extern double int_power(double, g2int );
+extern void mkieee(g2float *,g2int *,g2int);
+void rdieee(g2int *,g2float *,g2int );
+extern gtemplate *getpdstemplate(g2int);
+extern gtemplate *extpdstemplate(g2int,g2int *);
+extern gtemplate *getdrstemplate(g2int);
+extern gtemplate *extdrstemplate(g2int,g2int *);
+extern gtemplate *getgridtemplate(g2int);
+extern gtemplate *extgridtemplate(g2int,g2int *);
+extern void simpack(g2float *,g2int,g2int *,unsigned char *,g2int *);
+extern void compack(g2float *,g2int,g2int,g2int *,unsigned char *,g2int *);
+void misspack(g2float *,g2int ,g2int ,g2int *, unsigned char *, g2int *);
+void gbit(unsigned char *,g2int *,g2int ,g2int );
+void sbit(unsigned char *,g2int *,g2int ,g2int );
+void gbits(unsigned char *,g2int *,g2int ,g2int ,g2int ,g2int );
+void sbits(unsigned char *,g2int *,g2int ,g2int ,g2int ,g2int );
+
+int pack_gp(g2int *, g2int *, g2int *,
+            g2int *, g2int *, g2int *, g2int *, g2int *,
+            g2int *, g2int *, g2int *, g2int *,
+            g2int *, g2int *, g2int *, g2int *, g2int *,
+            g2int *, g2int *, g2int *);
+
+#endif  /*  _grib2_H  */
+
diff --git a/g2clib_src/grib2c.doc b/g2clib_src/grib2c.doc
new file mode 100755
index 0000000..4ad7c34
--- /dev/null
+++ b/g2clib_src/grib2c.doc
@@ -0,0 +1,946 @@
+                             GRIB2 USERS GUIDE (C)
+
+Contents:
+
+- Introduction
+- GRIB2 Tables/Templates
+- GRIB2 Encoding Routines
+- GRIB2 Decoding Routines
+- Decoding all GRIB2 Fields in a File
+- Extracting Selected GRIB2 Fields from a GRIB2 file
+- GRIB2 Routine Documentation
+
+===============================================================================
+ 
+                                Introduction
+
+This document briefly describes the routines available for encoding/decoding
+GRIB Edition 2 (GRIB2) messages.  A basic familiarity with GRIB is assumed.
+
+A GRIB Edition 2 message is a machine independent format for storing
+one or more gridded data fields.  Each GRIB2 message consists of the 
+following sections:
+
+SECTION 0 - Indicator Section
+SECTION 1 - Identification Section
+SECTION 2 - (Local Use Section) - optional                           }
+SECTION 3 - Grid Definition Section                     }            }
+SECTION 4 - Product Definition Section    }             }            }(repeated)
+SECTION 5 - Data Representation Section   }             }(repeated)  }
+SECTION 6 - Bit-map Section               }(repeated)   }            }
+SECTION 7 - Data Section                  }             }            }
+SECTION 8 - End Section                   }             }            }
+
+Sequences of GRIB sections 2 to 7, 3 to 7, or sections 4 to 7 may be repeated
+within a single GRIB message.  All sections within such repeated sequences
+must be present and shall appear in the numerical order noted above.
+Unrepeated sections remain in effect until redefined.
+
+The above overview was taken from WMO's FM 92-XII GRIB description
+of the GRIB Edition 2 form.
+
+===============================================================================
+
+                         GRIB2 Tables/Templates
+
+WMO's GRIB2 specification "FM 92-XII GRIB - General Regularly-distributed
+Information in Binary Form" contains descriptions of each template
+and code table information.  This document can be found at
+http://www.wmo.ch/web/www/WMOCodes.html
+(PDF and MSWord formats are available)
+
+===============================================================================
+
+                          GRIB2 Encoding Routines
+
+Since a GRIB2 message can contain gridded fields for many parameters on
+a number of different grids, several routines are used to encode a message.
+This should give users more flexibility in how to organize data
+within one or more GRIB2 messages.
+
+To start a new GRIB2 message, call function g2_create.  G2_create 
+encodes Sections 0 and 1 at the beginning of the message.  This routine 
+must be used to create each message.
+
+Routine g2_addlocal can be used to add a Local Use Section ( Section 2 ).
+Note that this section is optional and need not appear in a GRIB2 message.
+
+Function g2_addgrid is used to encode a grid definition into Section 3.
+This grid definition defines the geometry of the the data values in the
+fields that follow it.  g2_addgrid can be called again to change the grid 
+definition describing subsequent data fields.
+
+Each data field is added to the GRIB2 message using routine g2_addfield,
+which adds Sections 4, 5, 6, and 7 to the message.
+
+After all desired data fields have been added to the GRIB2 message, a
+call to function g2_gribend is needed to add the final section 8 to the
+message and to update the length of the message.  A call to g2_gribend
+is required for each GRIB2 message.
+
+Please see the "GRIB2 Routine Documentation" section below for subroutine
+argument usage for the routines mentioned above.
+
+===============================================================================
+
+                      GRIB2 Decoding Routines
+
+Routine g2_info can be used to find out how many Local Use sections
+and data fields are contained in a given GRIB2 message.  This routine also
+returns all the information stored in Sections 0 and 1 of the GRIB2
+message.
+
+g2_getfld can be used to get all information pertaining to the nth 
+data field in the message.  The subroutine returns all the unpacked metadata
+for each Section and Template in a gribfield structure,
+which is defined in include file grib2.h.  An option exists that lets the
+user decide if the decoder should unpack the Bit-map ( if applicable ) 
+and the data values or just return the field description information.
+
+Note that a struct gribfield is allocated by g2_getfld, and it also 
+contains pointers to many arrays of data that are alloated during decoding.
+Because of this, users are encouraged to free up this memory, when it is 
+no longer needed, by an explicit call to routine g2_free.
+
+Please see the "GRIB2 Routine Documentation" section below for subroutine
+argument usage for the routines mentioned above.
+
+===============================================================================
+                     Decoding all GRIB2 Fields in a File
+
+Routines seekgb, g2_info and g2_getfld can be used to sequentially decode
+all the GRIB2 fields in a file.  This is illustrated by the following example:
+
+    #include <stdio.h>
+    #include <stdlib.h>
+    #include "grib2.h"
+
+    unsigned char *cgrib;
+    g2int  listsec0[3],listsec1[13],numlocal,numfields;
+    long   lskip,n,lgrib,iseek;
+    int    unpack,ret,ierr;
+    gribfield  *gfld;
+    FILE   *fptr;
+    size_t  lengrib;
+ 
+    iseek=0;
+    unpack=1;
+    expand=1;
+    fptr=fopen("inputgribfile","r");
+    for (;;) {
+         seekgb(fptr,iseek,32000,&lskip,&lgrib);
+         if (lgrib == 0) break;    // end loop at EOF or problem
+         cgrib=(unsigned char *)malloc(lgrib);
+         ret=fseek(fptr,lskip,SEEK_SET);
+         lengrib=fread(cgrib,sizeof(unsigned char),lgrib,fptr);
+         iseek=lskip+lgrib;
+         ierr=g2_info(cgrib,listsec0,listsec1,&numfields,&numlocal);
+         for (n=0;n<numfields;n++) {
+            ierr=g2_getfld(cgrib,n+1,unpack,expand,&gfld);
+                .
+                .  // Process Field Here
+                .
+            g2_free(gfld);
+         }
+         free(cgrib);
+    }
+
+
+===============================================================================
+
+                Extracting Selected GRIB2 Fields from a GRIB2 File
+
+   This feature not implemented in the "C" version of the GRIB2
+   library yet.
+
+===============================================================================
+
+                       GRIB2 Routine Documentation
+
+//////////////////  grib2.h  ///////////////////////////////////////////
+//                .      .    .                                       .
+//   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2002-10-25
+//
+//   Each element of structure gribfield is defined as:
+//   
+//   gribfield gfld;
+//
+//        gfld->version = GRIB edition number ( currently 2 )
+//        gfld->discipline = Message Discipline ( see Code Table 0.0 )
+//        gfld->idsect = Contains the entries in the Identification
+//                        Section ( Section 1 )
+//                        This element is a pointer to an array
+//                        that holds the data.
+//            gfld->idsect[0]  = Identification of originating Centre
+//                                    ( see Common Code Table C-1 )
+//                             7 - US National Weather Service
+//            gfld->idsect[1]  = Identification of originating Sub-centre
+//            gfld->idsect[2]  = GRIB Master Tables Version Number
+//                                    ( see Code Table 1.0 )
+//                             0 - Experimental
+//                             1 - Initial operational version number
+//            gfld->idsect[3]  = GRIB Local Tables Version Number
+//                                    ( see Code Table 1.1 )
+//                             0     - Local tables not used
+//                             1-254 - Number of local tables version used
+//            gfld->idsect[4]  = Significance of Reference Time (Code Table 1.2)
+//                             0 - Analysis
+//                             1 - Start of forecast
+//                             2 - Verifying time of forecast
+//                             3 - Observation time
+//            gfld->idsect[5]  = Year ( 4 digits )
+//            gfld->idsect[6]  = Month
+//            gfld->idsect[7)  = Day
+//            gfld->idsect[8]  = Hour
+//            gfld->idsect[9]  = Minute
+//            gfld->idsect[10]  = Second
+//            gfld->idsect[11]  = Production status of processed data
+//                                    ( see Code Table 1.3 )
+//                              0 - Operational products
+//                              1 - Operational test products
+//                              2 - Research products
+//                              3 - Re-analysis products
+//            gfld->idsect[12]  = Type of processed data ( see Code Table 1.4 )
+//                              0  - Analysis products
+//                              1  - Forecast products
+//                              2  - Analysis and forecast products
+//                              3  - Control forecast products
+//                              4  - Perturbed forecast products
+//                              5  - Control and perturbed forecast products
+//                              6  - Processed satellite observations
+//                              7  - Processed radar observations
+//        gfld->idsectlen = Number of elements in gfld->idsect[].
+//        gfld->local   = Pointer to character array containing contents
+//                       of Local Section 2, if included
+//        gfld->locallen = length of array gfld->local[]
+//        gfld->ifldnum = field number within GRIB message
+//        gfld->griddef = Source of grid definition (see Code Table 3.0)
+//                      0 - Specified in Code table 3.1
+//                      1 - Predetermined grid Defined by originating centre
+//        gfld->ngrdpts = Number of grid points in the defined grid.
+//        gfld->numoct_opt = Number of octets needed for each
+//                          additional grid points definition.
+//                          Used to define number of
+//                          points in each row ( or column ) for
+//                          non-regular grids.
+//                          = 0, if using regular grid.
+//        gfld->interp_opt = Interpretation of list for optional points
+//                          definition.  (Code Table 3.11)
+//        gfld->igdtnum = Grid Definition Template Number (Code Table 3.1)
+//        gfld->igdtmpl  = Contains the data values for the specified Grid
+//                         Definition Template ( NN=gfld->igdtnum ).  Each
+//                         element of this integer array contains an entry (in
+//                         the order specified) of Grid Defintion Template 3.NN
+//                         This element is a pointer to an array
+//                         that holds the data.
+//        gfld->igdtlen = Number of elements in gfld->igdtmpl[].  i.e. number of
+//                       entries in Grid Defintion Template 3.NN
+//                       ( NN=gfld->igdtnum ).
+//        gfld->list_opt  = (Used if gfld->numoct_opt .ne. 0)  This array
+//                          contains the number of grid points contained in
+//                          each row ( or column ).  (part of Section 3)
+//                          This element is a pointer to an array
+//                          that holds the data.  This pointer is nullified
+//                          if gfld->numoct_opt=0.
+//        gfld->num_opt = (Used if gfld->numoct_opt .ne. 0) 
+//                       The number of entries
+//                       in array ideflist.  i.e. number of rows ( or columns )
+//                       for which optional grid points are defined.  This value
+//                       is set to zero, if gfld->numoct_opt=0.
+//        gfdl->ipdtnum = Product Definition Template Number(see Code Table 4.0)
+//        gfld->ipdtmpl  = Contains the data values for the specified Product
+//                         Definition Template ( N=gfdl->ipdtnum ). Each element
+//                         of this integer array contains an entry (in the
+//                         order specified) of Product Defintion Template 4.N.
+//                         This element is a pointer to an array
+//                         that holds the data.
+//        gfld->ipdtlen = Number of elements in gfld->ipdtmpl[].  i.e. number of
+//                       entries in Product Defintion Template 4.N
+//                       ( N=gfdl->ipdtnum ).
+//        gfld->coord_list  = Real array containing floating point values
+//                            intended to document the vertical discretisation
+//                            associated to model data on hybrid coordinate
+//                            vertical levels.  (part of Section 4)
+//                            This element is a pointer to an array
+//                            that holds the data.
+//        gfld->num_coord = number of values in array gfld->coord_list[].
+//        gfld->ndpts = Number of data points unpacked and returned.
+//        gfld->idrtnum = Data Representation Template Number
+//                       ( see Code Table 5.0)
+//        gfld->idrtmpl  = Contains the data values for the specified Data
+//                         Representation Template ( N=gfld->idrtnum ).  Each
+//                         element of this integer array contains an entry
+//                         (in the order specified) of Product Defintion
+//                         Template 5.N.
+//                         This element is a pointer to an array
+//                         that holds the data.
+//        gfld->idrtlen = Number of elements in gfld->idrtmpl[].  i.e. number
+//                       of entries in Data Representation Template 5.N
+//                       ( N=gfld->idrtnum ).
+//        gfld->unpacked = logical value indicating whether the bitmap and
+//                        data values were unpacked.  If false,
+//                        gfld->bmap and gfld->fld pointers are nullified.
+//        gfld->expanded = Logical value indicating whether the data field
+//                         was expanded to the grid in the case where a
+//                         bit-map is present.  If true, the data points in
+//                         gfld->fld match the grid points and zeros were
+//                         inserted at grid points where data was bit-mapped
+//                         out.  If false, the data values in gfld->fld were
+//                         not expanded to the grid and are just a consecutive
+//                         array of data points corresponding to each value of
+//                         "1" in gfld->bmap.
+//        gfld->ibmap = Bitmap indicator ( see Code Table 6.0 )
+//                     0 = bitmap applies and is included in Section 6.
+//                     1-253 = Predefined bitmap applies
+//                     254 = Previously defined bitmap applies to this field
+//                     255 = Bit map does not apply to this product.
+//        gfld->bmap  = integer array containing decoded bitmap,
+//                      if gfld->ibmap=0 or gfld->ibap=254.  
+//                      Otherwise nullified.
+//                      This element is a pointer to an array
+//                      that holds the data.
+//        gfld->fld  = Array of gfld->ndpts unpacked data points.
+//                     This element is a pointer to an array
+//                     that holds the data.
+///////////////////////////////////////////////////////////////////////////
+
+
+
+//$$$  SUBPROGRAM DOCUMENTATION BLOCK ////////////////////////////////////
+//
+// SUBPROGRAM: seekgb         Searches a file for the next GRIB message.
+//   PRGMMR: Gilbert          ORG: W/NP11      DATE: 2002-10-28
+//
+// ABSTRACT: This subprogram searches a file for the next GRIB Message.
+//   The search is done starting at byte offset iseek of the file referenced 
+//   by lugb for mseek bytes at a time.
+//   If found, the starting position and length of the message are returned
+//   in lskip and lgrib, respectively.
+//   The search is terminated when an EOF or I/O error is encountered.
+//
+// PROGRAM HISTORY LOG:
+// 2002-10-28  GILBERT   Modified from Iredell's skgb subroutine
+//
+// USAGE:    seekgb(FILE *lugb,long iseek,long mseek,int *lskip,int *lgrib)
+//   INPUT ARGUMENTS:
+//     lugb       - FILE pointer for the file to search.  File must be
+//                  opened before this routine is called.
+//     iseek      - number of bytes in the file to skip before search
+//     mseek      - number of bytes to search at a time
+//   OUTPUT ARGUMENTS:
+//     lskip      - number of bytes to skip from the beggining of the file
+//                  to where the GRIB message starts
+//     lgrib      - number of bytes in message (set to 0, if no message found)
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//
+//////////////////////////////////////////////////////////////////////////
+
+
+
+//$$$  SUBPROGRAM DOCUMENTATION BLOCK  ///////////////////////////////////
+//                .      .    .                                       .
+// SUBPROGRAM:    g2_info 
+//   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2002-10-28
+//
+// ABSTRACT: This subroutine searches through a GRIB2 message and
+//   returns the number of gridded fields found in the message and
+//   the number (and maximum size) of Local Use Sections.
+//   Also various checks  are performed
+//   to see if the message is a valid GRIB2 message.
+//
+// PROGRAM HISTORY LOG:
+// 2002-10-28  Gilbert
+//
+// USAGE:   int g2_info(unsigned char *cgrib,g2int *listsec0,g2int *listsec1,
+//            g2int *numfields,g2int *numlocal)
+//   INPUT ARGUMENT:
+//     cgrib    - Character pointer to the GRIB2 message
+//
+//   OUTPUT ARGUMENTS:      
+//     listsec0 - pointer to an array containing information decoded from 
+//                GRIB Indicator Section 0.
+//                Must be allocated with >= 3 elements.
+//                listsec0[0]=Discipline-GRIB Master Table Number
+//                            (see Code Table 0.0)
+//                listsec0[1]=GRIB Edition Number (currently 2)
+//                listsec0[2]=Length of GRIB message
+//     listsec1 - pointer to an array containing information read from GRIB 
+//                Identification Section 1.
+//                Must be allocated with >= 13 elements.
+//                listsec1[0]=Id of orginating centre (Common Code Table C-1)
+//                listsec1[1]=Id of orginating sub-centre (local table)
+//                listsec1[2]=GRIB Master Tables Version Number (Code Table 1.0)
+//                listsec1[3]=GRIB Local Tables Version Number 
+//                listsec1[4]=Significance of Reference Time (Code Table 1.1)
+//                listsec1[5]=Reference Time - Year (4 digits)
+//                listsec1[6]=Reference Time - Month
+//                listsec1[7]=Reference Time - Day
+//                listsec1[8]=Reference Time - Hour
+//                listsec1[9]=Reference Time - Minute
+//                listsec1[10]=Reference Time - Second
+//                listsec1[11]=Production status of data (Code Table 1.2)
+//                listsec1[12]=Type of processed data (Code Table 1.3)
+//     numfields- The number of gridded fields found in the GRIB message.
+//                That is, the number of occurences of Sections 4 - 7.
+//     numlocal - The number of Local Use Sections ( Section 2 ) found in 
+//                the GRIB message.
+//
+//     RETURN VALUES:
+//     ierr     - Error return code.
+//                0 = no error
+//                1 = Beginning characters "GRIB" not found.
+//                2 = GRIB message is not Edition 2.
+//                3 = Could not find Section 1, where expected.
+//                4 = End string "7777" found, but not where expected.
+//                5 = End string "7777" not found at end of message.
+//                6 = Invalid section number found.
+//
+// REMARKS: None
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE:  
+//
+//////////////////////////////////////////////////////////////////////////
+
+
+
+//$$$  SUBPROGRAM DOCUMENTATION BLOCK  ///////////////////////////////////
+//                .      .    .                                       .
+// SUBPROGRAM:    g2_getfld 
+//   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2002-10-28
+//
+// ABSTRACT: This subroutine returns all the metadata, template values, 
+//   Bit-map ( if applicable ), and the unpacked data for a given data
+//   field.  All of the information returned is stored in a gribfield
+//   structure, which is defined in file grib2.h.
+//   Users of this routine will need to include "grib2.h" in their source
+//   code that calls this routine.  Each component of the gribfield
+//   struct is also described in the OUTPUT ARGUMENTS section below.
+//
+//   Since there can be multiple data fields packed into a GRIB2
+//   message, the calling routine indicates which field is being requested
+//   with the ifldnum argument.
+//
+// PROGRAM HISTORY LOG:
+// 2002-10-28  Gilbert
+//
+// USAGE:    #include "grib2.h"
+//           int g2_getfld(unsigned char *cgrib,g2int ifldnum,g2int unpack,
+//                         g2int expand,gribfield **gfld)
+//   INPUT ARGUMENTS:
+//     cgrib    - Character pointer to the GRIB2 message
+//     ifldnum  - Specifies which field in the GRIB2 message to return.
+//     unpack   - Boolean value indicating whether to unpack bitmap/data
+//                1 = unpack bitmap and data values
+//                0 = do not unpack bitmap and data values
+//     expand   - Boolean value indicating whether the data points should be
+//                expanded to the correspond grid, if a bit-map is present.
+//                1 = if possible, expand data field to grid, inserting zero
+//                    values at gridpoints that are bitmapped out.
+//                    (SEE REMARKS2)
+//                0 = do not expand data field, leaving it an array of
+//                    consecutive data points for each "1" in the bitmap.
+//                This argument is ignored if unpack == 0 OR if the
+//                returned field does not contain a bit-map.
+//
+//   OUTPUT ARGUMENT:      
+//     gribfield gfld; - pointer to structure gribfield containing
+//                       all decoded data for the data field.
+// 
+//        gfld->version = GRIB edition number ( currently 2 )
+//        gfld->discipline = Message Discipline ( see Code Table 0.0 )
+//        gfld->idsect = Contains the entries in the Identification
+//                        Section ( Section 1 )
+//                        This element is a pointer to an array
+//                        that holds the data.
+//            gfld->idsect[0]  = Identification of originating Centre
+//                                    ( see Common Code Table C-1 )
+//                             7 - US National Weather Service
+//            gfld->idsect[1]  = Identification of originating Sub-centre
+//            gfld->idsect[2]  = GRIB Master Tables Version Number
+//                                    ( see Code Table 1.0 )
+//                             0 - Experimental
+//                             1 - Initial operational version number
+//            gfld->idsect[3]  = GRIB Local Tables Version Number
+//                                    ( see Code Table 1.1 )
+//                             0     - Local tables not used
+//                             1-254 - Number of local tables version used
+//            gfld->idsect[4]  = Significance of Reference Time (Code Table 1.2)
+//                             0 - Analysis
+//                             1 - Start of forecast
+//                             2 - Verifying time of forecast
+//                             3 - Observation time
+//            gfld->idsect[5]  = Year ( 4 digits )
+//            gfld->idsect[6]  = Month
+//            gfld->idsect[7)  = Day
+//            gfld->idsect[8]  = Hour
+//            gfld->idsect[9]  = Minute
+//            gfld->idsect[10]  = Second
+//            gfld->idsect[11]  = Production status of processed data
+//                                    ( see Code Table 1.3 )
+//                              0 - Operational products
+//                              1 - Operational test products
+//                              2 - Research products
+//                              3 - Re-analysis products
+//            gfld->idsect[12]  = Type of processed data ( see Code Table 1.4 )
+//                              0  - Analysis products
+//                              1  - Forecast products
+//                              2  - Analysis and forecast products
+//                              3  - Control forecast products
+//                              4  - Perturbed forecast products
+//                              5  - Control and perturbed forecast products
+//                              6  - Processed satellite observations
+//                              7  - Processed radar observations
+//        gfld->idsectlen = Number of elements in gfld->idsect[].
+//        gfld->local   = Pointer to character array containing contents
+//                       of Local Section 2, if included
+//        gfld->locallen = length of array gfld->local[]
+//        gfld->ifldnum = field number within GRIB message
+//        gfld->griddef = Source of grid definition (see Code Table 3.0)
+//                      0 - Specified in Code table 3.1
+//                      1 - Predetermined grid Defined by originating centre
+//        gfld->ngrdpts = Number of grid points in the defined grid.
+//        gfld->numoct_opt = Number of octets needed for each
+//                          additional grid points definition.
+//                          Used to define number of
+//                          points in each row ( or column ) for
+//                          non-regular grids.
+//                          = 0, if using regular grid.
+//        gfld->interp_opt = Interpretation of list for optional points
+//                          definition.  (Code Table 3.11)
+//        gfld->igdtnum = Grid Definition Template Number (Code Table 3.1)
+//        gfld->igdtmpl  = Contains the data values for the specified Grid
+//                         Definition Template ( NN=gfld->igdtnum ).  Each
+//                         element of this integer array contains an entry (in
+//                         the order specified) of Grid Defintion Template 3.NN
+//                         This element is a pointer to an array
+//                         that holds the data.
+//        gfld->igdtlen = Number of elements in gfld->igdtmpl[].  i.e. number of
+//                       entries in Grid Defintion Template 3.NN
+//                       ( NN=gfld->igdtnum ).
+//        gfld->list_opt  = (Used if gfld->numoct_opt .ne. 0)  This array
+//                          contains the number of grid points contained in
+//                          each row ( or column ).  (part of Section 3)
+//                          This element is a pointer to an array
+//                          that holds the data.  This pointer is nullified
+//                          if gfld->numoct_opt=0.
+//        gfld->num_opt = (Used if gfld->numoct_opt .ne. 0) 
+//                        The number of entries
+//                       in array ideflist.  i.e. number of rows ( or columns )
+//                       for which optional grid points are defined.  This value
+//                       is set to zero, if gfld->numoct_opt=0.
+//        gfdl->ipdtnum = Product Definition Template Number(see Code Table 4.0)
+//        gfld->ipdtmpl  = Contains the data values for the specified Product
+//                         Definition Template ( N=gfdl->ipdtnum ). Each element
+//                         of this integer array contains an entry (in the
+//                         order specified) of Product Defintion Template 4.N.
+//                         This element is a pointer to an array
+//                         that holds the data.
+//        gfld->ipdtlen = Number of elements in gfld->ipdtmpl[].  i.e. number of
+//                       entries in Product Defintion Template 4.N
+//                       ( N=gfdl->ipdtnum ).
+//        gfld->coord_list  = Real array containing floating point values
+//                            intended to document the vertical discretisation
+//                            associated to model data on hybrid coordinate
+//                            vertical levels.  (part of Section 4)
+//                            This element is a pointer to an array
+//                            that holds the data.
+//        gfld->num_coord = number of values in array gfld->coord_list[].
+//        gfld->ndpts = Number of data points unpacked and returned.
+//        gfld->idrtnum = Data Representation Template Number
+//                       ( see Code Table 5.0)
+//        gfld->idrtmpl  = Contains the data values for the specified Data
+//                         Representation Template ( N=gfld->idrtnum ).  Each
+//                         element of this integer array contains an entry
+//                         (in the order specified) of Product Defintion
+//                         Template 5.N.
+//                         This element is a pointer to an array
+//                         that holds the data.
+//        gfld->idrtlen = Number of elements in gfld->idrtmpl[].  i.e. number
+//                       of entries in Data Representation Template 5.N
+//                       ( N=gfld->idrtnum ).
+//        gfld->unpacked = logical value indicating whether the bitmap and
+//                        data values were unpacked.  If false,
+//                        gfld->bmap and gfld->fld pointers are nullified.
+//        gfld->expanded = Logical value indicating whether the data field
+//                         was expanded to the grid in the case where a
+//                         bit-map is present.  If true, the data points in
+//                         gfld->fld match the grid points and zeros were
+//                         inserted at grid points where data was bit-mapped
+//                         out.  If false, the data values in gfld->fld were
+//                         not expanded to the grid and are just a consecutive
+//                         array of data points corresponding to each value of
+//                         "1" in gfld->bmap.
+//        gfld->ibmap = Bitmap indicator ( see Code Table 6.0 )
+//                     0 = bitmap applies and is included in Section 6.
+//                     1-253 = Predefined bitmap applies
+//                     254 = Previously defined bitmap applies to this field
+//                     255 = Bit map does not apply to this product.
+//        gfld->bmap  = integer array containing decoded bitmap,
+//                      if gfld->ibmap=0 or gfld->ibap=254.  Otherwise nullified
+//                      This element is a pointer to an array
+//                      that holds the data.
+//        gfld->fld  = Array of gfld->ndpts unpacked data points.
+//                     This element is a pointer to an array
+//                     that holds the data.
+//
+// 
+//   RETURN VALUES:
+//     ierr     - Error return code.
+//                0 = no error
+//                1 = Beginning characters "GRIB" not found.
+//                2 = GRIB message is not Edition 2.
+//                3 = The data field request number was not positive.
+//                4 = End string "7777" found, but not where expected.
+//                6 = GRIB message did not contain the requested number of
+//                    data fields.
+//                7 = End string "7777" not found at end of message.
+//                8 = Unrecognized Section encountered.
+//                9 = Data Representation Template 5.NN not yet implemented.
+//               15 = Error unpacking Section 1.
+//               16 = Error unpacking Section 2.
+//               10 = Error unpacking Section 3.
+//               11 = Error unpacking Section 4.
+//               12 = Error unpacking Section 5.
+//               13 = Error unpacking Section 6.
+//               14 = Error unpacking Section 7.
+//
+// REMARKS: Note that struct gribfield is allocated by this routine and it
+//          also contains pointers to many arrays of data that were allocated
+//          during decoding.  Users are encouraged to free up this memory, 
+//          when it is no longer needed, by an explicit call to routine g2_free.
+//          EXAMPLE:
+//              #include "grib2.h"
+//              gribfield *gfld;
+//              ret=g2_getfld(cgrib,1,1,1,&gfld);
+//                ...
+//              g2_free(gfld);
+//
+//          Routine g2_info can be used to first determine
+//          how many data fields exist in a given GRIB message.
+//
+// REMARKS2: It may not always be possible to expand a bit-mapped data field.
+//           If a pre-defined bit-map is used and not included in the GRIB2
+//           message itself, this routine would not have the necessary
+//           information to expand the data.  In this case, gfld->expanded would
+//           would be set to 0 (false), regardless of the value of input
+//           argument expand.
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE:  
+//
+///////////////////////////////////////////////////////////////////////////
+
+
+
+//$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    g2_create 
+//   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2002-10-31
+//
+// ABSTRACT: This routine initializes a new GRIB2 message and packs
+//   GRIB2 sections 0 (Indicator Section) and 1 (Identification Section).
+//   This routine is used with routines "g2_addlocal", "g2_addgrid", 
+//   "g2_addfield", and "g2_gribend" to create a complete GRIB2 message.  
+//   g2_create must be called first to initialize a new GRIB2 message.
+//   Also, a call to g2_gribend is required to complete GRIB2 message
+//   after all fields have been added.
+//
+// PROGRAM HISTORY LOG:
+// 2002-10-31  Gilbert
+//
+// USAGE:    int g2_create(unsigned char *cgrib,long *listsec0,long *listsec1)
+//   INPUT ARGUMENTS:
+//     cgrib    - Character array to contain the GRIB2 message
+//     listsec0 - Contains information needed for GRIB Indicator Section 0.
+//                Must be dimensioned >= 2.
+//                listsec0[0]=Discipline-GRIB Master Table Number
+//                            (see Code Table 0.0)
+//                listsec0[1]=GRIB Edition Number (currently 2)
+//     listsec1 - Contains information needed for GRIB Identification Section 1.
+//                Must be dimensioned >= 13.
+//                listsec1[0]=Id of orginating centre (Common Code Table C-1)
+//                listsec1[1]=Id of orginating sub-centre (local table)
+//                listsec1[2]=GRIB Master Tables Version Number (Code Table 1.0)
+//                listsec1[3]=GRIB Local Tables Version Number (Code Table 1.1)
+//                listsec1[4]=Significance of Reference Time (Code Table 1.2)
+//                listsec1[5]=Reference Time - Year (4 digits)
+//                listsec1[6]=Reference Time - Month
+//                listsec1[7]=Reference Time - Day
+//                listsec1[8]=Reference Time - Hour
+//                listsec1[9]=Reference Time - Minute
+//                listsec1[10]=Reference Time - Second
+//                listsec1[11]=Production status of data (Code Table 1.3)
+//                listsec1[12]=Type of processed data (Code Table 1.4)
+//
+//   OUTPUT ARGUMENTS:      
+//     cgrib    - Char array to contain the new GRIB2 message.
+//                Must be allocated large enough to store the entire
+//                GRIB2 message.
+//
+//   RETURN VALUES:
+//     ierr     - return code.
+//              > 0 = Current size of new GRIB2 message
+//               -1 = Tried to use for version other than GRIB Edition 2
+//
+// REMARKS: This routine is intended for use with routines "g2_addlocal", 
+//          "g2_addgrid", "g2_addfield", and "g2_gribend" to create a complete 
+//          GRIB2 message.
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE:  
+//
+//$$$
+
+
+
+//$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    g2_addlocal 
+//   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2002-11-01
+//
+// ABSTRACT: This routine adds a Local Use Section (Section 2) to 
+//   a GRIB2 message.  It is used with routines "g2_create", 
+//   "g2_addgrid", "g2_addfield",
+//   and "g2_gribend" to create a complete GRIB2 message.  
+//   g2_create must be called first to initialize a new GRIB2 message.
+//
+// PROGRAM HISTORY LOG:
+// 2002-11-01  Gilbert
+//
+// USAGE:    int g2_addlocal(unsigned char *cgrib,unsigned char *csec2,
+//                           long lcsec2)
+//   INPUT ARGUMENTS:
+//     cgrib    - Char array that contains the GRIB2 message to which section
+//                2 should be added.
+//     csec2    - Character array containing information to be added in
+//                Section 2.
+//     lcsec2   - Number of bytes of character array csec2 to be added to
+//                Section 2.
+//
+//   OUTPUT ARGUMENT:      
+//     cgrib    - Char array to contain the updated GRIB2 message.
+//                Must be allocated large enough to store the entire
+//                GRIB2 message.
+//
+//   RETURN VALUES:
+//     ierr     - Return code.
+//              > 0 = Current size of updated GRIB2 message
+//               -1 = GRIB message was not initialized.  Need to call
+//                    routine gribcreate first.
+//               -2 = GRIB message already complete.  Cannot add new section.
+//               -3 = Sum of Section byte counts doesn't add to total byte count
+//               -4 = Previous Section was not 1 or 7.
+//
+// REMARKS: Note that the Local Use Section ( Section 2 ) can only follow
+//          Section 1 or Section 7 in a GRIB2 message.
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE: 
+//
+//$$$
+
+
+
+//$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    g2_addgrid 
+//   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2002-11-01
+//
+// ABSTRACT: This routine packs up a Grid Definition Section (Section 3) 
+//   and adds it to a GRIB2 message.  It is used with routines "g2_create",
+//   "g2_addlocal", "g2_addfield",
+//   and "g2_gribend" to create a complete GRIB2 message.
+//   g2_create must be called first to initialize a new GRIB2 message.
+//
+// PROGRAM HISTORY LOG:
+// 2002-11-01  Gilbert
+//
+// USAGE:    int g2_addgrid(unsigned char *cgrib,long *igds,g2int *igdstmpl,
+//                          long *ideflist,long idefnum)
+//   INPUT ARGUMENTS:
+//     cgrib    - Char array that contains the GRIB2 message to which
+//                section should be added.
+//     igds     - Contains information needed for GRIB Grid Definition Section 3
+//                Must be dimensioned >= 5.
+//                igds[0]=Source of grid definition (see Code Table 3.0)
+//                igds[1]=Number of grid points in the defined grid.
+//                igds[2]=Number of octets needed for each 
+//                            additional grid points definition.  
+//                            Used to define number of
+//                            points in each row ( or column ) for
+//                            non-regular grids.  
+//                            = 0, if using regular grid.
+//                igds[3]=Interpretation of list for optional points 
+//                            definition.  (Code Table 3.11)
+//                igds[4]=Grid Definition Template Number (Code Table 3.1)
+//     igdstmpl - Contains the data values for the specified Grid Definition
+//                Template ( NN=igds[4] ).  Each element of this integer 
+//                array contains an entry (in the order specified) of Grid
+//                Defintion Template 3.NN
+//     ideflist - (Used if igds[2] != 0)  This array contains the
+//                number of grid points contained in each row ( or column )
+//      idefnum - (Used if igds[2] != 0)  The number of entries
+//                in array ideflist.  i.e. number of rows ( or columns )
+//                for which optional grid points are defined.
+//
+//   OUTPUT ARGUMENTS:      
+//     cgrib    - Char array to contain the updated GRIB2 message.
+//                Must be allocated large enough to store the entire
+//                GRIB2 message.
+//
+//   RETURN VALUES:
+//     ierr     - Return code.
+//              > 0 = Current size of updated GRIB2 message
+//               -1 = GRIB message was not initialized.  Need to call
+//                    routine gribcreate first.
+//               -2 = GRIB message already complete.  Cannot add new section.
+//               -3 = Sum of Section byte counts doesn't add to total byte count
+//               -4 = Previous Section was not 1, 2 or 7.
+//               -5 = Could not find requested Grid Definition Template.
+//
+// REMARKS: Note that the Grid Def Section ( Section 3 ) can only follow
+//          Section 1, 2 or Section 7 in a GRIB2 message.
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE:  
+//
+//$$$
+
+
+
+//$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    g2_addfield 
+//   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2002-11-05
+//
+// ABSTRACT: This routine packs up Sections 4 through 7 for a given field
+//   and adds them to a GRIB2 message.  They are Product Definition Section,
+//   Data Representation Section, Bit-Map Section and Data Section, 
+//   respectively.
+//   This routine is used with routines "g2_create", "g2_addlocal", 
+//   "g2_addgrid", and "g2_gribend" to create a complete GRIB2 message.  
+//   g2_create must be called first to initialize a new GRIB2 message.
+//   Also, routine g2_addgrid must be called after g2_create and
+//   before this routine to add the appropriate grid description to
+//   the GRIB2 message.   Also, a call to g2_gribend is required to complete 
+//   GRIB2 message after all fields have been added.
+//
+// PROGRAM HISTORY LOG:
+// 2002-11-05  Gilbert
+//
+// USAGE:    int g2_addfield(unsigned char *cgrib,g2int ipdsnum,g2int *ipdstmpl,
+//              g2float *coordlist,g2int numcoord,g2int idrsnum,g2int *idrstmpl,
+//              g2float *fld,g2int ngrdpts,g2int ibmap,g2int *bmap)
+//   INPUT ARGUMENT LIST:
+//     cgrib    - Char array that contains the GRIB2 message to which sections
+//                4 through 7 should be added.
+//     ipdsnum  - Product Definition Template Number ( see Code Table 4.0)
+//     ipdstmpl - Contains the data values for the specified Product Definition
+//                Template ( N=ipdsnum ).  Each element of this integer 
+//                array contains an entry (in the order specified) of Product
+//                Defintion Template 4.N
+//     coordlist- Array containg floating point values intended to document
+//                the vertical discretisation associated to model data
+//                on hybrid coordinate vertical levels.
+//     numcoord - number of values in array coordlist.
+//     idrsnum  - Data Representation Template Number ( see Code Table 5.0 )
+//     idrstmpl - Contains the data values for the specified Data Representation
+//                Template ( N=idrsnum ).  Each element of this integer 
+//                array contains an entry (in the order specified) of Data
+//                Representation Template 5.N
+//                Note that some values in this template (eg. reference
+//                values, number of bits, etc...) may be changed by the
+//                data packing algorithms.
+//                Use this to specify scaling factors and order of
+//                spatial differencing, if desired.
+//     fld[]    - Array of data points to pack.
+//     ngrdpts  - Number of data points in grid.
+//                i.e.  size of fld and bmap.
+//     ibmap    - Bitmap indicator ( see Code Table 6.0 )
+//                0 = bitmap applies and is included in Section 6.
+//                1-253 = Predefined bitmap applies
+//                254 = Previously defined bitmap applies to this field
+//                255 = Bit map does not apply to this product.
+//     bmap[]   - Integer array containing bitmap to be added. ( if ibmap=0 )
+//
+//   OUTPUT ARGUMENT LIST:      
+//     cgrib    - Character array to contain the updated GRIB2 message.
+//                Must be allocated large enough to store the entire
+//                GRIB2 message.
+//
+//   RETURN VALUES:
+//     ierr     - Return code.
+//              > 0 = Current size of updated GRIB2 message
+//               -1 = GRIB message was not initialized.  Need to call
+//                    routine gribcreate first.
+//               -2 = GRIB message already complete.  Cannot add new section.
+//               -3 = Sum of Section byte counts doesn't add to total byte count
+//               -4 = Previous Section was not 3 or 7.
+//               -5 = Could not find requested Product Definition Template.
+//               -6 = Section 3 (GDS) not previously defined in message
+//               -7 = Tried to use unsupported Data Representationi Template
+//               -8 = Specified use of a previously defined bitmap, but one
+//                    does not exist in the GRIB message.
+//
+// REMARKS: Note that the Sections 4 through 7 can only follow
+//          Section 3 or Section 7 in a GRIB2 message.
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE:  
+//
+//$$$
+
+
+
+//$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    g2_gribend 
+//   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2002-10-31
+//
+// ABSTRACT: This routine finalizes a GRIB2 message after all grids
+//   and fields have been added.  It adds the End Section ( "7777" )
+//   to the end of the GRIB message and calculates the length and stores
+//   it in the appropriate place in Section 0.
+//   This routine is used with routines "g2_create", "g2_addlocal", 
+//   "g2_addgrid", and "g2_addfield" to create a complete GRIB2 message.
+//   g2_create must be called first to initialize a new GRIB2 message.
+//
+// PROGRAM HISTORY LOG:
+// 2002-10-31  Gilbert
+//
+// USAGE:    int g2_gribend(unsigned char *cgrib)
+//   INPUT ARGUMENT:
+//     cgrib    - Char array containing all the data sections added
+//                be previous calls to g2_create, g2_addlocal, g2_addgrid,
+//                and g2_addfield.
+//
+//   OUTPUT ARGUMENTS:      
+//     cgrib    - Char array containing the finalized GRIB2 message
+//
+//   RETURN VALUES:
+//     ierr     - Return code.
+//              > 0 = Length of the final GRIB2 message in bytes.
+//               -1 = GRIB message was not initialized.  Need to call
+//                    routine g2_create first.
+//               -2 = GRIB message already complete.  
+//               -3 = Sum of Section byte counts doesn't add to total byte count
+//               -4 = Previous Section was not 7.
+//
+// REMARKS: This routine is intended for use with routines "g2_create", 
+//          "g2_addlocal", "g2_addgrid", and "g2_addfield" to create a complete 
+//          GRIB2 message.
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE:
+//
+//$$$
diff --git a/g2clib_src/gridtemplates.c b/g2clib_src/gridtemplates.c
new file mode 100755
index 0000000..2556227
--- /dev/null
+++ b/g2clib_src/gridtemplates.c
@@ -0,0 +1,210 @@
+#include <stdlib.h>
+#include "grib2.h"
+#include "gridtemplates.h"
+
+g2int getgridindex(g2int number)
+/*!$$$  SUBPROGRAM DOCUMENTATION BLOCK
+!                .      .    .                                       .
+! SUBPROGRAM:    getgridindex
+!   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2001-06-28
+!
+! ABSTRACT: This function returns the index of specified Grid
+!   Definition Template 3.NN (NN=number) in array templates.
+!
+! PROGRAM HISTORY LOG:
+! 2001-06-28  Gilbert
+! 2007-08-16  Vuong     -  Added GDT 3.204  Curvilinear Orthogonal Grid
+! 2008-07-08  Vuong     -  Added GDT 3.32768 Rotate Lat/Lon E-grid (Arakawa)
+! 2009-01-14  Vuong     -  Changed structure name template to gtemplate
+! 2010-05-11  Vuong     -  Added GDT 3.32769 Rotate Lat/Lon Non-E Staggered grid (Arakawa)
+! 2013-08-06  Vuong     -  Added GDT 3.4,3.5,3.12,3.101,3.140
+!
+! USAGE:    index=getgridindex(number)
+!   INPUT ARGUMENT LIST:
+!     number   - NN, indicating the number of the Grid Definition
+!                Template 3.NN that is being requested.
+!
+! RETURNS:  Index of GDT 3.NN in array templates, if template exists.
+!           = -1, otherwise.
+!
+! REMARKS: None
+!
+! ATTRIBUTES:
+!   LANGUAGE: C
+!   MACHINE:  IBM SP
+!
+!$$$*/
+{
+           g2int j,getgridindex=-1;
+
+           for (j=0;j<MAXGRIDTEMP;j++) {
+              if (number == templatesgrid[j].template_num) {
+                 getgridindex=j;
+                 return(getgridindex);
+              }
+           }
+
+           return(getgridindex);
+}
+
+gtemplate *getgridtemplate(g2int number)
+/*!$$$  SUBPROGRAM DOCUMENTATION BLOCK
+!                .      .    .                                       .
+! SUBPROGRAM:    getgridtemplate 
+!   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2000-05-09
+!
+! ABSTRACT: This subroutine returns grid template information for a 
+!   specified Grid Definition Template 3.NN.
+!   The number of entries in the template is returned along with a map
+!   of the number of octets occupied by each entry.  Also, a flag is
+!   returned to indicate whether the template would need to be extended.
+!
+! PROGRAM HISTORY LOG:
+! 2000-05-09  Gilbert
+! 2007-08-16  Vuong     -  Added GDT 3.204  Curvilinear Orthogonal Grid
+! 2008-07-08  Vuong     -  Added GDT 3.32768 Rotate Lat/Lon E-grid (Arakawa)
+! 2010-05-11  Vuong     -  Added GDT 3.32769 Rotate Lat/Lon Non-E Staggered grid (Arakawa)
+! 2009-01-14  Vuong     -  Changed structure name template to gtemplate
+!
+! USAGE:    gtemplate *getgridtemplate(number)
+!   INPUT ARGUMENT LIST:
+!     number   - NN, indicating the number of the Grid Definition 
+!                Template 3.NN that is being requested.
+!
+!   RETURN VALUE:
+!        - Pointer to the returned template struct.
+!          Returns NULL pointer, if template not found.
+!
+! REMARKS: None
+!
+! ATTRIBUTES:
+!   LANGUAGE: C
+!   MACHINE:  IBM SP
+!
+!$$$*/
+{
+           g2int index;
+           gtemplate *new;
+
+           index=getgridindex(number);
+
+           if (index != -1) {
+              new=(gtemplate *)malloc(sizeof(gtemplate));
+              new->type=3;
+              new->num=templatesgrid[index].template_num;
+              new->maplen=templatesgrid[index].mapgridlen;
+              new->needext=templatesgrid[index].needext;
+              new->map=(g2int *)templatesgrid[index].mapgrid;
+              new->extlen=0;
+              new->ext=0;        //NULL
+              return(new);
+           }
+           else {
+             printf("getgridtemplate: GDT Template 3.%d not defined.\n",(int)number);
+             return(0);        //NULL
+           }
+
+         return(0);        //NULL
+}
+
+
+gtemplate *extgridtemplate(g2int number,g2int *list)
+/*!$$$  SUBPROGRAM DOCUMENTATION BLOCK
+!                .      .    .                                       .
+! SUBPROGRAM:    extgridtemplate 
+!   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2000-05-09
+!
+! ABSTRACT: This subroutine generates the remaining octet map for a 
+!   given Grid Definition Template, if required.  Some Templates can 
+!   vary depending on data values given in an earlier part of the 
+!   Template, and it is necessary to know some of the earlier entry
+!   values to generate the full octet map of the Template.
+!
+! PROGRAM HISTORY LOG:
+! 2000-05-09  Gilbert
+! 2008-07-08  Vuong     -  Added GDT 3.32768 Rotate Lat/Lon E-grid (Arakawa)
+! 2009-01-14  Vuong     -  Changed structure name template to gtemplate
+! 2010-05-11  Vuong     -  Added GDT 3.32769 Rotate Lat/Lon Non-E Staggered grid (Arakawa)
+! 2013-08-06  Vuong     -  Added GDT 3.4,3.5,3.12,3.101,3.140
+!
+! USAGE:    CALL extgridtemplate(number,list)
+!   INPUT ARGUMENT LIST:
+!     number   - NN, indicating the number of the Grid Definition 
+!                Template 3.NN that is being requested.
+!     list()   - The list of values for each entry in 
+!                the Grid Definition Template.
+!
+!   RETURN VALUE:
+!        - Pointer to the returned template struct.
+!          Returns NULL pointer, if template not found.
+!
+! ATTRIBUTES:
+!   LANGUAGE: C
+!   MACHINE:  IBM SP
+!
+!$$$*/
+{
+           gtemplate *new;
+           g2int index,i;
+
+           index=getgridindex(number);
+           if (index == -1) return(0);
+
+           new=getgridtemplate(number);
+
+           if ( ! new->needext ) return(new);
+
+           if ( number == 120 ) {
+              new->extlen=list[1]*2;
+              new->ext=(g2int *)malloc(sizeof(g2int)*new->extlen);
+              for (i=0;i<new->extlen;i++) {
+                 if ( i%2 == 0 ) {
+                    new->ext[i]=2;
+                 }
+                 else {
+                    new->ext[i]=-2;
+                 }
+              }
+           }
+           else if ( number == 4 ) {
+              new->extlen=list[7];
+              new->ext=(g2int *)malloc(sizeof(g2int)*new->extlen);
+              for (i=0;i<new->extlen;i++) {
+                 new->ext[i]=4;
+              }
+              new->extlen=list[8];
+              new->ext=(g2int *)malloc(sizeof(g2int)*new->extlen);
+              for (i=0;i<new->extlen;i++) {
+                 new->ext[i]=-4;
+              }
+           }
+           else if ( number == 5 ) {
+              new->extlen=list[7];
+              new->ext=(g2int *)malloc(sizeof(g2int)*new->extlen);
+              for (i=0;i<new->extlen;i++) {
+                 new->ext[i]=4;
+              }
+              new->extlen=list[8];
+              new->ext=(g2int *)malloc(sizeof(g2int)*new->extlen);
+              for (i=0;i<new->extlen;i++) {
+                 new->ext[i]=-4;
+              }
+           }
+           else if ( number == 1000 ) {
+              new->extlen=list[19];
+              new->ext=(g2int *)malloc(sizeof(g2int)*new->extlen);
+              for (i=0;i<new->extlen;i++) {
+                 new->ext[i]=4;
+              }
+           }
+           else if ( number == 1200 ) {
+              new->extlen=list[15];
+              new->ext=(g2int *)malloc(sizeof(g2int)*new->extlen);
+              for (i=0;i<new->extlen;i++) {
+                 new->ext[i]=4;
+              }
+           }
+
+           return(new);
+
+}
diff --git a/g2clib_src/gridtemplates.h b/g2clib_src/gridtemplates.h
new file mode 100755
index 0000000..f45a88f
--- /dev/null
+++ b/g2clib_src/gridtemplates.h
@@ -0,0 +1,121 @@
+#ifndef _gridtemplates_H
+#define _gridtemplates_H
+#include "grib2.h"
+
+//   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2001-10-26
+//
+// ABSTRACT: This Fortran Module contains info on all the available 
+//   GRIB2 Grid Definition Templates used in Section 3 (GDS).
+//   The information decribing each template is stored in the
+//   gridtemplate structure defined below.
+//
+//   Each Template has three parts: The number of entries in the template
+//   (mapgridlen);  A map of the template (mapgrid), which contains the
+//   number of octets in which to pack each of the template values; and
+//   a logical value (needext) that indicates whether the Template needs 
+//   to be extended.  In some cases the number of entries in a template 
+//   can vary depending upon values specified in the "static" part of 
+//   the template.  ( See Template 3.120 as an example )
+//
+//   NOTE:  Array mapgrid contains the number of octets in which the 
+//   corresponding template values will be stored.  A negative value in
+//   mapgrid is used to indicate that the corresponding template entry can
+//   contain negative values.  This information is used later when packing
+//   (or unpacking) the template data values.  Negative data values in GRIB
+//   are stored with the left most bit set to one, and a negative number
+//   of octets value in mapgrid[] indicates that this possibility should
+//   be considered.  The number of octets used to store the data value
+//   in this case would be the absolute value of the negative value in 
+//   mapgrid[].
+//  
+// PROGRAM HISTORY LOG:
+//
+// 2001-10-26  Gilbert
+// 2007-08-16  Vuong     -  Added GDT 3.204  Curvilinear Orthogonal Grid
+// 2008-07-08  Vuong     -  Added GDT 3.32768 Rot Lat/Lon E-grid (Arakawa)
+// 2010-05-11  Vuong     -  Added GDT 3.32769 Rotate Lat/Lon Non-E Staggered grid (Arakawa)
+// 2013-08-06  Vuong     -  Added GDT 3.4,3.5,3.12,3.101,3.140
+//
+////////////////////////////////////////////////////////////////////
+
+      #define MAXGRIDTEMP 31              // maximum number of templates
+      #define MAXGRIDMAPLEN 200           // maximum template map length
+
+      struct gridtemplate
+      {
+          g2int template_num;
+          g2int mapgridlen;
+          g2int needext;
+          g2int mapgrid[MAXGRIDMAPLEN];
+      };
+
+      const struct gridtemplate templatesgrid[MAXGRIDTEMP] = {
+             // 3.0: Lat/Lon grid
+         { 0, 19, 0, {1,1,4,1,4,1,4,4,4,4,4,-4,4,1,-4,4,4,4,1} },
+             // 3.1: Rotated Lat/Lon grid
+         { 1, 22, 0, {1,1,4,1,4,1,4,4,4,4,4,-4,4,1,-4,4,4,4,1,-4,4,4} },
+             // 3.2: Stretched Lat/Lon grid
+         { 2, 22, 0, {1,1,4,1,4,1,4,4,4,4,4,-4,4,1,-4,4,4,4,1,-4,4,-4} },
+             // 3.3: Stretched & Rotated Lat/Lon grid
+         { 3, 25, 0, {1,1,4,1,4,1,4,4,4,4,4,-4,4,1,-4,4,4,4,1,-4,4,4,-4,4,-4} },
+// Added GDT 3.4,3.5    (08/05/2013)
+             // 3.4: Variable resolution Latitude/Longitude
+         { 4, 13, 1, {1,1,4,1,4,1,4,4,4,4,4,1,1} },
+             // 3.5: Variable resolution rotate Latitude/Longitude
+         { 5, 16, 1, {1,1,4,1,4,1,4,4,4,4,4,1,1,-4,4,4} },
+             // 3.12: Transverse Mercator
+         {12, 22, 0, {1,1,4,1,4,1,4,4,4,-4,4,1,-4,4,4,1,4,4,-4,-4,-4,-4} },
+             // 3.101: General unstructured grid
+         {101, 4, 0, {1,4,1,-4} },
+             // 3.140: Lambert Azimuthal Equal Area Projection
+         {140, 17, 0, {1,1,4,1,4,1,4,4,4,-4,4,4,4,1,4,4,1} },
+//
+             // 3.10: Mercator
+         {10, 19, 0, {1,1,4,1,4,1,4,4,4,-4,4,1,-4,-4,4,1,4,4,4} },
+             // 3.20: Polar Stereographic Projection
+         {20, 18, 0, {1,1,4,1,4,1,4,4,4,-4,4,1,-4,4,4,4,1,1} },
+             // 3.30: Lambert Conformal
+         {30, 22, 0, {1,1,4,1,4,1,4,4,4,-4,4,1,-4,4,4,4,1,1,-4,-4,-4,4} },
+             // 3.31: Albers equal area
+         {31, 22, 0, {1,1,4,1,4,1,4,4,4,-4,4,1,-4,4,4,4,1,1,-4,-4,-4,4} },
+             // 3.40: Guassian Lat/Lon
+         {40, 19, 0, {1,1,4,1,4,1,4,4,4,4,4,-4,4,1,-4,4,4,4,1} },
+             // 3.41: Rotated Gaussian Lat/Lon
+         {41, 22, 0, {1,1,4,1,4,1,4,4,4,4,4,-4,4,1,-4,4,4,4,1,-4,4,4} },
+             // 3.42: Stretched Gaussian Lat/Lon
+         {42, 22, 0, {1,1,4,1,4,1,4,4,4,4,4,-4,4,1,-4,4,4,4,1,-4,4,-4} },
+             // 3.43: Stretched and Rotated Gaussian Lat/Lon
+         {43, 25, 0, {1,1,4,1,4,1,4,4,4,4,4,-4,4,1,-4,4,4,4,1,-4,4,4,-4,4,-4} },
+             // 3.50: Spherical Harmonic Coefficients
+         {50, 5, 0, {4,4,4,1,1} },
+             // 3.51: Rotated Spherical Harmonic Coefficients
+         {51, 8, 0, {4,4,4,1,1,-4,4,4} },
+             // 3.52: Stretched Spherical Harmonic Coefficients
+         {52, 8, 0, {4,4,4,1,1,-4,4,-4} },
+             // 3.53: Stretched and Rotated Spherical Harmonic Coefficients
+         {53, 11, 0, {4,4,4,1,1,-4,4,4,-4,4,-4} },
+             // 3.90: Space View Perspective or orthographic
+         {90, 21, 0, {1,1,4,1,4,1,4,4,4,-4,4,1,4,4,4,4,1,4,4,4,4} },
+             // 3.100: Triangular grid based on an icosahedron
+         {100, 11, 0, {1,1,2,1,-4,4,4,1,1,1,4} },
+             // 3.110: Equatorial Azimuthal equidistant
+         {110, 16, 0, {1,1,4,1,4,1,4,4,4,-4,4,1,4,4,1,1} },
+             // 3.120: Azimuth-range projection
+         {120, 7, 1, {4,4,-4,4,4,4,1} },
+             // 3.204: Curvilinear Orthogonal Grid
+         {204, 19, 0, {1,1,4,1,4,1,4,4,4,4,4,-4,4,1,-4,4,4,4,1} },
+             // 3.32768: Rot Lat/Lon E-grid (Arakawa)
+         {32768, 19, 0, {1,1,4,1,4,1,4,4,4,4,4,-4,4,1,-4,4,4,4,1} },
+             // 3.32769: Rot Lat/Lon Non-E Staggered grid (Arakawa)
+         {32769, 21, 0, {1,1,4,1,4,1,4,4,4,4,4,-4,4,1,-4,4,4,4,1,4,4} },
+             // 3.1000: Cross Section Grid
+         {1000, 20, 1, {1,1,4,1,4,1,4,4,4,4,-4,4,1,4,4,1,2,1,1,2} },
+             // 3.1100: Hovmoller Diagram Grid
+         {1100, 28, 0, {1,1,4,1,4,1,4,4,4,4,-4,4,1,-4,4,1,4,1,-4,1,1,-4,2,1,1,1,1,1} },
+             // 3.1200: Time Section Grid
+         {1200, 16, 1, {4,1,-4,1,1,-4,2,1,1,1,1,1,2,1,1,2} }
+
+      } ;
+
+
+#endif  /*  _gridtemplates_H  */
diff --git a/g2clib_src/int_power.c b/g2clib_src/int_power.c
new file mode 100755
index 0000000..76f645a
--- /dev/null
+++ b/g2clib_src/int_power.c
@@ -0,0 +1,30 @@
+#include "grib2.h"
+/*
+ * w. ebisuzaki
+ *
+ *  return x**y
+ *
+ *
+ *  input: double x
+ *         int y
+ */
+double int_power(double x, g2int y) {
+
+        double value;
+
+        if (y < 0) {
+                y = -y;
+                x = 1.0 / x;
+        }
+        value = 1.0;
+
+        while (y) {
+                if (y & 1) {
+                        value *= x;
+                }
+                x = x * x;
+                y >>= 1;
+        }
+        return value;
+}
+
diff --git a/g2clib_src/jpcpack.c b/g2clib_src/jpcpack.c
new file mode 100755
index 0000000..2666668
--- /dev/null
+++ b/g2clib_src/jpcpack.c
@@ -0,0 +1,175 @@
+#include <stdlib.h>
+#include <math.h>
+#include "grib2.h"
+
+int enc_jpeg2000(unsigned char *,g2int ,g2int ,g2int ,
+                 g2int , g2int, g2int , char *, g2int );
+
+void jpcpack(g2float *fld,g2int width,g2int height,g2int *idrstmpl,
+             unsigned char *cpack,g2int *lcpack)
+//$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    jpcpack
+//   PRGMMR: Gilbert          ORG: W/NP11    DATE: 2003-08-17
+//
+// ABSTRACT: This subroutine packs up a data field into a JPEG2000 code stream.
+//   After the data field is scaled, and the reference value is subtracted out,
+//   it is treated as a grayscale image and passed to a JPEG2000 encoder.
+//   It also fills in GRIB2 Data Representation Template 5.40 or 5.40000 with 
+//   the appropriate values.
+//
+// PROGRAM HISTORY LOG:
+// 2003-08-17  Gilbert
+// 2004-11-92  Gilbert  - Fixed bug encountered when packing a near constant
+//                        field.
+// 2004-07-19  Gilbert - Added check on whether the jpeg2000 encoding was
+//                       successful.  If not, try again with different encoder
+//                       options.
+// 2005-05-10  Gilbert - Imposed minimum size on cpack, used to hold encoded
+//                       bit string.
+//
+// USAGE:    jpcpack(g2float *fld,g2int width,g2int height,g2int *idrstmpl,
+//                   unsigned char *cpack,g2int *lcpack);
+//   INPUT ARGUMENT LIST:
+//     fld[]    - Contains the data values to pack
+//     width    - number of points in the x direction
+//     height   - number of points in the y direction
+//     idrstmpl - Contains the array of values for Data Representation
+//                Template 5.40 or 5.40000
+//                [0] = Reference value - ignored on input
+//                [1] = Binary Scale Factor
+//                [2] = Decimal Scale Factor
+//                [3] = number of bits for each data value - ignored on input
+//                [4] = Original field type - currently ignored on input
+//                      Data values assumed to be reals.
+//                [5] = 0 - use lossless compression
+//                    = 1 - use lossy compression
+//                [6] = Desired compression ratio, if idrstmpl[5]=1.
+//                      Set to 255, if idrstmpl[5]=0.
+//     lcpack   - size of array cpack[]
+//
+//   OUTPUT ARGUMENT LIST: 
+//     idrstmpl - Contains the array of values for Data Representation
+//                Template 5.0
+//                [0] = Reference value - set by jpcpack routine.
+//                [1] = Binary Scale Factor - unchanged from input
+//                [2] = Decimal Scale Factor - unchanged from input
+//                [3] = Number of bits containing each grayscale pixel value
+//                [4] = Original field type - currently set = 0 on output.
+//                      Data values assumed to be reals.
+//                [5] = 0 - use lossless compression
+//                    = 1 - use lossy compression
+//                [6] = Desired compression ratio, if idrstmpl[5]=1
+//     cpack    - The packed data field 
+//     lcpack   - length of packed field in cpack.
+//
+// REMARKS: None
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE:  IBM SP
+//
+//$$$
+{
+      g2int  *ifld;
+      static g2float alog2=0.69314718;       //  ln(2.0)
+      g2int  j,nbits,imin,imax,maxdif;
+      g2int  ndpts,nbytes,nsize,retry;
+      g2float  bscale,dscale,rmax,rmin,temp;
+      unsigned char *ctemp;
+      
+      ifld=0;
+      ndpts=width*height;
+      bscale=int_power(2.0,-idrstmpl[1]);
+      dscale=int_power(10.0,idrstmpl[2]);
+//
+//  Find max and min values in the data
+//
+      rmax=fld[0];
+      rmin=fld[0];
+      for (j=1;j<ndpts;j++) {
+        if (fld[j] > rmax) rmax=fld[j];
+        if (fld[j] < rmin) rmin=fld[j];
+      }
+      if (idrstmpl[1] == 0) 
+         maxdif = (g2int) (rint(rmax*dscale) - rint(rmin*dscale));
+      else
+         maxdif = (g2int)rint( (rmax-rmin)*dscale*bscale );
+//
+//  If max and min values are not equal, pack up field.
+//  If they are equal, we have a constant field, and the reference
+//  value (rmin) is the value for each point in the field and
+//  set nbits to 0.
+//
+      if ( rmin != rmax  &&  maxdif != 0 ) {
+        ifld=(g2int *)malloc(ndpts*sizeof(g2int));
+        //
+        //  Determine which algorithm to use based on user-supplied 
+        //  binary scale factor and number of bits.
+        //
+        if (idrstmpl[1] == 0) {
+           //
+           //  No binary scaling and calculate minumum number of 
+           //  bits in which the data will fit.
+           //
+           imin=(g2int)rint(rmin*dscale);
+           imax=(g2int)rint(rmax*dscale);
+           maxdif=imax-imin;
+           temp=log((double)(maxdif+1))/alog2;
+           nbits=(g2int)ceil(temp);
+           rmin=(g2float)imin;
+           //   scale data
+           for(j=0;j<ndpts;j++)
+             ifld[j]=(g2int)rint(fld[j]*dscale)-imin;
+        }
+        else {
+           //
+           //  Use binary scaling factor and calculate minumum number of 
+           //  bits in which the data will fit.
+           //
+           rmin=rmin*dscale;
+           rmax=rmax*dscale;
+           maxdif=(g2int)rint((rmax-rmin)*bscale);
+           temp=log((double)(maxdif+1))/alog2;
+           nbits=(g2int)ceil(temp);
+           //   scale data
+           for (j=0;j<ndpts;j++)
+             ifld[j]=(g2int)rint(((fld[j]*dscale)-rmin)*bscale);
+        }
+        //
+        //  Pack data into full octets, then do JPEG 2000 encode.
+        //  and calculate the length of the packed data in bytes
+        //
+        retry=0;
+        nbytes=(nbits+7)/8;
+        nsize=*lcpack;          // needed for input to enc_jpeg2000
+        ctemp=calloc(ndpts,nbytes);
+        sbits(ctemp,ifld,0,nbytes*8,0,ndpts);
+        *lcpack=(g2int)enc_jpeg2000(ctemp,width,height,nbits,idrstmpl[5],idrstmpl[6],retry,(char *)cpack,nsize);
+        if (*lcpack <= 0) {
+           printf("jpcpack: ERROR Packing JPC = %d\n",(int)*lcpack);
+           if ( *lcpack == -3 ) {
+              retry=1;
+              *lcpack=(g2int)enc_jpeg2000(ctemp,width,height,nbits,idrstmpl[5],idrstmpl[6],retry,(char *)cpack,nsize);
+              if ( *lcpack <= 0 ) printf("jpcpack: Retry Failed.\n");
+              else printf("jpcpack: Retry Successful.\n");
+           }
+        }
+        free(ctemp);
+
+      }
+      else {
+        nbits=0;
+        *lcpack=0;
+      }
+
+//
+//  Fill in ref value and number of bits in Template 5.0
+//
+      mkieee(&rmin,idrstmpl+0,1);   // ensure reference value is IEEE format
+      idrstmpl[3]=nbits;
+      idrstmpl[4]=0;         // original data were reals
+      if (idrstmpl[5] == 0) idrstmpl[6]=255;       // lossy not used
+      if (ifld != 0) free(ifld);
+
+}
diff --git a/g2clib_src/jpcunpack.c b/g2clib_src/jpcunpack.c
new file mode 100755
index 0000000..d3744ba
--- /dev/null
+++ b/g2clib_src/jpcunpack.c
@@ -0,0 +1,72 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include "grib2.h"
+
+   int dec_jpeg2000(char *,g2int ,g2int *);
+
+g2int jpcunpack(unsigned char *cpack,g2int len,g2int *idrstmpl,g2int ndpts,
+                g2float *fld)
+//$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    jpcunpack
+//   PRGMMR: Gilbert          ORG: W/NP11    DATE: 2003-08-27
+//
+// ABSTRACT: This subroutine unpacks a data field that was packed into a 
+//   JPEG2000 code stream
+//   using info from the GRIB2 Data Representation Template 5.40 or 5.40000.
+//
+// PROGRAM HISTORY LOG:
+// 2003-08-27  Gilbert
+//
+// USAGE:    jpcunpack(unsigned char *cpack,g2int len,g2int *idrstmpl,g2int ndpts,
+//                     g2float *fld)
+//   INPUT ARGUMENT LIST:
+//     cpack    - The packed data field (character*1 array)
+//     len      - length of packed field cpack().
+//     idrstmpl - Pointer to array of values for Data Representation
+//                Template 5.40 or 5.40000
+//     ndpts    - The number of data values to unpack
+//
+//   OUTPUT ARGUMENT LIST:
+//     fld[]    - Contains the unpacked data values
+//
+// REMARKS: None
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE:  IBM SP
+//
+//$$$
+{
+
+      g2int  *ifld;
+      g2int  j,nbits,iret;
+      g2float  ref,bscale,dscale;
+
+      rdieee(idrstmpl+0,&ref,1);
+      bscale = int_power(2.0,idrstmpl[1]);
+      dscale = int_power(10.0,-idrstmpl[2]);
+      nbits = idrstmpl[3];
+//
+//  if nbits equals 0, we have a constant field where the reference value
+//  is the data value at each gridpoint
+//
+      if (nbits != 0) {
+
+         ifld=(g2int *)calloc(ndpts,sizeof(g2int));
+         if ( ifld == 0 ) {
+            fprintf(stderr,"Could not allocate space in jpcunpack.\n  Data field NOT upacked.\n");
+            return(1);
+         }
+         iret=(g2int)dec_jpeg2000(cpack,len,ifld);
+         for (j=0;j<ndpts;j++) {
+           fld[j]=(((g2float)ifld[j]*bscale)+ref)*dscale;
+         }
+         free(ifld);
+      }
+      else {
+         for (j=0;j<ndpts;j++) fld[j]=ref;
+      }
+
+      return(0);
+}
diff --git a/g2clib_src/makefile b/g2clib_src/makefile
new file mode 100755
index 0000000..79a9677
--- /dev/null
+++ b/g2clib_src/makefile
@@ -0,0 +1,92 @@
+SHELL=/bin/sh
+
+#  If you want to enable support for PNG or JPEG2000 encoding/decoding,
+#  you must specify -DUSE_PNG and/or -DUSE_JPEG2000 in the DEFS variable
+#  for the C pre-processor
+#  -DUSE_PNG requires libpng.a and libz.a
+#                     ( and png.h pngconf.h zconf.h zlib.h include files).
+#  -DUSE_JPEG2000 requires libjasper.a
+#                     ( and all the jasper/*.h include files).
+#
+#  In addition, INC must include all directories where the above
+#  mentioned include files can be found.
+DEFS=-DUSE_JPEG2000 -DUSE_PNG
+
+#
+# Please make sure to include all idirectories where include files  
+#     can be found (jasper/*.h and png.h pngconf.h zconf.h zlib.h)
+#
+
+INC=-I/export/lnx102/wd42bv/jasper-1.900.1/src/libjasper/include
+
+#
+#   This "C" source code contains many uses of the C++
+#   comment style "//".  Please make sure you include the
+#   appropriate compiler flag to allow the use of "//" comment indicators.
+#
+
+CFLAGS= $(INC) $(DEFS)
+
+CC=cc
+
+LIB=libgrib2c.a
+ARFLAGS=
+
+all: $(LIB)
+
+$(LIB)(gridtemplates.o): gridtemplates.h
+
+$(LIB)(pdstemplates.o): pdstemplates.h
+
+$(LIB)(drstemplates.o): drstemplates.h
+
+$(LIB):	$(LIB)(gridtemplates.o) \
+	$(LIB)(drstemplates.o) \
+	$(LIB)(pdstemplates.o) \
+	$(LIB)(gbits.o) \
+	$(LIB)(g2_unpack1.o) \
+	$(LIB)(g2_unpack2.o) \
+	$(LIB)(g2_unpack3.o) \
+	$(LIB)(g2_unpack4.o) \
+	$(LIB)(g2_unpack5.o) \
+	$(LIB)(g2_unpack6.o) \
+	$(LIB)(g2_unpack7.o) \
+	$(LIB)(g2_free.o) \
+	$(LIB)(g2_info.o) \
+	$(LIB)(g2_getfld.o) \
+	$(LIB)(simunpack.o) \
+	$(LIB)(comunpack.o) \
+        $(LIB)(pack_gp.o) \
+        $(LIB)(reduce.o) \
+	$(LIB)(specpack.o) \
+	$(LIB)(specunpack.o) \
+	$(LIB)(rdieee.o) \
+	$(LIB)(mkieee.o) \
+	$(LIB)(int_power.o) \
+	$(LIB)(simpack.o) \
+	$(LIB)(compack.o) \
+        $(LIB)(cmplxpack.o) \
+	$(LIB)(misspack.o) \
+	$(LIB)(jpcpack.o) \
+	$(LIB)(jpcunpack.o) \
+	$(LIB)(pngpack.o) \
+	$(LIB)(pngunpack.o) \
+	$(LIB)(dec_jpeg2000.o) \
+	$(LIB)(enc_jpeg2000.o) \
+	$(LIB)(dec_png.o) \
+	$(LIB)(enc_png.o) \
+	$(LIB)(g2_create.o) \
+	$(LIB)(g2_addlocal.o) \
+	$(LIB)(g2_addgrid.o) \
+	$(LIB)(g2_addfield.o) \
+	$(LIB)(g2_gribend.o) \
+	$(LIB)(getdim.o) \
+	$(LIB)(g2_miss.o) \
+	$(LIB)(getpoly.o) \
+	$(LIB)(seekgb.o)
+
+.c.a:
+	$(CC) -c $(CFLAGS) $<
+	ar $(ARFLAGS) -ruv $@ $*.o
+	rm -f $*.o
+
diff --git a/g2clib_src/misspack.c b/g2clib_src/misspack.c
new file mode 100755
index 0000000..e631ddd
--- /dev/null
+++ b/g2clib_src/misspack.c
@@ -0,0 +1,532 @@
+#include <stdlib.h>
+#include <math.h>
+#include "grib2.h"
+
+void misspack(g2float *fld,g2int ndpts,g2int idrsnum,g2int *idrstmpl,
+              unsigned char *cpack, g2int *lcpack)
+//$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    misspack
+//   PRGMMR: Gilbert          ORG: W/NP11    DATE: 2000-06-21
+//
+// ABSTRACT: This subroutine packs up a data field using a complex
+//   packing algorithm as defined in the GRIB2 documention.  It
+//   supports GRIB2 complex packing templates with or without
+//   spatial differences (i.e. DRTs 5.2 and 5.3).
+//   It also fills in GRIB2 Data Representation Template 5.2 or 5.3 
+//   with the appropriate values.
+//   This version assumes that Missing Value Management is being used and that
+//   1 or 2 missing values appear in the data.
+//
+// PROGRAM HISTORY LOG:
+// 2000-06-21  Gilbert
+//
+// USAGE:    misspack(g2float *fld,g2int ndpts,g2int idrsnum,g2int *idrstmpl,
+//                    unsigned char *cpack, g2int *lcpack)
+//   INPUT ARGUMENT LIST:
+//     fld[]    - Contains the data values to pack
+//     ndpts    - The number of data values in array fld[]
+//     idrsnum  - Data Representation Template number 5.N
+//                Must equal 2 or 3.
+//     idrstmpl - Contains the array of values for Data Representation
+//                Template 5.2 or 5.3
+//                [0] = Reference value - ignored on input
+//                [1] = Binary Scale Factor
+//                [2] = Decimal Scale Factor
+//                    .
+//                    .
+//                [6] = Missing value management
+//                [7] = Primary missing value
+//                [8] = Secondary missing value
+//                    .
+//                    .
+//               [16] = Order of Spatial Differencing  ( 1 or 2 )
+//                    .
+//                    .
+//
+//   OUTPUT ARGUMENT LIST: 
+//     idrstmpl - Contains the array of values for Data Representation
+//                Template 5.3
+//                [0] = Reference value - set by misspack routine.
+//                [1] = Binary Scale Factor - unchanged from input
+//                [2] = Decimal Scale Factor - unchanged from input
+//                    .
+//                    .
+//     cpack    - The packed data field (character*1 array)
+//     *lcpack   - length of packed field cpack().
+//
+// REMARKS: None
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE:  
+//
+//$$$
+{
+
+      g2int  *ifld, *ifldmiss, *jfld;
+      g2int  *jmin, *jmax, *lbit;
+      static g2int zero=0;
+      g2int  *gref, *gwidth, *glen;
+      g2int  glength, grpwidth;
+      g2int  i, n, iofst, imin, ival1, ival2, isd, minsd, nbitsd;
+      g2int  nbitsgref, left, iwmax, ngwidthref, nbitsgwidth, ilmax;
+      g2int  nglenref, nglenlast, nbitsglen, ij;
+      g2int  j, missopt, nonmiss, itemp, maxorig, nbitorig, miss1, miss2;
+      g2int  ngroups, ng, num0, num1, num2;
+      g2int  imax, lg, mtemp, ier, igmax;
+      g2int  kfildo, minpk, inc, maxgrps, ibit, jbit, kbit, novref, lbitref;
+      g2float  rmissp, rmisss, bscale, dscale, rmin, temp;
+      static g2int simple_alg = 0;
+      static g2float alog2=0.69314718;       //  ln(2.0)
+      static g2int one=1;
+      
+      bscale=int_power(2.0,-idrstmpl[1]);
+      dscale=int_power(10.0,idrstmpl[2]);
+      missopt=idrstmpl[6];
+      if ( missopt != 1 && missopt != 2 ) {
+         printf("misspack: Unrecognized option.\n");
+         *lcpack=-1;
+         return;
+      }
+      else {    //  Get missing values
+         rdieee(idrstmpl+7,&rmissp,1);
+         if (missopt == 2) rdieee(idrstmpl+8,&rmisss,1);
+      }
+//
+//  Find min value of non-missing values in the data,
+//  AND set up missing value mapping of the field.
+//
+      ifldmiss = calloc(ndpts,sizeof(g2int));
+      rmin=1E+37;
+      if ( missopt ==  1 ) {        // Primary missing value only
+         for ( j=0; j<ndpts; j++) {
+           if (fld[j] == rmissp) {
+              ifldmiss[j]=1;
+           }
+           else {
+              ifldmiss[j]=0;
+              if (fld[j] < rmin) rmin=fld[j];
+           }
+         }
+      }
+      if ( missopt ==  2 ) {        // Primary and secondary missing values
+         for ( j=0; j<ndpts; j++ ) {
+           if (fld[j] == rmissp) {
+              ifldmiss[j]=1;
+           }
+           else if (fld[j] == rmisss) {
+              ifldmiss[j]=2;
+           }
+           else {
+              ifldmiss[j]=0;
+              if (fld[j] < rmin) rmin=fld[j];
+           }
+         }
+      }
+//
+//  Allocate work arrays:
+//  Note: -ifldmiss[j],j=0,ndpts-1 is a map of original field indicating 
+//         which of the original data values
+//         are primary missing (1), sencondary missing (2) or non-missing (0).
+//        -jfld[j],j=0,nonmiss-1 is a subarray of just the non-missing values 
+//         from the original field.
+//
+      //if (rmin != rmax) {
+        iofst=0;
+        ifld = calloc(ndpts,sizeof(g2int));
+        jfld = calloc(ndpts,sizeof(g2int));
+        gref = calloc(ndpts,sizeof(g2int));
+        gwidth = calloc(ndpts,sizeof(g2int));
+        glen = calloc(ndpts,sizeof(g2int));
+        //
+        //  Scale original data
+        //
+        nonmiss=0;
+        if (idrstmpl[1] == 0) {        //  No binary scaling
+           imin=(g2int)rint(rmin*dscale);
+           //imax=(g2int)rint(rmax*dscale);
+           rmin=(g2float)imin;
+           for ( j=0; j<ndpts; j++) {
+              if (ifldmiss[j] == 0) {
+                jfld[nonmiss]=(g2int)rint(fld[j]*dscale)-imin;
+                nonmiss++;
+              }
+           }
+        }
+        else {                             //  Use binary scaling factor
+           rmin=rmin*dscale;
+           //rmax=rmax*dscale;
+           for ( j=0; j<ndpts; j++ ) {
+              if (ifldmiss[j] == 0) {
+                jfld[nonmiss]=(g2int)rint(((fld[j]*dscale)-rmin)*bscale);
+                nonmiss++;
+              }
+           }
+        }
+        //
+        //  Calculate Spatial differences, if using DRS Template 5.3
+        //
+        if (idrsnum == 3) {        // spatial differences
+           if (idrstmpl[16]!=1 && idrstmpl[16]!=2) idrstmpl[16]=2;
+           if (idrstmpl[16] == 1) {      // first order
+              ival1=jfld[0];
+              for ( j=nonmiss-1; j>0; j--)
+                 jfld[j]=jfld[j]-jfld[j-1];
+              jfld[0]=0;
+           }
+           else if (idrstmpl[16] == 2) {      // second order
+              ival1=jfld[0];
+              ival2=jfld[1];
+              for ( j=nonmiss-1; j>1; j--)
+                 jfld[j]=jfld[j]-(2*jfld[j-1])+jfld[j-2];
+              jfld[0]=0;
+              jfld[1]=0;
+           }
+           //
+           //  subtract min value from spatial diff field
+           //
+           isd=idrstmpl[16];
+           minsd=jfld[isd];
+           for ( j=isd; j<nonmiss; j++ ) if ( jfld[j] < minsd ) minsd=jfld[j];
+           for ( j=isd; j<nonmiss; j++ ) jfld[j]=jfld[j]-minsd;
+           //
+           //   find num of bits need to store minsd and add 1 extra bit
+           //   to indicate sign
+           //
+           temp=log((double)(abs(minsd)+1))/alog2;
+           nbitsd=(g2int)ceil(temp)+1;
+           //
+           //   find num of bits need to store ifld[0] ( and ifld[1]
+           //   if using 2nd order differencing )
+           //
+           maxorig=ival1;
+           if (idrstmpl[16]==2 && ival2>ival1) maxorig=ival2;
+           temp=log((double)(maxorig+1))/alog2;
+           nbitorig=(g2int)ceil(temp)+1;
+           if (nbitorig > nbitsd) nbitsd=nbitorig;
+           //   increase number of bits to even multiple of 8 ( octet )
+           if ( (nbitsd%8) != 0) nbitsd=nbitsd+(8-(nbitsd%8));
+           //
+           //  Store extra spatial differencing info into the packed
+           //  data section.
+           //
+           if (nbitsd != 0) {
+              //   pack first original value
+              if (ival1 >= 0) {
+                 sbit(cpack,&ival1,iofst,nbitsd);
+                 iofst=iofst+nbitsd;
+              }
+              else {
+                 sbit(cpack,&one,iofst,1);
+                 iofst=iofst+1;
+                 itemp=abs(ival1);
+                 sbit(cpack,&itemp,iofst,nbitsd-1);
+                 iofst=iofst+nbitsd-1;
+              }
+              if (idrstmpl[16] == 2) {
+               //  pack second original value
+                 if (ival2 >= 0) {
+                    sbit(cpack,&ival2,iofst,nbitsd);
+                    iofst=iofst+nbitsd;
+                 }
+                 else {
+                    sbit(cpack,&one,iofst,1);
+                    iofst=iofst+1;
+                    itemp=abs(ival2);
+                    sbit(cpack,&itemp,iofst,nbitsd-1);
+                    iofst=iofst+nbitsd-1;
+                 }
+              }
+              //  pack overall min of spatial differences
+              if (minsd >= 0) {
+                 sbit(cpack,&minsd,iofst,nbitsd);
+                 iofst=iofst+nbitsd;
+              }
+              else {
+                 sbit(cpack,&one,iofst,1);
+                 iofst=iofst+1;
+                 itemp=abs(minsd);
+                 sbit(cpack,&itemp,iofst,nbitsd-1);
+                 iofst=iofst+nbitsd-1;
+              }
+           }
+         //print *,'SDp ',ival1,ival2,minsd,nbitsd
+        }       //  end of spatial diff section
+        //
+        //  Expand non-missing data values to original grid.
+        //
+        miss1=jfld[0];
+        for ( j=0; j<nonmiss; j++) if (jfld[j] < miss1) miss1 = jfld[j];
+        miss1--;
+        miss2=miss1-1;
+        n=0;
+        for ( j=0; j<ndpts; j++) {
+           if ( ifldmiss[j] == 0 ) {
+              ifld[j]=jfld[n];
+              n++;
+           }
+           else if ( ifldmiss[j] == 1 ) {
+              ifld[j]=miss1;
+           }
+           else if ( ifldmiss[j] == 2 ) {
+              ifld[j]=miss2;
+           }
+        }
+        //
+        //   Determine Groups to be used.
+        //
+        if ( simple_alg == 1 ) {
+           //  set group length to 10 :  calculate number of groups
+           //  and length of last group
+           ngroups=ndpts/10;
+           for (j=0;j<ngroups;j++) glen[j]=10;
+           itemp=ndpts%10;
+           if (itemp != 0) {
+              ngroups++;
+              glen[ngroups-1]=itemp;
+           }
+        }
+        else {
+           // Use Dr. Glahn's algorithm for determining grouping.
+           //
+           kfildo=6;
+           minpk=10;
+           inc=1;
+           maxgrps=(ndpts/minpk)+1;
+           jmin = calloc(maxgrps,sizeof(g2int));
+           jmax = calloc(maxgrps,sizeof(g2int));
+           lbit = calloc(maxgrps,sizeof(g2int));
+           pack_gp(&kfildo,ifld,&ndpts,&missopt,&minpk,&inc,&miss1,&miss2,
+                        jmin,jmax,lbit,glen,&maxgrps,&ngroups,&ibit,&jbit,
+                        &kbit,&novref,&lbitref,&ier);
+           //printf("SAGier = %d %d %d %d %d %d\n",ier,ibit,jbit,kbit,novref,lbitref);
+           for ( ng=0; ng<ngroups; ng++) glen[ng]=glen[ng]+novref;
+           free(jmin);
+           free(jmax);
+           free(lbit);
+        }
+        //  
+        //  For each group, find the group's reference value (min)
+        //  and the number of bits needed to hold the remaining values
+        //
+        n=0;
+        for ( ng=0; ng<ngroups; ng++) {
+           //  how many of each type?
+           num0=num1=num2=0;
+           for (j=n; j<n+glen[ng]; j++) {
+               if (ifldmiss[j] == 0 ) num0++;
+               if (ifldmiss[j] == 1 ) num1++;
+               if (ifldmiss[j] == 2 ) num2++;
+           }
+           if ( num0 == 0 ) {      // all missing values
+              if ( num1 == 0 ) {       // all secondary missing
+                gref[ng]=-2;
+                gwidth[ng]=0;
+              }
+              else if ( num2 == 0 ) {       // all primary missing
+                gref[ng]=-1;
+                gwidth[ng]=0;
+              }
+              else {                          // both primary and secondary
+                gref[ng]=0;
+                gwidth[ng]=1;
+              }
+           }
+           else {                      // contains some non-missing data
+             //    find max and min values of group
+             gref[ng]=2147483647;
+             imax=-2147483647;
+             j=n;
+             for ( lg=0; lg<glen[ng]; lg++ ) {
+                if ( ifldmiss[j] == 0 ) {
+                  if (ifld[j] < gref[ng]) gref[ng]=ifld[j];
+                  if (ifld[j] > imax) imax=ifld[j]; 
+                }
+                j++;
+             }
+             if (missopt == 1) imax=imax+1;
+             if (missopt == 2) imax=imax+2;
+             //   calc num of bits needed to hold data
+             if ( gref[ng] != imax ) {
+                temp=log((double)(imax-gref[ng]+1))/alog2;
+                gwidth[ng]=(g2int)ceil(temp);
+             }
+             else {
+                gwidth[ng]=0;
+             }
+           }
+           //   Subtract min from data
+           j=n;
+           mtemp=(g2int)int_power(2.,gwidth[ng]);
+           for ( lg=0; lg<glen[ng]; lg++ ) {
+              if (ifldmiss[j] == 0)            // non-missing
+                 ifld[j]=ifld[j]-gref[ng];
+              else if (ifldmiss[j] == 1)         // primary missing
+                 ifld[j]=mtemp-1;
+              else if (ifldmiss[j] == 2)         // secondary missing
+                 ifld[j]=mtemp-2;
+              
+              j++;
+           }
+           //   increment fld array counter
+           n=n+glen[ng];
+        }
+        //  
+        //  Find max of the group references and calc num of bits needed 
+        //  to pack each groups reference value, then
+        //  pack up group reference values
+        //
+        //printf(" GREFS: ");
+        //for (j=0;j<ngroups;j++) printf(" %d",gref[j]); printf("\n");
+        igmax=gref[0];
+        for (j=1;j<ngroups;j++) if (gref[j] > igmax) igmax=gref[j];
+        if (missopt == 1) igmax=igmax+1;
+        if (missopt == 2) igmax=igmax+2;
+        if (igmax != 0) {
+           temp=log((double)(igmax+1))/alog2;
+           nbitsgref=(g2int)ceil(temp);
+           // reset the ref values of any "missing only" groups.
+           mtemp=(g2int)int_power(2.,nbitsgref);
+           for ( j=0; j<ngroups; j++ ) {
+               if (gref[j] == -1) gref[j]=mtemp-1;
+               if (gref[j] == -2) gref[j]=mtemp-2;
+           }
+           sbits(cpack,gref,iofst,nbitsgref,0,ngroups);
+           itemp=nbitsgref*ngroups;
+           iofst=iofst+itemp;
+           //         Pad last octet with Zeros, if necessary,
+           if ( (itemp%8) != 0) {
+              left=8-(itemp%8);
+              sbit(cpack,&zero,iofst,left);
+              iofst=iofst+left;
+           }
+        }
+        else {
+           nbitsgref=0;
+        }
+        //
+        //  Find max/min of the group widths and calc num of bits needed
+        //  to pack each groups width value, then
+        //  pack up group width values
+        //
+        //write(77,*)'GWIDTHS: ',(gwidth(j),j=1,ngroups)
+        iwmax=gwidth[0];
+        ngwidthref=gwidth[0];
+        for (j=1;j<ngroups;j++) {
+           if (gwidth[j] > iwmax) iwmax=gwidth[j];
+           if (gwidth[j] < ngwidthref) ngwidthref=gwidth[j];
+        }
+        if (iwmax != ngwidthref) {
+           temp=log((double)(iwmax-ngwidthref+1))/alog2;
+           nbitsgwidth=(g2int)ceil(temp);
+           for ( i=0; i<ngroups; i++) gwidth[i]=gwidth[i]-ngwidthref;
+           sbits(cpack,gwidth,iofst,nbitsgwidth,0,ngroups);
+           itemp=nbitsgwidth*ngroups;
+           iofst=iofst+itemp;
+           //         Pad last octet with Zeros, if necessary,
+           if ( (itemp%8) != 0) {
+              left=8-(itemp%8);
+              sbit(cpack,&zero,iofst,left);
+              iofst=iofst+left;
+           }
+        }
+        else {
+           nbitsgwidth=0;
+           for (i=0;i<ngroups;i++) gwidth[i]=0;
+        }
+        //
+        //  Find max/min of the group lengths and calc num of bits needed
+        //  to pack each groups length value, then
+        //  pack up group length values
+        //
+        //printf(" GLENS: ");
+        //for (j=0;j<ngroups;j++) printf(" %d",glen[j]); printf("\n");
+        ilmax=glen[0];
+        nglenref=glen[0];
+        for (j=1;j<ngroups-1;j++) {
+           if (glen[j] > ilmax) ilmax=glen[j];
+           if (glen[j] < nglenref) nglenref=glen[j];
+        }
+        nglenlast=glen[ngroups-1];
+        if (ilmax != nglenref) {
+           temp=log((double)(ilmax-nglenref+1))/alog2;
+           nbitsglen=(g2int)ceil(temp);
+           for ( i=0; i<ngroups-1; i++) glen[i]=glen[i]-nglenref;
+           sbits(cpack,glen,iofst,nbitsglen,0,ngroups);
+           itemp=nbitsglen*ngroups;
+           iofst=iofst+itemp;
+           //         Pad last octet with Zeros, if necessary,
+           if ( (itemp%8) != 0) {
+              left=8-(itemp%8);
+              sbit(cpack,&zero,iofst,left);
+              iofst=iofst+left;
+           }
+        }
+        else {
+           nbitsglen=0;
+           for (i=0;i<ngroups;i++) glen[i]=0;
+        }
+        //
+        //  For each group, pack data values
+        //
+        //write(77,*)'IFLDS: ',(ifld(j),j=1,ndpts)
+        n=0;
+        ij=0;
+        for ( ng=0; ng<ngroups; ng++) {
+           glength=glen[ng]+nglenref;
+           if (ng == (ngroups-1) ) glength=nglenlast;
+           grpwidth=gwidth[ng]+ngwidthref;
+       //write(77,*)'NGP ',ng,grpwidth,glength,gref(ng)
+           if ( grpwidth != 0 ) {
+              sbits(cpack,ifld+n,iofst,grpwidth,0,glength);
+              iofst=iofst+(grpwidth*glength);
+           }
+       //  do kk=1,glength
+       //     ij=ij+1
+       //write(77,*)'SAG ',ij,fld(ij),ifld(ij),gref(ng),bscale,rmin,dscale
+       //  enddo
+           n=n+glength;
+        }
+        //         Pad last octet with Zeros, if necessary,
+        if ( (iofst%8) != 0) {
+           left=8-(iofst%8);
+           sbit(cpack,&zero,iofst,left);
+           iofst=iofst+left;
+        }
+        *lcpack=iofst/8;
+        //
+        if ( ifld != 0 ) free(ifld);
+        if ( jfld != 0 ) free(jfld);
+        if ( ifldmiss != 0 ) free(ifldmiss);
+        if ( gref != 0 ) free(gref);
+        if ( gwidth != 0 ) free(gwidth);
+        if ( glen != 0 ) free(glen);
+      //}
+      //else {          //   Constant field ( max = min )
+      //  nbits=0;
+      //  *lcpack=0;
+      //  nbitsgref=0;
+      //  ngroups=0;
+      //}
+
+//
+//  Fill in ref value and number of bits in Template 5.2
+//
+      mkieee(&rmin,idrstmpl+0,1);   // ensure reference value is IEEE format
+      idrstmpl[3]=nbitsgref;
+      idrstmpl[4]=0;         // original data were reals
+      idrstmpl[5]=1;         // general group splitting
+      idrstmpl[9]=ngroups;          // Number of groups
+      idrstmpl[10]=ngwidthref;       // reference for group widths
+      idrstmpl[11]=nbitsgwidth;      // num bits used for group widths
+      idrstmpl[12]=nglenref;         // Reference for group lengths
+      idrstmpl[13]=1;                // length increment for group lengths
+      idrstmpl[14]=nglenlast;        // True length of last group
+      idrstmpl[15]=nbitsglen;        // num bits used for group lengths
+      if (idrsnum == 3) {
+         idrstmpl[17]=nbitsd/8;      // num bits used for extra spatial
+                                     // differencing values
+      }
+
+}
diff --git a/g2clib_src/mkieee.c b/g2clib_src/mkieee.c
new file mode 100755
index 0000000..2cac991
--- /dev/null
+++ b/g2clib_src/mkieee.c
@@ -0,0 +1,123 @@
+#include <stdlib.h>
+#include <math.h>
+#include "grib2.h"
+
+
+void mkieee(g2float *a,g2int *rieee,g2int num)
+//$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    mkieee 
+//   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2002-10-29
+//
+// ABSTRACT: This subroutine stores a list of real values in 
+//   32-bit IEEE floating point format.
+//
+// PROGRAM HISTORY LOG:
+// 2002-10-29  Gilbert
+//
+// USAGE:    mkieee(g2float *a,g2int *rieee,g2int num);
+//   INPUT ARGUMENT LIST:
+//     a        - Input array of floating point values.
+//     num      - Number of floating point values to convert.
+//
+//   OUTPUT ARGUMENT LIST:      
+//     rieee    - Output array of data values in 32-bit IEEE format
+//                stored in g2int integer array.  rieee must be allocated
+//                with at least 4*num bytes of memory before calling this
+//                function.
+//
+// REMARKS: None
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE:  
+//
+//$$$
+{
+
+      g2int  j,n,ieee,iexp,imant;
+      double  alog2,atemp;
+
+      static double  two23,two126;
+      static g2int test=0;
+    //g2intu msk1=0x80000000;        // 10000000000000000000000000000000 binary
+    //g2int msk2=0x7F800000;         // 01111111100000000000000000000000 binary
+    //g2int msk3=0x007FFFFF;         // 00000000011111111111111111111111 binary
+
+      if ( test == 0 ) {
+         two23=(double)int_power(2.0,23);
+         two126=(double)int_power(2.0,126);
+         test=1;
+      }
+
+      alog2=0.69314718;       //  ln(2.0)
+
+      for (j=0;j<num;j++) {
+      
+        ieee=0;
+
+        if (a[j] == 0.0) {
+          rieee[j]=ieee;
+          continue;
+        }
+        
+//
+//  Set Sign bit (bit 31 - leftmost bit)
+//
+        if (a[j] < 0.0) {
+          ieee= 1 << 31;
+          atemp=-1.0*a[j];
+        }
+        else {
+          ieee= 0 << 31;
+          atemp=a[j];
+        }
+        //printf("sign %ld %x \n",ieee,ieee);
+//
+//  Determine exponent n with base 2
+//
+        if ( atemp >= 1.0 ) {
+           n = 0;
+           while ( int_power(2.0,n+1) <= atemp ) {
+              n++;
+           }
+        }
+        else {
+           n = -1;
+           while ( int_power(2.0,n) > atemp ) {
+              n--;
+           }
+        }
+        //n=(g2int)floor(log(atemp)/alog2);
+        iexp=n+127;
+        if (n >  127) iexp=255;     // overflow
+        if (n < -127) iexp=0;
+        //printf("exp %ld %ld \n",iexp,n);
+        //      set exponent bits ( bits 30-23 )
+        ieee = ieee | ( iexp << 23 );
+//
+//  Determine Mantissa
+// 
+        if (iexp != 255) {
+          if (iexp != 0) 
+            atemp=(atemp/int_power(2.0,n))-1.0;
+          else
+            atemp=atemp*two126;
+          imant=(g2int)rint(atemp*two23);
+        }
+        else {
+          imant=0;
+        }
+        //printf("mant %ld %x \n",imant,imant);
+        //      set mantissa bits ( bits 22-0 )
+        ieee = ieee | imant;
+//
+//  Transfer IEEE bit string to rieee array
+//
+        rieee[j]=ieee;
+
+      }
+
+      return;
+
+}
diff --git a/g2clib_src/pack_gp.c b/g2clib_src/pack_gp.c
new file mode 100644
index 0000000..2eaa00e
--- /dev/null
+++ b/g2clib_src/pack_gp.c
@@ -0,0 +1,1447 @@
+/* pack_gp.f -- translated by f2c (version 20031025).
+   You must link the resulting object file with libf2c:
+	on Microsoft Windows system, link with libf2c.lib;
+	on Linux or Unix systems, link with .../path/to/libf2c.a -lm
+	or, if you install libf2c.a in a standard place, with -lf2c -lm
+	-- in that order, at the end of the command line, as in
+		cc *.o -lf2c -lm
+	Source for libf2c is in /netlib/f2c/libf2c.zip, e.g.,
+
+		http://www.netlib.org/f2c/libf2c.zip
+*/
+
+/*#include "f2c.h"*/
+#include <stdlib.h>
+#include "grib2.h"
+typedef g2int integer;
+typedef g2int logical;
+#define TRUE_ (1)
+#define FALSE_ (0)
+
+/* Subroutine */ int pack_gp(integer *kfildo, integer *ic, integer *nxy, 
+	integer *is523, integer *minpk, integer *inc, integer *missp, integer 
+	*misss, integer *jmin, integer *jmax, integer *lbit, integer *nov, 
+	integer *ndg, integer *lx, integer *ibit, integer *jbit, integer *
+	kbit, integer *novref, integer *lbitref, integer *ier)
+{
+    /* Initialized data */
+
+    const  integer mallow = 1073741825;   /*  MALLOW=2**30+1  */
+    static integer ifeed = 12;
+    static integer ifirst = 0;
+
+    /* System generated locals */
+    integer i__1, i__2, i__3;
+
+    /* Local variables */
+    static integer j, k, l;
+    static logical adda;
+    static integer ired, kinc, mina, maxa, minb, maxb, minc, maxc, ibxx2[31];
+    static char cfeed[1];
+    static integer nenda, nendb, ibita, ibitb, minak, minbk, maxak, maxbk, 
+	    minck, maxck, nouta, lmiss, itest, nount;
+    extern /* Subroutine */ int reduce(integer *, integer *, integer *, 
+	    integer *, integer *, integer *, integer *, integer *, integer *, 
+	    integer *, integer *, integer *, integer *);
+    static integer ibitbs, mislla, misllb, misllc, iersav, lminpk, ktotal, 
+	    kounta, kountb, kstart, mstart, mintst, maxtst, 
+	    kounts, mintstk, maxtstk;
+    integer *misslx;
+
+
+/*        FEBRUARY 1994   GLAHN   TDL   MOS-2000 */
+/*        JUNE     1995   GLAHN   MODIFIED FOR LMISS ERROR. */
+/*        JULY     1996   GLAHN   ADDED MISSS */
+/*        FEBRUARY 1997   GLAHN   REMOVED 4 REDUNDANT TESTS FOR */
+/*                                MISSP.EQ.0; INSERTED A TEST TO BETTER */
+/*                                HANDLE A STRING OF 9999'S */
+/*        FEBRUARY 1997   GLAHN   ADDED LOOPS TO ELIMINATE TEST FOR */
+/*                                MISSS WHEN MISSS = 0 */
+/*        MARCH    1997   GLAHN   CORRECTED FOR SECONDARY MISSING VALUE */
+/*        MARCH    1997   GLAHN   CORRECTED FOR USE OF LOCAL VALUE */
+/*                                OF MINPK */
+/*        MARCH    1997   GLAHN   CORRECTED FOR SECONDARY MISSING VALUE */
+/*        MARCH    1997   GLAHN   CHANGED CALCULATING NUMBER OF BITS */
+/*                                THROUGH EXPONENTS TO AN ARRAY (IMPROVED */
+/*                                OVERALL PACKING PERFORMANCE BY ABOUT */
+/*                                35 PERCENT!).  ALLOWED 0 BITS FOR */
+/*                                PACKING JMIN( ), LBIT( ), AND NOV( ). */
+/*        MAY      1997   GLAHN   A NUMBER OF CHANGES FOR EFFICIENCY. */
+/*                                MOD FUNCTIONS ELIMINATED AND ONE */
+/*                                IFTHEN ADDED.  JOUNT REMOVED. */
+/*                                RECOMPUTATION OF BITS NOT MADE UNLESS */
+/*                                NECESSARY AFTER MOVING POINTS FROM */
+/*                                ONE GROUP TO ANOTHER.  NENDB ADJUSTED */
+/*                                TO ELIMINATE POSSIBILITY OF VERY */
+/*                                SMALL GROUP AT THE END. */
+/*                                ABOUT 8 PERCENT IMPROVEMENT IN */
+/*                                OVERALL PACKING.  ISKIPA REMOVED; */
+/*                                THERE IS ALWAYS A GROUP B THAT CAN */
+/*                                BECOME GROUP A.  CONTROL ON SIZE */
+/*                                OF GROUP B (STATEMENT BELOW 150) */
+/*                                ADDED.  ADDED ADDA, AND USE */
+/*                                OF GE AND LE INSTEAD OF GT AND LT */
+/*                                IN LOOPS BETWEEN 150 AND 160. */
+/*                                IBITBS ADDED TO SHORTEN TRIPS */
+/*                                THROUGH LOOP. */
+/*        MARCH    2000   GLAHN   MODIFIED FOR GRIB2; CHANGED NAME FROM */
+/*                                PACKGP */
+/*        JANUARY  2001   GLAHN   COMMENTS; IER = 706 SUBSTITUTED FOR */
+/*                                STOPS; ADDED RETURN1; REMOVED STATEMENT */
+/*                                NUMBER 110; ADDED IER AND * RETURN */
+/*        NOVEMBER 2001   GLAHN   CHANGED SOME DIAGNOSTIC FORMATS TO */
+/*                                ALLOW PRINTING LARGER NUMBERS */
+/*        NOVEMBER 2001   GLAHN   ADDED MISSLX( ) TO PUT MAXIMUM VALUE */
+/*                                INTO JMIN( ) WHEN ALL VALUES MISSING */
+/*                                TO AGREE WITH GRIB STANDARD. */
+/*        NOVEMBER 2001   GLAHN   CHANGED TWO TESTS ON MISSP AND MISSS */
+/*                                EQ 0 TO TESTS ON IS523.  HOWEVER, */
+/*                                MISSP AND MISSS CANNOT IN GENERAL BE */
+/*                                = 0. */
+/*        NOVEMBER 2001   GLAHN   ADDED CALL TO REDUCE; DEFINED ITEST */
+/*                                BEFORE LOOPS TO REDUCE COMPUTATION; */
+/*                                STARTED LARGE GROUP WHEN ALL SAME */
+/*                                VALUE */
+/*        DECEMBER 2001   GLAHN   MODIFIED AND ADDED A FEW COMMENTS */
+/*        JANUARY  2002   GLAHN   REMOVED LOOP BEFORE 150 TO DETERMINE */
+/*                                A GROUP OF ALL SAME VALUE */
+/*        JANUARY  2002   GLAHN   CHANGED MALLOW FROM 9999999 TO 2**30+1, */
+/*                                AND MADE IT A PARAMETER */
+/*        MARCH    2002   GLAHN   ADDED NON FATAL IER = 716, 717; */
+/*                                REMOVED NENDB=NXY ABOVE 150; */
+/*                                ADDED IERSAV=0; COMMENTS */
+
+/*        PURPOSE */
+/*            DETERMINES GROUPS OF VARIABLE SIZE, BUT AT LEAST OF */
+/*            SIZE MINPK, THE ASSOCIATED MAX (JMAX( )) AND MIN (JMIN( )), */
+/*            THE NUMBER OF BITS NECESSARY TO HOLD THE VALUES IN EACH */
+/*            GROUP (LBIT( )), THE NUMBER OF VALUES IN EACH GROUP */
+/*            (NOV( )), THE NUMBER OF BITS NECESSARY TO PACK THE JMIN( ) */
+/*            VALUES (IBIT), THE NUMBER OF BITS NECESSARY TO PACK THE */
+/*            LBIT( ) VALUES (JBIT), AND THE NUMBER OF BITS NECESSARY */
+/*            TO PACK THE NOV( ) VALUES (KBIT).  THE ROUTINE IS DESIGNED */
+/*            TO DETERMINE THE GROUPS SUCH THAT A SMALL NUMBER OF BITS */
+/*            IS NECESSARY TO PACK THE DATA WITHOUT EXCESSIVE */
+/*            COMPUTATIONS.  IF ALL VALUES IN THE GROUP ARE ZERO, THE */
+/*            NUMBER OF BITS TO USE IN PACKING IS DEFINED AS ZERO WHEN */
+/*            THERE CAN BE NO MISSING VALUES; WHEN THERE CAN BE MISSING */
+/*            VALUES, THE NUMBER OF BITS MUST BE AT LEAST 1 TO HAVE */
+/*            THE CAPABILITY TO RECOGNIZE THE MISSING VALUE.  HOWEVER, */
+/*            IF ALL VALUES IN A GROUP ARE MISSING, THE NUMBER OF BITS */
+/*            NEEDED IS 0, AND THE UNPACKER RECOGNIZES THIS. */
+/*            ALL VARIABLES ARE INTEGER.  EVEN THOUGH THE GROUPS ARE */
+/*            INITIALLY OF SIZE MINPK OR LARGER, AN ADJUSTMENT BETWEEN */
+/*            TWO GROUPS (THE LOOKBACK PROCEDURE) MAY MAKE A GROUP */
+/*            SMALLER THAN MINPK.  THE CONTROL ON GROUP SIZE IS THAT */
+/*            THE SUM OF THE SIZES OF THE TWO CONSECUTIVE GROUPS, EACH OF */
+/*            SIZE MINPK OR LARGER, IS NOT DECREASED.  WHEN DETERMINING */
+/*            THE NUMBER OF BITS NECESSARY FOR PACKING, THE LARGEST */
+/*            VALUE THAT CAN BE ACCOMMODATED IN, SAY, MBITS, IS */
+/*            2**MBITS-1; THIS LARGEST VALUE (AND THE NEXT SMALLEST */
+/*            VALUE) IS RESERVED FOR THE MISSING VALUE INDICATOR (ONLY) */
+/*            WHEN IS523 NE 0.  IF THE DIMENSION NDG */
+/*            IS NOT LARGE ENOUGH TO HOLD ALL THE GROUPS, THE LOCAL VALUE */
+/*            OF MINPK IS INCREASED BY 50 PERCENT.  THIS IS REPEATED */
+/*            UNTIL NDG WILL SUFFICE.  A DIAGNOSTIC IS PRINTED WHENEVER */
+/*            THIS HAPPENS, WHICH SHOULD BE VERY RARELY.  IF IT HAPPENS */
+/*            OFTEN, NDG IN SUBROUTINE PACK SHOULD BE INCREASED AND */
+/*            A CORRESPONDING INCREASE IN SUBROUTINE UNPACK MADE. */
+/*            CONSIDERABLE CODE IS PROVIDED SO THAT NO MORE CHECKING */
+/*            FOR MISSING VALUES WITHIN LOOPS IS DONE THAN NECESSARY; */
+/*            THE ADDED EFFICIENCY OF THIS IS RELATIVELY MINOR, */
+/*            BUT DOES NO HARM.  FOR GRIB2, THE REFERENCE VALUE FOR */
+/*            THE LENGTH OF GROUPS IN NOV( ) AND FOR THE NUMBER OF */
+/*            BITS NECESSARY TO PACK GROUP VALUES ARE DETERMINED, */
+/*            AND SUBTRACTED BEFORE JBIT AND KBIT ARE DETERMINED. */
+
+/*            WHEN 1 OR MORE GROUPS ARE LARGE COMPARED TO THE OTHERS, */
+/*            THE WIDTH OF ALL GROUPS MUST BE AS LARGE AS THE LARGEST. */
+/*            A SUBROUTINE REDUCE BREAKS UP LARGE GROUPS INTO 2 OR */
+/*            MORE TO REDUCE TOTAL BITS REQUIRED.  IF REDUCE SHOULD */
+/*            ABORT, PACK_GP WILL BE EXECUTED AGAIN WITHOUT THE CALL */
+/*            TO REDUCE. */
+
+/*        DATA SET USE */
+/*           KFILDO - UNIT NUMBER FOR OUTPUT (PRINT) FILE. (OUTPUT) */
+
+/*        VARIABLES IN CALL SEQUENCE */
+/*              KFILDO = UNIT NUMBER FOR OUTPUT (PRINT) FILE.  (INPUT) */
+/*               IC( ) = ARRAY TO HOLD DATA FOR PACKING.  THE VALUES */
+/*                       DO NOT HAVE TO BE POSITIVE AT THIS POINT, BUT */
+/*                       MUST BE IN THE RANGE -2**30 TO +2**30 (THE */
+/*                       THE VALUE OF MALLOW).  THESE INTEGER VALUES */
+/*                       WILL BE RETAINED EXACTLY THROUGH PACKING AND */
+/*                       UNPACKING.  (INPUT) */
+/*                 NXY = NUMBER OF VALUES IN IC( ).  ALSO TREATED */
+/*                       AS ITS DIMENSION.  (INPUT) */
+/*              IS523  = missing value management */
+/*                       0=data contains no missing values */
+/*                       1=data contains Primary missing values */
+/*                       2=data contains Primary and secondary missing values */
+/*                       (INPUT) */
+/*               MINPK = THE MINIMUM SIZE OF EACH GROUP, EXCEPT POSSIBLY */
+/*                       THE LAST ONE.  (INPUT) */
+/*                 INC = THE NUMBER OF VALUES TO ADD TO AN ALREADY */
+/*                       EXISTING GROUP IN DETERMINING WHETHER OR NOT */
+/*                       TO START A NEW GROUP.  IDEALLY, THIS WOULD BE */
+/*                       1, BUT EACH TIME INC VALUES ARE ATTEMPTED, THE */
+/*                       MAX AND MIN OF THE NEXT MINPK VALUES MUST BE */
+/*                       FOUND.  THIS IS "A LOOP WITHIN A LOOP," AND */
+/*                       A SLIGHTLY LARGER VALUE MAY GIVE ABOUT AS GOOD */
+/*                       RESULTS WITH SLIGHTLY LESS COMPUTATIONAL TIME. */
+/*                       IF INC IS LE 0, 1 IS USED, AND A DIAGNOSTIC IS */
+/*                       OUTPUT.  NOTE:  IT IS EXPECTED THAT INC WILL */
+/*                       EQUAL 1.  THE CODE USES INC PRIMARILY IN THE */
+/*                       LOOPS STARTING AT STATEMENT 180.  IF INC */
+/*                       WERE 1, THERE WOULD NOT NEED TO BE LOOPS */
+/*                       AS SUCH.  HOWEVER, KINC (THE LOCAL VALUE OF */
+/*                       INC) IS SET GE 1 WHEN NEAR THE END OF THE DATA */
+/*                       TO FORESTALL A VERY SMALL GROUP AT THE END. */
+/*                       (INPUT) */
+/*               MISSP = WHEN MISSING POINTS CAN BE PRESENT IN THE DATA, */
+/*                       THEY WILL HAVE THE VALUE MISSP OR MISSS. */
+/*                       MISSP IS THE PRIMARY MISSING VALUE AND  MISSS */
+/*                       IS THE SECONDARY MISSING VALUE .  THESE MUST */
+/*                       NOT BE VALUES THAT WOULD OCCUR WITH SUBTRACTING */
+/*                       THE MINIMUM (REFERENCE) VALUE OR SCALING. */
+/*                       FOR EXAMPLE, MISSP = 0 WOULD NOT BE ADVISABLE. */
+/*                       (INPUT) */
+/*               MISSS = SECONDARY MISSING VALUE INDICATOR (SEE MISSP). */
+/*                       (INPUT) */
+/*             JMIN(J) = THE MINIMUM OF EACH GROUP (J=1,LX).  (OUTPUT) */
+/*             JMAX(J) = THE MAXIMUM OF EACH GROUP (J=1,LX).  THIS IS */
+/*                       NOT REALLY NEEDED, BUT SINCE THE MAX OF EACH */
+/*                       GROUP MUST BE FOUND, SAVING IT HERE IS CHEAP */
+/*                       IN CASE THE USER WANTS IT.  (OUTPUT) */
+/*             LBIT(J) = THE NUMBER OF BITS NECESSARY TO PACK EACH GROUP */
+/*                       (J=1,LX).  IT IS ASSUMED THE MINIMUM OF EACH */
+/*                       GROUP WILL BE REMOVED BEFORE PACKING, AND THE */
+/*                       VALUES TO PACK WILL, THEREFORE, ALL BE POSITIVE. */
+/*                       HOWEVER, IC( ) DOES NOT NECESSARILY CONTAIN */
+/*                       ALL POSITIVE VALUES.  IF THE OVERALL MINIMUM */
+/*                       HAS BEEN REMOVED (THE USUAL CASE), THEN IC( ) */
+/*                       WILL CONTAIN ONLY POSITIVE VALUES.  (OUTPUT) */
+/*              NOV(J) = THE NUMBER OF VALUES IN EACH GROUP (J=1,LX). */
+/*                       (OUTPUT) */
+/*                 NDG = THE DIMENSION OF JMIN( ), JMAX( ), LBIT( ), AND */
+/*                       NOV( ).  (INPUT) */
+/*                  LX = THE NUMBER OF GROUPS DETERMINED.  (OUTPUT) */
+/*                IBIT = THE NUMBER OF BITS NECESSARY TO PACK THE JMIN(J) */
+/*                       VALUES, J=1,LX.  (OUTPUT) */
+/*                JBIT = THE NUMBER OF BITS NECESSARY TO PACK THE LBIT(J) */
+/*                       VALUES, J=1,LX.  (OUTPUT) */
+/*                KBIT = THE NUMBER OF BITS NECESSARY TO PACK THE NOV(J) */
+/*                       VALUES, J=1,LX.  (OUTPUT) */
+/*              NOVREF = REFERENCE VALUE FOR NOV( ).  (OUTPUT) */
+/*             LBITREF = REFERENCE VALUE FOR LBIT( ).  (OUTPUT) */
+/*                 IER = ERROR RETURN. */
+/*                       706 = VALUE WILL NOT PACK IN 30 BITS--FATAL */
+/*                       714 = ERROR IN REDUCE--NON-FATAL */
+/*                       715 = NGP NOT LARGE ENOUGH IN REDUCE--NON-FATAL */
+/*                       716 = MINPK INCEASED--NON-FATAL */
+/*                       717 = INC SET = 1--NON-FATAL */
+/*                       (OUTPUT) */
+/*                   * = ALTERNATE RETURN WHEN IER NE 0 AND FATAL ERROR. */
+
+/*        INTERNAL VARIABLES */
+/*               CFEED = CONTAINS THE CHARACTER REPRESENTATION */
+/*                       OF A PRINTER FORM FEED. */
+/*               IFEED = CONTAINS THE INTEGER VALUE OF A PRINTER */
+/*                       FORM FEED. */
+/*                KINC = WORKING COPY OF INC.  MAY BE MODIFIED. */
+/*                MINA = MINIMUM VALUE IN GROUP A. */
+/*                MAXA = MAXIMUM VALUE IN GROUP A. */
+/*               NENDA = THE PLACE IN IC( ) WHERE GROUP A ENDS. */
+/*              KSTART = THE PLACE IN IC( ) WHERE GROUP A STARTS. */
+/*               IBITA = NUMBER OF BITS NEEDED TO HOLD VALUES IN GROUP A. */
+/*                MINB = MINIMUM VALUE IN GROUP B. */
+/*                MAXB = MAXIMUM VALUE IN GROUP B. */
+/*               NENDB = THE PLACE IN IC( ) WHERE GROUP B ENDS. */
+/*               IBITB = NUMBER OF BITS NEEDED TO HOLD VALUES IN GROUP B. */
+/*                MINC = MINIMUM VALUE IN GROUP C. */
+/*                MAXC = MAXIMUM VALUE IN GROUP C. */
+/*              KTOTAL = COUNT OF NUMBER OF VALUES IN IC( ) PROCESSED. */
+/*               NOUNT = NUMBER OF VALUES ADDED TO GROUP A. */
+/*               LMISS = 0 WHEN IS523 = 0.  WHEN PACKING INTO A */
+/*                       SPECIFIC NUMBER OF BITS, SAY MBITS, */
+/*                       THE MAXIMUM VALUE THAT CAN BE HANDLED IS */
+/*                       2**MBITS-1.  WHEN IS523 = 1, INDICATING */
+/*                       PRIMARY MISSING VALUES, THIS MAXIMUM VALUE */
+/*                       IS RESERVED TO HOLD THE PRIMARY MISSING VALUE */
+/*                       INDICATOR AND LMISS = 1.  WHEN IS523 = 2, */
+/*                       THE VALUE JUST BELOW THE MAXIMUM (I.E., */
+/*                       2**MBITS-2) IS RESERVED TO HOLD THE SECONDARY */
+/*                       MISSING VALUE INDICATOR AND LMISS = 2. */
+/*              LMINPK = LOCAL VALUE OF MINPK.  THIS WILL BE ADJUSTED */
+/*                       UPWARD WHENEVER NDG IS NOT LARGE ENOUGH TO HOLD */
+/*                       ALL THE GROUPS. */
+/*              MALLOW = THE LARGEST ALLOWABLE VALUE FOR PACKING. */
+/*              MISLLA = SET TO 1 WHEN ALL VALUES IN GROUP A ARE MISSING. */
+/*                       THIS IS USED TO DISTINGUISH BETWEEN A REAL */
+/*                       MINIMUM WHEN ALL VALUES ARE NOT MISSING */
+/*                       AND A MINIMUM THAT HAS BEEN SET TO ZERO WHEN */
+/*                       ALL VALUES ARE MISSING.  0 OTHERWISE. */
+/*                       NOTE THAT THIS DOES NOT DISTINGUISH BETWEEN */
+/*                       PRIMARY AND SECONDARY MISSINGS WHEN SECONDARY */
+/*                       MISSINGS ARE PRESENT.  THIS MEANS THAT */
+/*                       LBIT( ) WILL NOT BE ZERO WITH THE RESULTING */
+/*                       COMPRESSION EFFICIENCY WHEN SECONDARY MISSINGS */
+/*                       ARE PRESENT.  ALSO NOTE THAT A CHECK HAS BEEN */
+/*                       MADE EARLIER TO DETERMINE THAT SECONDARY */
+/*                       MISSINGS ARE REALLY THERE. */
+/*              MISLLB = SET TO 1 WHEN ALL VALUES IN GROUP B ARE MISSING. */
+/*                       THIS IS USED TO DISTINGUISH BETWEEN A REAL */
+/*                       MINIMUM WHEN ALL VALUES ARE NOT MISSING */
+/*                       AND A MINIMUM THAT HAS BEEN SET TO ZERO WHEN */
+/*                       ALL VALUES ARE MISSING.  0 OTHERWISE. */
+/*              MISLLC = PERFORMS THE SAME FUNCTION FOR GROUP C THAT */
+/*                       MISLLA AND MISLLB DO FOR GROUPS B AND C, */
+/*                       RESPECTIVELY. */
+/*            IBXX2(J) = AN ARRAY THAT WHEN THIS ROUTINE IS FIRST ENTERED */
+/*                       IS SET TO 2**J, J=0,30. IBXX2(30) = 2**30, WHICH */
+/*                       IS THE LARGEST VALUE PACKABLE, BECAUSE 2**31 */
+/*                       IS LARGER THAN THE INTEGER WORD SIZE. */
+/*              IFIRST = SET BY DATA STATEMENT TO 0.  CHANGED TO 1 ON */
+/*                       FIRST */
+/*                       ENTRY WHEN IBXX2( ) IS FILLED. */
+/*               MINAK = KEEPS TRACK OF THE LOCATION IN IC( ) WHERE THE */
+/*                       MINIMUM VALUE IN GROUP A IS LOCATED. */
+/*               MAXAK = DOES THE SAME AS MINAK, EXCEPT FOR THE MAXIMUM. */
+/*               MINBK = THE SAME AS MINAK FOR GROUP B. */
+/*               MAXBK = THE SAME AS MAXAK FOR GROUP B. */
+/*               MINCK = THE SAME AS MINAK FOR GROUP C. */
+/*               MAXCK = THE SAME AS MAXAK FOR GROUP C. */
+/*                ADDA = KEEPS TRACK WHETHER OR NOT AN ATTEMPT TO ADD */
+/*                       POINTS TO GROUP A WAS MADE.  IF SO, THEN ADDA */
+/*                       KEEPS FROM TRYING TO PUT ONE BACK INTO B. */
+/*                       (LOGICAL) */
+/*              IBITBS = KEEPS CURRENT VALUE IF IBITB SO THAT LOOP */
+/*                       ENDING AT 166 DOESN'T HAVE TO START AT */
+/*                       IBITB = 0 EVERY TIME. */
+/*           MISSLX(J) = MALLOW EXCEPT WHEN A GROUP IS ALL ONE VALUE (AND */
+/*                       LBIT(J) = 0) AND THAT VALUE IS MISSING.  IN */
+/*                       THAT CASE, MISSLX(J) IS MISSP OR MISSS.  THIS */
+/*                       GETS INSERTED INTO JMIN(J) LATER AS THE */
+/*                       MISSING INDICATOR; IT CAN'T BE PUT IN UNTIL */
+/*                       THE END, BECAUSE JMIN( ) IS USED TO CALCULATE */
+/*                       THE MAXIMUM NUMBER OF BITS (IBITS) NEEDED TO */
+/*                       PACK JMIN( ). */
+/*        1         2         3         4         5         6         7 X */
+
+/*        NON SYSTEM SUBROUTINES CALLED */
+/*           NONE */
+
+
+
+/*        MISSLX( ) was AN AUTOMATIC ARRAY. */
+    misslx = (integer *)calloc(*ndg,sizeof(integer));
+
+
+    /* Parameter adjustments */
+    --ic;
+    --nov;
+    --lbit;
+    --jmax;
+    --jmin;
+
+    /* Function Body */
+
+    *ier = 0;
+    iersav = 0;
+/*     CALL TIMPR(KFILDO,KFILDO,'START PACK_GP        ') */
+    *(unsigned char *)cfeed = (char) ifeed;
+
+    ired = 0;
+/*        IRED IS A FLAG.  WHEN ZERO, REDUCE WILL BE CALLED. */
+/*        IF REDUCE ABORTS, IRED = 1 AND IS NOT CALLED.  IN */
+/*        THIS CASE PACK_GP EXECUTES AGAIN EXCEPT FOR REDUCE. */
+
+    if (*inc <= 0) {
+	iersav = 717;
+/*        WRITE(KFILDO,101)INC */
+/* 101     FORMAT(/' ****INC ='I8,' NOT CORRECT IN PACK_GP.  1 IS USED.') */
+    }
+
+/*        THERE WILL BE A RESTART OF PACK_GP IF SUBROUTINE REDUCE */
+/*        ABORTS.  THIS SHOULD NOT HAPPEN, BUT IF IT DOES, PACK_GP */
+/*        WILL COMPLETE WITHOUT SUBROUTINE REDUCE.  A NON FATAL */
+/*        DIAGNOSTIC RETURN IS PROVIDED. */
+
+L102:
+    /*kinc = max(*inc,1);*/
+    kinc = (*inc > 1) ? *inc : 1;
+    lminpk = *minpk;
+
+/*         CALCULATE THE POWERS OF 2 THE FIRST TIME ENTERED. */
+
+    if (ifirst == 0) {
+	ifirst = 1;
+	ibxx2[0] = 1;
+
+	for (j = 1; j <= 30; ++j) {
+	    ibxx2[j] = ibxx2[j - 1] << 1;
+/* L104: */
+	}
+
+    }
+
+/*        THERE WILL BE A RESTART AT 105 IS NDG IS NOT LARGE ENOUGH. */
+/*        A NON FATAL DIAGNOSTIC RETURN IS PROVIDED. */
+
+L105:
+    kstart = 1;
+    ktotal = 0;
+    *lx = 0;
+    adda = FALSE_;
+    lmiss = 0;
+    if (*is523 == 1) {
+	lmiss = 1;
+    }
+    if (*is523 == 2) {
+	lmiss = 2;
+    }
+
+/*        ************************************* */
+
+/*        THIS SECTION COMPUTES STATISTICS FOR GROUP A.  GROUP A IS */
+/*        A GROUP OF SIZE LMINPK. */
+
+/*        ************************************* */
+
+    ibita = 0;
+    mina = mallow;
+    maxa = -mallow;
+    minak = mallow;
+    maxak = -mallow;
+
+/*        FIND THE MIN AND MAX OF GROUP A.  THIS WILL INITIALLY BE OF */
+/*        SIZE LMINPK (IF THERE ARE STILL LMINPK VALUES IN IC( )), BUT */
+/*        WILL INCREASE IN SIZE IN INCREMENTS OF INC UNTIL A NEW */
+/*        GROUP IS STARTED.  THE DEFINITION OF GROUP A IS DONE HERE */
+/*        ONLY ONCE (UPON INITIAL ENTRY), BECAUSE A GROUP B CAN ALWAYS */
+/*        BECOME A NEW GROUP A AFTER A IS PACKED, EXCEPT IF LMINPK */
+/*        HAS TO BE INCREASED BECAUSE NDG IS TOO SMALL.  THEREFORE, */
+/*        THE SEPARATE LOOPS FOR MISSING AND NON-MISSING HERE BUYS */
+/*        ALMOST NOTHING. */
+
+/* Computing MIN */
+    i__1 = kstart + lminpk - 1;
+    /*nenda = min(i__1,*nxy);*/
+    nenda = (i__1 < *nxy) ? i__1 : *nxy;
+    if (*nxy - nenda <= lminpk / 2) {
+	nenda = *nxy;
+    }
+/*        ABOVE STATEMENT GUARANTEES THE LAST GROUP IS GT LMINPK/2 BY */
+/*        MAKING THE ACTUAL GROUP LARGER.  IF A PROVISION LIKE THIS IS */
+/*        NOT INCLUDED, THERE WILL MANY TIMES BE A VERY SMALL GROUP */
+/*        AT THE END.  USE SEPARATE LOOPS FOR MISSING AND NO MISSING */
+/*        VALUES FOR EFFICIENCY. */
+
+/*        DETERMINE WHETHER THERE IS A LONG STRING OF THE SAME VALUE */
+/*        UNLESS NENDA = NXY.  THIS MAY ALLOW A LARGE GROUP A TO */
+/*        START WITH, AS WITH MISSING VALUES.   SEPARATE LOOPS FOR */
+/*        MISSING OPTIONS.  THIS SECTION IS ONLY EXECUTED ONCE, */
+/*        IN DETERMINING THE FIRST GROUP.  IT HELPS FOR AN ARRAY */
+/*        OF MOSTLY MISSING VALUES OR OF ONE VALUE, SUCH AS */
+/*        RADAR OR PRECIP DATA. */
+
+    if (nenda != *nxy && ic[kstart] == ic[kstart + 1]) {
+/*           NO NEED TO EXECUTE IF FIRST TWO VALUES ARE NOT EQUAL. */
+
+	if (*is523 == 0) {
+/*              THIS LOOP IS FOR NO MISSING VALUES. */
+
+	    i__1 = *nxy;
+	    for (k = kstart + 1; k <= i__1; ++k) {
+
+		if (ic[k] != ic[kstart]) {
+/* Computing MAX */
+		    i__2 = nenda, i__3 = k - 1;
+		    /*nenda = max(i__2,i__3);*/
+		    nenda = (i__2 > i__3) ? i__2 : i__3;
+		    goto L114;
+		}
+
+/* L111: */
+	    }
+
+	    nenda = *nxy;
+/*              FALL THROUGH THE LOOP MEANS ALL VALUES ARE THE SAME. */
+
+	} else if (*is523 == 1) {
+/*              THIS LOOP IS FOR PRIMARY MISSING VALUES ONLY. */
+
+	    i__1 = *nxy;
+	    for (k = kstart + 1; k <= i__1; ++k) {
+
+		if (ic[k] != *missp) {
+
+		    if (ic[k] != ic[kstart]) {
+/* Computing MAX */
+			i__2 = nenda, i__3 = k - 1;
+			/*nenda = max(i__2,i__3);*/
+			nenda = (i__2 > i__3) ? i__2 : i__3;
+			goto L114;
+		    }
+
+		}
+
+/* L112: */
+	    }
+
+	    nenda = *nxy;
+/*              FALL THROUGH THE LOOP MEANS ALL VALUES ARE THE SAME. */
+
+	} else {
+/*              THIS LOOP IS FOR PRIMARY AND SECONDARY MISSING VALUES. */
+
+	    i__1 = *nxy;
+	    for (k = kstart + 1; k <= i__1; ++k) {
+
+		if (ic[k] != *missp && ic[k] != *misss) {
+
+		    if (ic[k] != ic[kstart]) {
+/* Computing MAX */
+			i__2 = nenda, i__3 = k - 1;
+			/*nenda = max(i__2,i__3);*/
+			nenda = (i__2 > i__3) ? i__2 : i__3;
+			goto L114;
+		    }
+
+		}
+
+/* L113: */
+	    }
+
+	    nenda = *nxy;
+/*              FALL THROUGH THE LOOP MEANS ALL VALUES ARE THE SAME. */
+	}
+
+    }
+
+L114:
+    if (*is523 == 0) {
+
+	i__1 = nenda;
+	for (k = kstart; k <= i__1; ++k) {
+	    if (ic[k] < mina) {
+		mina = ic[k];
+		minak = k;
+	    }
+	    if (ic[k] > maxa) {
+		maxa = ic[k];
+		maxak = k;
+	    }
+/* L115: */
+	}
+
+    } else if (*is523 == 1) {
+
+	i__1 = nenda;
+	for (k = kstart; k <= i__1; ++k) {
+	    if (ic[k] == *missp) {
+		goto L117;
+	    }
+	    if (ic[k] < mina) {
+		mina = ic[k];
+		minak = k;
+	    }
+	    if (ic[k] > maxa) {
+		maxa = ic[k];
+		maxak = k;
+	    }
+L117:
+	    ;
+	}
+
+    } else {
+
+	i__1 = nenda;
+	for (k = kstart; k <= i__1; ++k) {
+	    if (ic[k] == *missp || ic[k] == *misss) {
+		goto L120;
+	    }
+	    if (ic[k] < mina) {
+		mina = ic[k];
+		minak = k;
+	    }
+	    if (ic[k] > maxa) {
+		maxa = ic[k];
+		maxak = k;
+	    }
+L120:
+	    ;
+	}
+
+    }
+
+    kounta = nenda - kstart + 1;
+
+/*        INCREMENT KTOTAL AND FIND THE BITS NEEDED TO PACK THE A GROUP. */
+
+    ktotal += kounta;
+    mislla = 0;
+    if (mina != mallow) {
+	goto L125;
+    }
+/*        ALL MISSING VALUES MUST BE ACCOMMODATED. */
+    mina = 0;
+    maxa = 0;
+    mislla = 1;
+    ibitb = 0;
+    if (*is523 != 2) {
+	goto L130;
+    }
+/*        WHEN ALL VALUES ARE MISSING AND THERE ARE NO */
+/*        SECONDARY MISSING VALUES, IBITA = 0. */
+/*        OTHERWISE, IBITA MUST BE CALCULATED. */
+
+L125:
+    itest = maxa - mina + lmiss;
+
+    for (ibita = 0; ibita <= 30; ++ibita) {
+	if (itest < ibxx2[ibita]) {
+	    goto L130;
+	}
+/* ***        THIS TEST IS THE SAME AS: */
+/* ***     IF(MAXA-MINA.LT.IBXX2(IBITA)-LMISS)GO TO 130 */
+/* L126: */
+    }
+
+/*     WRITE(KFILDO,127)MAXA,MINA */
+/* 127  FORMAT(' ****ERROR IN PACK_GP.  VALUE WILL NOT PACK IN 30 BITS.', */
+/*    1       '  MAXA ='I13,'  MINA ='I13,'.  ERROR AT 127.') */
+    *ier = 706;
+    goto L900;
+
+L130:
+
+/* ***D     WRITE(KFILDO,131)KOUNTA,KTOTAL,MINA,MAXA,IBITA,MISLLA */
+/* ***D131  FORMAT(' AT 130, KOUNTA ='I8,'  KTOTAL ='I8,'  MINA ='I8, */
+/* ***D    1       '  MAXA ='I8,'  IBITA ='I3,'  MISLLA ='I3) */
+
+L133:
+    if (ktotal >= *nxy) {
+	goto L200;
+    }
+
+/*        ************************************* */
+
+/*        THIS SECTION COMPUTES STATISTICS FOR GROUP B.  GROUP B IS A */
+/*        GROUP OF SIZE LMINPK IMMEDIATELY FOLLOWING GROUP A. */
+
+/*        ************************************* */
+
+L140:
+    minb = mallow;
+    maxb = -mallow;
+    minbk = mallow;
+    maxbk = -mallow;
+    ibitbs = 0;
+    mstart = ktotal + 1;
+
+/*        DETERMINE WHETHER THERE IS A LONG STRING OF THE SAME VALUE. */
+/*        THIS WORKS WHEN THERE ARE NO MISSING VALUES. */
+
+    nendb = 1;
+
+    if (mstart < *nxy) {
+
+	if (*is523 == 0) {
+/*              THIS LOOP IS FOR NO MISSING VALUES. */
+
+	    i__1 = *nxy;
+	    for (k = mstart + 1; k <= i__1; ++k) {
+
+		if (ic[k] != ic[mstart]) {
+		    nendb = k - 1;
+		    goto L150;
+		}
+
+/* L145: */
+	    }
+
+	    nendb = *nxy;
+/*              FALL THROUGH THE LOOP MEANS ALL REMAINING VALUES */
+/*              ARE THE SAME. */
+	}
+
+    }
+
+L150:
+/* Computing MAX */
+/* Computing MIN */
+    i__3 = ktotal + lminpk;
+    /*i__1 = nendb, i__2 = min(i__3,*nxy);*/
+    i__1 = nendb, i__2 = (i__3 < *nxy) ? i__3 : *nxy;
+    /*nendb = max(i__1,i__2);*/
+    nendb = (i__1 > i__2) ? i__1 : i__2;
+/* **** 150  NENDB=MIN(KTOTAL+LMINPK,NXY) */
+
+    if (*nxy - nendb <= lminpk / 2) {
+	nendb = *nxy;
+    }
+/*        ABOVE STATEMENT GUARANTEES THE LAST GROUP IS GT LMINPK/2 BY */
+/*        MAKING THE ACTUAL GROUP LARGER.  IF A PROVISION LIKE THIS IS */
+/*        NOT INCLUDED, THERE WILL MANY TIMES BE A VERY SMALL GROUP */
+/*        AT THE END.  USE SEPARATE LOOPS FOR MISSING AND NO MISSING */
+
+/*        USE SEPARATE LOOPS FOR MISSING AND NO MISSING VALUES */
+/*        FOR EFFICIENCY. */
+
+    if (*is523 == 0) {
+
+	i__1 = nendb;
+	for (k = mstart; k <= i__1; ++k) {
+	    if (ic[k] <= minb) {
+		minb = ic[k];
+/*              NOTE LE, NOT LT.  LT COULD BE USED BUT THEN A */
+/*              RECOMPUTE OVER THE WHOLE GROUP WOULD BE NEEDED */
+/*              MORE OFTEN.  SAME REASONING FOR GE AND OTHER */
+/*              LOOPS BELOW. */
+		minbk = k;
+	    }
+	    if (ic[k] >= maxb) {
+		maxb = ic[k];
+		maxbk = k;
+	    }
+/* L155: */
+	}
+
+    } else if (*is523 == 1) {
+
+	i__1 = nendb;
+	for (k = mstart; k <= i__1; ++k) {
+	    if (ic[k] == *missp) {
+		goto L157;
+	    }
+	    if (ic[k] <= minb) {
+		minb = ic[k];
+		minbk = k;
+	    }
+	    if (ic[k] >= maxb) {
+		maxb = ic[k];
+		maxbk = k;
+	    }
+L157:
+	    ;
+	}
+
+    } else {
+
+	i__1 = nendb;
+	for (k = mstart; k <= i__1; ++k) {
+	    if (ic[k] == *missp || ic[k] == *misss) {
+		goto L160;
+	    }
+	    if (ic[k] <= minb) {
+		minb = ic[k];
+		minbk = k;
+	    }
+	    if (ic[k] >= maxb) {
+		maxb = ic[k];
+		maxbk = k;
+	    }
+L160:
+	    ;
+	}
+
+    }
+
+    kountb = nendb - ktotal;
+    misllb = 0;
+    if (minb != mallow) {
+	goto L165;
+    }
+/*        ALL MISSING VALUES MUST BE ACCOMMODATED. */
+    minb = 0;
+    maxb = 0;
+    misllb = 1;
+    ibitb = 0;
+
+    if (*is523 != 2) {
+	goto L170;
+    }
+/*        WHEN ALL VALUES ARE MISSING AND THERE ARE NO SECONDARY */
+/*        MISSING VALUES, IBITB = 0.  OTHERWISE, IBITB MUST BE */
+/*        CALCULATED. */
+
+L165:
+    for (ibitb = ibitbs; ibitb <= 30; ++ibitb) {
+	if (maxb - minb < ibxx2[ibitb] - lmiss) {
+	    goto L170;
+	}
+/* L166: */
+    }
+
+/*     WRITE(KFILDO,167)MAXB,MINB */
+/* 167  FORMAT(' ****ERROR IN PACK_GP.  VALUE WILL NOT PACK IN 30 BITS.', */
+/*    1       '  MAXB ='I13,'  MINB ='I13,'.  ERROR AT 167.') */
+    *ier = 706;
+    goto L900;
+
+/*        COMPARE THE BITS NEEDED TO PACK GROUP B WITH THOSE NEEDED */
+/*        TO PACK GROUP A.  IF IBITB GE IBITA, TRY TO ADD TO GROUP A. */
+/*        IF NOT, TRY TO ADD A'S POINTS TO B, UNLESS ADDITION TO A */
+/*        HAS BEEN DONE.  THIS LATTER IS CONTROLLED WITH ADDA. */
+
+L170:
+
+/* ***D     WRITE(KFILDO,171)KOUNTA,KTOTAL,MINA,MAXA,IBITA,MISLLA, */
+/* ***D    1                               MINB,MAXB,IBITB,MISLLB */
+/* ***D171  FORMAT(' AT 171, KOUNTA ='I8,'  KTOTAL ='I8,'  MINA ='I8, */
+/* ***D    1       '  MAXA ='I8,'  IBITA ='I3,'  MISLLA ='I3, */
+/* ***D    2       '  MINB ='I8,'  MAXB ='I8,'  IBITB ='I3,'  MISLLB ='I3) */
+
+    if (ibitb >= ibita) {
+	goto L180;
+    }
+    if (adda) {
+	goto L200;
+    }
+
+/*        ************************************* */
+
+/*        GROUP B REQUIRES LESS BITS THAN GROUP A.  PUT AS MANY OF A'S */
+/*        POINTS INTO B AS POSSIBLE WITHOUT EXCEEDING THE NUMBER OF */
+/*        BITS NECESSARY TO PACK GROUP B. */
+
+/*        ************************************* */
+
+    kounts = kounta;
+/*        KOUNTA REFERS TO THE PRESENT GROUP A. */
+    mintst = minb;
+    maxtst = maxb;
+    mintstk = minbk;
+    maxtstk = maxbk;
+
+/*        USE SEPARATE LOOPS FOR MISSING AND NO MISSING VALUES */
+/*        FOR EFFICIENCY. */
+
+    if (*is523 == 0) {
+
+	i__1 = kstart;
+	for (k = ktotal; k >= i__1; --k) {
+/*           START WITH THE END OF THE GROUP AND WORK BACKWARDS. */
+	    if (ic[k] < minb) {
+		mintst = ic[k];
+		mintstk = k;
+	    } else if (ic[k] > maxb) {
+		maxtst = ic[k];
+		maxtstk = k;
+	    }
+	    if (maxtst - mintst >= ibxx2[ibitb]) {
+		goto L174;
+	    }
+/*           NOTE THAT FOR THIS LOOP, LMISS = 0. */
+	    minb = mintst;
+	    maxb = maxtst;
+	    minbk = mintstk;
+	    maxbk = maxtstk;
+	    --kounta;
+/*           THERE IS ONE LESS POINT NOW IN A. */
+/* L1715: */
+	}
+
+    } else if (*is523 == 1) {
+
+	i__1 = kstart;
+	for (k = ktotal; k >= i__1; --k) {
+/*           START WITH THE END OF THE GROUP AND WORK BACKWARDS. */
+	    if (ic[k] == *missp) {
+		goto L1718;
+	    }
+	    if (ic[k] < minb) {
+		mintst = ic[k];
+		mintstk = k;
+	    } else if (ic[k] > maxb) {
+		maxtst = ic[k];
+		maxtstk = k;
+	    }
+	    if (maxtst - mintst >= ibxx2[ibitb] - lmiss) {
+		goto L174;
+	    }
+/*           FOR THIS LOOP, LMISS = 1. */
+	    minb = mintst;
+	    maxb = maxtst;
+	    minbk = mintstk;
+	    maxbk = maxtstk;
+	    misllb = 0;
+/*           WHEN THE POINT IS NON MISSING, MISLLB SET = 0. */
+L1718:
+	    --kounta;
+/*           THERE IS ONE LESS POINT NOW IN A. */
+/* L1719: */
+	}
+
+    } else {
+
+	i__1 = kstart;
+	for (k = ktotal; k >= i__1; --k) {
+/*           START WITH THE END OF THE GROUP AND WORK BACKWARDS. */
+	    if (ic[k] == *missp || ic[k] == *misss) {
+		goto L1729;
+	    }
+	    if (ic[k] < minb) {
+		mintst = ic[k];
+		mintstk = k;
+	    } else if (ic[k] > maxb) {
+		maxtst = ic[k];
+		maxtstk = k;
+	    }
+	    if (maxtst - mintst >= ibxx2[ibitb] - lmiss) {
+		goto L174;
+	    }
+/*           FOR THIS LOOP, LMISS = 2. */
+	    minb = mintst;
+	    maxb = maxtst;
+	    minbk = mintstk;
+	    maxbk = maxtstk;
+	    misllb = 0;
+/*           WHEN THE POINT IS NON MISSING, MISLLB SET = 0. */
+L1729:
+	    --kounta;
+/*           THERE IS ONE LESS POINT NOW IN A. */
+/* L173: */
+	}
+
+    }
+
+/*        AT THIS POINT, KOUNTA CONTAINS THE NUMBER OF POINTS TO CLOSE */
+/*        OUT GROUP A WITH.  GROUP B NOW STARTS WITH KSTART+KOUNTA AND */
+/*        ENDS WITH NENDB.  MINB AND MAXB HAVE BEEN ADJUSTED AS */
+/*        NECESSARY TO REFLECT GROUP B (EVEN THOUGH THE NUMBER OF BITS */
+/*        NEEDED TO PACK GROUP B HAVE NOT INCREASED, THE END POINTS */
+/*        OF THE RANGE MAY HAVE). */
+
+L174:
+    if (kounta == kounts) {
+	goto L200;
+    }
+/*        ON TRANSFER, GROUP A WAS NOT CHANGED.  CLOSE IT OUT. */
+
+/*        ONE OR MORE POINTS WERE TAKEN OUT OF A.  RANGE AND IBITA */
+/*        MAY HAVE TO BE RECOMPUTED; IBITA COULD BE LESS THAN */
+/*        ORIGINALLY COMPUTED.  IN FACT, GROUP A CAN NOW CONTAIN */
+/*        ONLY ONE POINT AND BE PACKED WITH ZERO BITS */
+/*        (UNLESS MISSS NE 0). */
+
+    nouta = kounts - kounta;
+    ktotal -= nouta;
+    kountb += nouta;
+    if (nenda - nouta > minak && nenda - nouta > maxak) {
+	goto L200;
+    }
+/*        WHEN THE ABOVE TEST IS MET, THE MIN AND MAX OF THE */
+/*        CURRENT GROUP A WERE WITHIN THE OLD GROUP A, SO THE */
+/*        RANGE AND IBITA DO NOT NEED TO BE RECOMPUTED. */
+/*        NOTE THAT MINAK AND MAXAK ARE NO LONGER NEEDED. */
+    ibita = 0;
+    mina = mallow;
+    maxa = -mallow;
+
+/*        USE SEPARATE LOOPS FOR MISSING AND NO MISSING VALUES */
+/*        FOR EFFICIENCY. */
+
+    if (*is523 == 0) {
+
+	i__1 = nenda - nouta;
+	for (k = kstart; k <= i__1; ++k) {
+	    if (ic[k] < mina) {
+		mina = ic[k];
+	    }
+	    if (ic[k] > maxa) {
+		maxa = ic[k];
+	    }
+/* L1742: */
+	}
+
+    } else if (*is523 == 1) {
+
+	i__1 = nenda - nouta;
+	for (k = kstart; k <= i__1; ++k) {
+	    if (ic[k] == *missp) {
+		goto L1744;
+	    }
+	    if (ic[k] < mina) {
+		mina = ic[k];
+	    }
+	    if (ic[k] > maxa) {
+		maxa = ic[k];
+	    }
+L1744:
+	    ;
+	}
+
+    } else {
+
+	i__1 = nenda - nouta;
+	for (k = kstart; k <= i__1; ++k) {
+	    if (ic[k] == *missp || ic[k] == *misss) {
+		goto L175;
+	    }
+	    if (ic[k] < mina) {
+		mina = ic[k];
+	    }
+	    if (ic[k] > maxa) {
+		maxa = ic[k];
+	    }
+L175:
+	    ;
+	}
+
+    }
+
+    mislla = 0;
+    if (mina != mallow) {
+	goto L1750;
+    }
+/*        ALL MISSING VALUES MUST BE ACCOMMODATED. */
+    mina = 0;
+    maxa = 0;
+    mislla = 1;
+    if (*is523 != 2) {
+	goto L177;
+    }
+/*        WHEN ALL VALUES ARE MISSING AND THERE ARE NO SECONDARY */
+/*        MISSING VALUES IBITA = 0 AS ORIGINALLY SET.  OTHERWISE, */
+/*        IBITA MUST BE CALCULATED. */
+
+L1750:
+    itest = maxa - mina + lmiss;
+
+    for (ibita = 0; ibita <= 30; ++ibita) {
+	if (itest < ibxx2[ibita]) {
+	    goto L177;
+	}
+/* ***        THIS TEST IS THE SAME AS: */
+/* ***         IF(MAXA-MINA.LT.IBXX2(IBITA)-LMISS)GO TO 177 */
+/* L176: */
+    }
+
+/*     WRITE(KFILDO,1760)MAXA,MINA */
+/* 1760 FORMAT(' ****ERROR IN PACK_GP.  VALUE WILL NOT PACK IN 30 BITS.', */
+/*    1       '  MAXA ='I13,'  MINA ='I13,'.  ERROR AT 1760.') */
+    *ier = 706;
+    goto L900;
+
+L177:
+    goto L200;
+
+/*        ************************************* */
+
+/*        AT THIS POINT, GROUP B REQUIRES AS MANY BITS TO PACK AS GROUPA. */
+/*        THEREFORE, TRY TO ADD INC POINTS TO GROUP A WITHOUT INCREASING */
+/*        IBITA.  THIS AUGMENTED GROUP IS CALLED GROUP C. */
+
+/*        ************************************* */
+
+L180:
+    if (mislla == 1) {
+	minc = mallow;
+	minck = mallow;
+	maxc = -mallow;
+	maxck = -mallow;
+    } else {
+	minc = mina;
+	maxc = maxa;
+	minck = minak;
+	maxck = minak;
+    }
+
+    nount = 0;
+    if (*nxy - (ktotal + kinc) <= lminpk / 2) {
+	kinc = *nxy - ktotal;
+    }
+/*        ABOVE STATEMENT CONSTRAINS THE LAST GROUP TO BE NOT LESS THAN */
+/*        LMINPK/2 IN SIZE.  IF A PROVISION LIKE THIS IS NOT INCLUDED, */
+/*        THERE WILL MANY TIMES BE A VERY SMALL GROUP AT THE END. */
+
+/*        USE SEPARATE LOOPS FOR MISSING AND NO MISSING VALUES */
+/*        FOR EFFICIENCY.  SINCE KINC IS USUALLY 1, USING SEPARATE */
+/*        LOOPS HERE DOESN'T BUY MUCH.  A MISSING VALUE WILL ALWAYS */
+/*        TRANSFER BACK TO GROUP A. */
+
+    if (*is523 == 0) {
+
+/* Computing MIN */
+	i__2 = ktotal + kinc;
+	/*i__1 = min(i__2,*nxy);*/
+	i__1 = (i__2 < *nxy) ? i__2 : *nxy;
+	for (k = ktotal + 1; k <= i__1; ++k) {
+	    if (ic[k] < minc) {
+		minc = ic[k];
+		minck = k;
+	    }
+	    if (ic[k] > maxc) {
+		maxc = ic[k];
+		maxck = k;
+	    }
+	    ++nount;
+/* L185: */
+	}
+
+    } else if (*is523 == 1) {
+
+/* Computing MIN */
+	i__2 = ktotal + kinc;
+	/*i__1 = min(i__2,*nxy);*/
+	i__1 = (i__2 < *nxy) ? i__2 : *nxy;
+	for (k = ktotal + 1; k <= i__1; ++k) {
+	    if (ic[k] == *missp) {
+		goto L186;
+	    }
+	    if (ic[k] < minc) {
+		minc = ic[k];
+		minck = k;
+	    }
+	    if (ic[k] > maxc) {
+		maxc = ic[k];
+		maxck = k;
+	    }
+L186:
+	    ++nount;
+/* L187: */
+	}
+
+    } else {
+
+/* Computing MIN */
+	i__2 = ktotal + kinc;
+	/*i__1 = min(i__2,*nxy);*/
+	i__1 = (i__2 < *nxy) ? i__2 : *nxy;
+	for (k = ktotal + 1; k <= i__1; ++k) {
+	    if (ic[k] == *missp || ic[k] == *misss) {
+		goto L189;
+	    }
+	    if (ic[k] < minc) {
+		minc = ic[k];
+		minck = k;
+	    }
+	    if (ic[k] > maxc) {
+		maxc = ic[k];
+		maxck = k;
+	    }
+L189:
+	    ++nount;
+/* L190: */
+	}
+
+    }
+
+/* ***D     WRITE(KFILDO,191)KOUNTA,KTOTAL,MINA,MAXA,IBITA,MISLLA, */
+/* ***D    1   MINC,MAXC,NOUNT,IC(KTOTAL),IC(KTOTAL+1) */
+/* ***D191  FORMAT(' AT 191, KOUNTA ='I8,'  KTOTAL ='I8,'  MINA ='I8, */
+/* ***D    1       '  MAXA ='I8,'  IBITA ='I3,'  MISLLA ='I3, */
+/* ***D    2       '  MINC ='I8,'  MAXC ='I8, */
+/* ***D    3       '  NOUNT ='I5,'  IC(KTOTAL) ='I9,'  IC(KTOTAL+1) =',I9) */
+
+/*        IF THE NUMBER OF BITS NEEDED FOR GROUP C IS GT IBITA, */
+/*        THEN THIS GROUP A IS A GROUP TO PACK. */
+
+    if (minc == mallow) {
+	minc = mina;
+	maxc = maxa;
+	minck = minak;
+	maxck = maxak;
+	misllc = 1;
+	goto L195;
+/*           WHEN THE NEW VALUE(S) ARE MISSING, THEY CAN ALWAYS */
+/*           BE ADDED. */
+
+    } else {
+	misllc = 0;
+    }
+
+    if (maxc - minc >= ibxx2[ibita] - lmiss) {
+	goto L200;
+    }
+
+/*        THE BITS NECESSARY FOR GROUP C HAS NOT INCREASED FROM THE */
+/*        BITS NECESSARY FOR GROUP A.  ADD THIS POINT(S) TO GROUP A. */
+/*        COMPUTE THE NEXT GROUP B, ETC., UNLESS ALL POINTS HAVE BEEN */
+/*        USED. */
+
+L195:
+    ktotal += nount;
+    kounta += nount;
+    mina = minc;
+    maxa = maxc;
+    minak = minck;
+    maxak = maxck;
+    mislla = misllc;
+    adda = TRUE_;
+    if (ktotal >= *nxy) {
+	goto L200;
+    }
+
+    if (minbk > ktotal && maxbk > ktotal) {
+	mstart = nendb + 1;
+/*           THE MAX AND MIN OF GROUP B WERE NOT FROM THE POINTS */
+/*           REMOVED, SO THE WHOLE GROUP DOES NOT HAVE TO BE LOOKED */
+/*           AT TO DETERMINE THE NEW MAX AND MIN.  RATHER START */
+/*           JUST BEYOND THE OLD NENDB. */
+	ibitbs = ibitb;
+	nendb = 1;
+	goto L150;
+    } else {
+	goto L140;
+    }
+
+/*        ************************************* */
+
+/*        GROUP A IS TO BE PACKED.  STORE VALUES IN JMIN( ), JMAX( ), */
+/*        LBIT( ), AND NOV( ). */
+
+/*        ************************************* */
+
+L200:
+    ++(*lx);
+    if (*lx <= *ndg) {
+	goto L205;
+    }
+    lminpk += lminpk / 2;
+/*     WRITE(KFILDO,201)NDG,LMINPK,LX */
+/* 201  FORMAT(' ****NDG ='I5,' NOT LARGE ENOUGH.', */
+/*    1       '  LMINPK IS INCREASED TO 'I3,' FOR THIS FIELD.'/ */
+/*    2       '  LX = 'I10) */
+    iersav = 716;
+    goto L105;
+
+L205:
+    jmin[*lx] = mina;
+    jmax[*lx] = maxa;
+    lbit[*lx] = ibita;
+    nov[*lx] = kounta;
+    kstart = ktotal + 1;
+
+    if (mislla == 0) {
+	misslx[*lx - 1] = mallow;
+    } else {
+	misslx[*lx - 1] = ic[ktotal];
+/*           IC(KTOTAL) WAS THE LAST VALUE PROCESSED.  IF MISLLA NE 0, */
+/*           THIS MUST BE THE MISSING VALUE FOR THIS GROUP. */
+    }
+
+/* ***D     WRITE(KFILDO,206)MISLLA,IC(KTOTAL),KTOTAL,LX,JMIN(LX),JMAX(LX), */
+/* ***D    1                 LBIT(LX),NOV(LX),MISSLX(LX) */
+/* ***D206  FORMAT(' AT 206,  MISLLA ='I2,'  IC(KTOTAL) ='I5,'  KTOTAL ='I8, */
+/* ***D    1       '  LX ='I6,'  JMIN(LX) ='I8,'  JMAX(LX) ='I8, */
+/* ***D    2       '  LBIT(LX) ='I5,'  NOV(LX) ='I8,'  MISSLX(LX) =',I7) */
+
+    if (ktotal >= *nxy) {
+	goto L209;
+    }
+
+/*        THE NEW GROUP A WILL BE THE PREVIOUS GROUP B.  SET LIMITS, ETC. */
+
+    ibita = ibitb;
+    mina = minb;
+    maxa = maxb;
+    minak = minbk;
+    maxak = maxbk;
+    mislla = misllb;
+    nenda = nendb;
+    kounta = kountb;
+    ktotal += kounta;
+    adda = FALSE_;
+    goto L133;
+
+/*        ************************************* */
+
+/*        CALCULATE IBIT, THE NUMBER OF BITS NEEDED TO HOLD THE GROUP */
+/*        MINIMUM VALUES. */
+
+/*        ************************************* */
+
+L209:
+    *ibit = 0;
+
+    i__1 = *lx;
+    for (l = 1; l <= i__1; ++l) {
+L210:
+	if (jmin[l] < ibxx2[*ibit]) {
+	    goto L220;
+	}
+	++(*ibit);
+	goto L210;
+L220:
+	;
+    }
+
+/*        INSERT THE VALUE IN JMIN( ) TO BE USED FOR ALL MISSING */
+/*        VALUES WHEN LBIT( ) = 0.  WHEN SECONDARY MISSING */
+/*        VALUES CAN BE PRESENT, LBIT(L) WILL NOT = 0. */
+
+    if (*is523 == 1) {
+
+	i__1 = *lx;
+	for (l = 1; l <= i__1; ++l) {
+
+	    if (lbit[l] == 0) {
+
+		if (misslx[l - 1] == *missp) {
+		    jmin[l] = ibxx2[*ibit] - 1;
+		}
+
+	    }
+
+/* L226: */
+	}
+
+    }
+
+/*        ************************************* */
+
+/*        CALCULATE JBIT, THE NUMBER OF BITS NEEDED TO HOLD THE BITS */
+/*        NEEDED TO PACK THE VALUES IN THE GROUPS.  BUT FIND AND */
+/*        REMOVE THE REFERENCE VALUE FIRST. */
+
+/*        ************************************* */
+
+/*     WRITE(KFILDO,228)CFEED,LX */
+/* 228  FORMAT(A1,/' *****************************************' */
+/*    1          /' THE GROUP WIDTHS LBIT( ) FOR ',I8,' GROUPS' */
+/*    2          /' *****************************************') */
+/*     WRITE(KFILDO,229) (LBIT(J),J=1,MIN(LX,100)) */
+/* 229  FORMAT(/' '20I6) */
+
+    *lbitref = lbit[1];
+
+    i__1 = *lx;
+    for (k = 1; k <= i__1; ++k) {
+	if (lbit[k] < *lbitref) {
+	    *lbitref = lbit[k];
+	}
+/* L230: */
+    }
+
+    if (*lbitref != 0) {
+
+	i__1 = *lx;
+	for (k = 1; k <= i__1; ++k) {
+	    lbit[k] -= *lbitref;
+/* L240: */
+	}
+
+    }
+
+/*     WRITE(KFILDO,241)CFEED,LBITREF */
+/* 241  FORMAT(A1,/' *****************************************' */
+/*    1          /' THE GROUP WIDTHS LBIT( ) AFTER REMOVING REFERENCE ', */
+/*    2             I8, */
+/*    3          /' *****************************************') */
+/*     WRITE(KFILDO,242) (LBIT(J),J=1,MIN(LX,100)) */
+/* 242  FORMAT(/' '20I6) */
+
+    *jbit = 0;
+
+    i__1 = *lx;
+    for (k = 1; k <= i__1; ++k) {
+L310:
+	if (lbit[k] < ibxx2[*jbit]) {
+	    goto L320;
+	}
+	++(*jbit);
+	goto L310;
+L320:
+	;
+    }
+
+/*        ************************************* */
+
+/*        CALCULATE KBIT, THE NUMBER OF BITS NEEDED TO HOLD THE NUMBER */
+/*        OF VALUES IN THE GROUPS.  BUT FIND AND REMOVE THE */
+/*        REFERENCE FIRST. */
+
+/*        ************************************* */
+
+/*     WRITE(KFILDO,321)CFEED,LX */
+/* 321  FORMAT(A1,/' *****************************************' */
+/*    1          /' THE GROUP SIZES NOV( ) FOR ',I8,' GROUPS' */
+/*    2          /' *****************************************') */
+/*     WRITE(KFILDO,322) (NOV(J),J=1,MIN(LX,100)) */
+/* 322  FORMAT(/' '20I6) */
+
+    *novref = nov[1];
+
+    i__1 = *lx;
+    for (k = 1; k <= i__1; ++k) {
+	if (nov[k] < *novref) {
+	    *novref = nov[k];
+	}
+/* L400: */
+    }
+
+    if (*novref > 0) {
+
+	i__1 = *lx;
+	for (k = 1; k <= i__1; ++k) {
+	    nov[k] -= *novref;
+/* L405: */
+	}
+
+    }
+
+/*     WRITE(KFILDO,406)CFEED,NOVREF */
+/* 406  FORMAT(A1,/' *****************************************' */
+/*    1          /' THE GROUP SIZES NOV( ) AFTER REMOVING REFERENCE ',I8, */
+/*    2          /' *****************************************') */
+/*     WRITE(KFILDO,407) (NOV(J),J=1,MIN(LX,100)) */
+/* 407  FORMAT(/' '20I6) */
+/*     WRITE(KFILDO,408)CFEED */
+/* 408  FORMAT(A1,/' *****************************************' */
+/*    1          /' THE GROUP REFERENCES JMIN( )' */
+/*    2          /' *****************************************') */
+/*     WRITE(KFILDO,409) (JMIN(J),J=1,MIN(LX,100)) */
+/* 409  FORMAT(/' '20I6) */
+
+    *kbit = 0;
+
+    i__1 = *lx;
+    for (k = 1; k <= i__1; ++k) {
+L410:
+	if (nov[k] < ibxx2[*kbit]) {
+	    goto L420;
+	}
+	++(*kbit);
+	goto L410;
+L420:
+	;
+    }
+
+/*        DETERMINE WHETHER THE GROUP SIZES SHOULD BE REDUCED */
+/*        FOR SPACE EFFICIENCY. */
+
+    if (ired == 0) {
+	reduce(kfildo, &jmin[1], &jmax[1], &lbit[1], &nov[1], lx, ndg, ibit, 
+		jbit, kbit, novref, ibxx2, ier);
+
+	if (*ier == 714 || *ier == 715) {
+/*              REDUCE HAS ABORTED.  REEXECUTE PACK_GP WITHOUT REDUCE. */
+/*              PROVIDE FOR A NON FATAL RETURN FROM REDUCE. */
+	    iersav = *ier;
+	    ired = 1;
+	    *ier = 0;
+	    goto L102;
+	}
+
+    }
+
+    if ( misslx != 0 ) {
+         free(misslx);
+         misslx=0;
+    }
+/*     CALL TIMPR(KFILDO,KFILDO,'END   PACK_GP        ') */
+    if (iersav != 0) {
+	*ier = iersav;
+	return 0;
+    }
+
+/* 900  IF(IER.NE.0)RETURN1 */
+
+L900:
+    if ( misslx != 0 ) free(misslx);
+    return 0;
+} /* pack_gp__ */
+
diff --git a/g2clib_src/pdstemplates.c b/g2clib_src/pdstemplates.c
new file mode 100755
index 0000000..02a9525
--- /dev/null
+++ b/g2clib_src/pdstemplates.c
@@ -0,0 +1,430 @@
+#include <stdlib.h>
+#include "grib2.h"
+#include "pdstemplates.h"
+
+g2int getpdsindex(g2int number)
+///$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    getpdsindex
+//   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2001-06-28
+//
+// ABSTRACT: This function returns the index of specified Product
+//   Definition Template 4.NN (NN=number) in array templates.
+//
+// PROGRAM HISTORY LOG:
+// 2001-06-28  Gilbert
+// 2009-01-14  Vuong     Changed structure name template to gtemplate
+// 2009-12-15  Vuong     Added Product Definition Template 4.31
+//                       Added Product Definition Template 4.15
+// 2010-08-03  Vuong     Added Product Definition Template 4.42 and 4.43
+// 2010-12-08  Vuong     Corrected Product Definition Template 4.42 and 4.43
+// 2012-03-29  Vuong     Added Templates 4.44,4.45,4.46,4.47,4.48,4.50,
+//                       4.51,4.91,4.32 and 4.52
+// 2013-08-05  Vuong     Corrected 4.91 and added Templates 4.33,4.34,4.53,4.54
+//
+// USAGE:    index=getpdsindex(number)
+//   INPUT ARGUMENT LIST:
+//     number   - NN, indicating the number of the Product Definition
+//                Template 4.NN that is being requested.
+//
+// RETURNS:  Index of PDT 4.NN in array templates, if template exists.
+//           = -1, otherwise.
+//
+// REMARKS: None
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE:  IBM SP
+//
+//$$$/
+{
+           g2int j,getpdsindex=-1;
+
+           for (j=0;j<MAXPDSTEMP;j++) {
+              if (number == templatespds[j].template_num) {
+                 getpdsindex=j;
+                 return(getpdsindex);
+              }
+           }
+
+           return(getpdsindex);
+}
+
+
+gtemplate *getpdstemplate(g2int number)
+///$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    getpdstemplate 
+//   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2000-05-11
+//
+// ABSTRACT: This subroutine returns PDS template information for a 
+//   specified Product Definition Template 4.NN.
+//   The number of entries in the template is returned along with a map
+//   of the number of octets occupied by each entry.  Also, a flag is
+//   returned to indicate whether the template would need to be extended.
+//
+// PROGRAM HISTORY LOG:
+// 2000-05-11  Gilbert
+// 2009-01-14  Vuong     Changed structure name template to gtemplate
+// 2009-08-05  Vuong     Added Product Definition Template 4.31
+// 2010-08-03  Vuong     Added Product Definition Template 4.42 and 4.43
+// 2010-12-08  Vuong     Corrected Product Definition Template 4.42 and 4.43
+// 2012-02-15  Vuong     Added Templates 4.44,4.45,4.46,4.47,4.48,4.50,
+//                       4.51,4.91,4.32 and 4.52
+// 2013-08-05  Vuong     Corrected 4.91 and added Templates 4.33,4.34,4.53,4.54
+//
+// USAGE:    CALL getpdstemplate(number)
+//   INPUT ARGUMENT LIST:
+//     number   - NN, indicating the number of the Product Definition 
+//                Template 4.NN that is being requested.
+//
+//   RETURN VALUE:
+//        - Pointer to the returned template struct.
+//          Returns NULL pointer, if template not found.
+//
+// REMARKS: None
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE:  IBM SP
+//
+//$$$/
+{
+           g2int index;
+           gtemplate *new;
+
+           index=getpdsindex(number);
+
+           if (index != -1) {
+              new=(gtemplate *)malloc(sizeof(gtemplate));
+              new->type=4;
+              new->num=templatespds[index].template_num;
+              new->maplen=templatespds[index].mappdslen;
+              new->needext=templatespds[index].needext;
+              new->map=(g2int *)templatespds[index].mappds;
+              new->extlen=0;
+              new->ext=0;        //NULL
+              return(new);
+           }
+           else {
+             printf("getpdstemplate: PDS Template 4.%d not defined.\n",(int)number);
+             return(0);        //NULL
+           }
+
+         return(0);        //NULL
+}
+         
+        
+gtemplate *extpdstemplate(g2int number,g2int *list)
+///$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    extpdstemplate 
+//   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2000-05-11
+//
+// ABSTRACT: This subroutine generates the remaining octet map for a
+//   given Product Definition Template, if required.  Some Templates can
+//   vary depending on data values given in an earlier part of the 
+//   Template, and it is necessary to know some of the earlier entry
+//   values to generate the full octet map of the Template.
+//
+// PROGRAM HISTORY LOG:
+// 2000-05-11  Gilbert
+// 2009-01-14  Vuong     Changed structure name template to gtemplate
+// 2009-08-05  Vuong     Added Product Definition Template 4.31
+// 2010-08-03  Vuong     Added Product Definition Template 4.42 and 4.43
+// 2010-12-08  Vuong     Corrected Product Definition Template 4.42 and 4.43
+// 2012-02-15  Vuong     Added Templates 4.44,4.45,4.46,4.47,4.48,4.50,
+//                       4.51,4.91,4.32 and 4.52
+// 2013-08-05  Vuong     Corrected 4.91 and added Templates 4.33,4.34,4.53,4.54
+//
+// USAGE:    CALL extpdstemplate(number,list)
+//   INPUT ARGUMENT LIST:
+//     number   - NN, indicating the number of the Product Definition 
+//                Template 4.NN that is being requested.
+//     list()   - The list of values for each entry in the 
+//                the Product Definition Template 4.NN.
+//
+//   RETURN VALUE:
+//        - Pointer to the returned template struct.
+//          Returns NULL pointer, if template not found.
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE:  IBM SP
+//
+//$$$
+{
+           gtemplate *new;
+           g2int index,i,j,k,l;
+
+           index=getpdsindex(number);
+           if (index == -1) return(0);
+
+           new=getpdstemplate(number);
+
+           if ( ! new->needext ) return(new);
+
+           if ( number == 3 ) {
+              new->extlen=list[26];
+              new->ext=(g2int *)malloc(sizeof(g2int)*new->extlen);
+              for (i=0;i<new->extlen;i++) {
+                 new->ext[i]=1;
+              }
+           }
+           else if ( number == 4 ) {
+              new->extlen=list[25];
+              new->ext=(g2int *)malloc(sizeof(g2int)*new->extlen);
+              for (i=0;i<new->extlen;i++) {
+                 new->ext[i]=1;
+              }
+           }
+           else if ( number == 8 ) {
+              if ( list[21] > 1 ) {
+                 new->extlen=(list[21]-1)*6;
+                 new->ext=(g2int *)malloc(sizeof(g2int)*new->extlen);
+                 for (j=2;j<=list[21];j++) {
+                    l=(j-2)*6;
+                    for (k=0;k<6;k++) {
+                       new->ext[l+k]=new->map[23+k];
+                    }
+                 }
+              }
+           }
+           else if ( number == 9 ) {
+              if ( list[28] > 1 ) {
+                 new->extlen=(list[28]-1)*6;
+                 new->ext=(g2int *)malloc(sizeof(g2int)*new->extlen);
+                 for (j=2;j<=list[28];j++) {
+                    l=(j-2)*6;
+                    for (k=0;k<6;k++) {
+                       new->ext[l+k]=new->map[30+k];
+                    }
+                 }
+              }
+           }
+           else if ( number == 10 ) {
+              if ( list[22] > 1 ) {
+                 new->extlen=(list[22]-1)*6;
+                 new->ext=(g2int *)malloc(sizeof(g2int)*new->extlen);
+                 for (j=2;j<=list[22];j++) {
+                    l=(j-2)*6;
+                    for (k=0;k<6;k++) {
+                       new->ext[l+k]=new->map[24+k];
+                    }
+                 }
+              }
+           }
+           else if ( number == 11 ) {
+              if ( list[24] > 1 ) {
+                 new->extlen=(list[24]-1)*6;
+                 new->ext=(g2int *)malloc(sizeof(g2int)*new->extlen);
+                 for (j=2;j<=list[24];j++) {
+                    l=(j-2)*6;
+                    for (k=0;k<6;k++) {
+                       new->ext[l+k]=new->map[26+k];
+                    }
+                 }
+              }
+           }
+           else if ( number == 12 ) {
+              if ( list[23] > 1 ) {
+                 new->extlen=(list[23]-1)*6;
+                 new->ext=(g2int *)malloc(sizeof(g2int)*new->extlen);
+                 for (j=2;j<=list[23];j++) {
+                    l=(j-2)*6;
+                    for (k=0;k<6;k++) {
+                       new->ext[l+k]=new->map[25+k];
+                    }
+                 }
+              }
+           }
+           else if ( number == 13 ) {
+              new->extlen=((list[37]-1)*6)+list[26];
+              new->ext=(g2int *)malloc(sizeof(g2int)*new->extlen);
+              if ( list[37] > 1 ) {
+                 for (j=2;j<=list[37];j++) {
+                    l=(j-2)*6;
+                    for (k=0;k<6;k++) {
+                       new->ext[l+k]=new->map[39+k];
+                    }
+                 }
+              }
+              l=(list[37]-1)*6;
+              if ( l<0 ) l=0;
+              for (i=0;i<list[26];i++) {
+                new->ext[l+i]=1;
+              }
+           }
+           else if ( number == 14 ) {
+              new->extlen=((list[36]-1)*6)+list[25];
+              new->ext=(g2int *)malloc(sizeof(g2int)*new->extlen);
+              if ( list[36] > 1 ) {
+                 for (j=2;j<=list[36];j++) {
+                    l=(j-2)*6;
+                    for (k=0;k<6;k++) {
+                       new->ext[l+k]=new->map[38+k];
+                    }
+                 }
+              }
+              l=(list[36]-1)*6;
+              if ( l<0 ) l=0;
+              for (i=0;i<list[25];i++) {
+                new->ext[l+i]=1;
+              }
+           }
+           else if ( number == 30 ) {
+              new->extlen=list[4]*5;
+              new->ext=(g2int *)malloc(sizeof(g2int)*new->extlen);
+              for (i=0;i<list[4];i++) {
+                 l=i*5;
+                 new->ext[l]=2;
+                 new->ext[l+1]=2;
+                 new->ext[l+2]=1;
+                 new->ext[l+3]=1;
+                 new->ext[l+4]=4;
+              }
+           }
+           else if ( number == 31 ) {
+              new->extlen=list[4]*5;
+              new->ext=(g2int *)malloc(sizeof(g2int)*new->extlen);
+              for (i=0;i<list[4];i++) {
+                 l=i*5;
+                 new->ext[l]=2;
+                 new->ext[l+1]=2;
+                 new->ext[l+2]=2;
+                 new->ext[l+3]=1;
+                 new->ext[l+4]=4;
+              }
+           }
+           else if ( number == 42 ) {
+              if ( list[22] > 1 ) {
+                 new->extlen=(list[22]-1)*6;
+                 new->ext=(g2int *)malloc(sizeof(g2int)*new->extlen);
+                 for (j=2;j<=list[22];j++) {
+                    l=(j-2)*6;
+                    for (k=0;k<6;k++) {
+                       new->ext[l+k]=new->map[24+k];
+                    }
+                 }
+              }
+           }
+           else if ( number == 43 ) {
+              if ( list[25] > 1 ) {
+                 new->extlen=(list[25]-1)*6;
+                 new->ext=(g2int *)malloc(sizeof(g2int)*new->extlen);
+                 for (j=2;j<=list[25];j++) {
+                    l=(j-2)*6;
+                    for (k=0;k<6;k++) {
+                       new->ext[l+k]=new->map[27+k];
+                    }
+                 }
+              }
+           }
+           else if ( number == 32 ) {
+              new->extlen=list[9]*10;
+              new->ext=(g2int *)malloc(sizeof(g2int)*new->extlen);
+              for (i=0;i<list[9];i++) {
+                 l=i*5;
+                 new->ext[l]=2;
+                 new->ext[l+1]=2;
+                 new->ext[l+2]=2;
+                 new->ext[l+3]=-1;
+                 new->ext[l+4]=-4;
+              }
+           }
+           else if ( number == 46 ) {
+              if ( list[27] > 1 ) {
+                 new->extlen=(list[27]-1)*6;
+                 new->ext=(g2int *)malloc(sizeof(g2int)*new->extlen);
+                 for (j=2;j<=list[27];j++) {
+                    l=(j-2)*6;
+                    for (k=0;k<6;k++) {
+                       new->ext[l+k]=new->map[29+k];
+                    }
+                 }
+              }
+           }
+           else if ( number == 47 ) {
+              if ( list[30] > 1 ) {
+                 new->extlen=(list[30]-1)*6;
+                 new->ext=(g2int *)malloc(sizeof(g2int)*new->extlen);
+                 for (j=2;j<=list[30];j++) {
+                    l=(j-2)*6;
+                    for (k=0;k<6;k++) {
+                       new->ext[l+k]=new->map[32+k];
+                    }
+                 }
+              }
+           else if ( number == 51 ) {
+              new->extlen=list[15]*11;
+              new->ext=(g2int *)malloc(sizeof(g2int)*new->extlen);
+              for (i=0;i<list[15];i++) {
+                 l=i*6;
+                 new->ext[l]=1;
+                 new->ext[l+1]=1;
+                 new->ext[l+2]=-1;
+                 new->ext[l+3]=-4;
+                 new->ext[l+4]=-1;
+                 new->ext[l+5]=-4;
+              }
+           }
+           else if ( number == 33 ) {
+              new->extlen=list[9];
+              new->ext=(g2int *)malloc(sizeof(g2int)*new->extlen);
+              for (i=0;i<new->extlen;i++) {
+                 new->ext[i]=1;
+              }
+           }
+           else if ( number == 34 ) {
+              new->extlen=((list[24]-1)*6)+list[9];
+              new->ext=(g2int *)malloc(sizeof(g2int)*new->extlen);
+              if ( list[24] > 1 ) {
+                 for (j=2;j<=list[24];j++) {
+                    l=(j-2)*6;
+                    for (k=0;k<6;k++) {
+                       new->ext[l+k]=new->map[26+k];
+                    }
+                 }
+              }
+              l=(list[24]-1)*6;
+              if ( l<0 ) l=0;
+              for (i=0;i<list[9];i++) {
+                new->ext[l+i]=1;
+              }
+           }
+           else if ( number == 53 ) {
+              new->extlen=list[3];
+              new->ext=(g2int *)malloc(sizeof(g2int)*new->extlen);
+              for (i=0;i<new->extlen;i++) {
+                 new->ext[i]=1;
+              }
+           }
+           else if ( number == 54 ) {
+              new->extlen=list[3];
+              new->ext=(g2int *)malloc(sizeof(g2int)*new->extlen);
+              for (i=0;i<new->extlen;i++) {
+                 new->ext[i]=1;
+              }
+           }
+           else if ( number == 91 ) {
+              new->extlen=((list[28]-1)*6)+list[15];
+              new->ext=(g2int *)malloc(sizeof(g2int)*new->extlen);
+              if ( list[28] > 1 ) {
+                 for (j=2;j<=list[28];j++) {
+                    l=(j-2)*6;
+                    for (k=0;k<6;k++) {
+                       new->ext[l+k]=new->map[30+k];
+                    }
+                 }
+              }
+              l=(list[29]-1)*6;
+              if ( l<0 ) l=0;
+              for (i=0;i<list[15];i++) {
+                new->ext[l+i]=1;
+              }
+             }
+           }
+
+           return(new);
+
+}
diff --git a/g2clib_src/pdstemplates.h b/g2clib_src/pdstemplates.h
new file mode 100755
index 0000000..fa0350a
--- /dev/null
+++ b/g2clib_src/pdstemplates.h
@@ -0,0 +1,206 @@
+#ifndef _pdstemplates_H
+#define _pdstemplates_H
+#include "grib2.h"
+
+//   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2002-10-26
+//
+// ABSTRACT: This inculde file contains info on all the available 
+//   GRIB2 Product Definition Templates used in Section 4 (PDS).
+//   The information decribing each template is stored in the
+//   pdstemplate structure defined below.
+//
+//   Each Template has three parts: The number of entries in the template
+//   (mappdslen);  A map of the template (mappds), which contains the
+//   number of octets in which to pack each of the template values; and
+//   a logical value (needext) that indicates whether the Template needs 
+//   to be extended.  In some cases the number of entries in a template 
+//   can vary depending upon values specified in the "static" part of 
+//   the template.  ( See Template 4.3 as an example )
+//
+//   NOTE:  Array mappds contains the number of octets in which the 
+//   corresponding template values will be stored.  A negative value in
+//   mappds is used to indicate that the corresponding template entry can
+//   contain negative values.  This information is used later when packing
+//   (or unpacking) the template data values.  Negative data values in GRIB
+//   are stored with the left most bit set to one, and a negative number
+//   of octets value in mappds[] indicates that this possibility should
+//   be considered.  The number of octets used to store the data value
+//   in this case would be the absolute value of the negative value in 
+//   mappds[].
+//  
+// 2005-12-08  Gilbert   Allow negative scale factors and limits for
+//                       Templates 4.5 and 4.9
+// 2009-12-15  Vuong     Added Product Definition Template 4.31
+//                       Added Product Definition Template 4.15
+// 2010-08-03  Vuong     Added Product Definition Template 4.40,4.41,4.42,4.43
+// 2010-12-08  Vuong     Corrected Definition Template 4.42,4.43
+// 2010-12-08  Vuong     Corrected Definition Template 4.42,4.43
+// 2012-03-29  Vuong     Added Templates 4.44,4.45,4.46,4.47,4.48,4.50,
+//                       4.51,4.91,4.32 and 4.52
+// 2013-08-05  Vuong     Corrected 4.91 and added Templates 4.33,4.34,4.53,4.54
+//
+//$$$
+
+      #define MAXPDSTEMP 43           // maximum number of templates
+      #define MAXPDSMAPLEN 200        // maximum template map length
+
+      struct pdstemplate 
+      {
+          g2int template_num;
+          g2int mappdslen;
+          g2int needext;
+          g2int mappds[MAXPDSMAPLEN];
+      };
+
+      const struct pdstemplate templatespds[MAXPDSTEMP] = {
+             // 4.0: Analysis or Forecast at Horizontal Level/Layer
+             //      at a point in time
+         {0,15,0, {1,1,1,1,1,2,1,1,4,1,-1,-4,1,-1,-4} },
+             // 4.1: Individual Ensemble Forecast at Horizontal Level/Layer
+             //      at a point in time
+         {1,18,0, {1,1,1,1,1,2,1,1,4,1,-1,-4,1,-1,-4,1,1,1} },
+             // 4.2: Derived Fcst based on whole Ensemble at Horiz Level/Layer
+             //      at a point in time
+         {2,17,0, {1,1,1,1,1,2,1,1,4,1,-1,-4,1,-1,-4,1,1} },
+             // 4.3: Derived Fcst based on Ensemble cluster over rectangular
+             //      area at Horiz Level/Layer at a point in time
+         {3,31,1, {1,1,1,1,1,2,1,1,4,1,-1,-4,1,-1,-4,1,1,1,1,1,1,1,-4,-4,4,4,1,-1,4,-1,4} },
+             // 4.4: Derived Fcst based on Ensemble cluster over circular
+             //      area at Horiz Level/Layer at a point in time
+         {4,30,1, {1,1,1,1,1,2,1,1,4,1,-1,-4,1,-1,-4,1,1,1,1,1,1,1,-4,4,4,1,-1,4,-1,4} },
+             // 4.5: Probablility Forecast at Horiz Level/Layer
+             //      at a point in time
+         {5,22,0, {1,1,1,1,1,2,1,1,4,1,-1,-4,1,-1,-4,1,1,1,-1,-4,-1,-4} },
+             // 4.6: Percentile Forecast at Horiz Level/Layer
+             //      at a point in time
+         {6,16,0, {1,1,1,1,1,2,1,1,4,1,-1,-4,1,-1,-4,1} },
+             // 4.7: Analysis or Forecast Error at Horizontal Level/Layer
+             //      at a point in time
+         {7,15,0, {1,1,1,1,1,2,1,1,4,1,-1,-4,1,-1,-4} },
+             // 4.8: Ave/Accum/etc... at Horiz Level/Layer
+             //      in a time interval
+         {8,29,1, {1,1,1,1,1,2,1,1,4,1,-1,-4,1,-1,-4,2,1,1,1,1,1,1,4,1,1,1,4,1,4} },
+             // 4.9: Probablility Forecast at Horiz Level/Layer
+             //      in a time interval
+         {9,36,1, {1,1,1,1,1,2,1,1,4,1,-1,-4,1,-1,-4,1,1,1,-1,-4,-1,-4,2,1,1,1,1,1,1,4,1,1,1,4,1,4} },
+             // 4.10: Percentile Forecast at Horiz Level/Layer
+             //       in a time interval
+         {10,30,1, {1,1,1,1,1,2,1,1,4,1,-1,-4,1,-1,-4,1,2,1,1,1,1,1,1,4,1,1,1,4,1,4} },
+             // 4.11: Individual Ensemble Forecast at Horizontal Level/Layer
+             //       in a time interval
+         {11,32,1, {1,1,1,1,1,2,1,1,4,1,-1,-4,1,-1,-4,1,1,1,2,1,1,1,1,1,1,4,1,1,1,4,1,4} },
+             // 4.12: Derived Fcst based on whole Ensemble at Horiz Level/Layer
+             //       in a time interval
+         {12,31,1, {1,1,1,1,1,2,1,1,4,1,-1,-4,1,-1,-4,1,1,2,1,1,1,1,1,1,4,1,1,1,4,1,4} },
+             // 4.13: Derived Fcst based on Ensemble cluster over rectangular
+             //       area at Horiz Level/Layer in a time interval
+         {13,45,1, {1,1,1,1,1,2,1,1,4,1,-1,-4,1,-1,-4,1,1,1,1,1,1,1,-4,-4,4,4,1,-1,4,-1,4,2,1,1,1,1,1,1,4,1,1,1,4,1,4} },
+             // 4.14: Derived Fcst based on Ensemble cluster over circular
+             //       area at Horiz Level/Layer in a time interval
+         {14,44,1, {1,1,1,1,1,2,1,1,4,1,-1,-4,1,-1,-4,1,1,1,1,1,1,1,-4,4,4,1,-1,4,-1,4,2,1,1,1,1,1,1,4,1,1,1,4,1,4} },
+             // 4.15: Average, accumulation, extreme values or other statistically-processed values over a
+             // spatial area at a horizontal level or in a horizontal layer at a point in time
+         {15,18,0, {1,1,1,1,1,2,1,1,4,1,-1,-4,1,-1,-4,1,1,1} },
+             // 4.20: Radar Product
+         {20,19,0, {1,1,1,1,1,-4,4,2,4,2,1,1,1,1,1,2,1,3,2} },
+             // 4.30: Satellite Product
+         {30,5,1, {1,1,1,1,1} },
+             // 4.31: Satellite Product
+         {31,5,1, {1,1,1,1,1} },
+             // 4.40: Analysis or forecast at a horizontal level or in a horizontal layer
+             // at a point in time for atmospheric chemical constituents
+         {40,16,0, {1,1,2,1,1,1,2,1,1,4,1,-1,-4,1,-1,-4} },
+             // 4.41: Individual ensemble forecast, control and perturbed, at a horizontal level or
+             // in a horizontal layer at a point in time for atmospheric chemical constituents
+         {41,19,0, {1,1,2,1,1,1,2,1,1,4,1,-1,-4,1,-1,-4,1,1,1} },
+             // 4.42: Average, accumulation, and/or extreme values or other statistically-processed values
+             // at a horizontal level or in a horizontal layer in a continuous or non-continuous
+             // time interval for atmospheric chemical constituents
+         {42,30,1, {1,1,2,1,1,1,2,1,1,4,1,-1,-4,1,-1,-4,2,1,1,1,1,1,1,4,1,1,1,4,1,4} },
+             // 4.43: Individual ensemble forecast, control and perturbed, at a horizontal level
+             // or in a horizontal layer in a continuous or non-continuous
+             // time interval for atmospheric chemical constituents
+         {43,33,1, {1,1,2,1,1,1,2,1,1,4,1,-1,-4,1,-1,-4,1,1,1,2,1,1,1,1,1,1,4,1,1,1,4,1,4} },
+             // 4.254: CCITT IA5 Character String
+         {254,3,0, {1,1,4} },
+             // 4.1000: Cross section of analysis or forecast
+             //         at a point in time
+         {1000,9,0, {1,1,1,1,1,2,1,1,4} },
+             // 4.1001: Cross section of Ave/Accum/etc... analysis or forecast
+             //         in a time interval
+         {1001,16,0, {1,1,1,1,1,2,1,1,4,4,1,1,1,4,1,4} },
+             // 4.1001: Cross section of Ave/Accum/etc... analysis or forecast
+             //         over latitude or longitude
+         {1002,15,0, {1,1,1,1,1,2,1,1,4,1,1,1,4,4,2} },
+             // 4.1100: Hovmoller-type grid w/ no averaging or other
+             //         statistical processing
+         {1100,15,0, {1,1,1,1,1,2,1,1,4,1,-1,-4,1,-1,-4} },
+             // 4.1100: Hovmoller-type grid with averaging or other
+             //         statistical processing
+         {1101,22,0, {1,1,1,1,1,2,1,1,4,1,-1,-4,1,-1,-4,4,1,1,1,4,1,4} },
+             // 4.32:Simulate (synthetic) Satellite Product
+         {32,10,1, {1,1,1,1,1,2,1,1,2,1} },
+             // 4.44: Analysis or forecast at a horizontal level or in a horizontal layer
+             // at a point in time for Aerosol
+         {44,21,0, {1,1,2,1,-1,-4,-1,-4,1,1,1,2,1,1,2,1,-1,-4,1,-1,-4} },
+             // 4.45: Individual ensemble forecast, control and 
+             // perturbed,  at a horizontal level or in a horizontal layer
+             // at a point in time for Aerosol
+         {45,24,0, {1,1,2,1,-1,-4,-1,-4,1,1,1,2,1,1,4,1,-1,-4,1,-1,-4,1,1,1} },
+             // 4.46: Ave or Accum or Extreme value at level/layer
+             // at horizontal level or in a horizontal in a continuous or
+             // non-continuous time interval for Aerosol
+         {46,35,1, {1,1,2,1,-1,-4,-1,-4,1,1,1,2,1,1,4,1,-1,-4,1,-1,-4,2,1,1,1,1,1,1,4,1,1,1,4,1,4} },
+             // 4.47: Individual ensemble forecast, control and 
+             // perturbed, at horizontal level or in a horizontal
+             // in a continuous or non-continuous time interval for Aerosol
+         {47,38,1, {1,1,1,2,1,-1,-4,-1,-4,1,1,2,1,1,4,1,-1,-4,1,-1,-4,1,1,1,2,1,1,1,1,1,1,4,1,1,1,4,1,4} },
+
+             //             PDT 4.48
+             // 4.48: Analysis or forecast at a horizontal level or in a horizontal layer
+             // at a point in time for Optical Properties of Aerosol
+         {48,26,0, {1,1,2,1,-1,-4,-1,-4,1,-1,-4,-1,-4,1,1,1,2,1,1,4,1,-1,-4,1,-1,-4} },
+
+             //             VALIDATION --- PDT 4.50
+             // 4.50: Analysis or forecast of multi component parameter or
+             // matrix element at a point in time
+         {50,21,0, {1,1,1,1,1,2,1,1,4,1,-1,-4,1,-1,-4,1,1,4,4,4,4} },
+
+             //             VALIDATION --- PDT 4.52
+             // 4.52: Analysis or forecast of Wave parameters
+             // at the Sea surface at a point in time
+         {52,15,0, {1,1,1,1,1,1,1,1,2,1,1,4,1,-1,-4} },
+
+             // 4.51: Categorical forecasts at a horizontal level or
+             // in a horizontal layer at a point in time
+         {51,16,1, {1,1,1,1,1,2,1,1,4,1,-1,-4,1,-1,-4,1} },
+
+             // 4.91: Categorical forecasts at a horizontal level or
+             // in a horizontal layer at a point in time
+             // in a continuous or non-continuous time interval
+         {91,36,1, {1,1,2,1,-1,-4,-1,-4,1,-1,-4,-1,-4,1,1,1,2,1,1,4,1,-1,-4,1,-1,-4} },
+// PDT 4.33  (07/29/2013)
+             // 4.33: Individual ensemble forecast, control, perturbed,
+             // at a horizontal level or in a  horizontal layer
+             // at a point in time for simulated (synthetic) Satellite data
+         {33,18,1, {1,1,1,1,1,2,1,1,4,1,2,2,2,-1,-4,1,1,1} },
+// PDT 4.34  (07/29/2013)
+             // 4.34: Individual ensemble forecast, control, perturbed,
+             // at a horizontal level or in a  horizontal layer,in a continuous or
+             // non-continuous interval for simulated (synthetic) Satellite data
+         {34,32,1, {1,1,1,1,1,2,1,1,4,1,2,2,2,-1,-4,1,1,1,2,1,1,1,1,1,1,4,1,1,1,4,1,4} },
+// PDT 4.53  (07/29/2013)
+             // 4.53:  Partitioned parameters at
+             // horizontal level or horizontal layer
+             // at a point in time
+         {53,19,1, {1,1,1,1,4,2,1,1,1,2,1,1,4,1,-1,-4,1,-1,-4} },
+// PDT 4.54  (07/29/2013)
+             // 4.54: Individual ensemble forecast, control, perturbed,
+             // at a horizontal level or in a  horizontal layer
+             // at a point in time for partitioned parameters
+         {54,22,1, {1,1,1,1,4,2,1,1,1,2,1,1,4,1,-1,-4,1,-1,-4,1,1,1} }
+
+      } ;
+
+
+#endif  /*  _pdstemplates_H  */
diff --git a/g2clib_src/pngpack.c b/g2clib_src/pngpack.c
new file mode 100755
index 0000000..f81ee41
--- /dev/null
+++ b/g2clib_src/pngpack.c
@@ -0,0 +1,162 @@
+#include <stdlib.h>
+#include <math.h>
+#include "grib2.h"
+
+int enc_png(char *,g2int ,g2int ,g2int ,char *);
+
+void pngpack(g2float *fld,g2int width,g2int height,g2int *idrstmpl,
+             unsigned char *cpack,g2int *lcpack)
+//$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    pngpack
+//   PRGMMR: Gilbert          ORG: W/NP11    DATE: 2003-08-27
+//
+// ABSTRACT: This subroutine packs up a data field into PNG image format.
+//   After the data field is scaled, and the reference value is subtracted out,
+//   it is treated as a grayscale image and passed to a PNG encoder.
+//   It also fills in GRIB2 Data Representation Template 5.41 or 5.40010 with 
+//   the appropriate values.
+//
+// PROGRAM HISTORY LOG:
+// 2003-08-27  Gilbert
+//
+// USAGE:    pngpack(g2float *fld,g2int width,g2int height,g2int *idrstmpl,
+//                   unsigned char *cpack,g2int *lcpack);
+//   INPUT ARGUMENT LIST:
+//     fld[]    - Contains the data values to pack
+//     width    - number of points in the x direction
+//     height   - number of points in the y direction
+//     idrstmpl - Contains the array of values for Data Representation
+//                Template 5.41 or 5.40010
+//                [0] = Reference value - ignored on input
+//                [1] = Binary Scale Factor
+//                [2] = Decimal Scale Factor
+//                [3] = number of bits for each data value - ignored on input
+//                [4] = Original field type - currently ignored on input
+//                      Data values assumed to be reals.
+//
+//   OUTPUT ARGUMENT LIST: 
+//     idrstmpl - Contains the array of values for Data Representation
+//                Template 5.41 or 5.40010
+//                [0] = Reference value - set by pngpack routine.
+//                [1] = Binary Scale Factor - unchanged from input
+//                [2] = Decimal Scale Factor - unchanged from input
+//                [3] = Number of bits containing each grayscale pixel value
+//                [4] = Original field type - currently set = 0 on output.
+//                      Data values assumed to be reals.
+//     cpack    - The packed data field 
+//     lcpack   - length of packed field cpack.
+//
+// REMARKS: None
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE:  IBM SP
+//
+//$$$
+{
+      g2int  *ifld;
+      static g2float alog2=0.69314718;       //  ln(2.0)
+      g2int  j,nbits,imin,imax,maxdif;
+      g2int  ndpts,nbytes;
+      g2float  bscale,dscale,rmax,rmin,temp;
+      unsigned char *ctemp;
+      
+      ifld=0;
+      ndpts=width*height;
+      bscale=int_power(2.0,-idrstmpl[1]);
+      dscale=int_power(10.0,idrstmpl[2]);
+//
+//  Find max and min values in the data
+//
+      rmax=fld[0];
+      rmin=fld[0];
+      for (j=1;j<ndpts;j++) {
+        if (fld[j] > rmax) rmax=fld[j];
+        if (fld[j] < rmin) rmin=fld[j];
+      }
+      maxdif = (g2int)rint( (rmax-rmin)*dscale*bscale );
+//
+//  If max and min values are not equal, pack up field.
+//  If they are equal, we have a constant field, and the reference
+//  value (rmin) is the value for each point in the field and
+//  set nbits to 0.
+//
+      if (rmin != rmax  &&  maxdif != 0 ) {
+        ifld=(g2int *)malloc(ndpts*sizeof(g2int));
+        //
+        //  Determine which algorithm to use based on user-supplied 
+        //  binary scale factor and number of bits.
+        //
+        if (idrstmpl[1] == 0) {
+           //
+           //  No binary scaling and calculate minumum number of 
+           //  bits in which the data will fit.
+           //
+           imin=(g2int)rint(rmin*dscale);
+           imax=(g2int)rint(rmax*dscale);
+           maxdif=imax-imin;
+           temp=log((double)(maxdif+1))/alog2;
+           nbits=(g2int)ceil(temp);
+           rmin=(g2float)imin;
+           //   scale data
+           for(j=0;j<ndpts;j++)
+             ifld[j]=(g2int)rint(fld[j]*dscale)-imin;
+        }
+        else {
+           //
+           //  Use binary scaling factor and calculate minumum number of 
+           //  bits in which the data will fit.
+           //
+           rmin=rmin*dscale;
+           rmax=rmax*dscale;
+           maxdif=(g2int)rint((rmax-rmin)*bscale);
+           temp=log((double)(maxdif+1))/alog2;
+           nbits=(g2int)ceil(temp);
+           //   scale data
+           for (j=0;j<ndpts;j++)
+             ifld[j]=(g2int)rint(((fld[j]*dscale)-rmin)*bscale);
+        }
+        //
+        //  Pack data into full octets, then do PNG encode.
+        //  and calculate the length of the packed data in bytes
+        //
+        if (nbits <= 8) {
+            nbits=8;
+        }
+        else if (nbits <= 16) {
+            nbits=16;
+        }
+        else if (nbits <= 24) {
+            nbits=24;
+        }
+        else {
+            nbits=32;
+        }
+        nbytes=(nbits/8)*ndpts;
+        ctemp=calloc(nbytes,1);
+        sbits(ctemp,ifld,0,nbits,0,ndpts);
+        //
+        //  Encode data into PNG Format.
+        //
+        *lcpack=(g2int)enc_png((char *)ctemp,width,height,nbits,(char *)cpack);
+        if (*lcpack <= 0) {
+           printf("pngpack: ERROR Packing PNG = %d\n",(int)*lcpack);
+        }
+        free(ctemp);
+
+      }
+      else {
+        nbits=0;
+        *lcpack=0;
+      }
+
+//
+//  Fill in ref value and number of bits in Template 5.0
+//
+      mkieee(&rmin,idrstmpl+0,1);   // ensure reference value is IEEE format
+      idrstmpl[3]=nbits;
+      idrstmpl[4]=0;         // original data were reals
+      if (ifld != 0) free(ifld);
+
+}
diff --git a/g2clib_src/pngunpack.c b/g2clib_src/pngunpack.c
new file mode 100755
index 0000000..407a358
--- /dev/null
+++ b/g2clib_src/pngunpack.c
@@ -0,0 +1,76 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include "grib2.h"
+
+int dec_png(unsigned char *,g2int *,g2int *,char *);
+
+g2int pngunpack(unsigned char *cpack,g2int len,g2int *idrstmpl,g2int ndpts,
+                g2float *fld)
+//$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    pngunpack
+//   PRGMMR: Gilbert          ORG: W/NP11    DATE: 2003-08-27
+//
+// ABSTRACT: This subroutine unpacks a data field that was packed into a 
+//   PNG image format
+//   using info from the GRIB2 Data Representation Template 5.41 or 5.40010.
+//
+// PROGRAM HISTORY LOG:
+// 2003-08-27  Gilbert
+//
+// USAGE:    pngunpack(unsigned char *cpack,g2int len,g2int *idrstmpl,g2int ndpts,
+//                     g2float *fld)
+//   INPUT ARGUMENT LIST:
+//     cpack    - The packed data field (character*1 array)
+//     len      - length of packed field cpack().
+//     idrstmpl - Pointer to array of values for Data Representation
+//                Template 5.41 or 5.40010
+//     ndpts    - The number of data values to unpack
+//
+//   OUTPUT ARGUMENT LIST:
+//     fld[]    - Contains the unpacked data values
+//
+// REMARKS: None
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE:  IBM SP
+//
+//$$$
+{
+
+      g2int  *ifld;
+      g2int  j,nbits,iret,width,height;
+      g2float  ref,bscale,dscale;
+      unsigned char *ctemp;
+
+      rdieee(idrstmpl+0,&ref,1);
+      bscale = int_power(2.0,idrstmpl[1]);
+      dscale = int_power(10.0,-idrstmpl[2]);
+      nbits = idrstmpl[3];
+//
+//  if nbits equals 0, we have a constant field where the reference value
+//  is the data value at each gridpoint
+//
+      if (nbits != 0) {
+
+         ifld=(g2int *)calloc(ndpts,sizeof(g2int));
+         ctemp=(unsigned char *)calloc(ndpts*4,1);
+         if ( ifld == 0 || ctemp == 0) {
+            fprintf(stderr,"Could not allocate space in jpcunpack.\n  Data field NOT upacked.\n");
+            return(1);
+         }
+         iret=(g2int)dec_png(cpack,&width,&height,ctemp);
+         gbits(ctemp,ifld,0,nbits,0,ndpts);
+         for (j=0;j<ndpts;j++) {
+           fld[j]=(((g2float)ifld[j]*bscale)+ref)*dscale;
+         }
+         free(ctemp);
+         free(ifld);
+      }
+      else {
+         for (j=0;j<ndpts;j++) fld[j]=ref;
+      }
+
+      return(0);
+}
diff --git a/g2clib_src/rdieee.c b/g2clib_src/rdieee.c
new file mode 100755
index 0000000..35fe338
--- /dev/null
+++ b/g2clib_src/rdieee.c
@@ -0,0 +1,78 @@
+#include "grib2.h"
+
+void rdieee(g2int *rieee,g2float *a,g2int num)
+//$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    rdieee 
+//   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2002-10-25
+//
+// ABSTRACT: This subroutine reads a list of real values in 
+//   32-bit IEEE floating point format.
+//
+// PROGRAM HISTORY LOG:
+// 2002-10-25  Gilbert
+//
+// USAGE:    void rdieee(g2int *rieee,g2float *a,g2int num)
+//   INPUT ARGUMENT LIST:
+//     rieee    - g2int array of floating point values in 32-bit IEEE format.
+//     num      - Number of floating point values to convert.
+//
+//   OUTPUT ARGUMENT LIST:      
+//     a        - float array of real values.  a must be allocated with at
+//                least 4*num bytes of memory before calling this function.
+//
+// REMARKS: None
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE:  IBM SP
+//
+//$$$
+{
+
+      g2int  j;
+      g2int  isign,iexp,imant;
+
+      g2float  sign,temp;
+      static g2float  two23,two126;
+      static g2int test=0;
+      g2intu msk1=0x80000000;        // 10000000000000000000000000000000 binary
+      g2int msk2=0x7F800000;         // 01111111100000000000000000000000 binary
+      g2int msk3=0x007FFFFF;         // 00000000011111111111111111111111 binary
+
+      if ( test == 0 ) {
+         two23=(g2float)int_power(2.0,-23);
+         two126=(g2float)int_power(2.0,-126);
+         test=1;
+      }
+
+      for (j=0;j<num;j++) {
+//
+//  Extract sign bit, exponent, and mantissa
+//
+        isign=(rieee[j]&msk1)>>31;
+        iexp=(rieee[j]&msk2)>>23;
+        imant=(rieee[j]&msk3);
+        //printf("SAGieee= %ld %ld %ld\n",isign,iexp,imant);
+
+        sign=1.0;
+        if (isign == 1) sign=-1.0;
+        
+        if ( (iexp > 0) && (iexp < 255) ) {
+          temp=(g2float)int_power(2.0,(iexp-127));
+          a[j]=sign*temp*(1.0+(two23*(g2float)imant));
+        }
+        else if ( iexp == 0 ) {
+          if ( imant != 0 )
+            a[j]=sign*two126*two23*(g2float)imant;
+          else
+            a[j]=sign*0.0;
+          
+        }
+        else if ( iexp == 255 )
+           a[j]=sign*(1E+37);
+
+
+      }
+
+}
diff --git a/g2clib_src/reduce.c b/g2clib_src/reduce.c
new file mode 100644
index 0000000..b1c3502
--- /dev/null
+++ b/g2clib_src/reduce.c
@@ -0,0 +1,410 @@
+/* reduce.f -- translated by f2c (version 20031025).
+   You must link the resulting object file with libf2c:
+	on Microsoft Windows system, link with libf2c.lib;
+	on Linux or Unix systems, link with .../path/to/libf2c.a -lm
+	or, if you install libf2c.a in a standard place, with -lf2c -lm
+	-- in that order, at the end of the command line, as in
+		cc *.o -lf2c -lm
+	Source for libf2c is in /netlib/f2c/libf2c.zip, e.g.,
+
+		http://www.netlib.org/f2c/libf2c.zip
+*/
+
+/*#include "f2c.h"*/
+#include <stdlib.h>
+#include "grib2.h"
+typedef g2int integer;
+typedef g2float real;
+
+/* Subroutine */ int reduce(integer *kfildo, integer *jmin, integer *jmax, 
+	integer *lbit, integer *nov, integer *lx, integer *ndg, integer *ibit,
+	 integer *jbit, integer *kbit, integer *novref, integer *ibxx2, 
+	integer *ier)
+{
+    /* Initialized data */
+
+    static integer ifeed = 12;
+
+    /* System generated locals */
+    integer i__1, i__2;
+
+    /* Local variables */
+    static integer newboxtp, j, l, m, jj, lxn, left;
+    static real pimp;
+    static integer move, novl;
+    static char cfeed[1];
+    static integer nboxj[31], lxnkp, iorigb, ibxx2m1, movmin,
+	     ntotbt[31], ntotpr, newboxt;
+    integer *newbox, *newboxp;
+
+
+/*        NOVEMBER 2001   GLAHN   TDL   GRIB2 */
+/*        MARCH    2002   GLAHN   COMMENT IER = 715 */
+/*        MARCH    2002   GLAHN   MODIFIED TO ACCOMMODATE LX=1 ON ENTRY */
+
+/*        PURPOSE */
+/*            DETERMINES WHETHER THE NUMBER OF GROUPS SHOULD BE */
+/*            INCREASED IN ORDER TO REDUCE THE SIZE OF THE LARGE */
+/*            GROUPS, AND TO MAKE THAT ADJUSTMENT.  BY REDUCING THE */
+/*            SIZE OF THE LARGE GROUPS, LESS BITS MAY BE NECESSARY */
+/*            FOR PACKING THE GROUP SIZES AND ALL THE INFORMATION */
+/*            ABOUT THE GROUPS. */
+
+/*            THE REFERENCE FOR NOV( ) WAS REMOVED IN THE CALLING */
+/*            ROUTINE SO THAT KBIT COULD BE DETERMINED.  THIS */
+/*            FURNISHES A STARTING POINT FOR THE ITERATIONS IN REDUCE. */
+/*            HOWEVER, THE REFERENCE MUST BE CONSIDERED. */
+
+/*        DATA SET USE */
+/*           KFILDO - UNIT NUMBER FOR OUTPUT (PRINT) FILE. (OUTPUT) */
+
+/*        VARIABLES IN CALL SEQUENCE */
+/*              KFILDO = UNIT NUMBER FOR OUTPUT (PRINT) FILE.  (INPUT) */
+/*             JMIN(J) = THE MINIMUM OF EACH GROUP (J=1,LX).  IT IS */
+/*                       POSSIBLE AFTER SPLITTING THE GROUPS, JMIN( ) */
+/*                       WILL NOT BE THE MINIMUM OF THE NEW GROUP. */
+/*                       THIS DOESN'T MATTER; JMIN( ) IS REALLY THE */
+/*                       GROUP REFERENCE AND DOESN'T HAVE TO BE THE */
+/*                       SMALLEST VALUE.  (INPUT/OUTPUT) */
+/*             JMAX(J) = THE MAXIMUM OF EACH GROUP (J=1,LX). */
+/*                       (INPUT/OUTPUT) */
+/*             LBIT(J) = THE NUMBER OF BITS NECESSARY TO PACK EACH GROUP */
+/*                       (J=1,LX).  (INPUT/OUTPUT) */
+/*              NOV(J) = THE NUMBER OF VALUES IN EACH GROUP (J=1,LX). */
+/*                       (INPUT/OUTPUT) */
+/*                  LX = THE NUMBER OF GROUPS.  THIS WILL BE INCREASED */
+/*                       IF GROUPS ARE SPLIT.  (INPUT/OUTPUT) */
+/*                 NDG = THE DIMENSION OF JMIN( ), JMAX( ), LBIT( ), AND */
+/*                       NOV( ).  (INPUT) */
+/*                IBIT = THE NUMBER OF BITS NECESSARY TO PACK THE JMIN(J) */
+/*                       VALUES, J=1,LX.  (INPUT) */
+/*                JBIT = THE NUMBER OF BITS NECESSARY TO PACK THE LBIT(J) */
+/*                       VALUES, J=1,LX.  (INPUT) */
+/*                KBIT = THE NUMBER OF BITS NECESSARY TO PACK THE NOV(J) */
+/*                       VALUES, J=1,LX.  IF THE GROUPS ARE SPLIT, KBIT */
+/*                       IS REDUCED.  (INPUT/OUTPUT) */
+/*              NOVREF = REFERENCE VALUE FOR NOV( ).  (INPUT) */
+/*            IBXX2(J) = 2**J (J=0,30).  (INPUT) */
+/*                 IER = ERROR RETURN.  (OUTPUT) */
+/*                         0 = GOOD RETURN. */
+/*                       714 = PROBLEM IN ALGORITHM.  REDUCE ABORTED. */
+/*                       715 = NGP NOT LARGE ENOUGH.  REDUCE ABORTED. */
+/*           NTOTBT(J) = THE TOTAL BITS USED FOR THE PACKING BITS J */
+/*                       (J=1,30).  (INTERNAL) */
+/*            NBOXJ(J) = NEW BOXES NEEDED FOR THE PACKING BITS J */
+/*                       (J=1,30).  (INTERNAL) */
+/*           NEWBOX(L) = NUMBER OF NEW BOXES (GROUPS) FOR EACH ORIGINAL */
+/*                       GROUP (L=1,LX) FOR THE CURRENT J.  (AUTOMATIC) */
+/*                       (INTERNAL) */
+/*          NEWBOXP(L) = SAME AS NEWBOX( ) BUT FOR THE PREVIOUS J. */
+/*                       THIS ELIMINATES RECOMPUTATION.  (AUTOMATIC) */
+/*                       (INTERNAL) */
+/*               CFEED = CONTAINS THE CHARACTER REPRESENTATION */
+/*                       OF A PRINTER FORM FEED.  (CHARACTER) (INTERNAL) */
+/*               IFEED = CONTAINS THE INTEGER VALUE OF A PRINTER */
+/*                       FORM FEED.  (INTERNAL) */
+/*              IORIGB = THE ORIGINAL NUMBER OF BITS NECESSARY */
+/*                       FOR THE GROUP VALUES.  (INTERNAL) */
+/*        1         2         3         4         5         6         7 X */
+
+/*        NON SYSTEM SUBROUTINES CALLED */
+/*           NONE */
+
+
+/*        NEWBOX( ) AND NEWBOXP( ) were AUTOMATIC ARRAYS. */
+    newbox = (integer *)calloc(*ndg,sizeof(integer));
+    newboxp = (integer *)calloc(*ndg,sizeof(integer));
+
+    /* Parameter adjustments */
+    --nov;
+    --lbit;
+    --jmax;
+    --jmin;
+
+    /* Function Body */
+
+    *ier = 0;
+    if (*lx == 1) {
+	goto L410;
+    }
+/*        IF THERE IS ONLY ONE GROUP, RETURN. */
+
+    *(unsigned char *)cfeed = (char) ifeed;
+
+/*        INITIALIZE NUMBER OF NEW BOXES PER GROUP TO ZERO. */
+
+    i__1 = *lx;
+    for (l = 1; l <= i__1; ++l) {
+	newbox[l - 1] = 0;
+/* L110: */
+    }
+
+/*        INITIALIZE NUMBER OF TOTAL NEW BOXES PER J TO ZERO. */
+
+    for (j = 1; j <= 31; ++j) {
+	ntotbt[j - 1] = 999999999;
+	nboxj[j - 1] = 0;
+/* L112: */
+    }
+
+    iorigb = (*ibit + *jbit + *kbit) * *lx;
+/*        IBIT = BITS TO PACK THE JMIN( ). */
+/*        JBIT = BITS TO PACK THE LBIT( ). */
+/*        KBIT = BITS TO PACK THE NOV( ). */
+/*        LX = NUMBER OF GROUPS. */
+    ntotbt[*kbit - 1] = iorigb;
+/*           THIS IS THE VALUE OF TOTAL BITS FOR THE ORIGINAL LX */
+/*           GROUPS, WHICH REQUIRES KBITS TO PACK THE GROUP */
+/*           LENGHTS.  SETTING THIS HERE MAKES ONE LESS LOOPS */
+/*           NECESSARY BELOW. */
+
+/*        COMPUTE BITS NOW USED FOR THE PARAMETERS DEFINED. */
+
+/*        DETERMINE OTHER POSSIBILITES BY INCREASING LX AND DECREASING */
+/*        NOV( ) WITH VALUES GREATER THAN THRESHOLDS.  ASSUME A GROUP IS */
+/*        SPLIT INTO 2 OR MORE GROUPS SO THAT KBIT IS REDUCED WITHOUT */
+/*        CHANGING IBIT OR JBIT. */
+
+    jj = 0;
+
+/* Computing MIN */
+    i__1 = 30, i__2 = *kbit - 1;
+    /*for (j = min(i__1,i__2); j >= 2; --j) {*/
+    for (j = (i__1 < i__2) ? i__1 : i__2; j >= 2; --j) {
+/*           VALUES GE KBIT WILL NOT REQUIRE SPLITS.  ONCE THE TOTAL */
+/*           BITS START INCREASING WITH DECREASING J, STOP.  ALSO, THE */
+/*           NUMBER OF BITS REQUIRED IS KNOWN FOR KBITS = NTOTBT(KBIT). */
+
+	newboxt = 0;
+
+	i__1 = *lx;
+	for (l = 1; l <= i__1; ++l) {
+
+	    if (nov[l] < ibxx2[j]) {
+		newbox[l - 1] = 0;
+/*                 NO SPLITS OR NEW BOXES. */
+		goto L190;
+	    } else {
+		novl = nov[l];
+
+		m = (nov[l] - 1) / (ibxx2[j] - 1) + 1;
+/*                 M IS FOUND BY SOLVING THE EQUATION BELOW FOR M: */
+/*                 (NOV(L)+M-1)/M LT IBXX2(J) */
+/*                 M GT (NOV(L)-1)/(IBXX2(J)-1) */
+/*                 SET M = (NOV(L)-1)/(IBXX2(J)-1)+1 */
+L130:
+		novl = (nov[l] + m - 1) / m;
+/*                 THE +M-1 IS NECESSARY.  FOR INSTANCE, 15 WILL FIT */
+/*                 INTO A BOX 4 BITS WIDE, BUT WON'T DIVIDE INTO */
+/*                 TWO BOXES 3 BITS WIDE EACH. */
+
+		if (novl < ibxx2[j]) {
+		    goto L185;
+		} else {
+		    ++m;
+/* ***                  WRITE(KFILDO,135)L,NOV(L),NOVL,M,J,IBXX2(J) */
+/* *** 135              FORMAT(/' AT 135--L,NOV(L),NOVL,M,J,IBXX2(J)',6I10) */
+		    goto L130;
+		}
+
+/*                 THE ABOVE DO LOOP WILL NEVER COMPLETE. */
+	    }
+
+L185:
+	    newbox[l - 1] = m - 1;
+	    newboxt = newboxt + m - 1;
+L190:
+	    ;
+	}
+
+	nboxj[j - 1] = newboxt;
+	ntotpr = ntotbt[j];
+	ntotbt[j - 1] = (*ibit + *jbit) * (*lx + newboxt) + j * (*lx + 
+		newboxt);
+
+	if (ntotbt[j - 1] >= ntotpr) {
+	    jj = j + 1;
+/*              THE PLUS IS USED BECAUSE J DECREASES PER ITERATION. */
+	    goto L250;
+	} else {
+
+/*              SAVE THE TOTAL NEW BOXES AND NEWBOX( ) IN CASE THIS */
+/*              IS THE J TO USE. */
+
+	    newboxtp = newboxt;
+
+	    i__1 = *lx;
+	    for (l = 1; l <= i__1; ++l) {
+		newboxp[l - 1] = newbox[l - 1];
+/* L195: */
+	    }
+
+/*           WRITE(KFILDO,197)NEWBOXT,IBXX2(J) */
+/* 197        FORMAT(/' *****************************************' */
+/*    1             /' THE NUMBER OF NEWBOXES PER GROUP OF THE TOTAL', */
+/*    2              I10,' FOR GROUP MAXSIZE PLUS 1 ='I10 */
+/*    3             /' *****************************************') */
+/*           WRITE(KFILDO,198) (NEWBOX(L),L=1,LX) */
+/* 198        FORMAT(/' '20I6/(' '20I6)) */
+	}
+
+/* 205     WRITE(KFILDO,209)KBIT,IORIGB */
+/* 209     FORMAT(/' ORIGINAL BITS WITH KBIT OF',I5,' =',I10) */
+/*        WRITE(KFILDO,210)(N,N=2,10),(IBXX2(N),N=2,10), */
+/*    1                    (NTOTBT(N),N=2,10),(NBOXJ(N),N=2,10), */
+/*    2                    (N,N=11,20),(IBXX2(N),N=11,20), */
+/*    3                    (NTOTBT(N),N=11,20),(NBOXJ(N),N=11,20), */
+/*    4                    (N,N=21,30),(IBXX2(N),N=11,20), */
+/*    5                    (NTOTBT(N),N=21,30),(NBOXJ(N),N=21,30) */
+/* 210     FORMAT(/' THE TOTAL BYTES FOR MAXIMUM GROUP LENGTHS BY ROW'// */
+/*    1      '   J         = THE NUMBER OF BITS PER GROUP LENGTH'/ */
+/*    2      '   IBXX2(J)  = THE MAXIMUM GROUP LENGTH PLUS 1 FOR THIS J'/ */
+/*    3      '   NTOTBT(J) = THE TOTAL BITS FOR THIS J'/ */
+/*    4      '   NBOXJ(J)  = THE NEW GROUPS FOR THIS J'/ */
+/*    5      4(/10X,9I10)/4(/10I10)/4(/10I10)) */
+
+/* L200: */
+    }
+
+L250:
+    pimp = (iorigb - ntotbt[jj - 1]) / (real) iorigb * 100.f;
+/*     WRITE(KFILDO,252)PIMP,KBIT,JJ */
+/* 252  FORMAT(/' PERCENT IMPROVEMENT =',F6.1, */
+/*    1        ' BY DECREASING GROUP LENGTHS FROM',I4,' TO',I4,' BITS') */
+    if (pimp >= 2.f) {
+
+/*        WRITE(KFILDO,255)CFEED,NEWBOXTP,IBXX2(JJ) */
+/* 255     FORMAT(A1,/' *****************************************' */
+/*    1             /' THE NUMBER OF NEWBOXES PER GROUP OF THE TOTAL', */
+/*    2             I10,' FOR GROUP MAXSIZE PLUS 1 ='I10 */
+/*    2             /' *****************************************') */
+/*        WRITE(KFILDO,256) (NEWBOXP(L),L=1,LX) */
+/* 256     FORMAT(/' '20I6) */
+
+/*           ADJUST GROUP LENGTHS FOR MAXIMUM LENGTH OF JJ BITS. */
+/*           THE MIN PER GROUP AND THE NUMBER OF BITS REQUIRED */
+/*           PER GROUP ARE NOT CHANGED.  THIS MAY MEAN THAT A */
+/*           GROUP HAS A MIN (OR REFERENCE) THAT IS NOT ZERO. */
+/*           THIS SHOULD NOT MATTER TO THE UNPACKER. */
+
+	lxnkp = *lx + newboxtp;
+/*           LXNKP = THE NEW NUMBER OF BOXES */
+
+	if (lxnkp > *ndg) {
+/*              DIMENSIONS NOT LARGE ENOUGH.  PROBABLY AN ERROR */
+/*              OF SOME SORT.  ABORT. */
+/*           WRITE(KFILDO,257)NDG,LXNPK */
+/*        1         2         3         4         5         6         7 X */
+/* 257        FORMAT(/' DIMENSIONS OF JMIN, ETC. IN REDUCE =',I8, */
+/*    1              ' NOT LARGE ENOUGH FOR THE EXPANDED NUMBER OF', */
+/*    2              ' GROUPS =',I8,'.  ABORT REDUCE.') */
+	    *ier = 715;
+	    goto L410;
+/*              AN ABORT CAUSES THE CALLING PROGRAM TO REEXECUTE */
+/*              WITHOUT CALLING REDUCE. */
+	}
+
+	lxn = lxnkp;
+/*           LXN IS THE NUMBER OF THE BOX IN THE NEW SERIES BEING */
+/*           FILLED.  IT DECREASES PER ITERATION. */
+	ibxx2m1 = ibxx2[jj] - 1;
+/*           IBXX2M1 IS THE MAXIMUM NUMBER OF VALUES PER GROUP. */
+
+	for (l = *lx; l >= 1; --l) {
+
+/*              THE VALUES IS NOV( ) REPRESENT THOSE VALUES + NOVREF. */
+/*              WHEN VALUES ARE MOVED TO ANOTHER BOX, EACH VALUE */
+/*              MOVED TO A NEW BOX REPRESENTS THAT VALUE + NOVREF. */
+/*              THIS HAS TO BE CONSIDERED IN MOVING VALUES. */
+
+	    if (newboxp[l - 1] * (ibxx2m1 + *novref) + *novref > nov[l] + *
+		    novref) {
+/*                 IF THE ABOVE TEST IS MET, THEN MOVING IBXX2M1 VALUES */
+/*                 FOR ALL NEW BOXES WILL LEAVE A NEGATIVE NUMBER FOR */
+/*                 THE LAST BOX.  NOT A TOLERABLE SITUATION. */
+		movmin = (nov[l] - newboxp[l - 1] * *novref) / newboxp[l - 1];
+		left = nov[l];
+/*                 LEFT = THE NUMBER OF VALUES TO MOVE FROM THE ORIGINAL */
+/*                 BOX TO EACH NEW BOX EXCEPT THE LAST.  LEFT IS THE */
+/*                 NUMBER LEFT TO MOVE. */
+	    } else {
+		movmin = ibxx2m1;
+/*                 MOVMIN VALUES CAN BE MOVED FOR EACH NEW BOX. */
+		left = nov[l];
+/*                 LEFT IS THE NUMBER OF VALUES LEFT TO MOVE. */
+	    }
+
+	    if (newboxp[l - 1] > 0) {
+		if ((movmin + *novref) * newboxp[l - 1] + *novref <= nov[l] + 
+			*novref && (movmin + *novref) * (newboxp[l - 1] + 1) 
+			>= nov[l] + *novref) {
+		    goto L288;
+		} else {
+/* ***D                 WRITE(KFILDO,287)L,MOVMIN,NOVREF,NEWBOXP(L),NOV(L) */
+/* ***D287              FORMAT(/' AT 287 IN REDUCE--L,MOVMIN,NOVREF,', */
+/* ***D    1                    'NEWBOXP(L),NOV(L)',5I12 */
+/* ***D    2                    ' REDUCE ABORTED.') */
+/*              WRITE(KFILDO,2870) */
+/* 2870          FORMAT(/' AN ERROR IN REDUCE ALGORITHM.  ABORT REDUCE.') */
+		    *ier = 714;
+		    goto L410;
+/*                 AN ABORT CAUSES THE CALLING PROGRAM TO REEXECUTE */
+/*                 WITHOUT CALLING REDUCE. */
+		}
+
+	    }
+
+L288:
+	    i__1 = newboxp[l - 1] + 1;
+	    for (j = 1; j <= i__1; ++j) {
+		/*move = min(movmin,left);*/
+		move = (movmin < left) ? movmin : left;
+		jmin[lxn] = jmin[l];
+		jmax[lxn] = jmax[l];
+		lbit[lxn] = lbit[l];
+		nov[lxn] = move;
+		--lxn;
+		left -= move + *novref;
+/*                 THE MOVE OF MOVE VALUES REALLY REPRESENTS A MOVE OF */
+/*                 MOVE + NOVREF VALUES. */
+/* L290: */
+	    }
+
+	    if (left != -(*novref)) {
+/* ***               WRITE(KFILDO,292)L,LXN,MOVE,LXNKP,IBXX2(JJ),LEFT,NOV(L), */
+/* ***     1                          MOVMIN */
+/* *** 292           FORMAT(' AT 292 IN REDUCE--L,LXN,MOVE,LXNKP,', */
+/* ***     1                'IBXX2(JJ),LEFT,NOV(L),MOVMIN'/8I12) */
+	    }
+
+/* L300: */
+	}
+
+	*lx = lxnkp;
+/*           LX IS NOW THE NEW NUMBER OF GROUPS. */
+	*kbit = jj;
+/*           KBIT IS NOW THE NEW NUMBER OF BITS REQUIRED FOR PACKING */
+/*           GROUP LENGHTS. */
+    }
+
+/*     WRITE(KFILDO,406)CFEED,LX */
+/* 406  FORMAT(A1,/' *****************************************' */
+/*    1          /' THE GROUP SIZES NOV( ) AFTER REDUCTION IN SIZE', */
+/*    2           ' FOR'I10,' GROUPS', */
+/*    3          /' *****************************************') */
+/*     WRITE(KFILDO,407) (NOV(J),J=1,LX) */
+/* 407  FORMAT(/' '20I6) */
+/*     WRITE(KFILDO,408)CFEED,LX */
+/* 408  FORMAT(A1,/' *****************************************' */
+/*    1          /' THE GROUP MINIMA JMIN( ) AFTER REDUCTION IN SIZE', */
+/*    2           ' FOR'I10,' GROUPS', */
+/*    3          /' *****************************************') */
+/*     WRITE(KFILDO,409) (JMIN(J),J=1,LX) */
+/* 409  FORMAT(/' '20I6) */
+
+L410:
+    if ( newbox != 0 ) free(newbox);
+    if ( newboxp != 0 ) free(newboxp);
+    return 0;
+} /* reduce_ */
+
diff --git a/g2clib_src/seekgb.c b/g2clib_src/seekgb.c
new file mode 100755
index 0000000..69cf66c
--- /dev/null
+++ b/g2clib_src/seekgb.c
@@ -0,0 +1,83 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include "grib2.h"
+
+void seekgb(FILE *lugb,g2int iseek,g2int mseek,g2int *lskip,g2int *lgrib)
+//$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//
+// SUBPROGRAM: seekgb         Searches a file for the next GRIB message.
+//   PRGMMR: Gilbert          ORG: W/NP11      DATE: 2002-10-28
+//
+// ABSTRACT: This subprogram searches a file for the next GRIB Message.
+//   The search is done starting at byte offset iseek of the file referenced 
+//   by lugb for mseek bytes at a time.
+//   If found, the starting position and length of the message are returned
+//   in lskip and lgrib, respectively.
+//   The search is terminated when an EOF or I/O error is encountered.
+//
+// PROGRAM HISTORY LOG:
+// 2002-10-28  GILBERT   Modified from Iredell's skgb subroutine
+// 2009-01-16  VUONG     Changed  lskip to 4 instead of sizof(g2int)
+//
+// USAGE:    seekgb(FILE *lugb,g2int iseek,g2int mseek,int *lskip,int *lgrib)
+//   INPUT ARGUMENTS:
+//     lugb       - FILE pointer for the file to search.  File must be
+//                  opened before this routine is called.
+//     iseek      - number of bytes in the file to skip before search
+//     mseek      - number of bytes to search at a time
+//   OUTPUT ARGUMENTS:
+//     lskip      - number of bytes to skip from the beggining of the file
+//                  to where the GRIB message starts
+//     lgrib      - number of bytes in message (set to 0, if no message found)
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//
+//$$$
+{
+      g2int  ret;
+      g2int k,k4,ipos,nread,lim,start,vers,lengrib;
+      int    end;
+      unsigned char *cbuf;
+
+// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+      *lgrib=0;
+      cbuf=(unsigned char *)malloc(mseek);
+      nread=mseek;
+      ipos=iseek;
+
+// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+//  LOOP UNTIL GRIB MESSAGE IS FOUND
+
+      while (*lgrib==0 && nread==mseek) {
+
+//  READ PARTIAL SECTION
+
+        ret=fseek(lugb,ipos,SEEK_SET);
+        nread=fread(cbuf,sizeof(unsigned char),mseek,lugb);
+        lim=nread-8;
+
+//  LOOK FOR 'GRIB...' IN PARTIAL SECTION
+
+        for (k=0;k<lim;k++) {
+          gbit(cbuf,&start,(k+0)*8,4*8);
+          gbit(cbuf,&vers,(k+7)*8,1*8);
+          if (start==1196575042 && (vers==1 || vers==2)) {
+//  LOOK FOR '7777' AT END OF GRIB MESSAGE
+            if (vers == 1) gbit(cbuf,&lengrib,(k+4)*8,3*8);
+            if (vers == 2) gbit(cbuf,&lengrib,(k+12)*8,4*8);
+            ret=fseek(lugb,ipos+k+lengrib-4,SEEK_SET);
+//          Hard code to 4 instead of sizeof(g2int)
+            k4=fread(&end,4,1,lugb);
+            if (k4 == 1 && end == 926365495) {      //GRIB message found
+                *lskip=ipos+k;
+                *lgrib=lengrib;
+                break;
+            }
+          }
+        }
+        ipos=ipos+lim;
+      }
+
+      free(cbuf);
+}
diff --git a/g2clib_src/simpack.c b/g2clib_src/simpack.c
new file mode 100755
index 0000000..da389e7
--- /dev/null
+++ b/g2clib_src/simpack.c
@@ -0,0 +1,181 @@
+#include <stdlib.h>
+#include <math.h>
+#include "grib2.h"
+
+
+void simpack(g2float *fld,g2int ndpts,g2int *idrstmpl,unsigned char *cpack,g2int *lcpack)
+//$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    simpack
+//   PRGMMR: Gilbert          ORG: W/NP11    DATE: 2002-11-06
+//
+// ABSTRACT: This subroutine packs up a data field using the simple
+//   packing algorithm as defined in the GRIB2 documention.  It
+//   also fills in GRIB2 Data Representation Template 5.0 with the
+//   appropriate values.
+//
+// PROGRAM HISTORY LOG:
+// 2002-11-06  Gilbert
+//
+// USAGE:    CALL simpack(fld,ndpts,idrstmpl,cpack,lcpack)
+//   INPUT ARGUMENT LIST:
+//     fld[]    - Contains the data values to pack
+//     ndpts    - The number of data values in array fld[]
+//     idrstmpl - Contains the array of values for Data Representation
+//                Template 5.0
+//                [0] = Reference value - ignored on input
+//                [1] = Binary Scale Factor
+//                [2] = Decimal Scale Factor
+//                [3] = Number of bits used to pack data, if value is
+//                      > 0 and  <= 31.
+//                      If this input value is 0 or outside above range
+//                      then the num of bits is calculated based on given 
+//                      data and scale factors.
+//                [4] = Original field type - currently ignored on input
+//                      Data values assumed to be reals.
+//
+//   OUTPUT ARGUMENT LIST: 
+//     idrstmpl - Contains the array of values for Data Representation
+//                Template 5.0
+//                [0] = Reference value - set by simpack routine.
+//                [1] = Binary Scale Factor - unchanged from input
+//                [2] = Decimal Scale Factor - unchanged from input
+//                [3] = Number of bits used to pack data, unchanged from 
+//                      input if value is between 0 and 31.
+//                      If this input value is 0 or outside above range
+//                      then the num of bits is calculated based on given 
+//                      data and scale factors.
+//                [4] = Original field type - currently set = 0 on output.
+//                      Data values assumed to be reals.
+//     cpack    - The packed data field
+//     lcpack   - length of packed field starting at cpack.
+//
+// REMARKS: None
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE:  
+//
+//$$$
+{
+
+      static g2int zero=0;
+      g2int  *ifld;
+      g2int  j,nbits,imin,imax,maxdif,nbittot,left;
+      g2float  bscale,dscale,rmax,rmin,temp;
+      double maxnum;
+      static g2float alog2=0.69314718;       //  ln(2.0)
+      
+      bscale=int_power(2.0,-idrstmpl[1]);
+      dscale=int_power(10.0,idrstmpl[2]);
+      if (idrstmpl[3] <= 0 || idrstmpl[3] > 31)
+         nbits=0;
+      else
+         nbits=idrstmpl[3];
+//
+//  Find max and min values in the data
+//
+      rmax=fld[0];
+      rmin=fld[0];
+      for (j=1;j<ndpts;j++) {
+        if (fld[j] > rmax) rmax=fld[j];
+        if (fld[j] < rmin) rmin=fld[j];
+      }
+     
+      ifld=calloc(ndpts,sizeof(g2int));
+//
+//  If max and min values are not equal, pack up field.
+//  If they are equal, we have a constant field, and the reference
+//  value (rmin) is the value for each point in the field and
+//  set nbits to 0.
+//
+      if (rmin != rmax) {
+        //
+        //  Determine which algorithm to use based on user-supplied 
+        //  binary scale factor and number of bits.
+        //
+        if (nbits==0 && idrstmpl[1]==0) {
+           //
+           //  No binary scaling and calculate minumum number of 
+           //  bits in which the data will fit.
+           //
+           imin=(g2int)rint(rmin*dscale);
+           imax=(g2int)rint(rmax*dscale);
+           maxdif=imax-imin;
+           temp=log((double)(maxdif+1))/alog2;
+           nbits=(g2int)ceil(temp);
+           rmin=(g2float)imin;
+           //   scale data
+           for(j=0;j<ndpts;j++)
+             ifld[j]=(g2int)rint(fld[j]*dscale)-imin;
+        }
+        else if (nbits!=0 && idrstmpl[1]==0) {
+           //
+           //  Use minimum number of bits specified by user and
+           //  adjust binary scaling factor to accomodate data.
+           //
+           rmin=rmin*dscale;
+           rmax=rmax*dscale;
+           maxnum=int_power(2.0,nbits)-1;
+           temp=log(maxnum/(rmax-rmin))/alog2;
+           idrstmpl[1]=(g2int)ceil(-1.0*temp);
+           bscale=int_power(2.0,-idrstmpl[1]);
+           //   scale data
+           for (j=0;j<ndpts;j++)
+             ifld[j]=(g2int)rint(((fld[j]*dscale)-rmin)*bscale);
+        }
+        else if (nbits==0 && idrstmpl[1]!=0) {
+           //
+           //  Use binary scaling factor and calculate minumum number of 
+           //  bits in which the data will fit.
+           //
+           rmin=rmin*dscale;
+           rmax=rmax*dscale;
+           maxdif=(g2int)rint((rmax-rmin)*bscale);
+           temp=log((double)(maxdif+1))/alog2;
+           nbits=(g2int)ceil(temp);
+           //   scale data
+           for (j=0;j<ndpts;j++)
+             ifld[j]=(g2int)rint(((fld[j]*dscale)-rmin)*bscale);
+        }
+        else if (nbits!=0 && idrstmpl[1]!=0) {
+           //
+           //  Use binary scaling factor and use minumum number of 
+           //  bits specified by user.   Dangerous - may loose
+           //  information if binary scale factor and nbits not set
+           //  properly by user.
+           //
+           rmin=rmin*dscale;
+           //   scale data
+           for (j=0;j<ndpts;j++)
+             ifld[j]=(g2int)rint(((fld[j]*dscale)-rmin)*bscale);
+        }
+        //
+        //  Pack data, Pad last octet with Zeros, if necessary,
+        //  and calculate the length of the packed data in bytes
+        //
+        sbits(cpack,ifld+0,0,nbits,0,ndpts);
+        nbittot=nbits*ndpts;
+        left=8-(nbittot%8);
+        if (left != 8) {
+          sbit(cpack,&zero,nbittot,left);   // Pad with zeros to fill Octet
+          nbittot=nbittot+left;
+        }
+        *lcpack=nbittot/8;
+      }
+      else {
+        nbits=0;
+        *lcpack=0;
+      }
+
+//
+//  Fill in ref value and number of bits in Template 5.0
+//
+      //printf("SAGmkieee %f\n",rmin);
+      mkieee(&rmin,idrstmpl+0,1);   // ensure reference value is IEEE format
+      //printf("SAGmkieee %ld\n",idrstmpl[0]);
+      idrstmpl[3]=nbits;
+      idrstmpl[4]=0;         // original data were reals
+
+      free(ifld);
+}
diff --git a/g2clib_src/simunpack.c b/g2clib_src/simunpack.c
new file mode 100755
index 0000000..dfa431b
--- /dev/null
+++ b/g2clib_src/simunpack.c
@@ -0,0 +1,76 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include "grib2.h"
+
+
+g2int simunpack(unsigned char *cpack,g2int *idrstmpl,g2int ndpts,g2float *fld)
+////$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    simunpack
+//   PRGMMR: Gilbert          ORG: W/NP11    DATE: 2002-10-29
+//
+// ABSTRACT: This subroutine unpacks a data field that was packed using a 
+//   simple packing algorithm as defined in the GRIB2 documention,
+//   using info from the GRIB2 Data Representation Template 5.0.
+//
+// PROGRAM HISTORY LOG:
+// 2002-10-29  Gilbert
+//
+// USAGE:    int simunpack(unsigned char *cpack,g2int *idrstmpl,g2int ndpts,
+//                         g2float *fld)
+//   INPUT ARGUMENT LIST:
+//     cpack    - pointer to the packed data field.
+//     idrstmpl - pointer to the array of values for Data Representation
+//                Template 5.0
+//     ndpts    - The number of data values to unpack
+//
+//   OUTPUT ARGUMENT LIST:
+//     fld      - Contains the unpacked data values.  fld must be allocated
+//                with at least ndpts*sizeof(g2float) bytes before
+//                calling this routine.
+//
+// REMARKS: None
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE:  
+//
+//$$$//
+{
+
+      g2int  *ifld;
+      g2int  j,nbits,itype;
+      g2float ref,bscale,dscale;
+
+      
+      rdieee(idrstmpl+0,&ref,1);
+      bscale = int_power(2.0,idrstmpl[1]);
+      dscale = int_power(10.0,-idrstmpl[2]);
+      nbits = idrstmpl[3];
+      itype = idrstmpl[4];
+
+      ifld=(g2int *)calloc(ndpts,sizeof(g2int));
+      if ( ifld == 0 ) {
+         fprintf(stderr,"Could not allocate space in simunpack.\n  Data field NOT upacked.\n");
+         return(1);
+      }
+      
+//
+//  if nbits equals 0, we have a constant field where the reference value
+//  is the data value at each gridpoint
+//
+      if (nbits != 0) {
+         gbits(cpack,ifld,0,nbits,0,ndpts);
+         for (j=0;j<ndpts;j++) {
+           fld[j]=(((g2float)ifld[j]*bscale)+ref)*dscale;
+         }
+      }
+      else {
+         for (j=0;j<ndpts;j++) {
+           fld[j]=ref;
+         }
+      }
+
+      free(ifld);
+      return(0);
+}
diff --git a/g2clib_src/specpack.c b/g2clib_src/specpack.c
new file mode 100644
index 0000000..66c16f0
--- /dev/null
+++ b/g2clib_src/specpack.c
@@ -0,0 +1,128 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include "grib2.h"
+
+
+void specpack(g2float *fld,g2int ndpts,g2int JJ,g2int KK,g2int MM,
+              g2int *idrstmpl,unsigned char *cpack,g2int *lcpack)
+//$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    specpack
+//   PRGMMR: Gilbert          ORG: W/NP11    DATE: 2002-12-19
+//
+// ABSTRACT: This subroutine packs a spectral data field using the complex
+//   packing algorithm for spherical harmonic data as 
+//   defined in the GRIB2 Data Representation Template 5.51.
+//
+// PROGRAM HISTORY LOG:
+// 2002-12-19  Gilbert
+//
+// USAGE:    void specpack(g2float *fld,g2int ndpts,g2int JJ,g2int KK,g2int MM,
+//                        g2int *idrstmpl,insigned char *cpack,g2int *lcpack)
+//   INPUT ARGUMENT LIST:
+//     fld[]    - Contains the packed data values
+//     ndpts    - The number of data values to pack
+//     JJ       - J - pentagonal resolution parameter
+//     KK       - K - pentagonal resolution parameter
+//     MM       - M - pentagonal resolution parameter
+//     idrstmpl - Contains the array of values for Data Representation
+//                Template 5.51
+//
+//   OUTPUT ARGUMENT LIST:
+//     cpack    - The packed data field (character*1 array)
+//     lcpack   - length of packed field cpack().
+//
+// REMARKS: None
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE:  IBM SP
+//
+//$$$
+{
+
+      g2int    *ifld,tmplsim[5];
+      g2float  bscale,dscale,*unpk,*tfld;
+      g2float  *pscale,tscale;
+      g2int    Js,Ks,Ms,Ts,Ns,inc,incu,incp,n,Nm,m,ipos;
+
+      bscale = int_power(2.0,-idrstmpl[1]);
+      dscale = int_power(10.0,idrstmpl[2]);
+      Js=idrstmpl[5];
+      Ks=idrstmpl[6];
+      Ms=idrstmpl[7];
+      Ts=idrstmpl[8];
+
+//
+//   Calculate Laplacian scaling factors for each possible wave number.
+//
+      pscale=(g2float *)malloc((JJ+MM)*sizeof(g2float));
+      tscale=(g2float)idrstmpl[4]*1E-6;
+      for (n=Js;n<=JJ+MM;n++)
+           pscale[n]=pow((g2float)(n*(n+1)),tscale);
+//
+//   Separate spectral coeffs into two lists; one to contain unpacked
+//   values within the sub-spectrum Js, Ks, Ms, and the other with values 
+//   outside of the sub-spectrum to be packed.
+//
+      tfld=(g2float *)malloc(ndpts*sizeof(g2float));
+      unpk=(g2float *)malloc(ndpts*sizeof(g2float));
+      ifld=(g2int *)malloc(ndpts*sizeof(g2int));
+      inc=0;
+      incu=0;
+      incp=0;
+      for (m=0;m<=MM;m++) {
+         Nm=JJ;      // triangular or trapezoidal
+         if ( KK == JJ+MM ) Nm=JJ+m;          // rhombodial
+         Ns=Js;      // triangular or trapezoidal
+         if ( Ks == Js+Ms ) Ns=Js+m;          // rhombodial
+         for (n=m;n<=Nm;n++) {
+            if (n<=Ns && m<=Ms) {       // save unpacked value
+               unpk[incu++]=fld[inc++];         // real part
+               unpk[incu++]=fld[inc++];     // imaginary part
+            }
+            else {                       // Save value to be packed and scale
+                                         // Laplacian scale factor
+               tfld[incp++]=fld[inc++]*pscale[n];      // real part
+               tfld[incp++]=fld[inc++]*pscale[n];      // imaginary part
+            }
+         }
+      }
+
+      free(pscale);
+
+      if (incu != Ts) {
+         printf("specpack: Incorrect number of unpacked values %d given:\n",(int)Ts);
+         printf("specpack: Resetting idrstmpl[8] to %d\n",(int)incu);
+         Ts=incu;
+      }
+//
+//  Add unpacked values to the packed data array in 32-bit IEEE format
+//
+      mkieee(unpk,(g2int *)cpack,Ts);
+      ipos=4*Ts;
+//
+//  Scale and pack the rest of the coefficients
+// 
+      tmplsim[1]=idrstmpl[1];
+      tmplsim[2]=idrstmpl[2];
+      tmplsim[3]=idrstmpl[3];
+      simpack(tfld,ndpts-Ts,tmplsim,cpack+ipos,lcpack);
+      *lcpack=(*lcpack)+ipos;
+//
+//  Fill in Template 5.51
+//
+      idrstmpl[0]=tmplsim[0];
+      idrstmpl[1]=tmplsim[1];
+      idrstmpl[2]=tmplsim[2];
+      idrstmpl[3]=tmplsim[3];
+      idrstmpl[8]=Ts;
+      idrstmpl[9]=1;         // Unpacked spectral data is 32-bit IEEE
+
+      free(tfld);
+      free(unpk);
+      free(ifld);
+
+      return;
+}
diff --git a/g2clib_src/specunpack.c b/g2clib_src/specunpack.c
new file mode 100755
index 0000000..5b35459
--- /dev/null
+++ b/g2clib_src/specunpack.c
@@ -0,0 +1,115 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include "grib2.h"
+
+
+g2int specunpack(unsigned char *cpack,g2int *idrstmpl,g2int ndpts,g2int JJ,
+               g2int KK, g2int MM, g2float *fld)
+//$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    specunpack
+//   PRGMMR: Gilbert          ORG: W/NP11    DATE: 2000-06-21
+//
+// ABSTRACT: This subroutine unpacks a spectral data field that was packed 
+//   using the complex packing algorithm for spherical harmonic data as 
+//   defined in the GRIB2 documention,
+//   using info from the GRIB2 Data Representation Template 5.51.
+//
+// PROGRAM HISTORY LOG:
+// 2000-06-21  Gilbert
+//
+// USAGE:    int specunpack(unsigned char *cpack,g2int *idrstmpl,
+//                          g2int ndpts,g2int JJ,g2int KK,g2int MM,g2float *fld)
+//   INPUT ARGUMENT LIST:
+//     cpack    - pointer to the packed data field.
+//     idrstmpl - pointer to the array of values for Data Representation
+//                Template 5.51
+//     ndpts    - The number of data values to unpack (real and imaginary parts)
+//     JJ       - J - pentagonal resolution parameter
+//     KK       - K - pentagonal resolution parameter
+//     MM       - M - pentagonal resolution parameter
+//
+//   OUTPUT ARGUMENT LIST:
+//     fld()    - Contains the unpacked data values.   fld must be allocated
+//                with at least ndpts*sizeof(g2float) bytes before
+//                calling this routine.
+//
+// REMARKS: None
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE:  
+//
+//$$$
+{
+
+      g2int  *ifld,j,iofst,nbits;
+      g2float  ref,bscale,dscale,*unpk;
+      g2float  *pscale,tscale;
+      g2int   Js,Ks,Ms,Ts,Ns,Nm,n,m;
+      g2int   inc,incu,incp;
+
+      rdieee(idrstmpl+0,&ref,1);
+      bscale = int_power(2.0,idrstmpl[1]);
+      dscale = int_power(10.0,-idrstmpl[2]);
+      nbits = idrstmpl[3];
+      Js=idrstmpl[5];
+      Ks=idrstmpl[6];
+      Ms=idrstmpl[7];
+      Ts=idrstmpl[8];
+
+      if (idrstmpl[9] == 1) {           // unpacked floats are 32-bit IEEE
+
+         unpk=(g2float *)malloc(ndpts*sizeof(g2float));
+         ifld=(g2int *)malloc(ndpts*sizeof(g2int));
+
+         gbits(cpack,ifld,0,32,0,Ts);
+         iofst=32*Ts;
+         rdieee(ifld,unpk,Ts);          // read IEEE unpacked floats
+         gbits(cpack,ifld,iofst,nbits,0,ndpts-Ts);  // unpack scaled data
+//
+//   Calculate Laplacian scaling factors for each possible wave number.
+//
+         pscale=(g2float *)malloc((JJ+MM+1)*sizeof(g2float));
+         tscale=(g2float)idrstmpl[4]*1E-6;
+         for (n=Js;n<=JJ+MM;n++) 
+              pscale[n]=pow((g2float)(n*(n+1)),-tscale);
+//
+//   Assemble spectral coeffs back to original order.
+//
+         inc=0;
+         incu=0;
+         incp=0;
+         for (m=0;m<=MM;m++) {
+            Nm=JJ;      // triangular or trapezoidal
+            if ( KK == JJ+MM ) Nm=JJ+m;          // rhombodial
+            Ns=Js;      // triangular or trapezoidal
+            if ( Ks == Js+Ms ) Ns=Js+m;          // rhombodial
+            for (n=m;n<=Nm;n++) {
+               if (n<=Ns && m<=Ms) {    // grab unpacked value
+                  fld[inc++]=unpk[incu++];         // real part
+                  fld[inc++]=unpk[incu++];     // imaginary part
+               }
+               else {                       // Calc coeff from packed value
+                  fld[inc++]=(((g2float)ifld[incp++]*bscale)+ref)*
+                            dscale*pscale[n];          // real part
+                  fld[inc++]=(((g2float)ifld[incp++]*bscale)+ref)*
+                            dscale*pscale[n];          // imaginary part
+               }
+            }
+         }
+
+         free(pscale);
+         free(unpk);
+         free(ifld);
+
+      }
+      else {
+         printf("specunpack: Cannot handle 64 or 128-bit floats.\n");
+         for (j=0;j<ndpts;j++) fld[j]=0.0;
+         return -3;
+      }
+
+      return 0;
+}
diff --git a/ncepgrib2.py b/ncepgrib2.py
index 5825ac9..badbc29 100755
--- a/ncepgrib2.py
+++ b/ncepgrib2.py
@@ -1,4 +1,4 @@
-__version__ = '1.9.3'
+__version__ = '2.0.0'
 import g2clib
 import struct
 import string
diff --git a/ncepgrib2_docs/class-tree.html b/ncepgrib2_docs/class-tree.html
index 0690b5e..41d1049 100644
--- a/ncepgrib2_docs/class-tree.html
+++ b/ncepgrib2_docs/class-tree.html
@@ -82,8 +82,7 @@
 <table border="0" cellpadding="0" cellspacing="0" width="100%%">
   <tr>
     <td align="left" class="footer">
-    Generated by Epydoc 3.0.1
-    on Wed Nov 20 14:10:14 2013
+    Generated by Epydoc 3.0.1 on Mon Dec 29 14:23:16 2014
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
diff --git a/ncepgrib2_docs/epydoc.css b/ncepgrib2_docs/epydoc.css
index 90e0507..86d4170 100644
--- a/ncepgrib2_docs/epydoc.css
+++ b/ncepgrib2_docs/epydoc.css
@@ -162,8 +162,8 @@ table.summary a.summary-sig-name:visited
 
 /* Subclass list
  */
-ul.subclass-list { display: inline; margin: 0; padding: 0; }
-ul.subclass-list li { display: inline; margin: 0; padding: 0; }
+ul.subclass-list { display: inline; }
+ul.subclass-list li { display: inline; }
 
 /* To render variables, classes etc. like functions */
 table.summary .summary-name { color: #006080; font-weight: bold;
diff --git a/ncepgrib2_docs/help.html b/ncepgrib2_docs/help.html
index b952f98..f88bcc0 100644
--- a/ncepgrib2_docs/help.html
+++ b/ncepgrib2_docs/help.html
@@ -240,8 +240,7 @@ page was last updated. </p>
 <table border="0" cellpadding="0" cellspacing="0" width="100%%">
   <tr>
     <td align="left" class="footer">
-    Generated by Epydoc 3.0.1
-    on Wed Nov 20 14:10:14 2013
+    Generated by Epydoc 3.0.1 on Mon Dec 29 14:23:16 2014
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
diff --git a/ncepgrib2_docs/identifier-index.html b/ncepgrib2_docs/identifier-index.html
index 0aab755..dd11863 100644
--- a/ncepgrib2_docs/identifier-index.html
+++ b/ncepgrib2_docs/identifier-index.html
@@ -224,8 +224,7 @@
 <table border="0" cellpadding="0" cellspacing="0" width="100%%">
   <tr>
     <td align="left" class="footer">
-    Generated by Epydoc 3.0.1
-    on Wed Nov 20 14:10:14 2013
+    Generated by Epydoc 3.0.1 on Mon Dec 29 14:23:16 2014
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
diff --git a/ncepgrib2_docs/index.html b/ncepgrib2_docs/index.html
index f24eb74..0abee3f 100644
--- a/ncepgrib2_docs/index.html
+++ b/ncepgrib2_docs/index.html
@@ -51,7 +51,7 @@
 <h1 class="epydoc">Module ncepgrib2</h1><p class="nomargin-top"><span class="codelink"><a href="ncepgrib2-pysrc.html">source code</a></span></p>
 <hr />
 <div class="fields">      <p><strong>Version:</strong>
-        1.9.3
+        2.0.0
       </p>
 </div><!-- ==================== CLASSES ==================== -->
 <a name="section-Classes"></a>
@@ -62,13 +62,17 @@
     <span class="table-header">Classes</span></td>
 </tr>
 <tr>
-    <td class="summary" colspan="2">
+    <td width="15%" align="right" valign="top" class="summary">
+      <span class="summary-type"> </span>
+    </td><td class="summary">
         <a href="ncepgrib2.Grib2Encode-class.html" class="summary-name">Grib2Encode</a><br />
       Class for encoding data into a GRIB2 message.
     </td>
   </tr>
 <tr>
-    <td class="summary" colspan="2">
+    <td width="15%" align="right" valign="top" class="summary">
+      <span class="summary-type"> </span>
+    </td><td class="summary">
         <a href="ncepgrib2.Grib2Message-class.html" class="summary-name">Grib2Message</a><br />
       Class for accessing data in a GRIB Edition 2 message.
     </td>
@@ -243,8 +247,7 @@
 <table border="0" cellpadding="0" cellspacing="0" width="100%%">
   <tr>
     <td align="left" class="footer">
-    Generated by Epydoc 3.0.1
-    on Wed Nov 20 14:10:14 2013
+    Generated by Epydoc 3.0.1 on Mon Dec 29 14:23:16 2014
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
diff --git a/ncepgrib2_docs/module-tree.html b/ncepgrib2_docs/module-tree.html
index 0a1dfec..aba2e8b 100644
--- a/ncepgrib2_docs/module-tree.html
+++ b/ncepgrib2_docs/module-tree.html
@@ -77,8 +77,7 @@
 <table border="0" cellpadding="0" cellspacing="0" width="100%%">
   <tr>
     <td align="left" class="footer">
-    Generated by Epydoc 3.0.1
-    on Wed Nov 20 14:10:14 2013
+    Generated by Epydoc 3.0.1 on Mon Dec 29 14:23:16 2014
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
diff --git a/ncepgrib2_docs/ncepgrib2-module.html b/ncepgrib2_docs/ncepgrib2-module.html
index f24eb74..0abee3f 100644
--- a/ncepgrib2_docs/ncepgrib2-module.html
+++ b/ncepgrib2_docs/ncepgrib2-module.html
@@ -51,7 +51,7 @@
 <h1 class="epydoc">Module ncepgrib2</h1><p class="nomargin-top"><span class="codelink"><a href="ncepgrib2-pysrc.html">source code</a></span></p>
 <hr />
 <div class="fields">      <p><strong>Version:</strong>
-        1.9.3
+        2.0.0
       </p>
 </div><!-- ==================== CLASSES ==================== -->
 <a name="section-Classes"></a>
@@ -62,13 +62,17 @@
     <span class="table-header">Classes</span></td>
 </tr>
 <tr>
-    <td class="summary" colspan="2">
+    <td width="15%" align="right" valign="top" class="summary">
+      <span class="summary-type"> </span>
+    </td><td class="summary">
         <a href="ncepgrib2.Grib2Encode-class.html" class="summary-name">Grib2Encode</a><br />
       Class for encoding data into a GRIB2 message.
     </td>
   </tr>
 <tr>
-    <td class="summary" colspan="2">
+    <td width="15%" align="right" valign="top" class="summary">
+      <span class="summary-type"> </span>
+    </td><td class="summary">
         <a href="ncepgrib2.Grib2Message-class.html" class="summary-name">Grib2Message</a><br />
       Class for accessing data in a GRIB Edition 2 message.
     </td>
@@ -243,8 +247,7 @@
 <table border="0" cellpadding="0" cellspacing="0" width="100%%">
   <tr>
     <td align="left" class="footer">
-    Generated by Epydoc 3.0.1
-    on Wed Nov 20 14:10:14 2013
+    Generated by Epydoc 3.0.1 on Mon Dec 29 14:23:16 2014
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
diff --git a/ncepgrib2_docs/ncepgrib2-pysrc.html b/ncepgrib2_docs/ncepgrib2-pysrc.html
index d0c78bd..bb5cdba 100644
--- a/ncepgrib2_docs/ncepgrib2-pysrc.html
+++ b/ncepgrib2_docs/ncepgrib2-pysrc.html
@@ -49,7 +49,7 @@
 </table>
 <h1 class="epydoc">Source Code for <a href="ncepgrib2-module.html">Module ncepgrib2</a></h1>
 <pre class="py-src">
-<a name="L1"></a><tt class="py-lineno">   1</tt>  <tt class="py-line"><tt class="py-name">__version__</tt> <tt class="py-op">=</tt> <tt class="py-docstring">'1.9.3'</tt> </tt>
+<a name="L1"></a><tt class="py-lineno">   1</tt>  <tt class="py-line"><tt class="py-name">__version__</tt> <tt class="py-op">=</tt> <tt class="py-docstring">'2.0.0'</tt> </tt>
 <a name="L2"></a><tt class="py-lineno">   2</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">g2clib</tt> </tt>
 <a name="L3"></a><tt class="py-lineno">   3</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">struct</tt> </tt>
 <a name="L4"></a><tt class="py-lineno">   4</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">string</tt> </tt>
@@ -764,725 +764,724 @@
 <a name="L713"></a><tt class="py-lineno"> 713</tt>  <tt class="py-line">                    <tt class="py-name">lonsperlat</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">grid_definition_list</tt> </tt>
 <a name="L714"></a><tt class="py-lineno"> 714</tt>  <tt class="py-line">                    <tt class="py-keyword">if</tt> <tt class="py-name">ma</tt><tt class="py-op">.</tt><tt class="py-name">isMA</tt><tt class="py-op">(</tt><tt class="py-name">fld</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
 <a name="L715"></a><tt class="py-lineno"> 715</tt>  <tt class="py-line">                        <tt class="py-name">fld</tt> <tt class="py-op">=</tt> <tt class="py-name">ma</tt><tt class="py-op">.</tt><tt class="py-name">filled</tt><tt class="py-op">(</tt><tt class="py-name">fld</tt><tt class="py-op">)</tt> </tt>
-<a name="L716"></a><tt class="py-lineno"> 716</tt>  <tt class="py-line">                        <tt class="py-keyword">print</tt> <tt class="py-name">fld</tt><tt class="py-op">.</tt><tt class="py-name">shape</tt><tt class="py-op">,</tt> <tt class="py-name">lonsperlat</tt><tt class="py-op">.</tt><tt class="py-name">dtype</tt><tt class="py-op">,</tt> <tt class="py-name">lonsperlat</tt><tt class="py-op">.</tt><tt class="py-name">shape</tt><tt class="py-op">,</tt> <tt class="py-name">lonsper [...]
-<a name="L717"></a><tt class="py-lineno"> 717</tt>  <tt class="py-line">                        <tt class="py-name">fld</tt> <tt class="py-op">=</tt> <tt class="py-name">_redtoreg</tt><tt class="py-op">(</tt><tt class="py-name">nx</tt><tt class="py-op">,</tt> <tt class="py-name">lonsperlat</tt><tt class="py-op">.</tt><tt class="py-name">astype</tt><tt class="py-op">(</tt><tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">long</tt><tt class="py-op">)</tt><tt class="py- [...]
-<a name="L718"></a><tt class="py-lineno"> 718</tt>  <tt class="py-line">                                <tt class="py-name">fld</tt><tt class="py-op">.</tt><tt class="py-name">astype</tt><tt class="py-op">(</tt><tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">double</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-name">fill_value</tt><tt class="py-op">)</tt> </tt>
-<a name="L719"></a><tt class="py-lineno"> 719</tt>  <tt class="py-line">                        <tt class="py-name">fld</tt> <tt class="py-op">=</tt> <tt class="py-name">ma</tt><tt class="py-op">.</tt><tt class="py-name">masked_values</tt><tt class="py-op">(</tt><tt class="py-name">fld</tt><tt class="py-op">,</tt><tt class="py-name">fill_value</tt><tt class="py-op">)</tt> </tt>
-<a name="L720"></a><tt class="py-lineno"> 720</tt>  <tt class="py-line">                    <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
-<a name="L721"></a><tt class="py-lineno"> 721</tt>  <tt class="py-line">                        <tt class="py-name">fld</tt> <tt class="py-op">=</tt> <tt class="py-name">_redtoreg</tt><tt class="py-op">(</tt><tt class="py-name">nx</tt><tt class="py-op">,</tt> <tt class="py-name">lonsperlat</tt><tt class="py-op">,</tt> <tt class="py-name">fld</tt><tt class="py-op">.</tt><tt class="py-name">astype</tt><tt class="py-op">(</tt><tt class="py-string">'f8'</tt><tt class="py-op">)</tt><tt class= [...]
-<a name="L722"></a><tt class="py-lineno"> 722</tt>  <tt class="py-line">                                <tt class="py-name">fill_value</tt><tt class="py-op">)</tt> </tt>
-<a name="L723"></a><tt class="py-lineno"> 723</tt>  <tt class="py-line">        <tt class="py-comment"># check scan modes for rect grids.</tt> </tt>
-<a name="L724"></a><tt class="py-lineno"> 724</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">nx</tt> <tt class="py-keyword">is</tt> <tt class="py-keyword">not</tt> <tt class="py-name">None</tt> <tt class="py-keyword">and</tt> <tt class="py-name">ny</tt> <tt class="py-keyword">is</tt> <tt class="py-keyword">not</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
-<a name="L725"></a><tt class="py-lineno"> 725</tt>  <tt class="py-line">            <tt class="py-comment"># rows scan in the -x direction (so flip)</tt> </tt>
-<a name="L726"></a><tt class="py-lineno"> 726</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">scanmodeflags</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">:</tt> </tt>
-<a name="L727"></a><tt class="py-lineno"> 727</tt>  <tt class="py-line">                <tt class="py-name">fldsave</tt> <tt class="py-op">=</tt> <tt class="py-name">fld</tt><tt class="py-op">.</tt><tt class="py-name">astype</tt><tt class="py-op">(</tt><tt class="py-string">'f'</tt><tt class="py-op">)</tt> <tt class="py-comment"># casting makes a copy</tt> </tt>
-<a name="L728"></a><tt class="py-lineno"> 728</tt>  <tt class="py-line">                <tt class="py-name">fld</tt><tt class="py-op">[</tt><tt class="py-op">:</tt><tt class="py-op">,</tt><tt class="py-op">:</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">fldsave</tt><tt class="py-op">[</tt><tt class="py-op">:</tt><tt class="py-op">,</tt><tt class="py-op">:</tt><tt class="py-op">:</tt><tt class="py-op">-</tt><tt class="py-number">1</tt><tt class="py-op">]</tt> </tt>
-<a name="L729"></a><tt class="py-lineno"> 729</tt>  <tt class="py-line">            <tt class="py-comment"># columns scan in the -y direction (so flip)</tt> </tt>
-<a name="L730"></a><tt class="py-lineno"> 730</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">scanmodeflags</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">:</tt> </tt>
-<a name="L731"></a><tt class="py-lineno"> 731</tt>  <tt class="py-line">                <tt class="py-name">fldsave</tt> <tt class="py-op">=</tt> <tt class="py-name">fld</tt><tt class="py-op">.</tt><tt class="py-name">astype</tt><tt class="py-op">(</tt><tt class="py-string">'f'</tt><tt class="py-op">)</tt> <tt class="py-comment"># casting makes a copy</tt> </tt>
-<a name="L732"></a><tt class="py-lineno"> 732</tt>  <tt class="py-line">                <tt class="py-name">fld</tt><tt class="py-op">[</tt><tt class="py-op">:</tt><tt class="py-op">,</tt><tt class="py-op">:</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">fldsave</tt><tt class="py-op">[</tt><tt class="py-op">:</tt><tt class="py-op">:</tt><tt class="py-op">-</tt><tt class="py-number">1</tt><tt class="py-op">,</tt><tt class="py-op">:</tt><tt class="py-op">]</tt> </tt>
-<a name="L733"></a><tt class="py-lineno"> 733</tt>  <tt class="py-line">            <tt class="py-comment"># adjacent rows scan in opposite direction.</tt> </tt>
-<a name="L734"></a><tt class="py-lineno"> 734</tt>  <tt class="py-line">            <tt class="py-comment"># (flip every other row)</tt> </tt>
-<a name="L735"></a><tt class="py-lineno"> 735</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">scanmodeflags</tt><tt class="py-op">[</tt><tt class="py-number">3</tt><tt class="py-op">]</tt><tt class="py-op">:</tt> </tt>
-<a name="L736"></a><tt class="py-lineno"> 736</tt>  <tt class="py-line">                <tt class="py-name">fldsave</tt> <tt class="py-op">=</tt> <tt class="py-name">fld</tt><tt class="py-op">.</tt><tt class="py-name">astype</tt><tt class="py-op">(</tt><tt class="py-string">'f'</tt><tt class="py-op">)</tt> <tt class="py-comment"># casting makes a copy</tt> </tt>
-<a name="L737"></a><tt class="py-lineno"> 737</tt>  <tt class="py-line">                <tt class="py-name">fld</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">:</tt><tt class="py-op">:</tt><tt class="py-number">2</tt><tt class="py-op">,</tt><tt class="py-op">:</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">fldsave</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">:</tt><tt class="py-op">:</tt><tt class="py-numb [...]
-<a name="L738"></a><tt class="py-lineno"> 738</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">fld</tt> </tt>
-</div><a name="L739"></a><tt class="py-lineno"> 739</tt>  <tt class="py-line"> </tt>
-<a name="L740"></a><tt class="py-lineno"> 740</tt>  <tt class="py-line">    <tt id="link-11" class="py-name" targets="Variable ncepgrib2.Grib2Message.values=ncepgrib2.Grib2Message-class.html#values"><a title="ncepgrib2.Grib2Message.values" class="py-name" href="#" onclick="return doclink('link-11', 'values', 'link-11');">values</a></tt> <tt class="py-op">=</tt> <tt class="py-name">property</tt><tt class="py-op">(</tt><tt id="link-12" class="py-name" targets="Method ncepgrib2.Grib2Message [...]
-<a name="L741"></a><tt class="py-lineno"> 741</tt>  <tt class="py-line"> </tt>
-<a name="Grib2Message.latlons"></a><div id="Grib2Message.latlons-def"><a name="L742"></a><tt class="py-lineno"> 742</tt> <a class="py-toggle" href="#" id="Grib2Message.latlons-toggle" onclick="return toggle('Grib2Message.latlons');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="ncepgrib2.Grib2Message-class.html#latlons">latlons</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
-</div><div id="Grib2Message.latlons-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Grib2Message.latlons-expanded"><a name="L743"></a><tt class="py-lineno"> 743</tt>  <tt class="py-line">        <tt class="py-docstring">"""alias for L{grid}"""</tt> </tt>
-<a name="L744"></a><tt class="py-lineno"> 744</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-13" class="py-name" targets="Method ncepgrib2.Grib2Message.grid()=ncepgrib2.Grib2Message-class.html#grid"><a title="ncepgrib2.Grib2Message.grid" class="py-name" href="#" onclick="return doclink('link-13', 'grid', 'link-13');">grid</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
-</div><a name="L745"></a><tt class="py-lineno"> 745</tt>  <tt class="py-line"> </tt>
-<a name="Grib2Message.grid"></a><div id="Grib2Message.grid-def"><a name="L746"></a><tt class="py-lineno"> 746</tt> <a class="py-toggle" href="#" id="Grib2Message.grid-toggle" onclick="return toggle('Grib2Message.grid');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="ncepgrib2.Grib2Message-class.html#grid">grid</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
-</div><div id="Grib2Message.grid-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Grib2Message.grid-expanded"><a name="L747"></a><tt class="py-lineno"> 747</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
-<a name="L748"></a><tt class="py-lineno"> 748</tt>  <tt class="py-line"><tt class="py-docstring"> return lats,lons (in degrees) of grid.</tt> </tt>
-<a name="L749"></a><tt class="py-lineno"> 749</tt>  <tt class="py-line"><tt class="py-docstring"> currently can handle reg. lat/lon, global gaussian, mercator, stereographic,</tt> </tt>
-<a name="L750"></a><tt class="py-lineno"> 750</tt>  <tt class="py-line"><tt class="py-docstring"> lambert conformal, albers equal-area, space-view and azimuthal</tt> </tt>
-<a name="L751"></a><tt class="py-lineno"> 751</tt>  <tt class="py-line"><tt class="py-docstring"> equidistant grids.  L{latlons} method does the same thing.</tt> </tt>
-<a name="L752"></a><tt class="py-lineno"> 752</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
-<a name="L753"></a><tt class="py-lineno"> 753</tt>  <tt class="py-line"><tt class="py-docstring"> @return: C{B{lats},B{lons}}, float32 numpy arrays</tt> </tt>
-<a name="L754"></a><tt class="py-lineno"> 754</tt>  <tt class="py-line"><tt class="py-docstring"> containing latitudes and longitudes of grid (in degrees).</tt> </tt>
-<a name="L755"></a><tt class="py-lineno"> 755</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
-<a name="L756"></a><tt class="py-lineno"> 756</tt>  <tt class="py-line">        <tt class="py-keyword">from</tt> <tt class="py-name">pygrib</tt> <tt class="py-keyword">import</tt> <tt class="py-name">gaulats</tt> </tt>
-<a name="L757"></a><tt class="py-lineno"> 757</tt>  <tt class="py-line">        <tt class="py-name">gdsinfo</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">grid_definition_info</tt> </tt>
-<a name="L758"></a><tt class="py-lineno"> 758</tt>  <tt class="py-line">        <tt class="py-name">gdtnum</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">grid_definition_template_number</tt> </tt>
-<a name="L759"></a><tt class="py-lineno"> 759</tt>  <tt class="py-line">        <tt class="py-name">gdtmpl</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">grid_definition_template</tt> </tt>
-<a name="L760"></a><tt class="py-lineno"> 760</tt>  <tt class="py-line">        <tt class="py-name">reggrid</tt> <tt class="py-op">=</tt> <tt class="py-name">gdsinfo</tt><tt class="py-op">[</tt><tt class="py-number">2</tt><tt class="py-op">]</tt> <tt class="py-op">==</tt> <tt class="py-number">0</tt> <tt class="py-comment"># gdsinfo[2]=0 means regular 2-d grid</tt> </tt>
-<a name="L761"></a><tt class="py-lineno"> 761</tt>  <tt class="py-line">        <tt class="py-name">projparams</tt> <tt class="py-op">=</tt> <tt class="py-op">{</tt><tt class="py-op">}</tt> </tt>
-<a name="L762"></a><tt class="py-lineno"> 762</tt>  <tt class="py-line">        <tt class="py-name">projparams</tt><tt class="py-op">[</tt><tt class="py-string">'a'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">earthRmajor</tt> </tt>
-<a name="L763"></a><tt class="py-lineno"> 763</tt>  <tt class="py-line">        <tt class="py-name">projparams</tt><tt class="py-op">[</tt><tt class="py-string">'b'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">earthRminor</tt> </tt>
-<a name="L764"></a><tt class="py-lineno"> 764</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">gdtnum</tt> <tt class="py-op">==</tt> <tt class="py-number">0</tt><tt class="py-op">:</tt> <tt class="py-comment"># regular lat/lon grid</tt> </tt>
-<a name="L765"></a><tt class="py-lineno"> 765</tt>  <tt class="py-line">            <tt class="py-name">lon1</tt><tt class="py-op">,</tt> <tt class="py-name">lat1</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">longitude_first_gridpoint</tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">latitude_first_gridpoint</tt> </tt>
-<a name="L766"></a><tt class="py-lineno"> 766</tt>  <tt class="py-line">            <tt class="py-name">lon2</tt><tt class="py-op">,</tt> <tt class="py-name">lat2</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">longitude_last_gridpoint</tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">latitude_last_gridpoint</tt> </tt>
-<a name="L767"></a><tt class="py-lineno"> 767</tt>  <tt class="py-line">            <tt class="py-name">delon</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">gridlength_in_x_direction</tt> </tt>
-<a name="L768"></a><tt class="py-lineno"> 768</tt>  <tt class="py-line">            <tt class="py-name">delat</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">gridlength_in_y_direction</tt> </tt>
-<a name="L769"></a><tt class="py-lineno"> 769</tt>  <tt class="py-line">            <tt class="py-name">lats</tt> <tt class="py-op">=</tt> <tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">arange</tt><tt class="py-op">(</tt><tt class="py-name">lat1</tt><tt class="py-op">,</tt><tt class="py-name">lat2</tt><tt class="py-op">+</tt><tt class="py-name">delat</tt><tt class="py-op">,</tt><tt class="py-name">delat</tt><tt class="py-op">)</tt> </tt>
-<a name="L770"></a><tt class="py-lineno"> 770</tt>  <tt class="py-line">            <tt class="py-name">lons</tt> <tt class="py-op">=</tt> <tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">arange</tt><tt class="py-op">(</tt><tt class="py-name">lon1</tt><tt class="py-op">,</tt><tt class="py-name">lon2</tt><tt class="py-op">+</tt><tt class="py-name">delon</tt><tt class="py-op">,</tt><tt class="py-name">delon</tt><tt class="py-op">)</tt> </tt>
-<a name="L771"></a><tt class="py-lineno"> 771</tt>  <tt class="py-line">            <tt class="py-comment"># flip if scan mode says to.</tt> </tt>
-<a name="L772"></a><tt class="py-lineno"> 772</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">scanmodeflags</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">:</tt> </tt>
-<a name="L773"></a><tt class="py-lineno"> 773</tt>  <tt class="py-line">                <tt class="py-name">lons</tt> <tt class="py-op">=</tt> <tt class="py-name">lons</tt><tt class="py-op">[</tt><tt class="py-op">:</tt><tt class="py-op">:</tt><tt class="py-op">-</tt><tt class="py-number">1</tt><tt class="py-op">]</tt> </tt>
-<a name="L774"></a><tt class="py-lineno"> 774</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">scanmodeflags</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">:</tt> </tt>
-<a name="L775"></a><tt class="py-lineno"> 775</tt>  <tt class="py-line">                <tt class="py-name">lats</tt> <tt class="py-op">=</tt> <tt class="py-name">lats</tt><tt class="py-op">[</tt><tt class="py-op">:</tt><tt class="py-op">:</tt><tt class="py-op">-</tt><tt class="py-number">1</tt><tt class="py-op">]</tt> </tt>
-<a name="L776"></a><tt class="py-lineno"> 776</tt>  <tt class="py-line">            <tt class="py-name">projparams</tt><tt class="py-op">[</tt><tt class="py-string">'proj'</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-string">'cyl'</tt> </tt>
-<a name="L777"></a><tt class="py-lineno"> 777</tt>  <tt class="py-line">            <tt class="py-name">lons</tt><tt class="py-op">,</tt><tt class="py-name">lats</tt> <tt class="py-op">=</tt> <tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">meshgrid</tt><tt class="py-op">(</tt><tt class="py-name">lons</tt><tt class="py-op">,</tt><tt class="py-name">lats</tt><tt class="py-op">)</tt> <tt class="py-comment"># make 2-d arrays.</tt> </tt>
-<a name="L778"></a><tt class="py-lineno"> 778</tt>  <tt class="py-line">        <tt class="py-keyword">elif</tt> <tt class="py-name">gdtnum</tt> <tt class="py-op">==</tt> <tt class="py-number">40</tt><tt class="py-op">:</tt> <tt class="py-comment"># gaussian grid (only works for global!)</tt> </tt>
-<a name="L779"></a><tt class="py-lineno"> 779</tt>  <tt class="py-line">            <tt class="py-name">lon1</tt><tt class="py-op">,</tt> <tt class="py-name">lat1</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">longitude_first_gridpoint</tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">latitude_first_gridpoint</tt> </tt>
-<a name="L780"></a><tt class="py-lineno"> 780</tt>  <tt class="py-line">            <tt class="py-name">lon2</tt><tt class="py-op">,</tt> <tt class="py-name">lat2</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">longitude_last_gridpoint</tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">latitude_last_gridpoint</tt> </tt>
-<a name="L781"></a><tt class="py-lineno"> 781</tt>  <tt class="py-line">            <tt class="py-name">nlats</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">points_in_y_direction</tt> </tt>
-<a name="L782"></a><tt class="py-lineno"> 782</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">reggrid</tt><tt class="py-op">:</tt> <tt class="py-comment"># ECMWF 'reduced' gaussian grid.</tt> </tt>
-<a name="L783"></a><tt class="py-lineno"> 783</tt>  <tt class="py-line">                <tt class="py-name">nlons</tt> <tt class="py-op">=</tt> <tt class="py-number">2</tt><tt class="py-op">*</tt><tt class="py-name">nlats</tt> </tt>
-<a name="L784"></a><tt class="py-lineno"> 784</tt>  <tt class="py-line">                <tt class="py-name">delon</tt> <tt class="py-op">=</tt> <tt class="py-number">360.</tt><tt class="py-op">/</tt><tt class="py-name">nlons</tt> </tt>
-<a name="L785"></a><tt class="py-lineno"> 785</tt>  <tt class="py-line">            <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
-<a name="L786"></a><tt class="py-lineno"> 786</tt>  <tt class="py-line">                <tt class="py-name">nlons</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">points_in_x_direction</tt> </tt>
-<a name="L787"></a><tt class="py-lineno"> 787</tt>  <tt class="py-line">                <tt class="py-name">delon</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">gridlength_in_x_direction</tt> </tt>
-<a name="L788"></a><tt class="py-lineno"> 788</tt>  <tt class="py-line">            <tt class="py-name">lons</tt> <tt class="py-op">=</tt> <tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">arange</tt><tt class="py-op">(</tt><tt class="py-name">lon1</tt><tt class="py-op">,</tt><tt class="py-name">lon2</tt><tt class="py-op">+</tt><tt class="py-name">delon</tt><tt class="py-op">,</tt><tt class="py-name">delon</tt><tt class="py-op">)</tt> </tt>
-<a name="L789"></a><tt class="py-lineno"> 789</tt>  <tt class="py-line">            <tt class="py-comment"># compute gaussian lats (north to south)</tt> </tt>
-<a name="L790"></a><tt class="py-lineno"> 790</tt>  <tt class="py-line">            <tt class="py-name">lats</tt> <tt class="py-op">=</tt> <tt class="py-name">gaulats</tt><tt class="py-op">(</tt><tt class="py-name">nlats</tt><tt class="py-op">)</tt> </tt>
-<a name="L791"></a><tt class="py-lineno"> 791</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">lat1</tt> <tt class="py-op"><</tt> <tt class="py-name">lat2</tt><tt class="py-op">:</tt>  <tt class="py-comment"># reverse them if necessary</tt> </tt>
-<a name="L792"></a><tt class="py-lineno"> 792</tt>  <tt class="py-line">                <tt class="py-name">lats</tt> <tt class="py-op">=</tt> <tt class="py-name">lats</tt><tt class="py-op">[</tt><tt class="py-op">:</tt><tt class="py-op">:</tt><tt class="py-op">-</tt><tt class="py-number">1</tt><tt class="py-op">]</tt> </tt>
-<a name="L793"></a><tt class="py-lineno"> 793</tt>  <tt class="py-line">            <tt class="py-comment"># flip if scan mode says to.</tt> </tt>
-<a name="L794"></a><tt class="py-lineno"> 794</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">scanmodeflags</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">:</tt> </tt>
-<a name="L795"></a><tt class="py-lineno"> 795</tt>  <tt class="py-line">                <tt class="py-name">lons</tt> <tt class="py-op">=</tt> <tt class="py-name">lons</tt><tt class="py-op">[</tt><tt class="py-op">:</tt><tt class="py-op">:</tt><tt class="py-op">-</tt><tt class="py-number">1</tt><tt class="py-op">]</tt> </tt>
-<a name="L796"></a><tt class="py-lineno"> 796</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">scanmodeflags</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">:</tt> </tt>
-<a name="L797"></a><tt class="py-lineno"> 797</tt>  <tt class="py-line">                <tt class="py-name">lats</tt> <tt class="py-op">=</tt> <tt class="py-name">lats</tt><tt class="py-op">[</tt><tt class="py-op">:</tt><tt class="py-op">:</tt><tt class="py-op">-</tt><tt class="py-number">1</tt><tt class="py-op">]</tt> </tt>
-<a name="L798"></a><tt class="py-lineno"> 798</tt>  <tt class="py-line">            <tt class="py-name">projparams</tt><tt class="py-op">[</tt><tt class="py-string">'proj'</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-string">'cyl'</tt> </tt>
-<a name="L799"></a><tt class="py-lineno"> 799</tt>  <tt class="py-line">            <tt class="py-name">lons</tt><tt class="py-op">,</tt><tt class="py-name">lats</tt> <tt class="py-op">=</tt> <tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">meshgrid</tt><tt class="py-op">(</tt><tt class="py-name">lons</tt><tt class="py-op">,</tt><tt class="py-name">lats</tt><tt class="py-op">)</tt> <tt class="py-comment"># make 2-d arrays</tt> </tt>
-<a name="L800"></a><tt class="py-lineno"> 800</tt>  <tt class="py-line">        <tt class="py-comment"># mercator, lambert conformal, stereographic, albers equal area, azimuthal equidistant</tt> </tt>
-<a name="L801"></a><tt class="py-lineno"> 801</tt>  <tt class="py-line">        <tt class="py-keyword">elif</tt> <tt class="py-name">gdtnum</tt> <tt class="py-keyword">in</tt> <tt class="py-op">[</tt><tt class="py-number">10</tt><tt class="py-op">,</tt><tt class="py-number">20</tt><tt class="py-op">,</tt><tt class="py-number">30</tt><tt class="py-op">,</tt><tt class="py-number">31</tt><tt class="py-op">,</tt><tt class="py-number">110</tt><tt class="py-op">]</tt><tt class="py-op">:</tt> </tt>
-<a name="L802"></a><tt class="py-lineno"> 802</tt>  <tt class="py-line">            <tt class="py-name">nx</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">points_in_x_direction</tt> </tt>
-<a name="L803"></a><tt class="py-lineno"> 803</tt>  <tt class="py-line">            <tt class="py-name">ny</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">points_in_y_direction</tt> </tt>
-<a name="L804"></a><tt class="py-lineno"> 804</tt>  <tt class="py-line">            <tt class="py-name">dx</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">gridlength_in_x_direction</tt> </tt>
-<a name="L805"></a><tt class="py-lineno"> 805</tt>  <tt class="py-line">            <tt class="py-name">dy</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">gridlength_in_y_direction</tt> </tt>
-<a name="L806"></a><tt class="py-lineno"> 806</tt>  <tt class="py-line">            <tt class="py-name">lon1</tt><tt class="py-op">,</tt> <tt class="py-name">lat1</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">longitude_first_gridpoint</tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">latitude_first_gridpoint</tt> </tt>
-<a name="L807"></a><tt class="py-lineno"> 807</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">gdtnum</tt> <tt class="py-op">==</tt> <tt class="py-number">10</tt><tt class="py-op">:</tt> <tt class="py-comment"># mercator.</tt> </tt>
-<a name="L808"></a><tt class="py-lineno"> 808</tt>  <tt class="py-line">                <tt class="py-name">projparams</tt><tt class="py-op">[</tt><tt class="py-string">'lat_ts'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">proj4_lat_ts</tt> </tt>
-<a name="L809"></a><tt class="py-lineno"> 809</tt>  <tt class="py-line">                <tt class="py-name">projparams</tt><tt class="py-op">[</tt><tt class="py-string">'proj'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">proj4_proj</tt> </tt>
-<a name="L810"></a><tt class="py-lineno"> 810</tt>  <tt class="py-line">                <tt class="py-name">projparams</tt><tt class="py-op">[</tt><tt class="py-string">'lon_0'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">proj4_lon_0</tt> </tt>
-<a name="L811"></a><tt class="py-lineno"> 811</tt>  <tt class="py-line">                <tt class="py-name">pj</tt> <tt class="py-op">=</tt> <tt class="py-name">pyproj</tt><tt class="py-op">.</tt><tt class="py-name">Proj</tt><tt class="py-op">(</tt><tt class="py-name">projparams</tt><tt class="py-op">)</tt> </tt>
-<a name="L812"></a><tt class="py-lineno"> 812</tt>  <tt class="py-line">                <tt class="py-name">llcrnrx</tt><tt class="py-op">,</tt> <tt class="py-name">llcrnry</tt> <tt class="py-op">=</tt> <tt class="py-name">pj</tt><tt class="py-op">(</tt><tt class="py-name">lon1</tt><tt class="py-op">,</tt><tt class="py-name">lat1</tt><tt class="py-op">)</tt> </tt>
-<a name="L813"></a><tt class="py-lineno"> 813</tt>  <tt class="py-line">                <tt class="py-name">x</tt> <tt class="py-op">=</tt> <tt class="py-name">llcrnrx</tt><tt class="py-op">+</tt><tt class="py-name">dx</tt><tt class="py-op">*</tt><tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">arange</tt><tt class="py-op">(</tt><tt class="py-name">nx</tt><tt class="py-op">)</tt> </tt>
-<a name="L814"></a><tt class="py-lineno"> 814</tt>  <tt class="py-line">                <tt class="py-name">y</tt> <tt class="py-op">=</tt> <tt class="py-name">llcrnry</tt><tt class="py-op">+</tt><tt class="py-name">dy</tt><tt class="py-op">*</tt><tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">arange</tt><tt class="py-op">(</tt><tt class="py-name">ny</tt><tt class="py-op">)</tt> </tt>
-<a name="L815"></a><tt class="py-lineno"> 815</tt>  <tt class="py-line">                <tt class="py-name">x</tt><tt class="py-op">,</tt> <tt class="py-name">y</tt> <tt class="py-op">=</tt> <tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">meshgrid</tt><tt class="py-op">(</tt><tt class="py-name">x</tt><tt class="py-op">,</tt> <tt class="py-name">y</tt><tt class="py-op">)</tt> </tt>
-<a name="L816"></a><tt class="py-lineno"> 816</tt>  <tt class="py-line">                <tt class="py-name">lons</tt><tt class="py-op">,</tt> <tt class="py-name">lats</tt> <tt class="py-op">=</tt> <tt class="py-name">pj</tt><tt class="py-op">(</tt><tt class="py-name">x</tt><tt class="py-op">,</tt> <tt class="py-name">y</tt><tt class="py-op">,</tt> <tt class="py-name">inverse</tt><tt class="py-op">=</tt><tt class="py-name">True</tt><tt class="py-op">)</tt> </tt>
-<a name="L817"></a><tt class="py-lineno"> 817</tt>  <tt class="py-line">            <tt class="py-keyword">elif</tt> <tt class="py-name">gdtnum</tt> <tt class="py-op">==</tt> <tt class="py-number">20</tt><tt class="py-op">:</tt>  <tt class="py-comment"># stereographic</tt> </tt>
-<a name="L818"></a><tt class="py-lineno"> 818</tt>  <tt class="py-line">                <tt class="py-name">projparams</tt><tt class="py-op">[</tt><tt class="py-string">'lat_ts'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">proj4_lat_ts</tt> </tt>
-<a name="L819"></a><tt class="py-lineno"> 819</tt>  <tt class="py-line">                <tt class="py-name">projparams</tt><tt class="py-op">[</tt><tt class="py-string">'proj'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">proj4_proj</tt> </tt>
-<a name="L820"></a><tt class="py-lineno"> 820</tt>  <tt class="py-line">                <tt class="py-name">projparams</tt><tt class="py-op">[</tt><tt class="py-string">'lat_0'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">proj4_lat_0</tt> </tt>
-<a name="L821"></a><tt class="py-lineno"> 821</tt>  <tt class="py-line">                <tt class="py-name">projparams</tt><tt class="py-op">[</tt><tt class="py-string">'lon_0'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">proj4_lon_0</tt> </tt>
-<a name="L822"></a><tt class="py-lineno"> 822</tt>  <tt class="py-line">                <tt class="py-name">pj</tt> <tt class="py-op">=</tt> <tt class="py-name">pyproj</tt><tt class="py-op">.</tt><tt class="py-name">Proj</tt><tt class="py-op">(</tt><tt class="py-name">projparams</tt><tt class="py-op">)</tt> </tt>
-<a name="L823"></a><tt class="py-lineno"> 823</tt>  <tt class="py-line">                <tt class="py-name">llcrnrx</tt><tt class="py-op">,</tt> <tt class="py-name">llcrnry</tt> <tt class="py-op">=</tt> <tt class="py-name">pj</tt><tt class="py-op">(</tt><tt class="py-name">lon1</tt><tt class="py-op">,</tt><tt class="py-name">lat1</tt><tt class="py-op">)</tt> </tt>
-<a name="L824"></a><tt class="py-lineno"> 824</tt>  <tt class="py-line">                <tt class="py-name">x</tt> <tt class="py-op">=</tt> <tt class="py-name">llcrnrx</tt><tt class="py-op">+</tt><tt class="py-name">dx</tt><tt class="py-op">*</tt><tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">arange</tt><tt class="py-op">(</tt><tt class="py-name">nx</tt><tt class="py-op">)</tt> </tt>
-<a name="L825"></a><tt class="py-lineno"> 825</tt>  <tt class="py-line">                <tt class="py-name">y</tt> <tt class="py-op">=</tt> <tt class="py-name">llcrnry</tt><tt class="py-op">+</tt><tt class="py-name">dy</tt><tt class="py-op">*</tt><tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">arange</tt><tt class="py-op">(</tt><tt class="py-name">ny</tt><tt class="py-op">)</tt> </tt>
-<a name="L826"></a><tt class="py-lineno"> 826</tt>  <tt class="py-line">                <tt class="py-name">x</tt><tt class="py-op">,</tt> <tt class="py-name">y</tt> <tt class="py-op">=</tt> <tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">meshgrid</tt><tt class="py-op">(</tt><tt class="py-name">x</tt><tt class="py-op">,</tt> <tt class="py-name">y</tt><tt class="py-op">)</tt> </tt>
-<a name="L827"></a><tt class="py-lineno"> 827</tt>  <tt class="py-line">                <tt class="py-name">lons</tt><tt class="py-op">,</tt> <tt class="py-name">lats</tt> <tt class="py-op">=</tt> <tt class="py-name">pj</tt><tt class="py-op">(</tt><tt class="py-name">x</tt><tt class="py-op">,</tt> <tt class="py-name">y</tt><tt class="py-op">,</tt> <tt class="py-name">inverse</tt><tt class="py-op">=</tt><tt class="py-name">True</tt><tt class="py-op">)</tt> </tt>
-<a name="L828"></a><tt class="py-lineno"> 828</tt>  <tt class="py-line">            <tt class="py-keyword">elif</tt> <tt class="py-name">gdtnum</tt> <tt class="py-keyword">in</tt> <tt class="py-op">[</tt><tt class="py-number">30</tt><tt class="py-op">,</tt><tt class="py-number">31</tt><tt class="py-op">]</tt><tt class="py-op">:</tt> <tt class="py-comment"># lambert, albers</tt> </tt>
-<a name="L829"></a><tt class="py-lineno"> 829</tt>  <tt class="py-line">                <tt class="py-name">projparams</tt><tt class="py-op">[</tt><tt class="py-string">'lat_1'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">proj4_lat_1</tt> </tt>
-<a name="L830"></a><tt class="py-lineno"> 830</tt>  <tt class="py-line">                <tt class="py-name">projparams</tt><tt class="py-op">[</tt><tt class="py-string">'lat_2'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">proj4_lat_2</tt> </tt>
-<a name="L831"></a><tt class="py-lineno"> 831</tt>  <tt class="py-line">                <tt class="py-name">projparams</tt><tt class="py-op">[</tt><tt class="py-string">'proj'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">proj4_proj</tt> </tt>
-<a name="L832"></a><tt class="py-lineno"> 832</tt>  <tt class="py-line">                <tt class="py-name">projparams</tt><tt class="py-op">[</tt><tt class="py-string">'lon_0'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">proj4_lon_0</tt> </tt>
-<a name="L833"></a><tt class="py-lineno"> 833</tt>  <tt class="py-line">                <tt class="py-name">pj</tt> <tt class="py-op">=</tt> <tt class="py-name">pyproj</tt><tt class="py-op">.</tt><tt class="py-name">Proj</tt><tt class="py-op">(</tt><tt class="py-name">projparams</tt><tt class="py-op">)</tt> </tt>
-<a name="L834"></a><tt class="py-lineno"> 834</tt>  <tt class="py-line">                <tt class="py-name">llcrnrx</tt><tt class="py-op">,</tt> <tt class="py-name">llcrnry</tt> <tt class="py-op">=</tt> <tt class="py-name">pj</tt><tt class="py-op">(</tt><tt class="py-name">lon1</tt><tt class="py-op">,</tt><tt class="py-name">lat1</tt><tt class="py-op">)</tt> </tt>
-<a name="L835"></a><tt class="py-lineno"> 835</tt>  <tt class="py-line">                <tt class="py-name">x</tt> <tt class="py-op">=</tt> <tt class="py-name">llcrnrx</tt><tt class="py-op">+</tt><tt class="py-name">dx</tt><tt class="py-op">*</tt><tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">arange</tt><tt class="py-op">(</tt><tt class="py-name">nx</tt><tt class="py-op">)</tt> </tt>
-<a name="L836"></a><tt class="py-lineno"> 836</tt>  <tt class="py-line">                <tt class="py-name">y</tt> <tt class="py-op">=</tt> <tt class="py-name">llcrnry</tt><tt class="py-op">+</tt><tt class="py-name">dy</tt><tt class="py-op">*</tt><tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">arange</tt><tt class="py-op">(</tt><tt class="py-name">ny</tt><tt class="py-op">)</tt> </tt>
-<a name="L837"></a><tt class="py-lineno"> 837</tt>  <tt class="py-line">                <tt class="py-name">x</tt><tt class="py-op">,</tt> <tt class="py-name">y</tt> <tt class="py-op">=</tt> <tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">meshgrid</tt><tt class="py-op">(</tt><tt class="py-name">x</tt><tt class="py-op">,</tt> <tt class="py-name">y</tt><tt class="py-op">)</tt> </tt>
-<a name="L838"></a><tt class="py-lineno"> 838</tt>  <tt class="py-line">                <tt class="py-name">lons</tt><tt class="py-op">,</tt> <tt class="py-name">lats</tt> <tt class="py-op">=</tt> <tt class="py-name">pj</tt><tt class="py-op">(</tt><tt class="py-name">x</tt><tt class="py-op">,</tt> <tt class="py-name">y</tt><tt class="py-op">,</tt> <tt class="py-name">inverse</tt><tt class="py-op">=</tt><tt class="py-name">True</tt><tt class="py-op">)</tt> </tt>
-<a name="L839"></a><tt class="py-lineno"> 839</tt>  <tt class="py-line">            <tt class="py-keyword">elif</tt> <tt class="py-name">gdtnum</tt> <tt class="py-op">==</tt> <tt class="py-number">110</tt><tt class="py-op">:</tt> <tt class="py-comment"># azimuthal equidistant</tt> </tt>
-<a name="L840"></a><tt class="py-lineno"> 840</tt>  <tt class="py-line">                <tt class="py-name">projparams</tt><tt class="py-op">[</tt><tt class="py-string">'proj'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">proj4_proj</tt> </tt>
-<a name="L841"></a><tt class="py-lineno"> 841</tt>  <tt class="py-line">                <tt class="py-name">projparams</tt><tt class="py-op">[</tt><tt class="py-string">'lat_0'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">proj4_lat_0</tt> </tt>
-<a name="L842"></a><tt class="py-lineno"> 842</tt>  <tt class="py-line">                <tt class="py-name">projparams</tt><tt class="py-op">[</tt><tt class="py-string">'lon_0'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">proj4_lon_0</tt> </tt>
-<a name="L843"></a><tt class="py-lineno"> 843</tt>  <tt class="py-line">                <tt class="py-name">pj</tt> <tt class="py-op">=</tt> <tt class="py-name">pyproj</tt><tt class="py-op">.</tt><tt class="py-name">Proj</tt><tt class="py-op">(</tt><tt class="py-name">projparams</tt><tt class="py-op">)</tt> </tt>
-<a name="L844"></a><tt class="py-lineno"> 844</tt>  <tt class="py-line">                <tt class="py-name">llcrnrx</tt><tt class="py-op">,</tt> <tt class="py-name">llcrnry</tt> <tt class="py-op">=</tt> <tt class="py-name">pj</tt><tt class="py-op">(</tt><tt class="py-name">lon1</tt><tt class="py-op">,</tt><tt class="py-name">lat1</tt><tt class="py-op">)</tt> </tt>
-<a name="L845"></a><tt class="py-lineno"> 845</tt>  <tt class="py-line">                <tt class="py-name">x</tt> <tt class="py-op">=</tt> <tt class="py-name">llcrnrx</tt><tt class="py-op">+</tt><tt class="py-name">dx</tt><tt class="py-op">*</tt><tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">arange</tt><tt class="py-op">(</tt><tt class="py-name">nx</tt><tt class="py-op">)</tt> </tt>
-<a name="L846"></a><tt class="py-lineno"> 846</tt>  <tt class="py-line">                <tt class="py-name">y</tt> <tt class="py-op">=</tt> <tt class="py-name">llcrnry</tt><tt class="py-op">+</tt><tt class="py-name">dy</tt><tt class="py-op">*</tt><tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">arange</tt><tt class="py-op">(</tt><tt class="py-name">ny</tt><tt class="py-op">)</tt> </tt>
-<a name="L847"></a><tt class="py-lineno"> 847</tt>  <tt class="py-line">                <tt class="py-name">x</tt><tt class="py-op">,</tt> <tt class="py-name">y</tt> <tt class="py-op">=</tt> <tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">meshgrid</tt><tt class="py-op">(</tt><tt class="py-name">x</tt><tt class="py-op">,</tt> <tt class="py-name">y</tt><tt class="py-op">)</tt> </tt>
-<a name="L848"></a><tt class="py-lineno"> 848</tt>  <tt class="py-line">                <tt class="py-name">lons</tt><tt class="py-op">,</tt> <tt class="py-name">lats</tt> <tt class="py-op">=</tt> <tt class="py-name">pj</tt><tt class="py-op">(</tt><tt class="py-name">x</tt><tt class="py-op">,</tt> <tt class="py-name">y</tt><tt class="py-op">,</tt> <tt class="py-name">inverse</tt><tt class="py-op">=</tt><tt class="py-name">True</tt><tt class="py-op">)</tt> </tt>
-<a name="L849"></a><tt class="py-lineno"> 849</tt>  <tt class="py-line">        <tt class="py-keyword">elif</tt> <tt class="py-name">gdtnum</tt> <tt class="py-op">==</tt> <tt class="py-number">90</tt><tt class="py-op">:</tt> <tt class="py-comment"># satellite projection.</tt> </tt>
-<a name="L850"></a><tt class="py-lineno"> 850</tt>  <tt class="py-line">            <tt class="py-name">nx</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">points_in_x_direction</tt> </tt>
-<a name="L851"></a><tt class="py-lineno"> 851</tt>  <tt class="py-line">            <tt class="py-name">ny</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">points_in_y_direction</tt> </tt>
-<a name="L852"></a><tt class="py-lineno"> 852</tt>  <tt class="py-line">            <tt class="py-name">dx</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">gridlength_in_x_direction</tt> </tt>
-<a name="L853"></a><tt class="py-lineno"> 853</tt>  <tt class="py-line">            <tt class="py-name">dy</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">gridlength_in_y_direction</tt> </tt>
-<a name="L854"></a><tt class="py-lineno"> 854</tt>  <tt class="py-line">            <tt class="py-name">projparams</tt><tt class="py-op">[</tt><tt class="py-string">'proj'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">proj4_proj</tt> </tt>
-<a name="L855"></a><tt class="py-lineno"> 855</tt>  <tt class="py-line">            <tt class="py-name">projparams</tt><tt class="py-op">[</tt><tt class="py-string">'lon_0'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">proj4_lon_0</tt> </tt>
-<a name="L856"></a><tt class="py-lineno"> 856</tt>  <tt class="py-line">            <tt class="py-name">projparams</tt><tt class="py-op">[</tt><tt class="py-string">'lat_0'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">proj4_lat_0</tt> </tt>
-<a name="L857"></a><tt class="py-lineno"> 857</tt>  <tt class="py-line">            <tt class="py-name">projparams</tt><tt class="py-op">[</tt><tt class="py-string">'h'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">proj4_h</tt> </tt>
-<a name="L858"></a><tt class="py-lineno"> 858</tt>  <tt class="py-line">            <tt class="py-name">pj</tt> <tt class="py-op">=</tt> <tt class="py-name">pyproj</tt><tt class="py-op">.</tt><tt class="py-name">Proj</tt><tt class="py-op">(</tt><tt class="py-name">projparams</tt><tt class="py-op">)</tt> </tt>
-<a name="L859"></a><tt class="py-lineno"> 859</tt>  <tt class="py-line">            <tt class="py-name">x</tt> <tt class="py-op">=</tt> <tt class="py-name">dx</tt><tt class="py-op">*</tt><tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">indices</tt><tt class="py-op">(</tt><tt class="py-op">(</tt><tt class="py-name">ny</tt><tt class="py-op">,</tt><tt class="py-name">nx</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-string">'f'</tt><tt class="py-op"> [...]
-<a name="L860"></a><tt class="py-lineno"> 860</tt>  <tt class="py-line">            <tt class="py-name">x</tt> <tt class="py-op">=</tt> <tt class="py-name">x</tt> <tt class="py-op">-</tt> <tt class="py-number">0.5</tt><tt class="py-op">*</tt><tt class="py-name">x</tt><tt class="py-op">.</tt><tt class="py-name">max</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
-<a name="L861"></a><tt class="py-lineno"> 861</tt>  <tt class="py-line">            <tt class="py-name">y</tt> <tt class="py-op">=</tt> <tt class="py-name">dy</tt><tt class="py-op">*</tt><tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">indices</tt><tt class="py-op">(</tt><tt class="py-op">(</tt><tt class="py-name">ny</tt><tt class="py-op">,</tt><tt class="py-name">nx</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-string">'f'</tt><tt class="py-op"> [...]
-<a name="L862"></a><tt class="py-lineno"> 862</tt>  <tt class="py-line">            <tt class="py-name">y</tt> <tt class="py-op">=</tt> <tt class="py-name">y</tt> <tt class="py-op">-</tt> <tt class="py-number">0.5</tt><tt class="py-op">*</tt><tt class="py-name">y</tt><tt class="py-op">.</tt><tt class="py-name">max</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
-<a name="L863"></a><tt class="py-lineno"> 863</tt>  <tt class="py-line">            <tt class="py-name">lons</tt><tt class="py-op">,</tt> <tt class="py-name">lats</tt> <tt class="py-op">=</tt> <tt class="py-name">pj</tt><tt class="py-op">(</tt><tt class="py-name">x</tt><tt class="py-op">,</tt><tt class="py-name">y</tt><tt class="py-op">,</tt><tt class="py-name">inverse</tt><tt class="py-op">=</tt><tt class="py-name">True</tt><tt class="py-op">)</tt> </tt>
-<a name="L864"></a><tt class="py-lineno"> 864</tt>  <tt class="py-line">            <tt class="py-comment"># set lons,lats to 1.e30 where undefined</tt> </tt>
-<a name="L865"></a><tt class="py-lineno"> 865</tt>  <tt class="py-line">            <tt class="py-name">abslons</tt> <tt class="py-op">=</tt> <tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">fabs</tt><tt class="py-op">(</tt><tt class="py-name">lons</tt><tt class="py-op">)</tt><tt class="py-op">;</tt> <tt class="py-name">abslats</tt> <tt class="py-op">=</tt> <tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">fabs</tt><tt class="py-op">(</tt><tt cl [...]
-<a name="L866"></a><tt class="py-lineno"> 866</tt>  <tt class="py-line">            <tt class="py-name">lons</tt> <tt class="py-op">=</tt> <tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">where</tt><tt class="py-op">(</tt><tt class="py-name">abslons</tt> <tt class="py-op"><</tt> <tt class="py-number">1.e20</tt><tt class="py-op">,</tt> <tt class="py-name">lons</tt><tt class="py-op">,</tt> <tt class="py-number">1.e30</tt><tt class="py-op">)</tt> </tt>
-<a name="L867"></a><tt class="py-lineno"> 867</tt>  <tt class="py-line">            <tt class="py-name">lats</tt> <tt class="py-op">=</tt> <tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">where</tt><tt class="py-op">(</tt><tt class="py-name">abslats</tt> <tt class="py-op"><</tt> <tt class="py-number">1.e20</tt><tt class="py-op">,</tt> <tt class="py-name">lats</tt><tt class="py-op">,</tt> <tt class="py-number">1.e30</tt><tt class="py-op">)</tt> </tt>
-<a name="L868"></a><tt class="py-lineno"> 868</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
-<a name="L869"></a><tt class="py-lineno"> 869</tt>  <tt class="py-line">            <tt class="py-keyword">raise</tt> <tt class="py-name">ValueError</tt><tt class="py-op">(</tt><tt class="py-string">'unsupported grid'</tt><tt class="py-op">)</tt> </tt>
-<a name="L870"></a><tt class="py-lineno"> 870</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">projparams</tt> <tt class="py-op">=</tt> <tt class="py-name">projparams</tt> </tt>
-<a name="L871"></a><tt class="py-lineno"> 871</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">lats</tt><tt class="py-op">.</tt><tt class="py-name">astype</tt><tt class="py-op">(</tt><tt class="py-string">'f'</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-name">lons</tt><tt class="py-op">.</tt><tt class="py-name">astype</tt><tt class="py-op">(</tt><tt class="py-string">'f'</tt><tt class="py-op">)</tt> </tt>
-</div></div><a name="L872"></a><tt class="py-lineno"> 872</tt>  <tt class="py-line"> </tt>
-<a name="Grib2Decode"></a><div id="Grib2Decode-def"><a name="L873"></a><tt class="py-lineno"> 873</tt> <a class="py-toggle" href="#" id="Grib2Decode-toggle" onclick="return toggle('Grib2Decode');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="ncepgrib2-module.html#Grib2Decode">Grib2Decode</a><tt class="py-op">(</tt><tt class="py-param">filename</tt><tt class="py-op">,</tt><tt class="py-param">gribmsg</tt><tt class="py-op">=</tt><tt class="py-name"> [...]
-</div><div id="Grib2Decode-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="Grib2Decode-expanded"><a name="L874"></a><tt class="py-lineno"> 874</tt>  <tt class="py-line">    <tt class="py-docstring">"""</tt> </tt>
-<a name="L875"></a><tt class="py-lineno"> 875</tt>  <tt class="py-line"><tt class="py-docstring"> Read the contents of a GRIB2 file.</tt> </tt>
-<a name="L876"></a><tt class="py-lineno"> 876</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
-<a name="L877"></a><tt class="py-lineno"> 877</tt>  <tt class="py-line"><tt class="py-docstring"> @param filename: name of GRIB2 file (default, gribmsg=False) or binary string</tt> </tt>
-<a name="L878"></a><tt class="py-lineno"> 878</tt>  <tt class="py-line"><tt class="py-docstring"> representing a grib message (if gribmsg=True).</tt> </tt>
-<a name="L879"></a><tt class="py-lineno"> 879</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
-<a name="L880"></a><tt class="py-lineno"> 880</tt>  <tt class="py-line"><tt class="py-docstring"> @return:  a list of L{Grib2Message} instances representing all of the</tt> </tt>
-<a name="L881"></a><tt class="py-lineno"> 881</tt>  <tt class="py-line"><tt class="py-docstring"> grib messages in the file.  Messages with multiple fields are split</tt> </tt>
-<a name="L882"></a><tt class="py-lineno"> 882</tt>  <tt class="py-line"><tt class="py-docstring"> into separate messages (so that each L{Grib2Message} instance contains</tt> </tt>
-<a name="L883"></a><tt class="py-lineno"> 883</tt>  <tt class="py-line"><tt class="py-docstring"> just one data field). The metadata in each GRIB2 message can be</tt> </tt>
-<a name="L884"></a><tt class="py-lineno"> 884</tt>  <tt class="py-line"><tt class="py-docstring"> accessed via L{Grib2Message} instance variables, the actual data</tt> </tt>
-<a name="L885"></a><tt class="py-lineno"> 885</tt>  <tt class="py-line"><tt class="py-docstring"> can be read using L{Grib2Message.data}, and the lat/lon values of the grid</tt> </tt>
-<a name="L886"></a><tt class="py-lineno"> 886</tt>  <tt class="py-line"><tt class="py-docstring"> can be accesses using L{Grib2Message.grid}. If there is only one grib</tt> </tt>
-<a name="L887"></a><tt class="py-lineno"> 887</tt>  <tt class="py-line"><tt class="py-docstring"> message, just the L{Grib2Message} instance is returned, instead of a list</tt> </tt>
-<a name="L888"></a><tt class="py-lineno"> 888</tt>  <tt class="py-line"><tt class="py-docstring"> with one element.</tt> </tt>
-<a name="L889"></a><tt class="py-lineno"> 889</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
-<a name="L890"></a><tt class="py-lineno"> 890</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt class="py-name">gribmsg</tt><tt class="py-op">:</tt> </tt>
-<a name="L891"></a><tt class="py-lineno"> 891</tt>  <tt class="py-line">        <tt class="py-name">f</tt> <tt class="py-op">=</tt> <tt class="py-name">StringIO</tt><tt class="py-op">(</tt><tt class="py-name">filename</tt><tt class="py-op">)</tt> </tt>
-<a name="L892"></a><tt class="py-lineno"> 892</tt>  <tt class="py-line">    <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
-<a name="L893"></a><tt class="py-lineno"> 893</tt>  <tt class="py-line">        <tt class="py-name">f</tt> <tt class="py-op">=</tt> <tt class="py-name">open</tt><tt class="py-op">(</tt><tt class="py-name">filename</tt><tt class="py-op">,</tt><tt class="py-string">'rb'</tt><tt class="py-op">)</tt> </tt>
-<a name="L894"></a><tt class="py-lineno"> 894</tt>  <tt class="py-line">    <tt class="py-name">nmsg</tt> <tt class="py-op">=</tt> <tt class="py-number">0</tt> </tt>
-<a name="L895"></a><tt class="py-lineno"> 895</tt>  <tt class="py-line">    <tt class="py-comment"># loop over grib messages, read section 0, get entire grib message.</tt> </tt>
-<a name="L896"></a><tt class="py-lineno"> 896</tt>  <tt class="py-line">    <tt class="py-name">disciplines</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
-<a name="L897"></a><tt class="py-lineno"> 897</tt>  <tt class="py-line">    <tt class="py-name">startingpos</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
-<a name="L898"></a><tt class="py-lineno"> 898</tt>  <tt class="py-line">    <tt class="py-name">msglen</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
-<a name="L899"></a><tt class="py-lineno"> 899</tt>  <tt class="py-line">    <tt class="py-keyword">while</tt> <tt class="py-number">1</tt><tt class="py-op">:</tt> </tt>
-<a name="L900"></a><tt class="py-lineno"> 900</tt>  <tt class="py-line">        <tt class="py-comment"># find next occurence of string 'GRIB' (or EOF).</tt> </tt>
-<a name="L901"></a><tt class="py-lineno"> 901</tt>  <tt class="py-line">        <tt class="py-name">nbyte</tt> <tt class="py-op">=</tt> <tt class="py-name">f</tt><tt class="py-op">.</tt><tt class="py-name">tell</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
-<a name="L902"></a><tt class="py-lineno"> 902</tt>  <tt class="py-line">        <tt class="py-keyword">while</tt> <tt class="py-number">1</tt><tt class="py-op">:</tt> </tt>
-<a name="L903"></a><tt class="py-lineno"> 903</tt>  <tt class="py-line">            <tt class="py-name">f</tt><tt class="py-op">.</tt><tt class="py-name">seek</tt><tt class="py-op">(</tt><tt class="py-name">nbyte</tt><tt class="py-op">)</tt> </tt>
-<a name="L904"></a><tt class="py-lineno"> 904</tt>  <tt class="py-line">            <tt class="py-name">start</tt> <tt class="py-op">=</tt> <tt class="py-name">f</tt><tt class="py-op">.</tt><tt class="py-name">read</tt><tt class="py-op">(</tt><tt class="py-number">4</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt class="py-name">decode</tt><tt class="py-op">(</tt><tt class="py-string">'ascii'</tt><tt class="py-op">,</tt><tt class="py-string">'ignore'</tt><tt class="py-op">)</tt> </tt>
-<a name="L905"></a><tt class="py-lineno"> 905</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">start</tt> <tt class="py-op">==</tt> <tt class="py-string">''</tt> <tt class="py-keyword">or</tt> <tt class="py-name">start</tt> <tt class="py-op">==</tt> <tt class="py-string">'GRIB'</tt><tt class="py-op">:</tt> <tt class="py-keyword">break</tt> </tt>
-<a name="L906"></a><tt class="py-lineno"> 906</tt>  <tt class="py-line">            <tt class="py-name">nbyte</tt> <tt class="py-op">=</tt> <tt class="py-name">nbyte</tt> <tt class="py-op">+</tt> <tt class="py-number">1</tt> </tt>
-<a name="L907"></a><tt class="py-lineno"> 907</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">start</tt> <tt class="py-op">==</tt> <tt class="py-string">''</tt><tt class="py-op">:</tt> <tt class="py-keyword">break</tt> <tt class="py-comment"># at EOF</tt> </tt>
-<a name="L908"></a><tt class="py-lineno"> 908</tt>  <tt class="py-line">        <tt class="py-comment"># otherwise, start (='GRIB') contains indicator message (section 0)</tt> </tt>
-<a name="L909"></a><tt class="py-lineno"> 909</tt>  <tt class="py-line">        <tt class="py-name">startpos</tt> <tt class="py-op">=</tt> <tt class="py-name">f</tt><tt class="py-op">.</tt><tt class="py-name">tell</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">-</tt><tt class="py-number">4</tt> </tt>
-<a name="L910"></a><tt class="py-lineno"> 910</tt>  <tt class="py-line">        <tt class="py-name">f</tt><tt class="py-op">.</tt><tt class="py-name">seek</tt><tt class="py-op">(</tt><tt class="py-number">2</tt><tt class="py-op">,</tt><tt class="py-number">1</tt><tt class="py-op">)</tt>  <tt class="py-comment"># next two octets are reserved</tt> </tt>
-<a name="L911"></a><tt class="py-lineno"> 911</tt>  <tt class="py-line">        <tt class="py-comment"># get discipline info.</tt> </tt>
-<a name="L912"></a><tt class="py-lineno"> 912</tt>  <tt class="py-line">        <tt class="py-name">disciplines</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">struct</tt><tt class="py-op">.</tt><tt class="py-name">unpack</tt><tt class="py-op">(</tt><tt class="py-string">'>B'</tt><tt class="py-op">,</tt><tt class="py-name">f</tt><tt class="py-op">.</tt><tt class="py-name">read</tt><tt class="py-op">(</tt><tt class="py-number">1</t [...]
-<a name="L913"></a><tt class="py-lineno"> 913</tt>  <tt class="py-line">        <tt class="py-comment"># check to see it's a grib edition 2 file.</tt> </tt>
-<a name="L914"></a><tt class="py-lineno"> 914</tt>  <tt class="py-line">        <tt class="py-name">vers</tt> <tt class="py-op">=</tt> <tt class="py-name">struct</tt><tt class="py-op">.</tt><tt class="py-name">unpack</tt><tt class="py-op">(</tt><tt class="py-string">'>B'</tt><tt class="py-op">,</tt><tt class="py-name">f</tt><tt class="py-op">.</tt><tt class="py-name">read</tt><tt class="py-op">(</tt><tt class="py-number">1</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class= [...]
-<a name="L915"></a><tt class="py-lineno"> 915</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">vers</tt> <tt class="py-op">!=</tt> <tt class="py-number">2</tt><tt class="py-op">:</tt> </tt>
-<a name="L916"></a><tt class="py-lineno"> 916</tt>  <tt class="py-line">            <tt class="py-keyword">raise</tt> <tt class="py-name">IOError</tt><tt class="py-op">(</tt><tt class="py-string">'not a GRIB2 file (version number %d)'</tt> <tt class="py-op">%</tt> <tt class="py-name">vers</tt><tt class="py-op">)</tt> </tt>
-<a name="L917"></a><tt class="py-lineno"> 917</tt>  <tt class="py-line">        <tt class="py-name">lengrib</tt> <tt class="py-op">=</tt> <tt class="py-name">struct</tt><tt class="py-op">.</tt><tt class="py-name">unpack</tt><tt class="py-op">(</tt><tt class="py-string">'>q'</tt><tt class="py-op">,</tt><tt class="py-name">f</tt><tt class="py-op">.</tt><tt class="py-name">read</tt><tt class="py-op">(</tt><tt class="py-number">8</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt cla [...]
-<a name="L918"></a><tt class="py-lineno"> 918</tt>  <tt class="py-line">        <tt class="py-name">msglen</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">lengrib</tt><tt class="py-op">)</tt> </tt>
-<a name="L919"></a><tt class="py-lineno"> 919</tt>  <tt class="py-line">        <tt class="py-name">startingpos</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">startpos</tt><tt class="py-op">)</tt> </tt>
-<a name="L920"></a><tt class="py-lineno"> 920</tt>  <tt class="py-line">        <tt class="py-comment"># read in entire grib message.</tt> </tt>
-<a name="L921"></a><tt class="py-lineno"> 921</tt>  <tt class="py-line">        <tt class="py-name">f</tt><tt class="py-op">.</tt><tt class="py-name">seek</tt><tt class="py-op">(</tt><tt class="py-name">startpos</tt><tt class="py-op">)</tt> </tt>
-<a name="L922"></a><tt class="py-lineno"> 922</tt>  <tt class="py-line">        <tt class="py-name">gribmsg</tt> <tt class="py-op">=</tt> <tt class="py-name">f</tt><tt class="py-op">.</tt><tt class="py-name">read</tt><tt class="py-op">(</tt><tt class="py-name">lengrib</tt><tt class="py-op">)</tt> </tt>
-<a name="L923"></a><tt class="py-lineno"> 923</tt>  <tt class="py-line">        <tt class="py-comment"># make sure the message ends with '7777'</tt> </tt>
-<a name="L924"></a><tt class="py-lineno"> 924</tt>  <tt class="py-line">        <tt id="link-14" class="py-name" targets="Method ncepgrib2.Grib2Encode.end()=ncepgrib2.Grib2Encode-class.html#end"><a title="ncepgrib2.Grib2Encode.end" class="py-name" href="#" onclick="return doclink('link-14', 'end', 'link-14');">end</a></tt> <tt class="py-op">=</tt> <tt class="py-name">gribmsg</tt><tt class="py-op">[</tt><tt class="py-op">-</tt><tt class="py-number">4</tt><tt class="py-op">:</tt><tt class= [...]
-<a name="L925"></a><tt class="py-lineno"> 925</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt id="link-15" class="py-name"><a title="ncepgrib2.Grib2Encode.end" class="py-name" href="#" onclick="return doclink('link-15', 'end', 'link-14');">end</a></tt> <tt class="py-op">!=</tt> <tt class="py-string">'7777'</tt><tt class="py-op">:</tt> </tt>
-<a name="L926"></a><tt class="py-lineno"> 926</tt>  <tt class="py-line">           <tt class="py-keyword">raise</tt> <tt class="py-name">IOError</tt><tt class="py-op">(</tt><tt class="py-string">'partial GRIB message (no "7777" at end)'</tt><tt class="py-op">)</tt> </tt>
-<a name="L927"></a><tt class="py-lineno"> 927</tt>  <tt class="py-line">        <tt class="py-comment"># do next message.</tt> </tt>
-<a name="L928"></a><tt class="py-lineno"> 928</tt>  <tt class="py-line">        <tt class="py-name">nmsg</tt><tt class="py-op">=</tt><tt class="py-name">nmsg</tt><tt class="py-op">+</tt><tt class="py-number">1</tt> </tt>
-<a name="L929"></a><tt class="py-lineno"> 929</tt>  <tt class="py-line">    <tt class="py-comment"># if no grib messages found, nmsg is still 0 and it's not GRIB.</tt> </tt>
-<a name="L930"></a><tt class="py-lineno"> 930</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt class="py-name">nmsg</tt><tt class="py-op">==</tt><tt class="py-number">0</tt><tt class="py-op">:</tt> </tt>
-<a name="L931"></a><tt class="py-lineno"> 931</tt>  <tt class="py-line">       <tt class="py-keyword">raise</tt> <tt class="py-name">IOError</tt><tt class="py-op">(</tt><tt class="py-string">'not a GRIB file'</tt><tt class="py-op">)</tt> </tt>
-<a name="L932"></a><tt class="py-lineno"> 932</tt>  <tt class="py-line">    <tt class="py-comment"># now for each grib message, find number of fields.</tt> </tt>
-<a name="L933"></a><tt class="py-lineno"> 933</tt>  <tt class="py-line">    <tt class="py-name">numfields</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
-<a name="L934"></a><tt class="py-lineno"> 934</tt>  <tt class="py-line">    <tt class="py-name">f</tt><tt class="py-op">.</tt><tt class="py-name">seek</tt><tt class="py-op">(</tt><tt class="py-number">0</tt><tt class="py-op">)</tt> <tt class="py-comment"># rewind file.</tt> </tt>
-<a name="L935"></a><tt class="py-lineno"> 935</tt>  <tt class="py-line">    <tt class="py-keyword">for</tt> <tt class="py-name">n</tt> <tt class="py-keyword">in</tt> <tt class="py-name">range</tt><tt class="py-op">(</tt><tt class="py-name">nmsg</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
-<a name="L936"></a><tt class="py-lineno"> 936</tt>  <tt class="py-line">        <tt class="py-name">f</tt><tt class="py-op">.</tt><tt class="py-name">seek</tt><tt class="py-op">(</tt><tt class="py-name">startingpos</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
-<a name="L937"></a><tt class="py-lineno"> 937</tt>  <tt class="py-line">        <tt class="py-name">gribmsg</tt> <tt class="py-op">=</tt> <tt class="py-name">f</tt><tt class="py-op">.</tt><tt class="py-name">read</tt><tt class="py-op">(</tt><tt class="py-name">msglen</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
-<a name="L938"></a><tt class="py-lineno"> 938</tt>  <tt class="py-line">        <tt class="py-name">pos</tt> <tt class="py-op">=</tt> <tt class="py-number">0</tt> </tt>
-<a name="L939"></a><tt class="py-lineno"> 939</tt>  <tt class="py-line">        <tt class="py-name">numflds</tt> <tt class="py-op">=</tt> <tt class="py-number">0</tt> </tt>
-<a name="L940"></a><tt class="py-lineno"> 940</tt>  <tt class="py-line">        <tt class="py-keyword">while</tt> <tt class="py-number">1</tt><tt class="py-op">:</tt> </tt>
-<a name="L941"></a><tt class="py-lineno"> 941</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">gribmsg</tt><tt class="py-op">[</tt><tt class="py-name">pos</tt><tt class="py-op">:</tt><tt class="py-name">pos</tt><tt class="py-op">+</tt><tt class="py-number">4</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt class="py-name">decode</tt><tt class="py-op">(</tt><tt class="py-string">'ascii'</tt><tt class="py-op">,</tt><tt class="py-string">'ignor [...]
-<a name="L942"></a><tt class="py-lineno"> 942</tt>  <tt class="py-line">                <tt class="py-name">sectnum</tt> <tt class="py-op">=</tt> <tt class="py-number">0</tt> </tt>
-<a name="L943"></a><tt class="py-lineno"> 943</tt>  <tt class="py-line">                <tt class="py-name">lensect</tt> <tt class="py-op">=</tt> <tt class="py-number">16</tt> </tt>
-<a name="L944"></a><tt class="py-lineno"> 944</tt>  <tt class="py-line">            <tt class="py-keyword">elif</tt> <tt class="py-name">gribmsg</tt><tt class="py-op">[</tt><tt class="py-name">pos</tt><tt class="py-op">:</tt><tt class="py-name">pos</tt><tt class="py-op">+</tt><tt class="py-number">4</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt class="py-name">decode</tt><tt class="py-op">(</tt><tt class="py-string">'ascii'</tt><tt class="py-op">,</tt><tt class="py-string">'ign [...]
-<a name="L945"></a><tt class="py-lineno"> 945</tt>  <tt class="py-line">                <tt class="py-keyword">break</tt> </tt>
-<a name="L946"></a><tt class="py-lineno"> 946</tt>  <tt class="py-line">            <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
-<a name="L947"></a><tt class="py-lineno"> 947</tt>  <tt class="py-line">                <tt class="py-name">lensect</tt> <tt class="py-op">=</tt> <tt class="py-name">struct</tt><tt class="py-op">.</tt><tt class="py-name">unpack</tt><tt class="py-op">(</tt><tt class="py-string">'>i'</tt><tt class="py-op">,</tt><tt class="py-name">gribmsg</tt><tt class="py-op">[</tt><tt class="py-name">pos</tt><tt class="py-op">:</tt><tt class="py-name">pos</tt><tt class="py-op">+</tt><tt class="py-numb [...]
-<a name="L948"></a><tt class="py-lineno"> 948</tt>  <tt class="py-line">                <tt class="py-name">sectnum</tt> <tt class="py-op">=</tt> <tt class="py-name">struct</tt><tt class="py-op">.</tt><tt class="py-name">unpack</tt><tt class="py-op">(</tt><tt class="py-string">'>B'</tt><tt class="py-op">,</tt><tt class="py-name">gribmsg</tt><tt class="py-op">[</tt><tt class="py-name">pos</tt><tt class="py-op">+</tt><tt class="py-number">4</tt><tt class="py-op">:</tt><tt class="py-name [...]
-<a name="L949"></a><tt class="py-lineno"> 949</tt>  <tt class="py-line">                <tt class="py-keyword">if</tt> <tt class="py-name">sectnum</tt> <tt class="py-op">==</tt> <tt class="py-number">4</tt><tt class="py-op">:</tt> <tt class="py-name">numflds</tt><tt class="py-op">=</tt><tt class="py-name">numflds</tt><tt class="py-op">+</tt><tt class="py-number">1</tt> </tt>
-<a name="L950"></a><tt class="py-lineno"> 950</tt>  <tt class="py-line">                <tt class="py-comment">#if sectnum == 2: numlocal=numlocal+1</tt> </tt>
-<a name="L951"></a><tt class="py-lineno"> 951</tt>  <tt class="py-line">            <tt class="py-name">pos</tt> <tt class="py-op">=</tt> <tt class="py-name">pos</tt> <tt class="py-op">+</tt> <tt class="py-name">lensect</tt> </tt>
-<a name="L952"></a><tt class="py-lineno"> 952</tt>  <tt class="py-line">            <tt class="py-comment">#print sectnum,lensect,pos</tt> </tt>
-<a name="L953"></a><tt class="py-lineno"> 953</tt>  <tt class="py-line">        <tt class="py-comment">#print n+1,len(gribmsg),numfields,numlocal</tt> </tt>
-<a name="L954"></a><tt class="py-lineno"> 954</tt>  <tt class="py-line">        <tt class="py-name">numfields</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">numflds</tt><tt class="py-op">)</tt> </tt>
-<a name="L955"></a><tt class="py-lineno"> 955</tt>  <tt class="py-line">    <tt class="py-comment"># decode each section in grib message (sections 1 and above).</tt> </tt>
-<a name="L956"></a><tt class="py-lineno"> 956</tt>  <tt class="py-line">    <tt class="py-name">gdtnum</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> <tt class="py-comment"># grid defn template number from sxn 3</tt> </tt>
-<a name="L957"></a><tt class="py-lineno"> 957</tt>  <tt class="py-line">    <tt class="py-name">gdtmpl</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> <tt class="py-comment"># grid defn template from sxn 3</tt> </tt>
-<a name="L958"></a><tt class="py-lineno"> 958</tt>  <tt class="py-line">    <tt class="py-name">gdeflist</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> <tt class="py-comment"># optional grid definition list from sxn 3</tt> </tt>
-<a name="L959"></a><tt class="py-lineno"> 959</tt>  <tt class="py-line">    <tt class="py-name">gdsinfo</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> <tt class="py-comment"># grid definition section info from sxn3</tt> </tt>
-<a name="L960"></a><tt class="py-lineno"> 960</tt>  <tt class="py-line">    <tt class="py-name">pdtmpl</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> <tt class="py-comment"># product defn template from sxn 4</tt> </tt>
-<a name="L961"></a><tt class="py-lineno"> 961</tt>  <tt class="py-line">    <tt class="py-name">pdtnum</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> <tt class="py-comment"># product defn template number from sxn 4</tt> </tt>
-<a name="L962"></a><tt class="py-lineno"> 962</tt>  <tt class="py-line">    <tt class="py-name">coordlist</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> <tt class="py-comment"># vertical coordinate info from sxn 4</tt> </tt>
-<a name="L963"></a><tt class="py-lineno"> 963</tt>  <tt class="py-line">    <tt class="py-name">drtmpl</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> <tt class="py-comment"># data representation template from sxn 5</tt> </tt>
-<a name="L964"></a><tt class="py-lineno"> 964</tt>  <tt class="py-line">    <tt class="py-name">drtnum</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> <tt class="py-comment"># data representation template number from sxn 5</tt> </tt>
-<a name="L965"></a><tt class="py-lineno"> 965</tt>  <tt class="py-line">    <tt class="py-name">ndpts</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> <tt class="py-comment"># number of data points to be unpacked (from sxn 5)</tt> </tt>
-<a name="L966"></a><tt class="py-lineno"> 966</tt>  <tt class="py-line">    <tt class="py-name">bitmapflag</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> <tt class="py-comment"># bit-map indicator flag from sxn 6</tt> </tt>
-<a name="L967"></a><tt class="py-lineno"> 967</tt>  <tt class="py-line">    <tt class="py-name">bitmap</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> <tt class="py-comment"># bitmap from sxn 6.</tt> </tt>
-<a name="L968"></a><tt class="py-lineno"> 968</tt>  <tt class="py-line">    <tt class="py-name">pos7</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> <tt class="py-comment"># byte offset for section 7.</tt> </tt>
-<a name="L969"></a><tt class="py-lineno"> 969</tt>  <tt class="py-line">    <tt class="py-name">localsxn</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> <tt class="py-comment"># local use sections.</tt> </tt>
-<a name="L970"></a><tt class="py-lineno"> 970</tt>  <tt class="py-line">    <tt class="py-name">msgstart</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> <tt class="py-comment"># byte offset in file for message start.</tt> </tt>
-<a name="L971"></a><tt class="py-lineno"> 971</tt>  <tt class="py-line">    <tt class="py-name">msglength</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> <tt class="py-comment"># length of the message in bytes.</tt> </tt>
-<a name="L972"></a><tt class="py-lineno"> 972</tt>  <tt class="py-line">    <tt class="py-name">message</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> <tt class="py-comment"># the actual grib message.</tt> </tt>
-<a name="L973"></a><tt class="py-lineno"> 973</tt>  <tt class="py-line">    <tt class="py-name">identsect</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> <tt class="py-comment"># identification section (section 1).</tt> </tt>
-<a name="L974"></a><tt class="py-lineno"> 974</tt>  <tt class="py-line">    <tt class="py-name">discipline</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> <tt class="py-comment"># discipline code.</tt> </tt>
-<a name="L975"></a><tt class="py-lineno"> 975</tt>  <tt class="py-line">    <tt class="py-keyword">for</tt> <tt class="py-name">n</tt> <tt class="py-keyword">in</tt> <tt class="py-name">range</tt><tt class="py-op">(</tt><tt class="py-name">nmsg</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
-<a name="L976"></a><tt class="py-lineno"> 976</tt>  <tt class="py-line">        <tt class="py-name">spos</tt> <tt class="py-op">=</tt> <tt class="py-name">startingpos</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt> </tt>
-<a name="L977"></a><tt class="py-lineno"> 977</tt>  <tt class="py-line">        <tt class="py-name">lengrib</tt> <tt class="py-op">=</tt> <tt class="py-name">msglen</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt> </tt>
-<a name="L978"></a><tt class="py-lineno"> 978</tt>  <tt class="py-line">        <tt class="py-comment">#gribmsg = gribmsgs[n]</tt> </tt>
-<a name="L979"></a><tt class="py-lineno"> 979</tt>  <tt class="py-line">        <tt class="py-name">f</tt><tt class="py-op">.</tt><tt class="py-name">seek</tt><tt class="py-op">(</tt><tt class="py-name">spos</tt><tt class="py-op">)</tt> </tt>
-<a name="L980"></a><tt class="py-lineno"> 980</tt>  <tt class="py-line">        <tt class="py-name">gribmsg</tt> <tt class="py-op">=</tt> <tt class="py-name">f</tt><tt class="py-op">.</tt><tt class="py-name">read</tt><tt class="py-op">(</tt><tt class="py-name">lengrib</tt><tt class="py-op">)</tt> </tt>
-<a name="L981"></a><tt class="py-lineno"> 981</tt>  <tt class="py-line">        <tt class="py-name">discipl</tt> <tt class="py-op">=</tt> <tt class="py-name">disciplines</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt> </tt>
-<a name="L982"></a><tt class="py-lineno"> 982</tt>  <tt class="py-line">        <tt class="py-name">lensect0</tt> <tt class="py-op">=</tt> <tt class="py-number">16</tt> </tt>
-<a name="L983"></a><tt class="py-lineno"> 983</tt>  <tt class="py-line">        <tt class="py-comment"># get length of section 1 and section number.</tt> </tt>
-<a name="L984"></a><tt class="py-lineno"> 984</tt>  <tt class="py-line">        <tt class="py-comment">#lensect1 = struct.unpack('>i',gribmsg[lensect0:lensect0+4])[0]</tt> </tt>
-<a name="L985"></a><tt class="py-lineno"> 985</tt>  <tt class="py-line">        <tt class="py-comment">#sectnum1 = struct.unpack('>B',gribmsg[lensect0+4])[0]</tt> </tt>
-<a name="L986"></a><tt class="py-lineno"> 986</tt>  <tt class="py-line">        <tt class="py-comment">#print 'sectnum1, lensect1 = ',sectnum1,lensect1</tt> </tt>
-<a name="L987"></a><tt class="py-lineno"> 987</tt>  <tt class="py-line">        <tt class="py-comment"># unpack section 1, octets 1-21 (13 parameters).  This section</tt> </tt>
-<a name="L988"></a><tt class="py-lineno"> 988</tt>  <tt class="py-line">        <tt class="py-comment"># can occur only once per grib message.</tt> </tt>
-<a name="L989"></a><tt class="py-lineno"> 989</tt>  <tt class="py-line">        <tt class="py-comment">#idsect,pos = _unpack1(gribmsg,lensect0) # python version</tt> </tt>
-<a name="L990"></a><tt class="py-lineno"> 990</tt>  <tt class="py-line">        <tt class="py-name">idsect</tt><tt class="py-op">,</tt><tt class="py-name">pos</tt> <tt class="py-op">=</tt> <tt class="py-name">g2clib</tt><tt class="py-op">.</tt><tt class="py-name">unpack1</tt><tt class="py-op">(</tt><tt class="py-name">gribmsg</tt><tt class="py-op">,</tt><tt class="py-name">lensect0</tt><tt class="py-op">,</tt><tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">empty</t [...]
-<a name="L991"></a><tt class="py-lineno"> 991</tt>  <tt class="py-line">        <tt class="py-comment"># loop over rest of sections in message.</tt> </tt>
-<a name="L992"></a><tt class="py-lineno"> 992</tt>  <tt class="py-line">        <tt class="py-name">gdtnums</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
-<a name="L993"></a><tt class="py-lineno"> 993</tt>  <tt class="py-line">        <tt class="py-name">gdtmpls</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
-<a name="L994"></a><tt class="py-lineno"> 994</tt>  <tt class="py-line">        <tt class="py-name">gdeflists</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
-<a name="L995"></a><tt class="py-lineno"> 995</tt>  <tt class="py-line">        <tt class="py-name">gdsinfos</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
-<a name="L996"></a><tt class="py-lineno"> 996</tt>  <tt class="py-line">        <tt class="py-name">pdtmpls</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
-<a name="L997"></a><tt class="py-lineno"> 997</tt>  <tt class="py-line">        <tt class="py-name">coordlists</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
-<a name="L998"></a><tt class="py-lineno"> 998</tt>  <tt class="py-line">        <tt class="py-name">pdtnums</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
-<a name="L999"></a><tt class="py-lineno"> 999</tt>  <tt class="py-line">        <tt class="py-name">drtmpls</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
-<a name="L1000"></a><tt class="py-lineno">1000</tt>  <tt class="py-line">        <tt class="py-name">drtnums</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
-<a name="L1001"></a><tt class="py-lineno">1001</tt>  <tt class="py-line">        <tt class="py-name">ndptslist</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
-<a name="L1002"></a><tt class="py-lineno">1002</tt>  <tt class="py-line">        <tt class="py-name">bitmapflags</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
-<a name="L1003"></a><tt class="py-lineno">1003</tt>  <tt class="py-line">        <tt class="py-name">bitmaps</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
-<a name="L1004"></a><tt class="py-lineno">1004</tt>  <tt class="py-line">        <tt class="py-name">sxn7pos</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
-<a name="L1005"></a><tt class="py-lineno">1005</tt>  <tt class="py-line">        <tt class="py-name">localsxns</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
-<a name="L1006"></a><tt class="py-lineno">1006</tt>  <tt class="py-line">        <tt class="py-keyword">while</tt> <tt class="py-number">1</tt><tt class="py-op">:</tt> </tt>
-<a name="L1007"></a><tt class="py-lineno">1007</tt>  <tt class="py-line">            <tt class="py-comment"># check to see if this is the end of the message.</tt> </tt>
-<a name="L1008"></a><tt class="py-lineno">1008</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">gribmsg</tt><tt class="py-op">[</tt><tt class="py-name">pos</tt><tt class="py-op">:</tt><tt class="py-name">pos</tt><tt class="py-op">+</tt><tt class="py-number">4</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt class="py-name">decode</tt><tt class="py-op">(</tt><tt class="py-string">'ascii'</tt><tt class="py-op">,</tt><tt class="py-string">'igno [...]
-<a name="L1009"></a><tt class="py-lineno">1009</tt>  <tt class="py-line">            <tt class="py-name">lensect</tt> <tt class="py-op">=</tt> <tt class="py-name">struct</tt><tt class="py-op">.</tt><tt class="py-name">unpack</tt><tt class="py-op">(</tt><tt class="py-string">'>i'</tt><tt class="py-op">,</tt><tt class="py-name">gribmsg</tt><tt class="py-op">[</tt><tt class="py-name">pos</tt><tt class="py-op">:</tt><tt class="py-name">pos</tt><tt class="py-op">+</tt><tt class="py-number" [...]
-<a name="L1010"></a><tt class="py-lineno">1010</tt>  <tt class="py-line">            <tt class="py-name">sectnum</tt> <tt class="py-op">=</tt> <tt class="py-name">struct</tt><tt class="py-op">.</tt><tt class="py-name">unpack</tt><tt class="py-op">(</tt><tt class="py-string">'>B'</tt><tt class="py-op">,</tt><tt class="py-name">gribmsg</tt><tt class="py-op">[</tt><tt class="py-name">pos</tt><tt class="py-op">+</tt><tt class="py-number">4</tt><tt class="py-op">:</tt><tt class="py-name">p [...]
-<a name="L1011"></a><tt class="py-lineno">1011</tt>  <tt class="py-line">            <tt class="py-comment"># section 2, local use section.</tt> </tt>
-<a name="L1012"></a><tt class="py-lineno">1012</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">sectnum</tt> <tt class="py-op">==</tt> <tt class="py-number">2</tt><tt class="py-op">:</tt> </tt>
-<a name="L1013"></a><tt class="py-lineno">1013</tt>  <tt class="py-line">                <tt class="py-comment"># "local use section", used by NDFD to store WX</tt> </tt>
-<a name="L1014"></a><tt class="py-lineno">1014</tt>  <tt class="py-line">                <tt class="py-comment"># strings.  This section is returned as a raw</tt> </tt>
-<a name="L1015"></a><tt class="py-lineno">1015</tt>  <tt class="py-line">                <tt class="py-comment"># bytestring for further dataset-specific parsing,</tt> </tt>
-<a name="L1016"></a><tt class="py-lineno">1016</tt>  <tt class="py-line">                <tt class="py-comment"># not as a numpy array.</tt> </tt>
-<a name="L1017"></a><tt class="py-lineno">1017</tt>  <tt class="py-line">                <tt class="py-name">localsxns</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">gribmsg</tt><tt class="py-op">[</tt><tt class="py-name">pos</tt><tt class="py-op">+</tt><tt class="py-number">5</tt><tt class="py-op">:</tt><tt class="py-name">pos</tt><tt class="py-op">+</tt><tt class="py-name">lensect</tt><tt class="py-op">]</tt><tt class="py-op">)</t [...]
-<a name="L1018"></a><tt class="py-lineno">1018</tt>  <tt class="py-line">                <tt class="py-name">pos</tt> <tt class="py-op">=</tt> <tt class="py-name">pos</tt> <tt class="py-op">+</tt> <tt class="py-name">lensect</tt> </tt>
-<a name="L1019"></a><tt class="py-lineno">1019</tt>  <tt class="py-line">            <tt class="py-comment"># section 3, grid definition section.</tt> </tt>
-<a name="L1020"></a><tt class="py-lineno">1020</tt>  <tt class="py-line">            <tt class="py-keyword">elif</tt> <tt class="py-name">sectnum</tt> <tt class="py-op">==</tt> <tt class="py-number">3</tt><tt class="py-op">:</tt> </tt>
-<a name="L1021"></a><tt class="py-lineno">1021</tt>  <tt class="py-line">                <tt class="py-name">gds</tt><tt class="py-op">,</tt><tt class="py-name">gdtempl</tt><tt class="py-op">,</tt><tt class="py-name">deflist</tt><tt class="py-op">,</tt><tt class="py-name">pos</tt> <tt class="py-op">=</tt> <tt class="py-name">g2clib</tt><tt class="py-op">.</tt><tt class="py-name">unpack3</tt><tt class="py-op">(</tt><tt class="py-name">gribmsg</tt><tt class="py-op">,</tt><tt class="py-name [...]
-<a name="L1022"></a><tt class="py-lineno">1022</tt>  <tt class="py-line">                <tt class="py-name">gdtnums</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">gds</tt><tt class="py-op">[</tt><tt class="py-number">4</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
-<a name="L1023"></a><tt class="py-lineno">1023</tt>  <tt class="py-line">                <tt class="py-name">gdtmpls</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">gdtempl</tt><tt class="py-op">)</tt> </tt>
-<a name="L1024"></a><tt class="py-lineno">1024</tt>  <tt class="py-line">                <tt class="py-name">gdeflists</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">deflist</tt><tt class="py-op">)</tt> </tt>
-<a name="L1025"></a><tt class="py-lineno">1025</tt>  <tt class="py-line">                <tt class="py-name">gdsinfos</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">gds</tt><tt class="py-op">)</tt> </tt>
-<a name="L1026"></a><tt class="py-lineno">1026</tt>  <tt class="py-line">            <tt class="py-comment"># section, product definition section.</tt> </tt>
-<a name="L1027"></a><tt class="py-lineno">1027</tt>  <tt class="py-line">            <tt class="py-keyword">elif</tt> <tt class="py-name">sectnum</tt> <tt class="py-op">==</tt> <tt class="py-number">4</tt><tt class="py-op">:</tt> </tt>
-<a name="L1028"></a><tt class="py-lineno">1028</tt>  <tt class="py-line">                <tt class="py-name">pdtempl</tt><tt class="py-op">,</tt><tt class="py-name">pdtn</tt><tt class="py-op">,</tt><tt class="py-name">coordlst</tt><tt class="py-op">,</tt><tt class="py-name">pos</tt> <tt class="py-op">=</tt> <tt class="py-name">g2clib</tt><tt class="py-op">.</tt><tt class="py-name">unpack4</tt><tt class="py-op">(</tt><tt class="py-name">gribmsg</tt><tt class="py-op">,</tt><tt class="py-na [...]
-<a name="L1029"></a><tt class="py-lineno">1029</tt>  <tt class="py-line">                <tt class="py-name">pdtmpls</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">pdtempl</tt><tt class="py-op">)</tt> </tt>
-<a name="L1030"></a><tt class="py-lineno">1030</tt>  <tt class="py-line">                <tt class="py-name">coordlists</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">coordlst</tt><tt class="py-op">)</tt> </tt>
-<a name="L1031"></a><tt class="py-lineno">1031</tt>  <tt class="py-line">                <tt class="py-name">pdtnums</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">pdtn</tt><tt class="py-op">)</tt> </tt>
-<a name="L1032"></a><tt class="py-lineno">1032</tt>  <tt class="py-line">            <tt class="py-comment"># section 5, data representation section.</tt> </tt>
-<a name="L1033"></a><tt class="py-lineno">1033</tt>  <tt class="py-line">            <tt class="py-keyword">elif</tt> <tt class="py-name">sectnum</tt> <tt class="py-op">==</tt> <tt class="py-number">5</tt><tt class="py-op">:</tt> </tt>
-<a name="L1034"></a><tt class="py-lineno">1034</tt>  <tt class="py-line">                <tt class="py-name">drtempl</tt><tt class="py-op">,</tt><tt class="py-name">drtn</tt><tt class="py-op">,</tt><tt class="py-name">npts</tt><tt class="py-op">,</tt><tt class="py-name">pos</tt> <tt class="py-op">=</tt> <tt class="py-name">g2clib</tt><tt class="py-op">.</tt><tt class="py-name">unpack5</tt><tt class="py-op">(</tt><tt class="py-name">gribmsg</tt><tt class="py-op">,</tt><tt class="py-name"> [...]
-<a name="L1035"></a><tt class="py-lineno">1035</tt>  <tt class="py-line">                <tt class="py-name">drtmpls</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">drtempl</tt><tt class="py-op">)</tt> </tt>
-<a name="L1036"></a><tt class="py-lineno">1036</tt>  <tt class="py-line">                <tt class="py-name">drtnums</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">drtn</tt><tt class="py-op">)</tt> </tt>
-<a name="L1037"></a><tt class="py-lineno">1037</tt>  <tt class="py-line">                <tt class="py-name">ndptslist</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">npts</tt><tt class="py-op">)</tt> </tt>
-<a name="L1038"></a><tt class="py-lineno">1038</tt>  <tt class="py-line">            <tt class="py-comment"># section 6, bit-map section.</tt> </tt>
-<a name="L1039"></a><tt class="py-lineno">1039</tt>  <tt class="py-line">            <tt class="py-keyword">elif</tt> <tt class="py-name">sectnum</tt> <tt class="py-op">==</tt> <tt class="py-number">6</tt><tt class="py-op">:</tt> </tt>
-<a name="L1040"></a><tt class="py-lineno">1040</tt>  <tt class="py-line">                <tt class="py-name">bmap</tt><tt class="py-op">,</tt><tt class="py-name">bmapflag</tt> <tt class="py-op">=</tt> <tt class="py-name">g2clib</tt><tt class="py-op">.</tt><tt class="py-name">unpack6</tt><tt class="py-op">(</tt><tt class="py-name">gribmsg</tt><tt class="py-op">,</tt><tt class="py-name">gds</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">,< [...]
-<a name="L1041"></a><tt class="py-lineno">1041</tt>  <tt class="py-line">                <tt class="py-comment">#bitmapflag = struct.unpack('>B',gribmsg[pos+5])[0]</tt> </tt>
-<a name="L1042"></a><tt class="py-lineno">1042</tt>  <tt class="py-line">                <tt class="py-keyword">if</tt> <tt class="py-name">bmapflag</tt> <tt class="py-op">==</tt> <tt class="py-number">0</tt><tt class="py-op">:</tt> </tt>
-<a name="L1043"></a><tt class="py-lineno">1043</tt>  <tt class="py-line">                    <tt class="py-name">bitmaps</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">bmap</tt><tt class="py-op">.</tt><tt class="py-name">astype</tt><tt class="py-op">(</tt><tt class="py-string">'b'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
-<a name="L1044"></a><tt class="py-lineno">1044</tt>  <tt class="py-line">                <tt class="py-comment"># use last defined bitmap.</tt> </tt>
-<a name="L1045"></a><tt class="py-lineno">1045</tt>  <tt class="py-line">                <tt class="py-keyword">elif</tt> <tt class="py-name">bmapflag</tt> <tt class="py-op">==</tt> <tt class="py-number">254</tt><tt class="py-op">:</tt> </tt>
-<a name="L1046"></a><tt class="py-lineno">1046</tt>  <tt class="py-line">                    <tt class="py-name">bmapflag</tt> <tt class="py-op">=</tt> <tt class="py-number">0</tt> </tt>
-<a name="L1047"></a><tt class="py-lineno">1047</tt>  <tt class="py-line">                    <tt class="py-keyword">for</tt> <tt class="py-name">bmp</tt> <tt class="py-keyword">in</tt> <tt class="py-name">bitmaps</tt><tt class="py-op">[</tt><tt class="py-op">:</tt><tt class="py-op">:</tt><tt class="py-op">-</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">:</tt> </tt>
-<a name="L1048"></a><tt class="py-lineno">1048</tt>  <tt class="py-line">                        <tt class="py-keyword">if</tt> <tt class="py-name">bmp</tt> <tt class="py-keyword">is</tt> <tt class="py-keyword">not</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> <tt class="py-name">bitmaps</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">bmp</tt><tt class="py-op">)</tt> </tt>
-<a name="L1049"></a><tt class="py-lineno">1049</tt>  <tt class="py-line">                <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
-<a name="L1050"></a><tt class="py-lineno">1050</tt>  <tt class="py-line">                    <tt class="py-name">bitmaps</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">None</tt><tt class="py-op">)</tt> </tt>
-<a name="L1051"></a><tt class="py-lineno">1051</tt>  <tt class="py-line">                <tt class="py-name">bitmapflags</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">bmapflag</tt><tt class="py-op">)</tt> </tt>
-<a name="L1052"></a><tt class="py-lineno">1052</tt>  <tt class="py-line">                <tt class="py-name">pos</tt> <tt class="py-op">=</tt> <tt class="py-name">pos</tt> <tt class="py-op">+</tt> <tt class="py-name">lensect</tt> </tt>
-<a name="L1053"></a><tt class="py-lineno">1053</tt>  <tt class="py-line">            <tt class="py-comment"># section 7, data section (nothing done here,</tt> </tt>
-<a name="L1054"></a><tt class="py-lineno">1054</tt>  <tt class="py-line">            <tt class="py-comment"># data unpacked when getfld method is invoked).</tt> </tt>
-<a name="L1055"></a><tt class="py-lineno">1055</tt>  <tt class="py-line">            <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
-<a name="L1056"></a><tt class="py-lineno">1056</tt>  <tt class="py-line">                <tt class="py-keyword">if</tt> <tt class="py-name">sectnum</tt> <tt class="py-op">!=</tt> <tt class="py-number">7</tt><tt class="py-op">:</tt> </tt>
-<a name="L1057"></a><tt class="py-lineno">1057</tt>  <tt class="py-line">                   <tt class="py-name">msg</tt> <tt class="py-op">=</tt> <tt class="py-string">'unknown section = %i'</tt> <tt class="py-op">%</tt> <tt class="py-name">sectnum</tt> </tt>
-<a name="L1058"></a><tt class="py-lineno">1058</tt>  <tt class="py-line">                   <tt class="py-keyword">raise</tt> <tt class="py-name">ValueError</tt><tt class="py-op">(</tt><tt class="py-name">msg</tt><tt class="py-op">)</tt> </tt>
-<a name="L1059"></a><tt class="py-lineno">1059</tt>  <tt class="py-line">                <tt class="py-name">sxn7pos</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">pos</tt><tt class="py-op">)</tt> </tt>
-<a name="L1060"></a><tt class="py-lineno">1060</tt>  <tt class="py-line">                <tt class="py-name">pos</tt> <tt class="py-op">=</tt> <tt class="py-name">pos</tt> <tt class="py-op">+</tt> <tt class="py-name">lensect</tt> </tt>
-<a name="L1061"></a><tt class="py-lineno">1061</tt>  <tt class="py-line">        <tt class="py-comment"># extend by repeating last value for all remaining fields.</tt> </tt>
-<a name="L1062"></a><tt class="py-lineno">1062</tt>  <tt class="py-line">        <tt class="py-name">gdtnum</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">_repeatlast</tt><tt class="py-op">(</tt><tt class="py-name">numfields</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">gdtnums</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
-<a name="L1063"></a><tt class="py-lineno">1063</tt>  <tt class="py-line">        <tt class="py-name">gdtmpl</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">_repeatlast</tt><tt class="py-op">(</tt><tt class="py-name">numfields</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">gdtmpls</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
-<a name="L1064"></a><tt class="py-lineno">1064</tt>  <tt class="py-line">        <tt class="py-name">gdeflist</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">_repeatlast</tt><tt class="py-op">(</tt><tt class="py-name">numfields</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">gdeflists</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
-<a name="L1065"></a><tt class="py-lineno">1065</tt>  <tt class="py-line">        <tt class="py-name">gdsinfo</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">_repeatlast</tt><tt class="py-op">(</tt><tt class="py-name">numfields</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">gdsinfos</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
-<a name="L1066"></a><tt class="py-lineno">1066</tt>  <tt class="py-line">        <tt class="py-name">pdtmpl</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">_repeatlast</tt><tt class="py-op">(</tt><tt class="py-name">numfields</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">pdtmpls</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
-<a name="L1067"></a><tt class="py-lineno">1067</tt>  <tt class="py-line">        <tt class="py-name">pdtnum</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">_repeatlast</tt><tt class="py-op">(</tt><tt class="py-name">numfields</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">pdtnums</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
-<a name="L1068"></a><tt class="py-lineno">1068</tt>  <tt class="py-line">        <tt class="py-name">coordlist</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">_repeatlast</tt><tt class="py-op">(</tt><tt class="py-name">numfields</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">coordlists</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
-<a name="L1069"></a><tt class="py-lineno">1069</tt>  <tt class="py-line">        <tt class="py-name">drtmpl</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">_repeatlast</tt><tt class="py-op">(</tt><tt class="py-name">numfields</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">drtmpls</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
-<a name="L1070"></a><tt class="py-lineno">1070</tt>  <tt class="py-line">        <tt class="py-name">drtnum</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">_repeatlast</tt><tt class="py-op">(</tt><tt class="py-name">numfields</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">drtnums</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
-<a name="L1071"></a><tt class="py-lineno">1071</tt>  <tt class="py-line">        <tt class="py-name">ndpts</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">_repeatlast</tt><tt class="py-op">(</tt><tt class="py-name">numfields</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">ndptslist</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
-<a name="L1072"></a><tt class="py-lineno">1072</tt>  <tt class="py-line">        <tt class="py-name">bitmapflag</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">_repeatlast</tt><tt class="py-op">(</tt><tt class="py-name">numfields</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">bitmapflags</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
-<a name="L1073"></a><tt class="py-lineno">1073</tt>  <tt class="py-line">        <tt class="py-name">bitmap</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">_repeatlast</tt><tt class="py-op">(</tt><tt class="py-name">numfields</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">bitmaps</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
-<a name="L1074"></a><tt class="py-lineno">1074</tt>  <tt class="py-line">        <tt class="py-name">pos7</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">_repeatlast</tt><tt class="py-op">(</tt><tt class="py-name">numfields</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">sxn7pos</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
-<a name="L1075"></a><tt class="py-lineno">1075</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">localsxns</tt><tt class="py-op">)</tt> <tt class="py-op">==</tt> <tt class="py-number">0</tt><tt class="py-op">:</tt> </tt>
-<a name="L1076"></a><tt class="py-lineno">1076</tt>  <tt class="py-line">            <tt class="py-name">localsxns</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-name">None</tt><tt class="py-op">]</tt> </tt>
-<a name="L1077"></a><tt class="py-lineno">1077</tt>  <tt class="py-line">        <tt class="py-name">localsxn</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">_repeatlast</tt><tt class="py-op">(</tt><tt class="py-name">numfields</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">localsxns</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
-<a name="L1078"></a><tt class="py-lineno">1078</tt>  <tt class="py-line">        <tt class="py-name">msgstart</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">_repeatlast</tt><tt class="py-op">(</tt><tt class="py-name">numfields</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-op">[</tt><tt class="py-name">spos</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt cl [...]
-<a name="L1079"></a><tt class="py-lineno">1079</tt>  <tt class="py-line">        <tt class="py-name">msglength</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">_repeatlast</tt><tt class="py-op">(</tt><tt class="py-name">numfields</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-op">[</tt><tt class="py-name">lengrib</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><t [...]
-<a name="L1080"></a><tt class="py-lineno">1080</tt>  <tt class="py-line">        <tt class="py-name">identsect</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">_repeatlast</tt><tt class="py-op">(</tt><tt class="py-name">numfields</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-op">[</tt><tt class="py-name">idsect</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt [...]
-<a name="L1081"></a><tt class="py-lineno">1081</tt>  <tt class="py-line">        <tt class="py-name">discipline</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">_repeatlast</tt><tt class="py-op">(</tt><tt class="py-name">numfields</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-op">[</tt><tt class="py-name">discipl</tt><tt class="py-op">]</tt><tt class="py-op">)</tt>< [...]
-<a name="L1082"></a><tt class="py-lineno">1082</tt>  <tt class="py-line"> </tt>
-<a name="L1083"></a><tt class="py-lineno">1083</tt>  <tt class="py-line">    <tt class="py-name">gdtnum</tt> <tt class="py-op">=</tt> <tt class="py-name">_flatten</tt><tt class="py-op">(</tt><tt class="py-name">gdtnum</tt><tt class="py-op">)</tt> </tt>
-<a name="L1084"></a><tt class="py-lineno">1084</tt>  <tt class="py-line">    <tt class="py-name">gdtmpl</tt> <tt class="py-op">=</tt> <tt class="py-name">_flatten</tt><tt class="py-op">(</tt><tt class="py-name">gdtmpl</tt><tt class="py-op">)</tt> </tt>
-<a name="L1085"></a><tt class="py-lineno">1085</tt>  <tt class="py-line">    <tt class="py-name">gdeflist</tt> <tt class="py-op">=</tt> <tt class="py-name">_flatten</tt><tt class="py-op">(</tt><tt class="py-name">gdeflist</tt><tt class="py-op">)</tt> </tt>
-<a name="L1086"></a><tt class="py-lineno">1086</tt>  <tt class="py-line">    <tt class="py-name">gdsinfo</tt> <tt class="py-op">=</tt> <tt class="py-name">_flatten</tt><tt class="py-op">(</tt><tt class="py-name">gdsinfo</tt><tt class="py-op">)</tt> </tt>
-<a name="L1087"></a><tt class="py-lineno">1087</tt>  <tt class="py-line">    <tt class="py-name">pdtmpl</tt> <tt class="py-op">=</tt> <tt class="py-name">_flatten</tt><tt class="py-op">(</tt><tt class="py-name">pdtmpl</tt><tt class="py-op">)</tt> </tt>
-<a name="L1088"></a><tt class="py-lineno">1088</tt>  <tt class="py-line">    <tt class="py-name">pdtnum</tt> <tt class="py-op">=</tt> <tt class="py-name">_flatten</tt><tt class="py-op">(</tt><tt class="py-name">pdtnum</tt><tt class="py-op">)</tt> </tt>
-<a name="L1089"></a><tt class="py-lineno">1089</tt>  <tt class="py-line">    <tt class="py-name">coordlist</tt> <tt class="py-op">=</tt> <tt class="py-name">_flatten</tt><tt class="py-op">(</tt><tt class="py-name">coordlist</tt><tt class="py-op">)</tt> </tt>
-<a name="L1090"></a><tt class="py-lineno">1090</tt>  <tt class="py-line">    <tt class="py-name">drtmpl</tt> <tt class="py-op">=</tt> <tt class="py-name">_flatten</tt><tt class="py-op">(</tt><tt class="py-name">drtmpl</tt><tt class="py-op">)</tt> </tt>
-<a name="L1091"></a><tt class="py-lineno">1091</tt>  <tt class="py-line">    <tt class="py-name">drtnum</tt> <tt class="py-op">=</tt> <tt class="py-name">_flatten</tt><tt class="py-op">(</tt><tt class="py-name">drtnum</tt><tt class="py-op">)</tt> </tt>
-<a name="L1092"></a><tt class="py-lineno">1092</tt>  <tt class="py-line">    <tt class="py-name">ndpts</tt> <tt class="py-op">=</tt> <tt class="py-name">_flatten</tt><tt class="py-op">(</tt><tt class="py-name">ndpts</tt><tt class="py-op">)</tt> </tt>
-<a name="L1093"></a><tt class="py-lineno">1093</tt>  <tt class="py-line">    <tt class="py-name">bitmapflag</tt> <tt class="py-op">=</tt> <tt class="py-name">_flatten</tt><tt class="py-op">(</tt><tt class="py-name">bitmapflag</tt><tt class="py-op">)</tt> </tt>
-<a name="L1094"></a><tt class="py-lineno">1094</tt>  <tt class="py-line">    <tt class="py-name">bitmap</tt> <tt class="py-op">=</tt> <tt class="py-name">_flatten</tt><tt class="py-op">(</tt><tt class="py-name">bitmap</tt><tt class="py-op">)</tt> </tt>
-<a name="L1095"></a><tt class="py-lineno">1095</tt>  <tt class="py-line">    <tt class="py-name">pos7</tt> <tt class="py-op">=</tt> <tt class="py-name">_flatten</tt><tt class="py-op">(</tt><tt class="py-name">pos7</tt><tt class="py-op">)</tt> </tt>
-<a name="L1096"></a><tt class="py-lineno">1096</tt>  <tt class="py-line">    <tt class="py-name">localsxn</tt> <tt class="py-op">=</tt> <tt class="py-name">_flatten</tt><tt class="py-op">(</tt><tt class="py-name">localsxn</tt><tt class="py-op">)</tt> </tt>
-<a name="L1097"></a><tt class="py-lineno">1097</tt>  <tt class="py-line">    <tt class="py-name">msgstart</tt> <tt class="py-op">=</tt> <tt class="py-name">_flatten</tt><tt class="py-op">(</tt><tt class="py-name">msgstart</tt><tt class="py-op">)</tt> </tt>
-<a name="L1098"></a><tt class="py-lineno">1098</tt>  <tt class="py-line">    <tt class="py-name">msglength</tt> <tt class="py-op">=</tt> <tt class="py-name">_flatten</tt><tt class="py-op">(</tt><tt class="py-name">msglength</tt><tt class="py-op">)</tt> </tt>
-<a name="L1099"></a><tt class="py-lineno">1099</tt>  <tt class="py-line">    <tt class="py-name">identsect</tt> <tt class="py-op">=</tt> <tt class="py-name">_flatten</tt><tt class="py-op">(</tt><tt class="py-name">identsect</tt><tt class="py-op">)</tt> </tt>
-<a name="L1100"></a><tt class="py-lineno">1100</tt>  <tt class="py-line">    <tt class="py-name">discipline</tt> <tt class="py-op">=</tt> <tt class="py-name">_flatten</tt><tt class="py-op">(</tt><tt class="py-name">discipline</tt><tt class="py-op">)</tt> </tt>
-<a name="L1101"></a><tt class="py-lineno">1101</tt>  <tt class="py-line"> </tt>
-<a name="L1102"></a><tt class="py-lineno">1102</tt>  <tt class="py-line">    <tt class="py-name">gribs</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
-<a name="L1103"></a><tt class="py-lineno">1103</tt>  <tt class="py-line">    <tt class="py-keyword">for</tt> <tt class="py-name">n</tt> <tt class="py-keyword">in</tt> <tt class="py-name">range</tt><tt class="py-op">(</tt><tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">msgstart</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
-<a name="L1104"></a><tt class="py-lineno">1104</tt>  <tt class="py-line">        <tt class="py-name">kwargs</tt> <tt class="py-op">=</tt> <tt class="py-op">{</tt><tt class="py-op">}</tt> </tt>
-<a name="L1105"></a><tt class="py-lineno">1105</tt>  <tt class="py-line">        <tt class="py-name">kwargs</tt><tt class="py-op">[</tt><tt class="py-string">'originating_center'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt id="link-16" class="py-name"><a title="ncepgrib2._table0" class="py-name" href="#" onclick="return doclink('link-16', '_table0', 'link-9');">_table0</a></tt><tt class="py-op">[</tt><tt class="py-name">identsect</tt><tt class="py-op">[</tt><tt class="py-name [...]
-<a name="L1106"></a><tt class="py-lineno">1106</tt>  <tt class="py-line">        <tt class="py-name">wmo_code</tt> <tt class="py-op">=</tt> <tt id="link-17" class="py-name"><a title="ncepgrib2._table0" class="py-name" href="#" onclick="return doclink('link-17', '_table0', 'link-9');">_table0</a></tt><tt class="py-op">[</tt><tt class="py-name">identsect</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt cla [...]
-<a name="L1107"></a><tt class="py-lineno">1107</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">wmo_code</tt> <tt class="py-keyword">is</tt> <tt class="py-keyword">not</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
-<a name="L1108"></a><tt class="py-lineno">1108</tt>  <tt class="py-line">            <tt class="py-name">kwargs</tt><tt class="py-op">[</tt><tt class="py-string">'center_wmo_code'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">wmo_code</tt> </tt>
-<a name="L1109"></a><tt class="py-lineno">1109</tt>  <tt class="py-line">        <tt class="py-name">kwargs</tt><tt class="py-op">[</tt><tt class="py-string">'grid_definition_template_number'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">gdtnum</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt> </tt>
-<a name="L1110"></a><tt class="py-lineno">1110</tt>  <tt class="py-line">        <tt class="py-name">kwargs</tt><tt class="py-op">[</tt><tt class="py-string">'grid_definition_template'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">gdtmpl</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt> </tt>
-<a name="L1111"></a><tt class="py-lineno">1111</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">gdeflist</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt> <tt class="py-op">!=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt><tt class="py-op">:</tt> </tt>
-<a name="L1112"></a><tt class="py-lineno">1112</tt>  <tt class="py-line">            <tt class="py-name">kwargs</tt><tt class="py-op">[</tt><tt class="py-string">'grid_definition_list'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">gdeflist</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt> </tt>
-<a name="L1113"></a><tt class="py-lineno">1113</tt>  <tt class="py-line">        <tt class="py-name">kwargs</tt><tt class="py-op">[</tt><tt class="py-string">'grid_definition_info'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">gdsinfo</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt> </tt>
-<a name="L1114"></a><tt class="py-lineno">1114</tt>  <tt class="py-line">        <tt class="py-name">kwargs</tt><tt class="py-op">[</tt><tt class="py-string">'discipline_code'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">discipline</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt> </tt>
-<a name="L1115"></a><tt class="py-lineno">1115</tt>  <tt class="py-line">        <tt class="py-name">kwargs</tt><tt class="py-op">[</tt><tt class="py-string">'product_definition_template_number'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">pdtnum</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt> </tt>
-<a name="L1116"></a><tt class="py-lineno">1116</tt>  <tt class="py-line">        <tt class="py-name">kwargs</tt><tt class="py-op">[</tt><tt class="py-string">'product_definition_template'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">pdtmpl</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt> </tt>
-<a name="L1117"></a><tt class="py-lineno">1117</tt>  <tt class="py-line">        <tt class="py-name">kwargs</tt><tt class="py-op">[</tt><tt class="py-string">'data_representation_template_number'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">drtnum</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt> </tt>
-<a name="L1118"></a><tt class="py-lineno">1118</tt>  <tt class="py-line">        <tt class="py-name">kwargs</tt><tt class="py-op">[</tt><tt class="py-string">'data_representation_template'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">drtmpl</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt> </tt>
-<a name="L1119"></a><tt class="py-lineno">1119</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">coordlist</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt> <tt class="py-op">!=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt><tt class="py-op">:</tt> </tt>
-<a name="L1120"></a><tt class="py-lineno">1120</tt>  <tt class="py-line">            <tt class="py-name">kwargs</tt><tt class="py-op">[</tt><tt class="py-string">'extra_vertical_coordinate_info'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">coordlist</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt> </tt>
-<a name="L1121"></a><tt class="py-lineno">1121</tt>  <tt class="py-line">        <tt class="py-name">kwargs</tt><tt class="py-op">[</tt><tt class="py-string">'number_of_data_points_to_unpack'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">ndpts</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt> </tt>
-<a name="L1122"></a><tt class="py-lineno">1122</tt>  <tt class="py-line">        <tt class="py-name">kwargs</tt><tt class="py-op">[</tt><tt class="py-string">'bitmap_indicator_flag'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">bitmapflag</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt> </tt>
-<a name="L1123"></a><tt class="py-lineno">1123</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">bitmap</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt> <tt class="py-keyword">is</tt> <tt class="py-keyword">not</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt><tt class="py-op">:</tt> </tt>
-<a name="L1124"></a><tt class="py-lineno">1124</tt>  <tt class="py-line">            <tt class="py-name">kwargs</tt><tt class="py-op">[</tt><tt class="py-string">'_bitmap'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">bitmap</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt> </tt>
-<a name="L1125"></a><tt class="py-lineno">1125</tt>  <tt class="py-line">        <tt class="py-name">kwargs</tt><tt class="py-op">[</tt><tt class="py-string">'_section7_byte_offset'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">pos7</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt> </tt>
-<a name="L1126"></a><tt class="py-lineno">1126</tt>  <tt class="py-line">        <tt class="py-name">kwargs</tt><tt class="py-op">[</tt><tt class="py-string">'_grib_message_byteoffset'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">msgstart</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt> </tt>
-<a name="L1127"></a><tt class="py-lineno">1127</tt>  <tt class="py-line">        <tt class="py-name">kwargs</tt><tt class="py-op">[</tt><tt class="py-string">'_grib_message_length'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">msglength</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt> </tt>
-<a name="L1128"></a><tt class="py-lineno">1128</tt>  <tt class="py-line">        <tt class="py-name">kwargs</tt><tt class="py-op">[</tt><tt class="py-string">'_grib_filename'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">filename</tt> </tt>
-<a name="L1129"></a><tt class="py-lineno">1129</tt>  <tt class="py-line">        <tt class="py-name">kwargs</tt><tt class="py-op">[</tt><tt class="py-string">'identification_section'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">identsect</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt> </tt>
-<a name="L1130"></a><tt class="py-lineno">1130</tt>  <tt class="py-line">        <tt class="py-name">kwargs</tt><tt class="py-op">[</tt><tt class="py-string">'_grib_message_number'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">n</tt><tt class="py-op">+</tt><tt class="py-number">1</tt> </tt>
-<a name="L1131"></a><tt class="py-lineno">1131</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">localsxn</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt> <tt class="py-keyword">is</tt> <tt class="py-keyword">not</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
-<a name="L1132"></a><tt class="py-lineno">1132</tt>  <tt class="py-line">            <tt class="py-name">kwargs</tt><tt class="py-op">[</tt><tt class="py-string">'has_local_use_section'</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">True</tt> </tt>
-<a name="L1133"></a><tt class="py-lineno">1133</tt>  <tt class="py-line">            <tt class="py-name">kwargs</tt><tt class="py-op">[</tt><tt class="py-string">'_local_use_section'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">localsxn</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt> </tt>
-<a name="L1134"></a><tt class="py-lineno">1134</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
-<a name="L1135"></a><tt class="py-lineno">1135</tt>  <tt class="py-line">            <tt class="py-name">kwargs</tt><tt class="py-op">[</tt><tt class="py-string">'has_local_use_section'</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">False</tt> </tt>
-<a name="L1136"></a><tt class="py-lineno">1136</tt>  <tt class="py-line">        <tt class="py-name">gribs</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt id="link-18" class="py-name" targets="Class ncepgrib2.Grib2Message=ncepgrib2.Grib2Message-class.html"><a title="ncepgrib2.Grib2Message" class="py-name" href="#" onclick="return doclink('link-18', 'Grib2Message', 'link-18');">Grib2Message</a></tt><tt class="py-op">(</tt><tt class="py-op">**</tt><tt [...]
-<a name="L1137"></a><tt class="py-lineno">1137</tt>  <tt class="py-line">    <tt class="py-name">f</tt><tt class="py-op">.</tt><tt class="py-name">close</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
-<a name="L1138"></a><tt class="py-lineno">1138</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">gribs</tt><tt class="py-op">)</tt> <tt class="py-op">==</tt> <tt class="py-number">1</tt><tt class="py-op">:</tt> </tt>
-<a name="L1139"></a><tt class="py-lineno">1139</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">gribs</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> </tt>
-<a name="L1140"></a><tt class="py-lineno">1140</tt>  <tt class="py-line">    <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
-<a name="L1141"></a><tt class="py-lineno">1141</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">gribs</tt> </tt>
-</div><a name="L1142"></a><tt class="py-lineno">1142</tt>  <tt class="py-line"> </tt>
-<a name="dump"></a><div id="dump-def"><a name="L1143"></a><tt class="py-lineno">1143</tt> <a class="py-toggle" href="#" id="dump-toggle" onclick="return toggle('dump');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="ncepgrib2-module.html#dump">dump</a><tt class="py-op">(</tt><tt class="py-param">filename</tt><tt class="py-op">,</tt> <tt class="py-param">grbs</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
-</div><div id="dump-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="dump-expanded"><a name="L1144"></a><tt class="py-lineno">1144</tt>  <tt class="py-line">    <tt class="py-docstring">"""</tt> </tt>
-<a name="L1145"></a><tt class="py-lineno">1145</tt>  <tt class="py-line"><tt class="py-docstring"> write the given L{Grib2Message} instances to a grib file.</tt> </tt>
-<a name="L1146"></a><tt class="py-lineno">1146</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
-<a name="L1147"></a><tt class="py-lineno">1147</tt>  <tt class="py-line"><tt class="py-docstring"> @param filename: file to write grib data to.</tt> </tt>
-<a name="L1148"></a><tt class="py-lineno">1148</tt>  <tt class="py-line"><tt class="py-docstring"> @param grbs: a list of L{Grib2Message} instances.</tt> </tt>
-<a name="L1149"></a><tt class="py-lineno">1149</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
-<a name="L1150"></a><tt class="py-lineno">1150</tt>  <tt class="py-line">    <tt class="py-name">gribfile</tt> <tt class="py-op">=</tt> <tt class="py-name">open</tt><tt class="py-op">(</tt><tt class="py-name">filename</tt><tt class="py-op">,</tt><tt class="py-string">'wb'</tt><tt class="py-op">)</tt> </tt>
-<a name="L1151"></a><tt class="py-lineno">1151</tt>  <tt class="py-line">    <tt class="py-keyword">for</tt> <tt class="py-name">grb</tt> <tt class="py-keyword">in</tt> <tt class="py-name">grbs</tt><tt class="py-op">:</tt> </tt>
-<a name="L1152"></a><tt class="py-lineno">1152</tt>  <tt class="py-line">        <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
-<a name="L1153"></a><tt class="py-lineno">1153</tt>  <tt class="py-line">            <tt class="py-name">f</tt> <tt class="py-op">=</tt> <tt class="py-name">open</tt><tt class="py-op">(</tt><tt class="py-name">grb</tt><tt class="py-op">.</tt><tt class="py-name">_grib_filename</tt><tt class="py-op">,</tt><tt class="py-string">'rb'</tt><tt class="py-op">)</tt> </tt>
-<a name="L1154"></a><tt class="py-lineno">1154</tt>  <tt class="py-line">        <tt class="py-keyword">except</tt> <tt class="py-name">TypeError</tt><tt class="py-op">:</tt> </tt>
-<a name="L1155"></a><tt class="py-lineno">1155</tt>  <tt class="py-line">            <tt class="py-name">f</tt> <tt class="py-op">=</tt> <tt class="py-name">StringIO</tt><tt class="py-op">(</tt><tt class="py-name">grb</tt><tt class="py-op">.</tt><tt class="py-name">_grib_filename</tt><tt class="py-op">)</tt> </tt>
-<a name="L1156"></a><tt class="py-lineno">1156</tt>  <tt class="py-line">        <tt class="py-name">f</tt><tt class="py-op">.</tt><tt class="py-name">seek</tt><tt class="py-op">(</tt><tt class="py-name">grb</tt><tt class="py-op">.</tt><tt class="py-name">_grib_message_byteoffset</tt><tt class="py-op">)</tt> </tt>
-<a name="L1157"></a><tt class="py-lineno">1157</tt>  <tt class="py-line">        <tt class="py-name">gribmsg</tt> <tt class="py-op">=</tt> <tt class="py-name">f</tt><tt class="py-op">.</tt><tt class="py-name">read</tt><tt class="py-op">(</tt><tt class="py-name">grb</tt><tt class="py-op">.</tt><tt class="py-name">_grib_message_length</tt><tt class="py-op">)</tt> </tt>
-<a name="L1158"></a><tt class="py-lineno">1158</tt>  <tt class="py-line">        <tt class="py-name">f</tt><tt class="py-op">.</tt><tt class="py-name">close</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
-<a name="L1159"></a><tt class="py-lineno">1159</tt>  <tt class="py-line">        <tt class="py-name">gribfile</tt><tt class="py-op">.</tt><tt class="py-name">write</tt><tt class="py-op">(</tt><tt class="py-name">gribmsg</tt><tt class="py-op">)</tt> </tt>
-<a name="L1160"></a><tt class="py-lineno">1160</tt>  <tt class="py-line">    <tt class="py-name">gribfile</tt><tt class="py-op">.</tt><tt class="py-name">close</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
-</div><a name="L1161"></a><tt class="py-lineno">1161</tt>  <tt class="py-line"> </tt>
-<a name="L1162"></a><tt class="py-lineno">1162</tt>  <tt class="py-line"><tt class="py-comment"># private methods and functions below here.</tt> </tt>
-<a name="L1163"></a><tt class="py-lineno">1163</tt>  <tt class="py-line"> </tt>
-<a name="_getdate"></a><div id="_getdate-def"><a name="L1164"></a><tt class="py-lineno">1164</tt> <a class="py-toggle" href="#" id="_getdate-toggle" onclick="return toggle('_getdate');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="ncepgrib2-module.html#_getdate">_getdate</a><tt class="py-op">(</tt><tt class="py-param">idsect</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
-</div><div id="_getdate-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="_getdate-expanded"><a name="L1165"></a><tt class="py-lineno">1165</tt>  <tt class="py-line">    <tt class="py-docstring">"""return yyyy,mm,dd,min,ss from section 1"""</tt> </tt>
-<a name="L1166"></a><tt class="py-lineno">1166</tt>  <tt class="py-line">    <tt class="py-name">yyyy</tt><tt class="py-op">=</tt><tt class="py-name">idsect</tt><tt class="py-op">[</tt><tt class="py-number">5</tt><tt class="py-op">]</tt> </tt>
-<a name="L1167"></a><tt class="py-lineno">1167</tt>  <tt class="py-line">    <tt class="py-name">mm</tt><tt class="py-op">=</tt><tt class="py-name">idsect</tt><tt class="py-op">[</tt><tt class="py-number">6</tt><tt class="py-op">]</tt> </tt>
-<a name="L1168"></a><tt class="py-lineno">1168</tt>  <tt class="py-line">    <tt class="py-name">dd</tt><tt class="py-op">=</tt><tt class="py-name">idsect</tt><tt class="py-op">[</tt><tt class="py-number">7</tt><tt class="py-op">]</tt> </tt>
-<a name="L1169"></a><tt class="py-lineno">1169</tt>  <tt class="py-line">    <tt class="py-name">hh</tt><tt class="py-op">=</tt><tt class="py-name">idsect</tt><tt class="py-op">[</tt><tt class="py-number">8</tt><tt class="py-op">]</tt> </tt>
-<a name="L1170"></a><tt class="py-lineno">1170</tt>  <tt class="py-line">    <tt class="py-name">min</tt><tt class="py-op">=</tt><tt class="py-name">idsect</tt><tt class="py-op">[</tt><tt class="py-number">9</tt><tt class="py-op">]</tt> </tt>
-<a name="L1171"></a><tt class="py-lineno">1171</tt>  <tt class="py-line">    <tt class="py-name">ss</tt><tt class="py-op">=</tt><tt class="py-name">idsect</tt><tt class="py-op">[</tt><tt class="py-number">10</tt><tt class="py-op">]</tt> </tt>
-<a name="L1172"></a><tt class="py-lineno">1172</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt class="py-name">yyyy</tt><tt class="py-op">,</tt><tt class="py-name">mm</tt><tt class="py-op">,</tt><tt class="py-name">dd</tt><tt class="py-op">,</tt><tt class="py-name">hh</tt><tt class="py-op">,</tt><tt class="py-name">min</tt><tt class="py-op">,</tt><tt class="py-name">ss</tt> </tt>
-</div><a name="L1173"></a><tt class="py-lineno">1173</tt>  <tt class="py-line"> </tt>
-<a name="_unpack1"></a><div id="_unpack1-def"><a name="L1174"></a><tt class="py-lineno">1174</tt> <a class="py-toggle" href="#" id="_unpack1-toggle" onclick="return toggle('_unpack1');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="ncepgrib2-module.html#_unpack1">_unpack1</a><tt class="py-op">(</tt><tt class="py-param">gribmsg</tt><tt class="py-op">,</tt><tt class="py-param">pos</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
-</div><div id="_unpack1-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="_unpack1-expanded"><a name="L1175"></a><tt class="py-lineno">1175</tt>  <tt class="py-line">    <tt class="py-docstring">"""unpack section 1 given starting point in bytes</tt> </tt>
-<a name="L1176"></a><tt class="py-lineno">1176</tt>  <tt class="py-line"><tt class="py-docstring">    used to test pyrex interface to g2_unpack1"""</tt> </tt>
-<a name="L1177"></a><tt class="py-lineno">1177</tt>  <tt class="py-line">    <tt class="py-name">idsect</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
-<a name="L1178"></a><tt class="py-lineno">1178</tt>  <tt class="py-line">    <tt class="py-name">pos</tt> <tt class="py-op">=</tt> <tt class="py-name">pos</tt> <tt class="py-op">+</tt> <tt class="py-number">5</tt> </tt>
-<a name="L1179"></a><tt class="py-lineno">1179</tt>  <tt class="py-line">    <tt class="py-name">idsect</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">struct</tt><tt class="py-op">.</tt><tt class="py-name">unpack</tt><tt class="py-op">(</tt><tt class="py-string">'>h'</tt><tt class="py-op">,</tt><tt class="py-name">gribmsg</tt><tt class="py-op">[</tt><tt class="py-name">pos</tt><tt class="py-op">:</tt><tt class="py-name">pos</tt>< [...]
-<a name="L1180"></a><tt class="py-lineno">1180</tt>  <tt class="py-line">    <tt class="py-name">pos</tt> <tt class="py-op">=</tt> <tt class="py-name">pos</tt> <tt class="py-op">+</tt> <tt class="py-number">2</tt> </tt>
-<a name="L1181"></a><tt class="py-lineno">1181</tt>  <tt class="py-line">    <tt class="py-name">idsect</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">struct</tt><tt class="py-op">.</tt><tt class="py-name">unpack</tt><tt class="py-op">(</tt><tt class="py-string">'>h'</tt><tt class="py-op">,</tt><tt class="py-name">gribmsg</tt><tt class="py-op">[</tt><tt class="py-name">pos</tt><tt class="py-op">:</tt><tt class="py-name">pos</tt>< [...]
-<a name="L1182"></a><tt class="py-lineno">1182</tt>  <tt class="py-line">    <tt class="py-name">pos</tt> <tt class="py-op">=</tt> <tt class="py-name">pos</tt> <tt class="py-op">+</tt> <tt class="py-number">2</tt> </tt>
-<a name="L1183"></a><tt class="py-lineno">1183</tt>  <tt class="py-line">    <tt class="py-name">idsect</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">struct</tt><tt class="py-op">.</tt><tt class="py-name">unpack</tt><tt class="py-op">(</tt><tt class="py-string">'>B'</tt><tt class="py-op">,</tt><tt class="py-name">gribmsg</tt><tt class="py-op">[</tt><tt class="py-name">pos</tt><tt class="py-op">:</tt><tt class="py-name">pos</tt>< [...]
-<a name="L1184"></a><tt class="py-lineno">1184</tt>  <tt class="py-line">    <tt class="py-name">pos</tt> <tt class="py-op">=</tt> <tt class="py-name">pos</tt> <tt class="py-op">+</tt> <tt class="py-number">1</tt> </tt>
-<a name="L1185"></a><tt class="py-lineno">1185</tt>  <tt class="py-line">    <tt class="py-name">idsect</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">struct</tt><tt class="py-op">.</tt><tt class="py-name">unpack</tt><tt class="py-op">(</tt><tt class="py-string">'>B'</tt><tt class="py-op">,</tt><tt class="py-name">gribmsg</tt><tt class="py-op">[</tt><tt class="py-name">pos</tt><tt class="py-op">:</tt><tt class="py-name">pos</tt>< [...]
-<a name="L1186"></a><tt class="py-lineno">1186</tt>  <tt class="py-line">    <tt class="py-name">pos</tt> <tt class="py-op">=</tt> <tt class="py-name">pos</tt> <tt class="py-op">+</tt> <tt class="py-number">1</tt> </tt>
-<a name="L1187"></a><tt class="py-lineno">1187</tt>  <tt class="py-line">    <tt class="py-name">idsect</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">struct</tt><tt class="py-op">.</tt><tt class="py-name">unpack</tt><tt class="py-op">(</tt><tt class="py-string">'>B'</tt><tt class="py-op">,</tt><tt class="py-name">gribmsg</tt><tt class="py-op">[</tt><tt class="py-name">pos</tt><tt class="py-op">:</tt><tt class="py-name">pos</tt>< [...]
-<a name="L1188"></a><tt class="py-lineno">1188</tt>  <tt class="py-line">    <tt class="py-name">pos</tt> <tt class="py-op">=</tt> <tt class="py-name">pos</tt> <tt class="py-op">+</tt> <tt class="py-number">1</tt> </tt>
-<a name="L1189"></a><tt class="py-lineno">1189</tt>  <tt class="py-line">    <tt class="py-name">idsect</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">struct</tt><tt class="py-op">.</tt><tt class="py-name">unpack</tt><tt class="py-op">(</tt><tt class="py-string">'>h'</tt><tt class="py-op">,</tt><tt class="py-name">gribmsg</tt><tt class="py-op">[</tt><tt class="py-name">pos</tt><tt class="py-op">:</tt><tt class="py-name">pos</tt>< [...]
-<a name="L1190"></a><tt class="py-lineno">1190</tt>  <tt class="py-line">    <tt class="py-name">pos</tt> <tt class="py-op">=</tt> <tt class="py-name">pos</tt> <tt class="py-op">+</tt> <tt class="py-number">2</tt> </tt>
-<a name="L1191"></a><tt class="py-lineno">1191</tt>  <tt class="py-line">    <tt class="py-name">idsect</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">struct</tt><tt class="py-op">.</tt><tt class="py-name">unpack</tt><tt class="py-op">(</tt><tt class="py-string">'>B'</tt><tt class="py-op">,</tt><tt class="py-name">gribmsg</tt><tt class="py-op">[</tt><tt class="py-name">pos</tt><tt class="py-op">:</tt><tt class="py-name">pos</tt>< [...]
-<a name="L1192"></a><tt class="py-lineno">1192</tt>  <tt class="py-line">    <tt class="py-name">pos</tt> <tt class="py-op">=</tt> <tt class="py-name">pos</tt> <tt class="py-op">+</tt> <tt class="py-number">1</tt> </tt>
-<a name="L1193"></a><tt class="py-lineno">1193</tt>  <tt class="py-line">    <tt class="py-name">idsect</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">struct</tt><tt class="py-op">.</tt><tt class="py-name">unpack</tt><tt class="py-op">(</tt><tt class="py-string">'>B'</tt><tt class="py-op">,</tt><tt class="py-name">gribmsg</tt><tt class="py-op">[</tt><tt class="py-name">pos</tt><tt class="py-op">:</tt><tt class="py-name">pos</tt>< [...]
-<a name="L1194"></a><tt class="py-lineno">1194</tt>  <tt class="py-line">    <tt class="py-name">pos</tt> <tt class="py-op">=</tt> <tt class="py-name">pos</tt> <tt class="py-op">+</tt> <tt class="py-number">1</tt> </tt>
-<a name="L1195"></a><tt class="py-lineno">1195</tt>  <tt class="py-line">    <tt class="py-name">idsect</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">struct</tt><tt class="py-op">.</tt><tt class="py-name">unpack</tt><tt class="py-op">(</tt><tt class="py-string">'>B'</tt><tt class="py-op">,</tt><tt class="py-name">gribmsg</tt><tt class="py-op">[</tt><tt class="py-name">pos</tt><tt class="py-op">:</tt><tt class="py-name">pos</tt>< [...]
-<a name="L1196"></a><tt class="py-lineno">1196</tt>  <tt class="py-line">    <tt class="py-name">pos</tt> <tt class="py-op">=</tt> <tt class="py-name">pos</tt> <tt class="py-op">+</tt> <tt class="py-number">1</tt> </tt>
-<a name="L1197"></a><tt class="py-lineno">1197</tt>  <tt class="py-line">    <tt class="py-name">idsect</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">struct</tt><tt class="py-op">.</tt><tt class="py-name">unpack</tt><tt class="py-op">(</tt><tt class="py-string">'>B'</tt><tt class="py-op">,</tt><tt class="py-name">gribmsg</tt><tt class="py-op">[</tt><tt class="py-name">pos</tt><tt class="py-op">:</tt><tt class="py-name">pos</tt>< [...]
-<a name="L1198"></a><tt class="py-lineno">1198</tt>  <tt class="py-line">    <tt class="py-name">pos</tt> <tt class="py-op">=</tt> <tt class="py-name">pos</tt> <tt class="py-op">+</tt> <tt class="py-number">1</tt> </tt>
-<a name="L1199"></a><tt class="py-lineno">1199</tt>  <tt class="py-line">    <tt class="py-name">idsect</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">struct</tt><tt class="py-op">.</tt><tt class="py-name">unpack</tt><tt class="py-op">(</tt><tt class="py-string">'>B'</tt><tt class="py-op">,</tt><tt class="py-name">gribmsg</tt><tt class="py-op">[</tt><tt class="py-name">pos</tt><tt class="py-op">:</tt><tt class="py-name">pos</tt>< [...]
-<a name="L1200"></a><tt class="py-lineno">1200</tt>  <tt class="py-line">    <tt class="py-name">pos</tt> <tt class="py-op">=</tt> <tt class="py-name">pos</tt> <tt class="py-op">+</tt> <tt class="py-number">1</tt> </tt>
-<a name="L1201"></a><tt class="py-lineno">1201</tt>  <tt class="py-line">    <tt class="py-name">idsect</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">struct</tt><tt class="py-op">.</tt><tt class="py-name">unpack</tt><tt class="py-op">(</tt><tt class="py-string">'>B'</tt><tt class="py-op">,</tt><tt class="py-name">gribmsg</tt><tt class="py-op">[</tt><tt class="py-name">pos</tt><tt class="py-op">:</tt><tt class="py-name">pos</tt>< [...]
-<a name="L1202"></a><tt class="py-lineno">1202</tt>  <tt class="py-line">    <tt class="py-name">pos</tt> <tt class="py-op">=</tt> <tt class="py-name">pos</tt> <tt class="py-op">+</tt> <tt class="py-number">1</tt> </tt>
-<a name="L1203"></a><tt class="py-lineno">1203</tt>  <tt class="py-line">    <tt class="py-name">idsect</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">struct</tt><tt class="py-op">.</tt><tt class="py-name">unpack</tt><tt class="py-op">(</tt><tt class="py-string">'>B'</tt><tt class="py-op">,</tt><tt class="py-name">gribmsg</tt><tt class="py-op">[</tt><tt class="py-name">pos</tt><tt class="py-op">:</tt><tt class="py-name">pos</tt>< [...]
-<a name="L1204"></a><tt class="py-lineno">1204</tt>  <tt class="py-line">    <tt class="py-name">pos</tt> <tt class="py-op">=</tt> <tt class="py-name">pos</tt> <tt class="py-op">+</tt> <tt class="py-number">1</tt> </tt>
-<a name="L1205"></a><tt class="py-lineno">1205</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">array</tt><tt class="py-op">(</tt><tt class="py-name">idsect</tt><tt class="py-op">,</tt><tt class="py-string">'i'</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-name">pos</tt> </tt>
-</div><a name="L1206"></a><tt class="py-lineno">1206</tt>  <tt class="py-line"> </tt>
-<a name="_repeatlast"></a><div id="_repeatlast-def"><a name="L1207"></a><tt class="py-lineno">1207</tt> <a class="py-toggle" href="#" id="_repeatlast-toggle" onclick="return toggle('_repeatlast');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="ncepgrib2-module.html#_repeatlast">_repeatlast</a><tt class="py-op">(</tt><tt class="py-param">numfields</tt><tt class="py-op">,</tt><tt class="py-param">listin</tt><tt class="py-op">)</tt><tt class="py-op">: [...]
-</div><div id="_repeatlast-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="_repeatlast-expanded"><a name="L1208"></a><tt class="py-lineno">1208</tt>  <tt class="py-line">    <tt class="py-docstring">"""repeat last item in listin, until len(listin) = numfields"""</tt> </tt>
-<a name="L1209"></a><tt class="py-lineno">1209</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">listin</tt><tt class="py-op">)</tt> <tt class="py-op"><</tt> <tt class="py-name">numfields</tt><tt class="py-op">:</tt> </tt>
-<a name="L1210"></a><tt class="py-lineno">1210</tt>  <tt class="py-line">        <tt class="py-name">last</tt> <tt class="py-op">=</tt> <tt class="py-name">listin</tt><tt class="py-op">[</tt><tt class="py-op">-</tt><tt class="py-number">1</tt><tt class="py-op">]</tt> </tt>
-<a name="L1211"></a><tt class="py-lineno">1211</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt class="py-name">n</tt> <tt class="py-keyword">in</tt> <tt class="py-name">range</tt><tt class="py-op">(</tt><tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">listin</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-name">numfields</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
-<a name="L1212"></a><tt class="py-lineno">1212</tt>  <tt class="py-line">            <tt class="py-name">listin</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">last</tt><tt class="py-op">)</tt> </tt>
-<a name="L1213"></a><tt class="py-lineno">1213</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt class="py-name">listin</tt> </tt>
-</div><a name="L1214"></a><tt class="py-lineno">1214</tt>  <tt class="py-line"> </tt>
-<a name="_flatten"></a><div id="_flatten-def"><a name="L1215"></a><tt class="py-lineno">1215</tt> <a class="py-toggle" href="#" id="_flatten-toggle" onclick="return toggle('_flatten');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="ncepgrib2-module.html#_flatten">_flatten</a><tt class="py-op">(</tt><tt class="py-param">lst</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
-</div><div id="_flatten-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="_flatten-expanded"><a name="L1216"></a><tt class="py-lineno">1216</tt>  <tt class="py-line">    <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
-<a name="L1217"></a><tt class="py-lineno">1217</tt>  <tt class="py-line">        <tt class="py-name">flist</tt> <tt class="py-op">=</tt> <tt class="py-name">functools</tt><tt class="py-op">.</tt><tt class="py-name">reduce</tt><tt class="py-op">(</tt><tt class="py-name">operator</tt><tt class="py-op">.</tt><tt class="py-name">add</tt><tt class="py-op">,</tt><tt class="py-name">lst</tt><tt class="py-op">)</tt> </tt>
-<a name="L1218"></a><tt class="py-lineno">1218</tt>  <tt class="py-line">    <tt class="py-keyword">except</tt> <tt class="py-name">NameError</tt><tt class="py-op">:</tt> <tt class="py-comment"># no reduce in python 3.</tt> </tt>
-<a name="L1219"></a><tt class="py-lineno">1219</tt>  <tt class="py-line">        <tt class="py-keyword">import</tt> <tt class="py-name">functools</tt> </tt>
-<a name="L1220"></a><tt class="py-lineno">1220</tt>  <tt class="py-line">        <tt class="py-name">flist</tt> <tt class="py-op">=</tt> <tt class="py-name">functools</tt><tt class="py-op">.</tt><tt class="py-name">reduce</tt><tt class="py-op">(</tt><tt class="py-name">operator</tt><tt class="py-op">.</tt><tt class="py-name">add</tt><tt class="py-op">,</tt><tt class="py-name">lst</tt><tt class="py-op">)</tt> </tt>
-<a name="L1221"></a><tt class="py-lineno">1221</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt class="py-name">flist</tt> </tt>
-</div><a name="L1222"></a><tt class="py-lineno">1222</tt>  <tt class="py-line"> </tt>
-<a name="L1223"></a><tt class="py-lineno">1223</tt>  <tt class="py-line"> </tt>
-<a name="Grib2Encode"></a><div id="Grib2Encode-def"><a name="L1224"></a><tt class="py-lineno">1224</tt> <a class="py-toggle" href="#" id="Grib2Encode-toggle" onclick="return toggle('Grib2Encode');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="ncepgrib2.Grib2Encode-class.html">Grib2Encode</a><tt class="py-op">:</tt> </tt>
-</div><div id="Grib2Encode-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="Grib2Encode-expanded"><a name="L1225"></a><tt class="py-lineno">1225</tt>  <tt class="py-line">    <tt class="py-docstring">"""</tt> </tt>
-<a name="L1226"></a><tt class="py-lineno">1226</tt>  <tt class="py-line"><tt class="py-docstring"> Class for encoding data into a GRIB2 message.</tt> </tt>
-<a name="L1227"></a><tt class="py-lineno">1227</tt>  <tt class="py-line"><tt class="py-docstring">  - Creating a class instance (L{__init__}) initializes the message and adds</tt> </tt>
-<a name="L1228"></a><tt class="py-lineno">1228</tt>  <tt class="py-line"><tt class="py-docstring">    sections 0 and 1 (the indicator and identification sections),</tt> </tt>
-<a name="L1229"></a><tt class="py-lineno">1229</tt>  <tt class="py-line"><tt class="py-docstring">  - method L{addgrid} adds a grid definition (section 3) to the messsage.</tt> </tt>
-<a name="L1230"></a><tt class="py-lineno">1230</tt>  <tt class="py-line"><tt class="py-docstring">  - method L{addfield} adds sections 4-7 to the message (the product</tt> </tt>
-<a name="L1231"></a><tt class="py-lineno">1231</tt>  <tt class="py-line"><tt class="py-docstring">    definition, data representation, bitmap and data sections).</tt> </tt>
-<a name="L1232"></a><tt class="py-lineno">1232</tt>  <tt class="py-line"><tt class="py-docstring">  - method L{end} adds the end section (section 8) and terminates the message.</tt> </tt>
+<a name="L716"></a><tt class="py-lineno"> 716</tt>  <tt class="py-line">                        <tt class="py-name">fld</tt> <tt class="py-op">=</tt> <tt class="py-name">_redtoreg</tt><tt class="py-op">(</tt><tt class="py-name">nx</tt><tt class="py-op">,</tt> <tt class="py-name">lonsperlat</tt><tt class="py-op">.</tt><tt class="py-name">astype</tt><tt class="py-op">(</tt><tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">long</tt><tt class="py-op">)</tt><tt class="py- [...]
+<a name="L717"></a><tt class="py-lineno"> 717</tt>  <tt class="py-line">                                <tt class="py-name">fld</tt><tt class="py-op">.</tt><tt class="py-name">astype</tt><tt class="py-op">(</tt><tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">double</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-name">fill_value</tt><tt class="py-op">)</tt> </tt>
+<a name="L718"></a><tt class="py-lineno"> 718</tt>  <tt class="py-line">                        <tt class="py-name">fld</tt> <tt class="py-op">=</tt> <tt class="py-name">ma</tt><tt class="py-op">.</tt><tt class="py-name">masked_values</tt><tt class="py-op">(</tt><tt class="py-name">fld</tt><tt class="py-op">,</tt><tt class="py-name">fill_value</tt><tt class="py-op">)</tt> </tt>
+<a name="L719"></a><tt class="py-lineno"> 719</tt>  <tt class="py-line">                    <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
+<a name="L720"></a><tt class="py-lineno"> 720</tt>  <tt class="py-line">                        <tt class="py-name">fld</tt> <tt class="py-op">=</tt> <tt class="py-name">_redtoreg</tt><tt class="py-op">(</tt><tt class="py-name">nx</tt><tt class="py-op">,</tt> <tt class="py-name">lonsperlat</tt><tt class="py-op">.</tt><tt class="py-name">astype</tt><tt class="py-op">(</tt><tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">long</tt><tt class="py-op">)</tt><tt class="py- [...]
+<a name="L721"></a><tt class="py-lineno"> 721</tt>  <tt class="py-line">                                <tt class="py-name">fld</tt><tt class="py-op">.</tt><tt class="py-name">astype</tt><tt class="py-op">(</tt><tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">double</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-name">fill_value</tt><tt class="py-op">)</tt> </tt>
+<a name="L722"></a><tt class="py-lineno"> 722</tt>  <tt class="py-line">        <tt class="py-comment"># check scan modes for rect grids.</tt> </tt>
+<a name="L723"></a><tt class="py-lineno"> 723</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">nx</tt> <tt class="py-keyword">is</tt> <tt class="py-keyword">not</tt> <tt class="py-name">None</tt> <tt class="py-keyword">and</tt> <tt class="py-name">ny</tt> <tt class="py-keyword">is</tt> <tt class="py-keyword">not</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
+<a name="L724"></a><tt class="py-lineno"> 724</tt>  <tt class="py-line">            <tt class="py-comment"># rows scan in the -x direction (so flip)</tt> </tt>
+<a name="L725"></a><tt class="py-lineno"> 725</tt>  <tt class="py-line">            <tt class="py-comment">#if self.scanmodeflags[0]:</tt> </tt>
+<a name="L726"></a><tt class="py-lineno"> 726</tt>  <tt class="py-line">            <tt class="py-comment">#    fldsave = fld.astype('f') # casting makes a copy</tt> </tt>
+<a name="L727"></a><tt class="py-lineno"> 727</tt>  <tt class="py-line">            <tt class="py-comment">#    fld[:,:] = fldsave[:,::-1]</tt> </tt>
+<a name="L728"></a><tt class="py-lineno"> 728</tt>  <tt class="py-line">            <tt class="py-comment"># columns scan in the -y direction (so flip)</tt> </tt>
+<a name="L729"></a><tt class="py-lineno"> 729</tt>  <tt class="py-line">            <tt class="py-comment">#if not self.scanmodeflags[1]:</tt> </tt>
+<a name="L730"></a><tt class="py-lineno"> 730</tt>  <tt class="py-line">            <tt class="py-comment">#    fldsave = fld.astype('f') # casting makes a copy</tt> </tt>
+<a name="L731"></a><tt class="py-lineno"> 731</tt>  <tt class="py-line">            <tt class="py-comment">#    fld[:,:] = fldsave[::-1,:]</tt> </tt>
+<a name="L732"></a><tt class="py-lineno"> 732</tt>  <tt class="py-line">            <tt class="py-comment"># adjacent rows scan in opposite direction.</tt> </tt>
+<a name="L733"></a><tt class="py-lineno"> 733</tt>  <tt class="py-line">            <tt class="py-comment"># (flip every other row)</tt> </tt>
+<a name="L734"></a><tt class="py-lineno"> 734</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">scanmodeflags</tt><tt class="py-op">[</tt><tt class="py-number">3</tt><tt class="py-op">]</tt><tt class="py-op">:</tt> </tt>
+<a name="L735"></a><tt class="py-lineno"> 735</tt>  <tt class="py-line">                <tt class="py-name">fldsave</tt> <tt class="py-op">=</tt> <tt class="py-name">fld</tt><tt class="py-op">.</tt><tt class="py-name">astype</tt><tt class="py-op">(</tt><tt class="py-string">'f'</tt><tt class="py-op">)</tt> <tt class="py-comment"># casting makes a copy</tt> </tt>
+<a name="L736"></a><tt class="py-lineno"> 736</tt>  <tt class="py-line">                <tt class="py-name">fld</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">:</tt><tt class="py-op">:</tt><tt class="py-number">2</tt><tt class="py-op">,</tt><tt class="py-op">:</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">fldsave</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">:</tt><tt class="py-op">:</tt><tt class="py-numb [...]
+<a name="L737"></a><tt class="py-lineno"> 737</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">fld</tt> </tt>
+</div><a name="L738"></a><tt class="py-lineno"> 738</tt>  <tt class="py-line"> </tt>
+<a name="L739"></a><tt class="py-lineno"> 739</tt>  <tt class="py-line">    <tt id="link-11" class="py-name" targets="Variable ncepgrib2.Grib2Message.values=ncepgrib2.Grib2Message-class.html#values"><a title="ncepgrib2.Grib2Message.values" class="py-name" href="#" onclick="return doclink('link-11', 'values', 'link-11');">values</a></tt> <tt class="py-op">=</tt> <tt class="py-name">property</tt><tt class="py-op">(</tt><tt id="link-12" class="py-name" targets="Method ncepgrib2.Grib2Message [...]
+<a name="L740"></a><tt class="py-lineno"> 740</tt>  <tt class="py-line"> </tt>
+<a name="Grib2Message.latlons"></a><div id="Grib2Message.latlons-def"><a name="L741"></a><tt class="py-lineno"> 741</tt> <a class="py-toggle" href="#" id="Grib2Message.latlons-toggle" onclick="return toggle('Grib2Message.latlons');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="ncepgrib2.Grib2Message-class.html#latlons">latlons</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
+</div><div id="Grib2Message.latlons-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Grib2Message.latlons-expanded"><a name="L742"></a><tt class="py-lineno"> 742</tt>  <tt class="py-line">        <tt class="py-docstring">"""alias for L{grid}"""</tt> </tt>
+<a name="L743"></a><tt class="py-lineno"> 743</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-13" class="py-name" targets="Method ncepgrib2.Grib2Message.grid()=ncepgrib2.Grib2Message-class.html#grid"><a title="ncepgrib2.Grib2Message.grid" class="py-name" href="#" onclick="return doclink('link-13', 'grid', 'link-13');">grid</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
+</div><a name="L744"></a><tt class="py-lineno"> 744</tt>  <tt class="py-line"> </tt>
+<a name="Grib2Message.grid"></a><div id="Grib2Message.grid-def"><a name="L745"></a><tt class="py-lineno"> 745</tt> <a class="py-toggle" href="#" id="Grib2Message.grid-toggle" onclick="return toggle('Grib2Message.grid');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="ncepgrib2.Grib2Message-class.html#grid">grid</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
+</div><div id="Grib2Message.grid-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Grib2Message.grid-expanded"><a name="L746"></a><tt class="py-lineno"> 746</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
+<a name="L747"></a><tt class="py-lineno"> 747</tt>  <tt class="py-line"><tt class="py-docstring"> return lats,lons (in degrees) of grid.</tt> </tt>
+<a name="L748"></a><tt class="py-lineno"> 748</tt>  <tt class="py-line"><tt class="py-docstring"> currently can handle reg. lat/lon, global gaussian, mercator, stereographic,</tt> </tt>
+<a name="L749"></a><tt class="py-lineno"> 749</tt>  <tt class="py-line"><tt class="py-docstring"> lambert conformal, albers equal-area, space-view and azimuthal</tt> </tt>
+<a name="L750"></a><tt class="py-lineno"> 750</tt>  <tt class="py-line"><tt class="py-docstring"> equidistant grids.  L{latlons} method does the same thing.</tt> </tt>
+<a name="L751"></a><tt class="py-lineno"> 751</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
+<a name="L752"></a><tt class="py-lineno"> 752</tt>  <tt class="py-line"><tt class="py-docstring"> @return: C{B{lats},B{lons}}, float32 numpy arrays</tt> </tt>
+<a name="L753"></a><tt class="py-lineno"> 753</tt>  <tt class="py-line"><tt class="py-docstring"> containing latitudes and longitudes of grid (in degrees).</tt> </tt>
+<a name="L754"></a><tt class="py-lineno"> 754</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
+<a name="L755"></a><tt class="py-lineno"> 755</tt>  <tt class="py-line">        <tt class="py-keyword">from</tt> <tt class="py-name">pygrib</tt> <tt class="py-keyword">import</tt> <tt class="py-name">gaulats</tt> </tt>
+<a name="L756"></a><tt class="py-lineno"> 756</tt>  <tt class="py-line">        <tt class="py-name">gdsinfo</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">grid_definition_info</tt> </tt>
+<a name="L757"></a><tt class="py-lineno"> 757</tt>  <tt class="py-line">        <tt class="py-name">gdtnum</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">grid_definition_template_number</tt> </tt>
+<a name="L758"></a><tt class="py-lineno"> 758</tt>  <tt class="py-line">        <tt class="py-name">gdtmpl</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">grid_definition_template</tt> </tt>
+<a name="L759"></a><tt class="py-lineno"> 759</tt>  <tt class="py-line">        <tt class="py-name">reggrid</tt> <tt class="py-op">=</tt> <tt class="py-name">gdsinfo</tt><tt class="py-op">[</tt><tt class="py-number">2</tt><tt class="py-op">]</tt> <tt class="py-op">==</tt> <tt class="py-number">0</tt> <tt class="py-comment"># gdsinfo[2]=0 means regular 2-d grid</tt> </tt>
+<a name="L760"></a><tt class="py-lineno"> 760</tt>  <tt class="py-line">        <tt class="py-name">projparams</tt> <tt class="py-op">=</tt> <tt class="py-op">{</tt><tt class="py-op">}</tt> </tt>
+<a name="L761"></a><tt class="py-lineno"> 761</tt>  <tt class="py-line">        <tt class="py-name">projparams</tt><tt class="py-op">[</tt><tt class="py-string">'a'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">earthRmajor</tt> </tt>
+<a name="L762"></a><tt class="py-lineno"> 762</tt>  <tt class="py-line">        <tt class="py-name">projparams</tt><tt class="py-op">[</tt><tt class="py-string">'b'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">earthRminor</tt> </tt>
+<a name="L763"></a><tt class="py-lineno"> 763</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">gdtnum</tt> <tt class="py-op">==</tt> <tt class="py-number">0</tt><tt class="py-op">:</tt> <tt class="py-comment"># regular lat/lon grid</tt> </tt>
+<a name="L764"></a><tt class="py-lineno"> 764</tt>  <tt class="py-line">            <tt class="py-name">lon1</tt><tt class="py-op">,</tt> <tt class="py-name">lat1</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">longitude_first_gridpoint</tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">latitude_first_gridpoint</tt> </tt>
+<a name="L765"></a><tt class="py-lineno"> 765</tt>  <tt class="py-line">            <tt class="py-name">lon2</tt><tt class="py-op">,</tt> <tt class="py-name">lat2</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">longitude_last_gridpoint</tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">latitude_last_gridpoint</tt> </tt>
+<a name="L766"></a><tt class="py-lineno"> 766</tt>  <tt class="py-line">            <tt class="py-name">delon</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">gridlength_in_x_direction</tt> </tt>
+<a name="L767"></a><tt class="py-lineno"> 767</tt>  <tt class="py-line">            <tt class="py-name">delat</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">gridlength_in_y_direction</tt> </tt>
+<a name="L768"></a><tt class="py-lineno"> 768</tt>  <tt class="py-line">            <tt class="py-name">lats</tt> <tt class="py-op">=</tt> <tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">arange</tt><tt class="py-op">(</tt><tt class="py-name">lat1</tt><tt class="py-op">,</tt><tt class="py-name">lat2</tt><tt class="py-op">+</tt><tt class="py-name">delat</tt><tt class="py-op">,</tt><tt class="py-name">delat</tt><tt class="py-op">)</tt> </tt>
+<a name="L769"></a><tt class="py-lineno"> 769</tt>  <tt class="py-line">            <tt class="py-name">lons</tt> <tt class="py-op">=</tt> <tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">arange</tt><tt class="py-op">(</tt><tt class="py-name">lon1</tt><tt class="py-op">,</tt><tt class="py-name">lon2</tt><tt class="py-op">+</tt><tt class="py-name">delon</tt><tt class="py-op">,</tt><tt class="py-name">delon</tt><tt class="py-op">)</tt> </tt>
+<a name="L770"></a><tt class="py-lineno"> 770</tt>  <tt class="py-line">            <tt class="py-comment"># flip if scan mode says to.</tt> </tt>
+<a name="L771"></a><tt class="py-lineno"> 771</tt>  <tt class="py-line">            <tt class="py-comment">#if self.scanmodeflags[0]:</tt> </tt>
+<a name="L772"></a><tt class="py-lineno"> 772</tt>  <tt class="py-line">            <tt class="py-comment">#    lons = lons[::-1]</tt> </tt>
+<a name="L773"></a><tt class="py-lineno"> 773</tt>  <tt class="py-line">            <tt class="py-comment">#if not self.scanmodeflags[1]:</tt> </tt>
+<a name="L774"></a><tt class="py-lineno"> 774</tt>  <tt class="py-line">            <tt class="py-comment">#    lats = lats[::-1]</tt> </tt>
+<a name="L775"></a><tt class="py-lineno"> 775</tt>  <tt class="py-line">            <tt class="py-name">projparams</tt><tt class="py-op">[</tt><tt class="py-string">'proj'</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-string">'cyl'</tt> </tt>
+<a name="L776"></a><tt class="py-lineno"> 776</tt>  <tt class="py-line">            <tt class="py-name">lons</tt><tt class="py-op">,</tt><tt class="py-name">lats</tt> <tt class="py-op">=</tt> <tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">meshgrid</tt><tt class="py-op">(</tt><tt class="py-name">lons</tt><tt class="py-op">,</tt><tt class="py-name">lats</tt><tt class="py-op">)</tt> <tt class="py-comment"># make 2-d arrays.</tt> </tt>
+<a name="L777"></a><tt class="py-lineno"> 777</tt>  <tt class="py-line">        <tt class="py-keyword">elif</tt> <tt class="py-name">gdtnum</tt> <tt class="py-op">==</tt> <tt class="py-number">40</tt><tt class="py-op">:</tt> <tt class="py-comment"># gaussian grid (only works for global!)</tt> </tt>
+<a name="L778"></a><tt class="py-lineno"> 778</tt>  <tt class="py-line">            <tt class="py-name">lon1</tt><tt class="py-op">,</tt> <tt class="py-name">lat1</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">longitude_first_gridpoint</tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">latitude_first_gridpoint</tt> </tt>
+<a name="L779"></a><tt class="py-lineno"> 779</tt>  <tt class="py-line">            <tt class="py-name">lon2</tt><tt class="py-op">,</tt> <tt class="py-name">lat2</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">longitude_last_gridpoint</tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">latitude_last_gridpoint</tt> </tt>
+<a name="L780"></a><tt class="py-lineno"> 780</tt>  <tt class="py-line">            <tt class="py-name">nlats</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">points_in_y_direction</tt> </tt>
+<a name="L781"></a><tt class="py-lineno"> 781</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">reggrid</tt><tt class="py-op">:</tt> <tt class="py-comment"># ECMWF 'reduced' gaussian grid.</tt> </tt>
+<a name="L782"></a><tt class="py-lineno"> 782</tt>  <tt class="py-line">                <tt class="py-name">nlons</tt> <tt class="py-op">=</tt> <tt class="py-number">2</tt><tt class="py-op">*</tt><tt class="py-name">nlats</tt> </tt>
+<a name="L783"></a><tt class="py-lineno"> 783</tt>  <tt class="py-line">                <tt class="py-name">delon</tt> <tt class="py-op">=</tt> <tt class="py-number">360.</tt><tt class="py-op">/</tt><tt class="py-name">nlons</tt> </tt>
+<a name="L784"></a><tt class="py-lineno"> 784</tt>  <tt class="py-line">            <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
+<a name="L785"></a><tt class="py-lineno"> 785</tt>  <tt class="py-line">                <tt class="py-name">nlons</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">points_in_x_direction</tt> </tt>
+<a name="L786"></a><tt class="py-lineno"> 786</tt>  <tt class="py-line">                <tt class="py-name">delon</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">gridlength_in_x_direction</tt> </tt>
+<a name="L787"></a><tt class="py-lineno"> 787</tt>  <tt class="py-line">            <tt class="py-name">lons</tt> <tt class="py-op">=</tt> <tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">arange</tt><tt class="py-op">(</tt><tt class="py-name">lon1</tt><tt class="py-op">,</tt><tt class="py-name">lon2</tt><tt class="py-op">+</tt><tt class="py-name">delon</tt><tt class="py-op">,</tt><tt class="py-name">delon</tt><tt class="py-op">)</tt> </tt>
+<a name="L788"></a><tt class="py-lineno"> 788</tt>  <tt class="py-line">            <tt class="py-comment"># compute gaussian lats (north to south)</tt> </tt>
+<a name="L789"></a><tt class="py-lineno"> 789</tt>  <tt class="py-line">            <tt class="py-name">lats</tt> <tt class="py-op">=</tt> <tt class="py-name">gaulats</tt><tt class="py-op">(</tt><tt class="py-name">nlats</tt><tt class="py-op">)</tt> </tt>
+<a name="L790"></a><tt class="py-lineno"> 790</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">lat1</tt> <tt class="py-op"><</tt> <tt class="py-name">lat2</tt><tt class="py-op">:</tt>  <tt class="py-comment"># reverse them if necessary</tt> </tt>
+<a name="L791"></a><tt class="py-lineno"> 791</tt>  <tt class="py-line">                <tt class="py-name">lats</tt> <tt class="py-op">=</tt> <tt class="py-name">lats</tt><tt class="py-op">[</tt><tt class="py-op">:</tt><tt class="py-op">:</tt><tt class="py-op">-</tt><tt class="py-number">1</tt><tt class="py-op">]</tt> </tt>
+<a name="L792"></a><tt class="py-lineno"> 792</tt>  <tt class="py-line">            <tt class="py-comment"># flip if scan mode says to.</tt> </tt>
+<a name="L793"></a><tt class="py-lineno"> 793</tt>  <tt class="py-line">            <tt class="py-comment">#if self.scanmodeflags[0]:</tt> </tt>
+<a name="L794"></a><tt class="py-lineno"> 794</tt>  <tt class="py-line">            <tt class="py-comment">#    lons = lons[::-1]</tt> </tt>
+<a name="L795"></a><tt class="py-lineno"> 795</tt>  <tt class="py-line">            <tt class="py-comment">#if not self.scanmodeflags[1]:</tt> </tt>
+<a name="L796"></a><tt class="py-lineno"> 796</tt>  <tt class="py-line">            <tt class="py-comment">#    lats = lats[::-1]</tt> </tt>
+<a name="L797"></a><tt class="py-lineno"> 797</tt>  <tt class="py-line">            <tt class="py-name">projparams</tt><tt class="py-op">[</tt><tt class="py-string">'proj'</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-string">'cyl'</tt> </tt>
+<a name="L798"></a><tt class="py-lineno"> 798</tt>  <tt class="py-line">            <tt class="py-name">lons</tt><tt class="py-op">,</tt><tt class="py-name">lats</tt> <tt class="py-op">=</tt> <tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">meshgrid</tt><tt class="py-op">(</tt><tt class="py-name">lons</tt><tt class="py-op">,</tt><tt class="py-name">lats</tt><tt class="py-op">)</tt> <tt class="py-comment"># make 2-d arrays</tt> </tt>
+<a name="L799"></a><tt class="py-lineno"> 799</tt>  <tt class="py-line">        <tt class="py-comment"># mercator, lambert conformal, stereographic, albers equal area, azimuthal equidistant</tt> </tt>
+<a name="L800"></a><tt class="py-lineno"> 800</tt>  <tt class="py-line">        <tt class="py-keyword">elif</tt> <tt class="py-name">gdtnum</tt> <tt class="py-keyword">in</tt> <tt class="py-op">[</tt><tt class="py-number">10</tt><tt class="py-op">,</tt><tt class="py-number">20</tt><tt class="py-op">,</tt><tt class="py-number">30</tt><tt class="py-op">,</tt><tt class="py-number">31</tt><tt class="py-op">,</tt><tt class="py-number">110</tt><tt class="py-op">]</tt><tt class="py-op">:</tt> </tt>
+<a name="L801"></a><tt class="py-lineno"> 801</tt>  <tt class="py-line">            <tt class="py-name">nx</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">points_in_x_direction</tt> </tt>
+<a name="L802"></a><tt class="py-lineno"> 802</tt>  <tt class="py-line">            <tt class="py-name">ny</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">points_in_y_direction</tt> </tt>
+<a name="L803"></a><tt class="py-lineno"> 803</tt>  <tt class="py-line">            <tt class="py-name">dx</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">gridlength_in_x_direction</tt> </tt>
+<a name="L804"></a><tt class="py-lineno"> 804</tt>  <tt class="py-line">            <tt class="py-name">dy</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">gridlength_in_y_direction</tt> </tt>
+<a name="L805"></a><tt class="py-lineno"> 805</tt>  <tt class="py-line">            <tt class="py-name">lon1</tt><tt class="py-op">,</tt> <tt class="py-name">lat1</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">longitude_first_gridpoint</tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">latitude_first_gridpoint</tt> </tt>
+<a name="L806"></a><tt class="py-lineno"> 806</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">gdtnum</tt> <tt class="py-op">==</tt> <tt class="py-number">10</tt><tt class="py-op">:</tt> <tt class="py-comment"># mercator.</tt> </tt>
+<a name="L807"></a><tt class="py-lineno"> 807</tt>  <tt class="py-line">                <tt class="py-name">projparams</tt><tt class="py-op">[</tt><tt class="py-string">'lat_ts'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">proj4_lat_ts</tt> </tt>
+<a name="L808"></a><tt class="py-lineno"> 808</tt>  <tt class="py-line">                <tt class="py-name">projparams</tt><tt class="py-op">[</tt><tt class="py-string">'proj'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">proj4_proj</tt> </tt>
+<a name="L809"></a><tt class="py-lineno"> 809</tt>  <tt class="py-line">                <tt class="py-name">projparams</tt><tt class="py-op">[</tt><tt class="py-string">'lon_0'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">proj4_lon_0</tt> </tt>
+<a name="L810"></a><tt class="py-lineno"> 810</tt>  <tt class="py-line">                <tt class="py-name">pj</tt> <tt class="py-op">=</tt> <tt class="py-name">pyproj</tt><tt class="py-op">.</tt><tt class="py-name">Proj</tt><tt class="py-op">(</tt><tt class="py-name">projparams</tt><tt class="py-op">)</tt> </tt>
+<a name="L811"></a><tt class="py-lineno"> 811</tt>  <tt class="py-line">                <tt class="py-name">llcrnrx</tt><tt class="py-op">,</tt> <tt class="py-name">llcrnry</tt> <tt class="py-op">=</tt> <tt class="py-name">pj</tt><tt class="py-op">(</tt><tt class="py-name">lon1</tt><tt class="py-op">,</tt><tt class="py-name">lat1</tt><tt class="py-op">)</tt> </tt>
+<a name="L812"></a><tt class="py-lineno"> 812</tt>  <tt class="py-line">                <tt class="py-name">x</tt> <tt class="py-op">=</tt> <tt class="py-name">llcrnrx</tt><tt class="py-op">+</tt><tt class="py-name">dx</tt><tt class="py-op">*</tt><tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">arange</tt><tt class="py-op">(</tt><tt class="py-name">nx</tt><tt class="py-op">)</tt> </tt>
+<a name="L813"></a><tt class="py-lineno"> 813</tt>  <tt class="py-line">                <tt class="py-name">y</tt> <tt class="py-op">=</tt> <tt class="py-name">llcrnry</tt><tt class="py-op">+</tt><tt class="py-name">dy</tt><tt class="py-op">*</tt><tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">arange</tt><tt class="py-op">(</tt><tt class="py-name">ny</tt><tt class="py-op">)</tt> </tt>
+<a name="L814"></a><tt class="py-lineno"> 814</tt>  <tt class="py-line">                <tt class="py-name">x</tt><tt class="py-op">,</tt> <tt class="py-name">y</tt> <tt class="py-op">=</tt> <tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">meshgrid</tt><tt class="py-op">(</tt><tt class="py-name">x</tt><tt class="py-op">,</tt> <tt class="py-name">y</tt><tt class="py-op">)</tt> </tt>
+<a name="L815"></a><tt class="py-lineno"> 815</tt>  <tt class="py-line">                <tt class="py-name">lons</tt><tt class="py-op">,</tt> <tt class="py-name">lats</tt> <tt class="py-op">=</tt> <tt class="py-name">pj</tt><tt class="py-op">(</tt><tt class="py-name">x</tt><tt class="py-op">,</tt> <tt class="py-name">y</tt><tt class="py-op">,</tt> <tt class="py-name">inverse</tt><tt class="py-op">=</tt><tt class="py-name">True</tt><tt class="py-op">)</tt> </tt>
+<a name="L816"></a><tt class="py-lineno"> 816</tt>  <tt class="py-line">            <tt class="py-keyword">elif</tt> <tt class="py-name">gdtnum</tt> <tt class="py-op">==</tt> <tt class="py-number">20</tt><tt class="py-op">:</tt>  <tt class="py-comment"># stereographic</tt> </tt>
+<a name="L817"></a><tt class="py-lineno"> 817</tt>  <tt class="py-line">                <tt class="py-name">projparams</tt><tt class="py-op">[</tt><tt class="py-string">'lat_ts'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">proj4_lat_ts</tt> </tt>
+<a name="L818"></a><tt class="py-lineno"> 818</tt>  <tt class="py-line">                <tt class="py-name">projparams</tt><tt class="py-op">[</tt><tt class="py-string">'proj'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">proj4_proj</tt> </tt>
+<a name="L819"></a><tt class="py-lineno"> 819</tt>  <tt class="py-line">                <tt class="py-name">projparams</tt><tt class="py-op">[</tt><tt class="py-string">'lat_0'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">proj4_lat_0</tt> </tt>
+<a name="L820"></a><tt class="py-lineno"> 820</tt>  <tt class="py-line">                <tt class="py-name">projparams</tt><tt class="py-op">[</tt><tt class="py-string">'lon_0'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">proj4_lon_0</tt> </tt>
+<a name="L821"></a><tt class="py-lineno"> 821</tt>  <tt class="py-line">                <tt class="py-name">pj</tt> <tt class="py-op">=</tt> <tt class="py-name">pyproj</tt><tt class="py-op">.</tt><tt class="py-name">Proj</tt><tt class="py-op">(</tt><tt class="py-name">projparams</tt><tt class="py-op">)</tt> </tt>
+<a name="L822"></a><tt class="py-lineno"> 822</tt>  <tt class="py-line">                <tt class="py-name">llcrnrx</tt><tt class="py-op">,</tt> <tt class="py-name">llcrnry</tt> <tt class="py-op">=</tt> <tt class="py-name">pj</tt><tt class="py-op">(</tt><tt class="py-name">lon1</tt><tt class="py-op">,</tt><tt class="py-name">lat1</tt><tt class="py-op">)</tt> </tt>
+<a name="L823"></a><tt class="py-lineno"> 823</tt>  <tt class="py-line">                <tt class="py-name">x</tt> <tt class="py-op">=</tt> <tt class="py-name">llcrnrx</tt><tt class="py-op">+</tt><tt class="py-name">dx</tt><tt class="py-op">*</tt><tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">arange</tt><tt class="py-op">(</tt><tt class="py-name">nx</tt><tt class="py-op">)</tt> </tt>
+<a name="L824"></a><tt class="py-lineno"> 824</tt>  <tt class="py-line">                <tt class="py-name">y</tt> <tt class="py-op">=</tt> <tt class="py-name">llcrnry</tt><tt class="py-op">+</tt><tt class="py-name">dy</tt><tt class="py-op">*</tt><tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">arange</tt><tt class="py-op">(</tt><tt class="py-name">ny</tt><tt class="py-op">)</tt> </tt>
+<a name="L825"></a><tt class="py-lineno"> 825</tt>  <tt class="py-line">                <tt class="py-name">x</tt><tt class="py-op">,</tt> <tt class="py-name">y</tt> <tt class="py-op">=</tt> <tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">meshgrid</tt><tt class="py-op">(</tt><tt class="py-name">x</tt><tt class="py-op">,</tt> <tt class="py-name">y</tt><tt class="py-op">)</tt> </tt>
+<a name="L826"></a><tt class="py-lineno"> 826</tt>  <tt class="py-line">                <tt class="py-name">lons</tt><tt class="py-op">,</tt> <tt class="py-name">lats</tt> <tt class="py-op">=</tt> <tt class="py-name">pj</tt><tt class="py-op">(</tt><tt class="py-name">x</tt><tt class="py-op">,</tt> <tt class="py-name">y</tt><tt class="py-op">,</tt> <tt class="py-name">inverse</tt><tt class="py-op">=</tt><tt class="py-name">True</tt><tt class="py-op">)</tt> </tt>
+<a name="L827"></a><tt class="py-lineno"> 827</tt>  <tt class="py-line">            <tt class="py-keyword">elif</tt> <tt class="py-name">gdtnum</tt> <tt class="py-keyword">in</tt> <tt class="py-op">[</tt><tt class="py-number">30</tt><tt class="py-op">,</tt><tt class="py-number">31</tt><tt class="py-op">]</tt><tt class="py-op">:</tt> <tt class="py-comment"># lambert, albers</tt> </tt>
+<a name="L828"></a><tt class="py-lineno"> 828</tt>  <tt class="py-line">                <tt class="py-name">projparams</tt><tt class="py-op">[</tt><tt class="py-string">'lat_1'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">proj4_lat_1</tt> </tt>
+<a name="L829"></a><tt class="py-lineno"> 829</tt>  <tt class="py-line">                <tt class="py-name">projparams</tt><tt class="py-op">[</tt><tt class="py-string">'lat_2'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">proj4_lat_2</tt> </tt>
+<a name="L830"></a><tt class="py-lineno"> 830</tt>  <tt class="py-line">                <tt class="py-name">projparams</tt><tt class="py-op">[</tt><tt class="py-string">'proj'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">proj4_proj</tt> </tt>
+<a name="L831"></a><tt class="py-lineno"> 831</tt>  <tt class="py-line">                <tt class="py-name">projparams</tt><tt class="py-op">[</tt><tt class="py-string">'lon_0'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">proj4_lon_0</tt> </tt>
+<a name="L832"></a><tt class="py-lineno"> 832</tt>  <tt class="py-line">                <tt class="py-name">pj</tt> <tt class="py-op">=</tt> <tt class="py-name">pyproj</tt><tt class="py-op">.</tt><tt class="py-name">Proj</tt><tt class="py-op">(</tt><tt class="py-name">projparams</tt><tt class="py-op">)</tt> </tt>
+<a name="L833"></a><tt class="py-lineno"> 833</tt>  <tt class="py-line">                <tt class="py-name">llcrnrx</tt><tt class="py-op">,</tt> <tt class="py-name">llcrnry</tt> <tt class="py-op">=</tt> <tt class="py-name">pj</tt><tt class="py-op">(</tt><tt class="py-name">lon1</tt><tt class="py-op">,</tt><tt class="py-name">lat1</tt><tt class="py-op">)</tt> </tt>
+<a name="L834"></a><tt class="py-lineno"> 834</tt>  <tt class="py-line">                <tt class="py-name">x</tt> <tt class="py-op">=</tt> <tt class="py-name">llcrnrx</tt><tt class="py-op">+</tt><tt class="py-name">dx</tt><tt class="py-op">*</tt><tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">arange</tt><tt class="py-op">(</tt><tt class="py-name">nx</tt><tt class="py-op">)</tt> </tt>
+<a name="L835"></a><tt class="py-lineno"> 835</tt>  <tt class="py-line">                <tt class="py-name">y</tt> <tt class="py-op">=</tt> <tt class="py-name">llcrnry</tt><tt class="py-op">+</tt><tt class="py-name">dy</tt><tt class="py-op">*</tt><tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">arange</tt><tt class="py-op">(</tt><tt class="py-name">ny</tt><tt class="py-op">)</tt> </tt>
+<a name="L836"></a><tt class="py-lineno"> 836</tt>  <tt class="py-line">                <tt class="py-name">x</tt><tt class="py-op">,</tt> <tt class="py-name">y</tt> <tt class="py-op">=</tt> <tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">meshgrid</tt><tt class="py-op">(</tt><tt class="py-name">x</tt><tt class="py-op">,</tt> <tt class="py-name">y</tt><tt class="py-op">)</tt> </tt>
+<a name="L837"></a><tt class="py-lineno"> 837</tt>  <tt class="py-line">                <tt class="py-name">lons</tt><tt class="py-op">,</tt> <tt class="py-name">lats</tt> <tt class="py-op">=</tt> <tt class="py-name">pj</tt><tt class="py-op">(</tt><tt class="py-name">x</tt><tt class="py-op">,</tt> <tt class="py-name">y</tt><tt class="py-op">,</tt> <tt class="py-name">inverse</tt><tt class="py-op">=</tt><tt class="py-name">True</tt><tt class="py-op">)</tt> </tt>
+<a name="L838"></a><tt class="py-lineno"> 838</tt>  <tt class="py-line">            <tt class="py-keyword">elif</tt> <tt class="py-name">gdtnum</tt> <tt class="py-op">==</tt> <tt class="py-number">110</tt><tt class="py-op">:</tt> <tt class="py-comment"># azimuthal equidistant</tt> </tt>
+<a name="L839"></a><tt class="py-lineno"> 839</tt>  <tt class="py-line">                <tt class="py-name">projparams</tt><tt class="py-op">[</tt><tt class="py-string">'proj'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">proj4_proj</tt> </tt>
+<a name="L840"></a><tt class="py-lineno"> 840</tt>  <tt class="py-line">                <tt class="py-name">projparams</tt><tt class="py-op">[</tt><tt class="py-string">'lat_0'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">proj4_lat_0</tt> </tt>
+<a name="L841"></a><tt class="py-lineno"> 841</tt>  <tt class="py-line">                <tt class="py-name">projparams</tt><tt class="py-op">[</tt><tt class="py-string">'lon_0'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">proj4_lon_0</tt> </tt>
+<a name="L842"></a><tt class="py-lineno"> 842</tt>  <tt class="py-line">                <tt class="py-name">pj</tt> <tt class="py-op">=</tt> <tt class="py-name">pyproj</tt><tt class="py-op">.</tt><tt class="py-name">Proj</tt><tt class="py-op">(</tt><tt class="py-name">projparams</tt><tt class="py-op">)</tt> </tt>
+<a name="L843"></a><tt class="py-lineno"> 843</tt>  <tt class="py-line">                <tt class="py-name">llcrnrx</tt><tt class="py-op">,</tt> <tt class="py-name">llcrnry</tt> <tt class="py-op">=</tt> <tt class="py-name">pj</tt><tt class="py-op">(</tt><tt class="py-name">lon1</tt><tt class="py-op">,</tt><tt class="py-name">lat1</tt><tt class="py-op">)</tt> </tt>
+<a name="L844"></a><tt class="py-lineno"> 844</tt>  <tt class="py-line">                <tt class="py-name">x</tt> <tt class="py-op">=</tt> <tt class="py-name">llcrnrx</tt><tt class="py-op">+</tt><tt class="py-name">dx</tt><tt class="py-op">*</tt><tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">arange</tt><tt class="py-op">(</tt><tt class="py-name">nx</tt><tt class="py-op">)</tt> </tt>
+<a name="L845"></a><tt class="py-lineno"> 845</tt>  <tt class="py-line">                <tt class="py-name">y</tt> <tt class="py-op">=</tt> <tt class="py-name">llcrnry</tt><tt class="py-op">+</tt><tt class="py-name">dy</tt><tt class="py-op">*</tt><tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">arange</tt><tt class="py-op">(</tt><tt class="py-name">ny</tt><tt class="py-op">)</tt> </tt>
+<a name="L846"></a><tt class="py-lineno"> 846</tt>  <tt class="py-line">                <tt class="py-name">x</tt><tt class="py-op">,</tt> <tt class="py-name">y</tt> <tt class="py-op">=</tt> <tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">meshgrid</tt><tt class="py-op">(</tt><tt class="py-name">x</tt><tt class="py-op">,</tt> <tt class="py-name">y</tt><tt class="py-op">)</tt> </tt>
+<a name="L847"></a><tt class="py-lineno"> 847</tt>  <tt class="py-line">                <tt class="py-name">lons</tt><tt class="py-op">,</tt> <tt class="py-name">lats</tt> <tt class="py-op">=</tt> <tt class="py-name">pj</tt><tt class="py-op">(</tt><tt class="py-name">x</tt><tt class="py-op">,</tt> <tt class="py-name">y</tt><tt class="py-op">,</tt> <tt class="py-name">inverse</tt><tt class="py-op">=</tt><tt class="py-name">True</tt><tt class="py-op">)</tt> </tt>
+<a name="L848"></a><tt class="py-lineno"> 848</tt>  <tt class="py-line">        <tt class="py-keyword">elif</tt> <tt class="py-name">gdtnum</tt> <tt class="py-op">==</tt> <tt class="py-number">90</tt><tt class="py-op">:</tt> <tt class="py-comment"># satellite projection.</tt> </tt>
+<a name="L849"></a><tt class="py-lineno"> 849</tt>  <tt class="py-line">            <tt class="py-name">nx</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">points_in_x_direction</tt> </tt>
+<a name="L850"></a><tt class="py-lineno"> 850</tt>  <tt class="py-line">            <tt class="py-name">ny</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">points_in_y_direction</tt> </tt>
+<a name="L851"></a><tt class="py-lineno"> 851</tt>  <tt class="py-line">            <tt class="py-name">dx</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">gridlength_in_x_direction</tt> </tt>
+<a name="L852"></a><tt class="py-lineno"> 852</tt>  <tt class="py-line">            <tt class="py-name">dy</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">gridlength_in_y_direction</tt> </tt>
+<a name="L853"></a><tt class="py-lineno"> 853</tt>  <tt class="py-line">            <tt class="py-name">projparams</tt><tt class="py-op">[</tt><tt class="py-string">'proj'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">proj4_proj</tt> </tt>
+<a name="L854"></a><tt class="py-lineno"> 854</tt>  <tt class="py-line">            <tt class="py-name">projparams</tt><tt class="py-op">[</tt><tt class="py-string">'lon_0'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">proj4_lon_0</tt> </tt>
+<a name="L855"></a><tt class="py-lineno"> 855</tt>  <tt class="py-line">            <tt class="py-name">projparams</tt><tt class="py-op">[</tt><tt class="py-string">'lat_0'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">proj4_lat_0</tt> </tt>
+<a name="L856"></a><tt class="py-lineno"> 856</tt>  <tt class="py-line">            <tt class="py-name">projparams</tt><tt class="py-op">[</tt><tt class="py-string">'h'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">proj4_h</tt> </tt>
+<a name="L857"></a><tt class="py-lineno"> 857</tt>  <tt class="py-line">            <tt class="py-name">pj</tt> <tt class="py-op">=</tt> <tt class="py-name">pyproj</tt><tt class="py-op">.</tt><tt class="py-name">Proj</tt><tt class="py-op">(</tt><tt class="py-name">projparams</tt><tt class="py-op">)</tt> </tt>
+<a name="L858"></a><tt class="py-lineno"> 858</tt>  <tt class="py-line">            <tt class="py-name">x</tt> <tt class="py-op">=</tt> <tt class="py-name">dx</tt><tt class="py-op">*</tt><tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">indices</tt><tt class="py-op">(</tt><tt class="py-op">(</tt><tt class="py-name">ny</tt><tt class="py-op">,</tt><tt class="py-name">nx</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-string">'f'</tt><tt class="py-op"> [...]
+<a name="L859"></a><tt class="py-lineno"> 859</tt>  <tt class="py-line">            <tt class="py-name">x</tt> <tt class="py-op">=</tt> <tt class="py-name">x</tt> <tt class="py-op">-</tt> <tt class="py-number">0.5</tt><tt class="py-op">*</tt><tt class="py-name">x</tt><tt class="py-op">.</tt><tt class="py-name">max</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
+<a name="L860"></a><tt class="py-lineno"> 860</tt>  <tt class="py-line">            <tt class="py-name">y</tt> <tt class="py-op">=</tt> <tt class="py-name">dy</tt><tt class="py-op">*</tt><tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">indices</tt><tt class="py-op">(</tt><tt class="py-op">(</tt><tt class="py-name">ny</tt><tt class="py-op">,</tt><tt class="py-name">nx</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-string">'f'</tt><tt class="py-op"> [...]
+<a name="L861"></a><tt class="py-lineno"> 861</tt>  <tt class="py-line">            <tt class="py-name">y</tt> <tt class="py-op">=</tt> <tt class="py-name">y</tt> <tt class="py-op">-</tt> <tt class="py-number">0.5</tt><tt class="py-op">*</tt><tt class="py-name">y</tt><tt class="py-op">.</tt><tt class="py-name">max</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
+<a name="L862"></a><tt class="py-lineno"> 862</tt>  <tt class="py-line">            <tt class="py-name">lons</tt><tt class="py-op">,</tt> <tt class="py-name">lats</tt> <tt class="py-op">=</tt> <tt class="py-name">pj</tt><tt class="py-op">(</tt><tt class="py-name">x</tt><tt class="py-op">,</tt><tt class="py-name">y</tt><tt class="py-op">,</tt><tt class="py-name">inverse</tt><tt class="py-op">=</tt><tt class="py-name">True</tt><tt class="py-op">)</tt> </tt>
+<a name="L863"></a><tt class="py-lineno"> 863</tt>  <tt class="py-line">            <tt class="py-comment"># set lons,lats to 1.e30 where undefined</tt> </tt>
+<a name="L864"></a><tt class="py-lineno"> 864</tt>  <tt class="py-line">            <tt class="py-name">abslons</tt> <tt class="py-op">=</tt> <tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">fabs</tt><tt class="py-op">(</tt><tt class="py-name">lons</tt><tt class="py-op">)</tt><tt class="py-op">;</tt> <tt class="py-name">abslats</tt> <tt class="py-op">=</tt> <tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">fabs</tt><tt class="py-op">(</tt><tt cl [...]
+<a name="L865"></a><tt class="py-lineno"> 865</tt>  <tt class="py-line">            <tt class="py-name">lons</tt> <tt class="py-op">=</tt> <tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">where</tt><tt class="py-op">(</tt><tt class="py-name">abslons</tt> <tt class="py-op"><</tt> <tt class="py-number">1.e20</tt><tt class="py-op">,</tt> <tt class="py-name">lons</tt><tt class="py-op">,</tt> <tt class="py-number">1.e30</tt><tt class="py-op">)</tt> </tt>
+<a name="L866"></a><tt class="py-lineno"> 866</tt>  <tt class="py-line">            <tt class="py-name">lats</tt> <tt class="py-op">=</tt> <tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">where</tt><tt class="py-op">(</tt><tt class="py-name">abslats</tt> <tt class="py-op"><</tt> <tt class="py-number">1.e20</tt><tt class="py-op">,</tt> <tt class="py-name">lats</tt><tt class="py-op">,</tt> <tt class="py-number">1.e30</tt><tt class="py-op">)</tt> </tt>
+<a name="L867"></a><tt class="py-lineno"> 867</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
+<a name="L868"></a><tt class="py-lineno"> 868</tt>  <tt class="py-line">            <tt class="py-keyword">raise</tt> <tt class="py-name">ValueError</tt><tt class="py-op">(</tt><tt class="py-string">'unsupported grid'</tt><tt class="py-op">)</tt> </tt>
+<a name="L869"></a><tt class="py-lineno"> 869</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">projparams</tt> <tt class="py-op">=</tt> <tt class="py-name">projparams</tt> </tt>
+<a name="L870"></a><tt class="py-lineno"> 870</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">lats</tt><tt class="py-op">.</tt><tt class="py-name">astype</tt><tt class="py-op">(</tt><tt class="py-string">'f'</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-name">lons</tt><tt class="py-op">.</tt><tt class="py-name">astype</tt><tt class="py-op">(</tt><tt class="py-string">'f'</tt><tt class="py-op">)</tt> </tt>
+</div></div><a name="L871"></a><tt class="py-lineno"> 871</tt>  <tt class="py-line"> </tt>
+<a name="Grib2Decode"></a><div id="Grib2Decode-def"><a name="L872"></a><tt class="py-lineno"> 872</tt> <a class="py-toggle" href="#" id="Grib2Decode-toggle" onclick="return toggle('Grib2Decode');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="ncepgrib2-module.html#Grib2Decode">Grib2Decode</a><tt class="py-op">(</tt><tt class="py-param">filename</tt><tt class="py-op">,</tt><tt class="py-param">gribmsg</tt><tt class="py-op">=</tt><tt class="py-name"> [...]
+</div><div id="Grib2Decode-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="Grib2Decode-expanded"><a name="L873"></a><tt class="py-lineno"> 873</tt>  <tt class="py-line">    <tt class="py-docstring">"""</tt> </tt>
+<a name="L874"></a><tt class="py-lineno"> 874</tt>  <tt class="py-line"><tt class="py-docstring"> Read the contents of a GRIB2 file.</tt> </tt>
+<a name="L875"></a><tt class="py-lineno"> 875</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
+<a name="L876"></a><tt class="py-lineno"> 876</tt>  <tt class="py-line"><tt class="py-docstring"> @param filename: name of GRIB2 file (default, gribmsg=False) or binary string</tt> </tt>
+<a name="L877"></a><tt class="py-lineno"> 877</tt>  <tt class="py-line"><tt class="py-docstring"> representing a grib message (if gribmsg=True).</tt> </tt>
+<a name="L878"></a><tt class="py-lineno"> 878</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
+<a name="L879"></a><tt class="py-lineno"> 879</tt>  <tt class="py-line"><tt class="py-docstring"> @return:  a list of L{Grib2Message} instances representing all of the</tt> </tt>
+<a name="L880"></a><tt class="py-lineno"> 880</tt>  <tt class="py-line"><tt class="py-docstring"> grib messages in the file.  Messages with multiple fields are split</tt> </tt>
+<a name="L881"></a><tt class="py-lineno"> 881</tt>  <tt class="py-line"><tt class="py-docstring"> into separate messages (so that each L{Grib2Message} instance contains</tt> </tt>
+<a name="L882"></a><tt class="py-lineno"> 882</tt>  <tt class="py-line"><tt class="py-docstring"> just one data field). The metadata in each GRIB2 message can be</tt> </tt>
+<a name="L883"></a><tt class="py-lineno"> 883</tt>  <tt class="py-line"><tt class="py-docstring"> accessed via L{Grib2Message} instance variables, the actual data</tt> </tt>
+<a name="L884"></a><tt class="py-lineno"> 884</tt>  <tt class="py-line"><tt class="py-docstring"> can be read using L{Grib2Message.data}, and the lat/lon values of the grid</tt> </tt>
+<a name="L885"></a><tt class="py-lineno"> 885</tt>  <tt class="py-line"><tt class="py-docstring"> can be accesses using L{Grib2Message.grid}. If there is only one grib</tt> </tt>
+<a name="L886"></a><tt class="py-lineno"> 886</tt>  <tt class="py-line"><tt class="py-docstring"> message, just the L{Grib2Message} instance is returned, instead of a list</tt> </tt>
+<a name="L887"></a><tt class="py-lineno"> 887</tt>  <tt class="py-line"><tt class="py-docstring"> with one element.</tt> </tt>
+<a name="L888"></a><tt class="py-lineno"> 888</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
+<a name="L889"></a><tt class="py-lineno"> 889</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt class="py-name">gribmsg</tt><tt class="py-op">:</tt> </tt>
+<a name="L890"></a><tt class="py-lineno"> 890</tt>  <tt class="py-line">        <tt class="py-name">f</tt> <tt class="py-op">=</tt> <tt class="py-name">StringIO</tt><tt class="py-op">(</tt><tt class="py-name">filename</tt><tt class="py-op">)</tt> </tt>
+<a name="L891"></a><tt class="py-lineno"> 891</tt>  <tt class="py-line">    <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
+<a name="L892"></a><tt class="py-lineno"> 892</tt>  <tt class="py-line">        <tt class="py-name">f</tt> <tt class="py-op">=</tt> <tt class="py-name">open</tt><tt class="py-op">(</tt><tt class="py-name">filename</tt><tt class="py-op">,</tt><tt class="py-string">'rb'</tt><tt class="py-op">)</tt> </tt>
+<a name="L893"></a><tt class="py-lineno"> 893</tt>  <tt class="py-line">    <tt class="py-name">nmsg</tt> <tt class="py-op">=</tt> <tt class="py-number">0</tt> </tt>
+<a name="L894"></a><tt class="py-lineno"> 894</tt>  <tt class="py-line">    <tt class="py-comment"># loop over grib messages, read section 0, get entire grib message.</tt> </tt>
+<a name="L895"></a><tt class="py-lineno"> 895</tt>  <tt class="py-line">    <tt class="py-name">disciplines</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
+<a name="L896"></a><tt class="py-lineno"> 896</tt>  <tt class="py-line">    <tt class="py-name">startingpos</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
+<a name="L897"></a><tt class="py-lineno"> 897</tt>  <tt class="py-line">    <tt class="py-name">msglen</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
+<a name="L898"></a><tt class="py-lineno"> 898</tt>  <tt class="py-line">    <tt class="py-keyword">while</tt> <tt class="py-number">1</tt><tt class="py-op">:</tt> </tt>
+<a name="L899"></a><tt class="py-lineno"> 899</tt>  <tt class="py-line">        <tt class="py-comment"># find next occurence of string 'GRIB' (or EOF).</tt> </tt>
+<a name="L900"></a><tt class="py-lineno"> 900</tt>  <tt class="py-line">        <tt class="py-name">nbyte</tt> <tt class="py-op">=</tt> <tt class="py-name">f</tt><tt class="py-op">.</tt><tt class="py-name">tell</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
+<a name="L901"></a><tt class="py-lineno"> 901</tt>  <tt class="py-line">        <tt class="py-keyword">while</tt> <tt class="py-number">1</tt><tt class="py-op">:</tt> </tt>
+<a name="L902"></a><tt class="py-lineno"> 902</tt>  <tt class="py-line">            <tt class="py-name">f</tt><tt class="py-op">.</tt><tt class="py-name">seek</tt><tt class="py-op">(</tt><tt class="py-name">nbyte</tt><tt class="py-op">)</tt> </tt>
+<a name="L903"></a><tt class="py-lineno"> 903</tt>  <tt class="py-line">            <tt class="py-name">start</tt> <tt class="py-op">=</tt> <tt class="py-name">f</tt><tt class="py-op">.</tt><tt class="py-name">read</tt><tt class="py-op">(</tt><tt class="py-number">4</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt class="py-name">decode</tt><tt class="py-op">(</tt><tt class="py-string">'ascii'</tt><tt class="py-op">,</tt><tt class="py-string">'ignore'</tt><tt class="py-op">)</tt> </tt>
+<a name="L904"></a><tt class="py-lineno"> 904</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">start</tt> <tt class="py-op">==</tt> <tt class="py-string">''</tt> <tt class="py-keyword">or</tt> <tt class="py-name">start</tt> <tt class="py-op">==</tt> <tt class="py-string">'GRIB'</tt><tt class="py-op">:</tt> <tt class="py-keyword">break</tt> </tt>
+<a name="L905"></a><tt class="py-lineno"> 905</tt>  <tt class="py-line">            <tt class="py-name">nbyte</tt> <tt class="py-op">=</tt> <tt class="py-name">nbyte</tt> <tt class="py-op">+</tt> <tt class="py-number">1</tt> </tt>
+<a name="L906"></a><tt class="py-lineno"> 906</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">start</tt> <tt class="py-op">==</tt> <tt class="py-string">''</tt><tt class="py-op">:</tt> <tt class="py-keyword">break</tt> <tt class="py-comment"># at EOF</tt> </tt>
+<a name="L907"></a><tt class="py-lineno"> 907</tt>  <tt class="py-line">        <tt class="py-comment"># otherwise, start (='GRIB') contains indicator message (section 0)</tt> </tt>
+<a name="L908"></a><tt class="py-lineno"> 908</tt>  <tt class="py-line">        <tt class="py-name">startpos</tt> <tt class="py-op">=</tt> <tt class="py-name">f</tt><tt class="py-op">.</tt><tt class="py-name">tell</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">-</tt><tt class="py-number">4</tt> </tt>
+<a name="L909"></a><tt class="py-lineno"> 909</tt>  <tt class="py-line">        <tt class="py-name">f</tt><tt class="py-op">.</tt><tt class="py-name">seek</tt><tt class="py-op">(</tt><tt class="py-number">2</tt><tt class="py-op">,</tt><tt class="py-number">1</tt><tt class="py-op">)</tt>  <tt class="py-comment"># next two octets are reserved</tt> </tt>
+<a name="L910"></a><tt class="py-lineno"> 910</tt>  <tt class="py-line">        <tt class="py-comment"># get discipline info.</tt> </tt>
+<a name="L911"></a><tt class="py-lineno"> 911</tt>  <tt class="py-line">        <tt class="py-name">disciplines</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">struct</tt><tt class="py-op">.</tt><tt class="py-name">unpack</tt><tt class="py-op">(</tt><tt class="py-string">'>B'</tt><tt class="py-op">,</tt><tt class="py-name">f</tt><tt class="py-op">.</tt><tt class="py-name">read</tt><tt class="py-op">(</tt><tt class="py-number">1</t [...]
+<a name="L912"></a><tt class="py-lineno"> 912</tt>  <tt class="py-line">        <tt class="py-comment"># check to see it's a grib edition 2 file.</tt> </tt>
+<a name="L913"></a><tt class="py-lineno"> 913</tt>  <tt class="py-line">        <tt class="py-name">vers</tt> <tt class="py-op">=</tt> <tt class="py-name">struct</tt><tt class="py-op">.</tt><tt class="py-name">unpack</tt><tt class="py-op">(</tt><tt class="py-string">'>B'</tt><tt class="py-op">,</tt><tt class="py-name">f</tt><tt class="py-op">.</tt><tt class="py-name">read</tt><tt class="py-op">(</tt><tt class="py-number">1</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class= [...]
+<a name="L914"></a><tt class="py-lineno"> 914</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">vers</tt> <tt class="py-op">!=</tt> <tt class="py-number">2</tt><tt class="py-op">:</tt> </tt>
+<a name="L915"></a><tt class="py-lineno"> 915</tt>  <tt class="py-line">            <tt class="py-keyword">raise</tt> <tt class="py-name">IOError</tt><tt class="py-op">(</tt><tt class="py-string">'not a GRIB2 file (version number %d)'</tt> <tt class="py-op">%</tt> <tt class="py-name">vers</tt><tt class="py-op">)</tt> </tt>
+<a name="L916"></a><tt class="py-lineno"> 916</tt>  <tt class="py-line">        <tt class="py-name">lengrib</tt> <tt class="py-op">=</tt> <tt class="py-name">struct</tt><tt class="py-op">.</tt><tt class="py-name">unpack</tt><tt class="py-op">(</tt><tt class="py-string">'>q'</tt><tt class="py-op">,</tt><tt class="py-name">f</tt><tt class="py-op">.</tt><tt class="py-name">read</tt><tt class="py-op">(</tt><tt class="py-number">8</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt cla [...]
+<a name="L917"></a><tt class="py-lineno"> 917</tt>  <tt class="py-line">        <tt class="py-name">msglen</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">lengrib</tt><tt class="py-op">)</tt> </tt>
+<a name="L918"></a><tt class="py-lineno"> 918</tt>  <tt class="py-line">        <tt class="py-name">startingpos</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">startpos</tt><tt class="py-op">)</tt> </tt>
+<a name="L919"></a><tt class="py-lineno"> 919</tt>  <tt class="py-line">        <tt class="py-comment"># read in entire grib message.</tt> </tt>
+<a name="L920"></a><tt class="py-lineno"> 920</tt>  <tt class="py-line">        <tt class="py-name">f</tt><tt class="py-op">.</tt><tt class="py-name">seek</tt><tt class="py-op">(</tt><tt class="py-name">startpos</tt><tt class="py-op">)</tt> </tt>
+<a name="L921"></a><tt class="py-lineno"> 921</tt>  <tt class="py-line">        <tt class="py-name">gribmsg</tt> <tt class="py-op">=</tt> <tt class="py-name">f</tt><tt class="py-op">.</tt><tt class="py-name">read</tt><tt class="py-op">(</tt><tt class="py-name">lengrib</tt><tt class="py-op">)</tt> </tt>
+<a name="L922"></a><tt class="py-lineno"> 922</tt>  <tt class="py-line">        <tt class="py-comment"># make sure the message ends with '7777'</tt> </tt>
+<a name="L923"></a><tt class="py-lineno"> 923</tt>  <tt class="py-line">        <tt id="link-14" class="py-name" targets="Method ncepgrib2.Grib2Encode.end()=ncepgrib2.Grib2Encode-class.html#end"><a title="ncepgrib2.Grib2Encode.end" class="py-name" href="#" onclick="return doclink('link-14', 'end', 'link-14');">end</a></tt> <tt class="py-op">=</tt> <tt class="py-name">gribmsg</tt><tt class="py-op">[</tt><tt class="py-op">-</tt><tt class="py-number">4</tt><tt class="py-op">:</tt><tt class= [...]
+<a name="L924"></a><tt class="py-lineno"> 924</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt id="link-15" class="py-name"><a title="ncepgrib2.Grib2Encode.end" class="py-name" href="#" onclick="return doclink('link-15', 'end', 'link-14');">end</a></tt> <tt class="py-op">!=</tt> <tt class="py-string">'7777'</tt><tt class="py-op">:</tt> </tt>
+<a name="L925"></a><tt class="py-lineno"> 925</tt>  <tt class="py-line">           <tt class="py-keyword">raise</tt> <tt class="py-name">IOError</tt><tt class="py-op">(</tt><tt class="py-string">'partial GRIB message (no "7777" at end)'</tt><tt class="py-op">)</tt> </tt>
+<a name="L926"></a><tt class="py-lineno"> 926</tt>  <tt class="py-line">        <tt class="py-comment"># do next message.</tt> </tt>
+<a name="L927"></a><tt class="py-lineno"> 927</tt>  <tt class="py-line">        <tt class="py-name">nmsg</tt><tt class="py-op">=</tt><tt class="py-name">nmsg</tt><tt class="py-op">+</tt><tt class="py-number">1</tt> </tt>
+<a name="L928"></a><tt class="py-lineno"> 928</tt>  <tt class="py-line">    <tt class="py-comment"># if no grib messages found, nmsg is still 0 and it's not GRIB.</tt> </tt>
+<a name="L929"></a><tt class="py-lineno"> 929</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt class="py-name">nmsg</tt><tt class="py-op">==</tt><tt class="py-number">0</tt><tt class="py-op">:</tt> </tt>
+<a name="L930"></a><tt class="py-lineno"> 930</tt>  <tt class="py-line">       <tt class="py-keyword">raise</tt> <tt class="py-name">IOError</tt><tt class="py-op">(</tt><tt class="py-string">'not a GRIB file'</tt><tt class="py-op">)</tt> </tt>
+<a name="L931"></a><tt class="py-lineno"> 931</tt>  <tt class="py-line">    <tt class="py-comment"># now for each grib message, find number of fields.</tt> </tt>
+<a name="L932"></a><tt class="py-lineno"> 932</tt>  <tt class="py-line">    <tt class="py-name">numfields</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
+<a name="L933"></a><tt class="py-lineno"> 933</tt>  <tt class="py-line">    <tt class="py-name">f</tt><tt class="py-op">.</tt><tt class="py-name">seek</tt><tt class="py-op">(</tt><tt class="py-number">0</tt><tt class="py-op">)</tt> <tt class="py-comment"># rewind file.</tt> </tt>
+<a name="L934"></a><tt class="py-lineno"> 934</tt>  <tt class="py-line">    <tt class="py-keyword">for</tt> <tt class="py-name">n</tt> <tt class="py-keyword">in</tt> <tt class="py-name">range</tt><tt class="py-op">(</tt><tt class="py-name">nmsg</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
+<a name="L935"></a><tt class="py-lineno"> 935</tt>  <tt class="py-line">        <tt class="py-name">f</tt><tt class="py-op">.</tt><tt class="py-name">seek</tt><tt class="py-op">(</tt><tt class="py-name">startingpos</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
+<a name="L936"></a><tt class="py-lineno"> 936</tt>  <tt class="py-line">        <tt class="py-name">gribmsg</tt> <tt class="py-op">=</tt> <tt class="py-name">f</tt><tt class="py-op">.</tt><tt class="py-name">read</tt><tt class="py-op">(</tt><tt class="py-name">msglen</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
+<a name="L937"></a><tt class="py-lineno"> 937</tt>  <tt class="py-line">        <tt class="py-name">pos</tt> <tt class="py-op">=</tt> <tt class="py-number">0</tt> </tt>
+<a name="L938"></a><tt class="py-lineno"> 938</tt>  <tt class="py-line">        <tt class="py-name">numflds</tt> <tt class="py-op">=</tt> <tt class="py-number">0</tt> </tt>
+<a name="L939"></a><tt class="py-lineno"> 939</tt>  <tt class="py-line">        <tt class="py-keyword">while</tt> <tt class="py-number">1</tt><tt class="py-op">:</tt> </tt>
+<a name="L940"></a><tt class="py-lineno"> 940</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">gribmsg</tt><tt class="py-op">[</tt><tt class="py-name">pos</tt><tt class="py-op">:</tt><tt class="py-name">pos</tt><tt class="py-op">+</tt><tt class="py-number">4</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt class="py-name">decode</tt><tt class="py-op">(</tt><tt class="py-string">'ascii'</tt><tt class="py-op">,</tt><tt class="py-string">'ignor [...]
+<a name="L941"></a><tt class="py-lineno"> 941</tt>  <tt class="py-line">                <tt class="py-name">sectnum</tt> <tt class="py-op">=</tt> <tt class="py-number">0</tt> </tt>
+<a name="L942"></a><tt class="py-lineno"> 942</tt>  <tt class="py-line">                <tt class="py-name">lensect</tt> <tt class="py-op">=</tt> <tt class="py-number">16</tt> </tt>
+<a name="L943"></a><tt class="py-lineno"> 943</tt>  <tt class="py-line">            <tt class="py-keyword">elif</tt> <tt class="py-name">gribmsg</tt><tt class="py-op">[</tt><tt class="py-name">pos</tt><tt class="py-op">:</tt><tt class="py-name">pos</tt><tt class="py-op">+</tt><tt class="py-number">4</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt class="py-name">decode</tt><tt class="py-op">(</tt><tt class="py-string">'ascii'</tt><tt class="py-op">,</tt><tt class="py-string">'ign [...]
+<a name="L944"></a><tt class="py-lineno"> 944</tt>  <tt class="py-line">                <tt class="py-keyword">break</tt> </tt>
+<a name="L945"></a><tt class="py-lineno"> 945</tt>  <tt class="py-line">            <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
+<a name="L946"></a><tt class="py-lineno"> 946</tt>  <tt class="py-line">                <tt class="py-name">lensect</tt> <tt class="py-op">=</tt> <tt class="py-name">struct</tt><tt class="py-op">.</tt><tt class="py-name">unpack</tt><tt class="py-op">(</tt><tt class="py-string">'>i'</tt><tt class="py-op">,</tt><tt class="py-name">gribmsg</tt><tt class="py-op">[</tt><tt class="py-name">pos</tt><tt class="py-op">:</tt><tt class="py-name">pos</tt><tt class="py-op">+</tt><tt class="py-numb [...]
+<a name="L947"></a><tt class="py-lineno"> 947</tt>  <tt class="py-line">                <tt class="py-name">sectnum</tt> <tt class="py-op">=</tt> <tt class="py-name">struct</tt><tt class="py-op">.</tt><tt class="py-name">unpack</tt><tt class="py-op">(</tt><tt class="py-string">'>B'</tt><tt class="py-op">,</tt><tt class="py-name">gribmsg</tt><tt class="py-op">[</tt><tt class="py-name">pos</tt><tt class="py-op">+</tt><tt class="py-number">4</tt><tt class="py-op">:</tt><tt class="py-name [...]
+<a name="L948"></a><tt class="py-lineno"> 948</tt>  <tt class="py-line">                <tt class="py-keyword">if</tt> <tt class="py-name">sectnum</tt> <tt class="py-op">==</tt> <tt class="py-number">4</tt><tt class="py-op">:</tt> <tt class="py-name">numflds</tt><tt class="py-op">=</tt><tt class="py-name">numflds</tt><tt class="py-op">+</tt><tt class="py-number">1</tt> </tt>
+<a name="L949"></a><tt class="py-lineno"> 949</tt>  <tt class="py-line">                <tt class="py-comment">#if sectnum == 2: numlocal=numlocal+1</tt> </tt>
+<a name="L950"></a><tt class="py-lineno"> 950</tt>  <tt class="py-line">            <tt class="py-name">pos</tt> <tt class="py-op">=</tt> <tt class="py-name">pos</tt> <tt class="py-op">+</tt> <tt class="py-name">lensect</tt> </tt>
+<a name="L951"></a><tt class="py-lineno"> 951</tt>  <tt class="py-line">            <tt class="py-comment">#print sectnum,lensect,pos</tt> </tt>
+<a name="L952"></a><tt class="py-lineno"> 952</tt>  <tt class="py-line">        <tt class="py-comment">#print n+1,len(gribmsg),numfields,numlocal</tt> </tt>
+<a name="L953"></a><tt class="py-lineno"> 953</tt>  <tt class="py-line">        <tt class="py-name">numfields</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">numflds</tt><tt class="py-op">)</tt> </tt>
+<a name="L954"></a><tt class="py-lineno"> 954</tt>  <tt class="py-line">    <tt class="py-comment"># decode each section in grib message (sections 1 and above).</tt> </tt>
+<a name="L955"></a><tt class="py-lineno"> 955</tt>  <tt class="py-line">    <tt class="py-name">gdtnum</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> <tt class="py-comment"># grid defn template number from sxn 3</tt> </tt>
+<a name="L956"></a><tt class="py-lineno"> 956</tt>  <tt class="py-line">    <tt class="py-name">gdtmpl</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> <tt class="py-comment"># grid defn template from sxn 3</tt> </tt>
+<a name="L957"></a><tt class="py-lineno"> 957</tt>  <tt class="py-line">    <tt class="py-name">gdeflist</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> <tt class="py-comment"># optional grid definition list from sxn 3</tt> </tt>
+<a name="L958"></a><tt class="py-lineno"> 958</tt>  <tt class="py-line">    <tt class="py-name">gdsinfo</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> <tt class="py-comment"># grid definition section info from sxn3</tt> </tt>
+<a name="L959"></a><tt class="py-lineno"> 959</tt>  <tt class="py-line">    <tt class="py-name">pdtmpl</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> <tt class="py-comment"># product defn template from sxn 4</tt> </tt>
+<a name="L960"></a><tt class="py-lineno"> 960</tt>  <tt class="py-line">    <tt class="py-name">pdtnum</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> <tt class="py-comment"># product defn template number from sxn 4</tt> </tt>
+<a name="L961"></a><tt class="py-lineno"> 961</tt>  <tt class="py-line">    <tt class="py-name">coordlist</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> <tt class="py-comment"># vertical coordinate info from sxn 4</tt> </tt>
+<a name="L962"></a><tt class="py-lineno"> 962</tt>  <tt class="py-line">    <tt class="py-name">drtmpl</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> <tt class="py-comment"># data representation template from sxn 5</tt> </tt>
+<a name="L963"></a><tt class="py-lineno"> 963</tt>  <tt class="py-line">    <tt class="py-name">drtnum</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> <tt class="py-comment"># data representation template number from sxn 5</tt> </tt>
+<a name="L964"></a><tt class="py-lineno"> 964</tt>  <tt class="py-line">    <tt class="py-name">ndpts</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> <tt class="py-comment"># number of data points to be unpacked (from sxn 5)</tt> </tt>
+<a name="L965"></a><tt class="py-lineno"> 965</tt>  <tt class="py-line">    <tt class="py-name">bitmapflag</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> <tt class="py-comment"># bit-map indicator flag from sxn 6</tt> </tt>
+<a name="L966"></a><tt class="py-lineno"> 966</tt>  <tt class="py-line">    <tt class="py-name">bitmap</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> <tt class="py-comment"># bitmap from sxn 6.</tt> </tt>
+<a name="L967"></a><tt class="py-lineno"> 967</tt>  <tt class="py-line">    <tt class="py-name">pos7</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> <tt class="py-comment"># byte offset for section 7.</tt> </tt>
+<a name="L968"></a><tt class="py-lineno"> 968</tt>  <tt class="py-line">    <tt class="py-name">localsxn</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> <tt class="py-comment"># local use sections.</tt> </tt>
+<a name="L969"></a><tt class="py-lineno"> 969</tt>  <tt class="py-line">    <tt class="py-name">msgstart</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> <tt class="py-comment"># byte offset in file for message start.</tt> </tt>
+<a name="L970"></a><tt class="py-lineno"> 970</tt>  <tt class="py-line">    <tt class="py-name">msglength</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> <tt class="py-comment"># length of the message in bytes.</tt> </tt>
+<a name="L971"></a><tt class="py-lineno"> 971</tt>  <tt class="py-line">    <tt class="py-name">message</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> <tt class="py-comment"># the actual grib message.</tt> </tt>
+<a name="L972"></a><tt class="py-lineno"> 972</tt>  <tt class="py-line">    <tt class="py-name">identsect</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> <tt class="py-comment"># identification section (section 1).</tt> </tt>
+<a name="L973"></a><tt class="py-lineno"> 973</tt>  <tt class="py-line">    <tt class="py-name">discipline</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> <tt class="py-comment"># discipline code.</tt> </tt>
+<a name="L974"></a><tt class="py-lineno"> 974</tt>  <tt class="py-line">    <tt class="py-keyword">for</tt> <tt class="py-name">n</tt> <tt class="py-keyword">in</tt> <tt class="py-name">range</tt><tt class="py-op">(</tt><tt class="py-name">nmsg</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
+<a name="L975"></a><tt class="py-lineno"> 975</tt>  <tt class="py-line">        <tt class="py-name">spos</tt> <tt class="py-op">=</tt> <tt class="py-name">startingpos</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt> </tt>
+<a name="L976"></a><tt class="py-lineno"> 976</tt>  <tt class="py-line">        <tt class="py-name">lengrib</tt> <tt class="py-op">=</tt> <tt class="py-name">msglen</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt> </tt>
+<a name="L977"></a><tt class="py-lineno"> 977</tt>  <tt class="py-line">        <tt class="py-comment">#gribmsg = gribmsgs[n]</tt> </tt>
+<a name="L978"></a><tt class="py-lineno"> 978</tt>  <tt class="py-line">        <tt class="py-name">f</tt><tt class="py-op">.</tt><tt class="py-name">seek</tt><tt class="py-op">(</tt><tt class="py-name">spos</tt><tt class="py-op">)</tt> </tt>
+<a name="L979"></a><tt class="py-lineno"> 979</tt>  <tt class="py-line">        <tt class="py-name">gribmsg</tt> <tt class="py-op">=</tt> <tt class="py-name">f</tt><tt class="py-op">.</tt><tt class="py-name">read</tt><tt class="py-op">(</tt><tt class="py-name">lengrib</tt><tt class="py-op">)</tt> </tt>
+<a name="L980"></a><tt class="py-lineno"> 980</tt>  <tt class="py-line">        <tt class="py-name">discipl</tt> <tt class="py-op">=</tt> <tt class="py-name">disciplines</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt> </tt>
+<a name="L981"></a><tt class="py-lineno"> 981</tt>  <tt class="py-line">        <tt class="py-name">lensect0</tt> <tt class="py-op">=</tt> <tt class="py-number">16</tt> </tt>
+<a name="L982"></a><tt class="py-lineno"> 982</tt>  <tt class="py-line">        <tt class="py-comment"># get length of section 1 and section number.</tt> </tt>
+<a name="L983"></a><tt class="py-lineno"> 983</tt>  <tt class="py-line">        <tt class="py-comment">#lensect1 = struct.unpack('>i',gribmsg[lensect0:lensect0+4])[0]</tt> </tt>
+<a name="L984"></a><tt class="py-lineno"> 984</tt>  <tt class="py-line">        <tt class="py-comment">#sectnum1 = struct.unpack('>B',gribmsg[lensect0+4])[0]</tt> </tt>
+<a name="L985"></a><tt class="py-lineno"> 985</tt>  <tt class="py-line">        <tt class="py-comment">#print 'sectnum1, lensect1 = ',sectnum1,lensect1</tt> </tt>
+<a name="L986"></a><tt class="py-lineno"> 986</tt>  <tt class="py-line">        <tt class="py-comment"># unpack section 1, octets 1-21 (13 parameters).  This section</tt> </tt>
+<a name="L987"></a><tt class="py-lineno"> 987</tt>  <tt class="py-line">        <tt class="py-comment"># can occur only once per grib message.</tt> </tt>
+<a name="L988"></a><tt class="py-lineno"> 988</tt>  <tt class="py-line">        <tt class="py-comment">#idsect,pos = _unpack1(gribmsg,lensect0) # python version</tt> </tt>
+<a name="L989"></a><tt class="py-lineno"> 989</tt>  <tt class="py-line">        <tt class="py-name">idsect</tt><tt class="py-op">,</tt><tt class="py-name">pos</tt> <tt class="py-op">=</tt> <tt class="py-name">g2clib</tt><tt class="py-op">.</tt><tt class="py-name">unpack1</tt><tt class="py-op">(</tt><tt class="py-name">gribmsg</tt><tt class="py-op">,</tt><tt class="py-name">lensect0</tt><tt class="py-op">,</tt><tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">empty</t [...]
+<a name="L990"></a><tt class="py-lineno"> 990</tt>  <tt class="py-line">        <tt class="py-comment"># loop over rest of sections in message.</tt> </tt>
+<a name="L991"></a><tt class="py-lineno"> 991</tt>  <tt class="py-line">        <tt class="py-name">gdtnums</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
+<a name="L992"></a><tt class="py-lineno"> 992</tt>  <tt class="py-line">        <tt class="py-name">gdtmpls</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
+<a name="L993"></a><tt class="py-lineno"> 993</tt>  <tt class="py-line">        <tt class="py-name">gdeflists</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
+<a name="L994"></a><tt class="py-lineno"> 994</tt>  <tt class="py-line">        <tt class="py-name">gdsinfos</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
+<a name="L995"></a><tt class="py-lineno"> 995</tt>  <tt class="py-line">        <tt class="py-name">pdtmpls</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
+<a name="L996"></a><tt class="py-lineno"> 996</tt>  <tt class="py-line">        <tt class="py-name">coordlists</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
+<a name="L997"></a><tt class="py-lineno"> 997</tt>  <tt class="py-line">        <tt class="py-name">pdtnums</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
+<a name="L998"></a><tt class="py-lineno"> 998</tt>  <tt class="py-line">        <tt class="py-name">drtmpls</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
+<a name="L999"></a><tt class="py-lineno"> 999</tt>  <tt class="py-line">        <tt class="py-name">drtnums</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
+<a name="L1000"></a><tt class="py-lineno">1000</tt>  <tt class="py-line">        <tt class="py-name">ndptslist</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
+<a name="L1001"></a><tt class="py-lineno">1001</tt>  <tt class="py-line">        <tt class="py-name">bitmapflags</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
+<a name="L1002"></a><tt class="py-lineno">1002</tt>  <tt class="py-line">        <tt class="py-name">bitmaps</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
+<a name="L1003"></a><tt class="py-lineno">1003</tt>  <tt class="py-line">        <tt class="py-name">sxn7pos</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
+<a name="L1004"></a><tt class="py-lineno">1004</tt>  <tt class="py-line">        <tt class="py-name">localsxns</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
+<a name="L1005"></a><tt class="py-lineno">1005</tt>  <tt class="py-line">        <tt class="py-keyword">while</tt> <tt class="py-number">1</tt><tt class="py-op">:</tt> </tt>
+<a name="L1006"></a><tt class="py-lineno">1006</tt>  <tt class="py-line">            <tt class="py-comment"># check to see if this is the end of the message.</tt> </tt>
+<a name="L1007"></a><tt class="py-lineno">1007</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">gribmsg</tt><tt class="py-op">[</tt><tt class="py-name">pos</tt><tt class="py-op">:</tt><tt class="py-name">pos</tt><tt class="py-op">+</tt><tt class="py-number">4</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt class="py-name">decode</tt><tt class="py-op">(</tt><tt class="py-string">'ascii'</tt><tt class="py-op">,</tt><tt class="py-string">'igno [...]
+<a name="L1008"></a><tt class="py-lineno">1008</tt>  <tt class="py-line">            <tt class="py-name">lensect</tt> <tt class="py-op">=</tt> <tt class="py-name">struct</tt><tt class="py-op">.</tt><tt class="py-name">unpack</tt><tt class="py-op">(</tt><tt class="py-string">'>i'</tt><tt class="py-op">,</tt><tt class="py-name">gribmsg</tt><tt class="py-op">[</tt><tt class="py-name">pos</tt><tt class="py-op">:</tt><tt class="py-name">pos</tt><tt class="py-op">+</tt><tt class="py-number" [...]
+<a name="L1009"></a><tt class="py-lineno">1009</tt>  <tt class="py-line">            <tt class="py-name">sectnum</tt> <tt class="py-op">=</tt> <tt class="py-name">struct</tt><tt class="py-op">.</tt><tt class="py-name">unpack</tt><tt class="py-op">(</tt><tt class="py-string">'>B'</tt><tt class="py-op">,</tt><tt class="py-name">gribmsg</tt><tt class="py-op">[</tt><tt class="py-name">pos</tt><tt class="py-op">+</tt><tt class="py-number">4</tt><tt class="py-op">:</tt><tt class="py-name">p [...]
+<a name="L1010"></a><tt class="py-lineno">1010</tt>  <tt class="py-line">            <tt class="py-comment"># section 2, local use section.</tt> </tt>
+<a name="L1011"></a><tt class="py-lineno">1011</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">sectnum</tt> <tt class="py-op">==</tt> <tt class="py-number">2</tt><tt class="py-op">:</tt> </tt>
+<a name="L1012"></a><tt class="py-lineno">1012</tt>  <tt class="py-line">                <tt class="py-comment"># "local use section", used by NDFD to store WX</tt> </tt>
+<a name="L1013"></a><tt class="py-lineno">1013</tt>  <tt class="py-line">                <tt class="py-comment"># strings.  This section is returned as a raw</tt> </tt>
+<a name="L1014"></a><tt class="py-lineno">1014</tt>  <tt class="py-line">                <tt class="py-comment"># bytestring for further dataset-specific parsing,</tt> </tt>
+<a name="L1015"></a><tt class="py-lineno">1015</tt>  <tt class="py-line">                <tt class="py-comment"># not as a numpy array.</tt> </tt>
+<a name="L1016"></a><tt class="py-lineno">1016</tt>  <tt class="py-line">                <tt class="py-name">localsxns</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">gribmsg</tt><tt class="py-op">[</tt><tt class="py-name">pos</tt><tt class="py-op">+</tt><tt class="py-number">5</tt><tt class="py-op">:</tt><tt class="py-name">pos</tt><tt class="py-op">+</tt><tt class="py-name">lensect</tt><tt class="py-op">]</tt><tt class="py-op">)</t [...]
+<a name="L1017"></a><tt class="py-lineno">1017</tt>  <tt class="py-line">                <tt class="py-name">pos</tt> <tt class="py-op">=</tt> <tt class="py-name">pos</tt> <tt class="py-op">+</tt> <tt class="py-name">lensect</tt> </tt>
+<a name="L1018"></a><tt class="py-lineno">1018</tt>  <tt class="py-line">            <tt class="py-comment"># section 3, grid definition section.</tt> </tt>
+<a name="L1019"></a><tt class="py-lineno">1019</tt>  <tt class="py-line">            <tt class="py-keyword">elif</tt> <tt class="py-name">sectnum</tt> <tt class="py-op">==</tt> <tt class="py-number">3</tt><tt class="py-op">:</tt> </tt>
+<a name="L1020"></a><tt class="py-lineno">1020</tt>  <tt class="py-line">                <tt class="py-name">gds</tt><tt class="py-op">,</tt><tt class="py-name">gdtempl</tt><tt class="py-op">,</tt><tt class="py-name">deflist</tt><tt class="py-op">,</tt><tt class="py-name">pos</tt> <tt class="py-op">=</tt> <tt class="py-name">g2clib</tt><tt class="py-op">.</tt><tt class="py-name">unpack3</tt><tt class="py-op">(</tt><tt class="py-name">gribmsg</tt><tt class="py-op">,</tt><tt class="py-name [...]
+<a name="L1021"></a><tt class="py-lineno">1021</tt>  <tt class="py-line">                <tt class="py-name">gdtnums</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">gds</tt><tt class="py-op">[</tt><tt class="py-number">4</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
+<a name="L1022"></a><tt class="py-lineno">1022</tt>  <tt class="py-line">                <tt class="py-name">gdtmpls</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">gdtempl</tt><tt class="py-op">)</tt> </tt>
+<a name="L1023"></a><tt class="py-lineno">1023</tt>  <tt class="py-line">                <tt class="py-name">gdeflists</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">deflist</tt><tt class="py-op">)</tt> </tt>
+<a name="L1024"></a><tt class="py-lineno">1024</tt>  <tt class="py-line">                <tt class="py-name">gdsinfos</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">gds</tt><tt class="py-op">)</tt> </tt>
+<a name="L1025"></a><tt class="py-lineno">1025</tt>  <tt class="py-line">            <tt class="py-comment"># section, product definition section.</tt> </tt>
+<a name="L1026"></a><tt class="py-lineno">1026</tt>  <tt class="py-line">            <tt class="py-keyword">elif</tt> <tt class="py-name">sectnum</tt> <tt class="py-op">==</tt> <tt class="py-number">4</tt><tt class="py-op">:</tt> </tt>
+<a name="L1027"></a><tt class="py-lineno">1027</tt>  <tt class="py-line">                <tt class="py-name">pdtempl</tt><tt class="py-op">,</tt><tt class="py-name">pdtn</tt><tt class="py-op">,</tt><tt class="py-name">coordlst</tt><tt class="py-op">,</tt><tt class="py-name">pos</tt> <tt class="py-op">=</tt> <tt class="py-name">g2clib</tt><tt class="py-op">.</tt><tt class="py-name">unpack4</tt><tt class="py-op">(</tt><tt class="py-name">gribmsg</tt><tt class="py-op">,</tt><tt class="py-na [...]
+<a name="L1028"></a><tt class="py-lineno">1028</tt>  <tt class="py-line">                <tt class="py-name">pdtmpls</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">pdtempl</tt><tt class="py-op">)</tt> </tt>
+<a name="L1029"></a><tt class="py-lineno">1029</tt>  <tt class="py-line">                <tt class="py-name">coordlists</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">coordlst</tt><tt class="py-op">)</tt> </tt>
+<a name="L1030"></a><tt class="py-lineno">1030</tt>  <tt class="py-line">                <tt class="py-name">pdtnums</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">pdtn</tt><tt class="py-op">)</tt> </tt>
+<a name="L1031"></a><tt class="py-lineno">1031</tt>  <tt class="py-line">            <tt class="py-comment"># section 5, data representation section.</tt> </tt>
+<a name="L1032"></a><tt class="py-lineno">1032</tt>  <tt class="py-line">            <tt class="py-keyword">elif</tt> <tt class="py-name">sectnum</tt> <tt class="py-op">==</tt> <tt class="py-number">5</tt><tt class="py-op">:</tt> </tt>
+<a name="L1033"></a><tt class="py-lineno">1033</tt>  <tt class="py-line">                <tt class="py-name">drtempl</tt><tt class="py-op">,</tt><tt class="py-name">drtn</tt><tt class="py-op">,</tt><tt class="py-name">npts</tt><tt class="py-op">,</tt><tt class="py-name">pos</tt> <tt class="py-op">=</tt> <tt class="py-name">g2clib</tt><tt class="py-op">.</tt><tt class="py-name">unpack5</tt><tt class="py-op">(</tt><tt class="py-name">gribmsg</tt><tt class="py-op">,</tt><tt class="py-name"> [...]
+<a name="L1034"></a><tt class="py-lineno">1034</tt>  <tt class="py-line">                <tt class="py-name">drtmpls</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">drtempl</tt><tt class="py-op">)</tt> </tt>
+<a name="L1035"></a><tt class="py-lineno">1035</tt>  <tt class="py-line">                <tt class="py-name">drtnums</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">drtn</tt><tt class="py-op">)</tt> </tt>
+<a name="L1036"></a><tt class="py-lineno">1036</tt>  <tt class="py-line">                <tt class="py-name">ndptslist</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">npts</tt><tt class="py-op">)</tt> </tt>
+<a name="L1037"></a><tt class="py-lineno">1037</tt>  <tt class="py-line">            <tt class="py-comment"># section 6, bit-map section.</tt> </tt>
+<a name="L1038"></a><tt class="py-lineno">1038</tt>  <tt class="py-line">            <tt class="py-keyword">elif</tt> <tt class="py-name">sectnum</tt> <tt class="py-op">==</tt> <tt class="py-number">6</tt><tt class="py-op">:</tt> </tt>
+<a name="L1039"></a><tt class="py-lineno">1039</tt>  <tt class="py-line">                <tt class="py-name">bmap</tt><tt class="py-op">,</tt><tt class="py-name">bmapflag</tt> <tt class="py-op">=</tt> <tt class="py-name">g2clib</tt><tt class="py-op">.</tt><tt class="py-name">unpack6</tt><tt class="py-op">(</tt><tt class="py-name">gribmsg</tt><tt class="py-op">,</tt><tt class="py-name">gds</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">,< [...]
+<a name="L1040"></a><tt class="py-lineno">1040</tt>  <tt class="py-line">                <tt class="py-comment">#bitmapflag = struct.unpack('>B',gribmsg[pos+5])[0]</tt> </tt>
+<a name="L1041"></a><tt class="py-lineno">1041</tt>  <tt class="py-line">                <tt class="py-keyword">if</tt> <tt class="py-name">bmapflag</tt> <tt class="py-op">==</tt> <tt class="py-number">0</tt><tt class="py-op">:</tt> </tt>
+<a name="L1042"></a><tt class="py-lineno">1042</tt>  <tt class="py-line">                    <tt class="py-name">bitmaps</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">bmap</tt><tt class="py-op">.</tt><tt class="py-name">astype</tt><tt class="py-op">(</tt><tt class="py-string">'b'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
+<a name="L1043"></a><tt class="py-lineno">1043</tt>  <tt class="py-line">                <tt class="py-comment"># use last defined bitmap.</tt> </tt>
+<a name="L1044"></a><tt class="py-lineno">1044</tt>  <tt class="py-line">                <tt class="py-keyword">elif</tt> <tt class="py-name">bmapflag</tt> <tt class="py-op">==</tt> <tt class="py-number">254</tt><tt class="py-op">:</tt> </tt>
+<a name="L1045"></a><tt class="py-lineno">1045</tt>  <tt class="py-line">                    <tt class="py-name">bmapflag</tt> <tt class="py-op">=</tt> <tt class="py-number">0</tt> </tt>
+<a name="L1046"></a><tt class="py-lineno">1046</tt>  <tt class="py-line">                    <tt class="py-keyword">for</tt> <tt class="py-name">bmp</tt> <tt class="py-keyword">in</tt> <tt class="py-name">bitmaps</tt><tt class="py-op">[</tt><tt class="py-op">:</tt><tt class="py-op">:</tt><tt class="py-op">-</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">:</tt> </tt>
+<a name="L1047"></a><tt class="py-lineno">1047</tt>  <tt class="py-line">                        <tt class="py-keyword">if</tt> <tt class="py-name">bmp</tt> <tt class="py-keyword">is</tt> <tt class="py-keyword">not</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> <tt class="py-name">bitmaps</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">bmp</tt><tt class="py-op">)</tt> </tt>
+<a name="L1048"></a><tt class="py-lineno">1048</tt>  <tt class="py-line">                <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
+<a name="L1049"></a><tt class="py-lineno">1049</tt>  <tt class="py-line">                    <tt class="py-name">bitmaps</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">None</tt><tt class="py-op">)</tt> </tt>
+<a name="L1050"></a><tt class="py-lineno">1050</tt>  <tt class="py-line">                <tt class="py-name">bitmapflags</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">bmapflag</tt><tt class="py-op">)</tt> </tt>
+<a name="L1051"></a><tt class="py-lineno">1051</tt>  <tt class="py-line">                <tt class="py-name">pos</tt> <tt class="py-op">=</tt> <tt class="py-name">pos</tt> <tt class="py-op">+</tt> <tt class="py-name">lensect</tt> </tt>
+<a name="L1052"></a><tt class="py-lineno">1052</tt>  <tt class="py-line">            <tt class="py-comment"># section 7, data section (nothing done here,</tt> </tt>
+<a name="L1053"></a><tt class="py-lineno">1053</tt>  <tt class="py-line">            <tt class="py-comment"># data unpacked when getfld method is invoked).</tt> </tt>
+<a name="L1054"></a><tt class="py-lineno">1054</tt>  <tt class="py-line">            <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
+<a name="L1055"></a><tt class="py-lineno">1055</tt>  <tt class="py-line">                <tt class="py-keyword">if</tt> <tt class="py-name">sectnum</tt> <tt class="py-op">!=</tt> <tt class="py-number">7</tt><tt class="py-op">:</tt> </tt>
+<a name="L1056"></a><tt class="py-lineno">1056</tt>  <tt class="py-line">                   <tt class="py-name">msg</tt> <tt class="py-op">=</tt> <tt class="py-string">'unknown section = %i'</tt> <tt class="py-op">%</tt> <tt class="py-name">sectnum</tt> </tt>
+<a name="L1057"></a><tt class="py-lineno">1057</tt>  <tt class="py-line">                   <tt class="py-keyword">raise</tt> <tt class="py-name">ValueError</tt><tt class="py-op">(</tt><tt class="py-name">msg</tt><tt class="py-op">)</tt> </tt>
+<a name="L1058"></a><tt class="py-lineno">1058</tt>  <tt class="py-line">                <tt class="py-name">sxn7pos</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">pos</tt><tt class="py-op">)</tt> </tt>
+<a name="L1059"></a><tt class="py-lineno">1059</tt>  <tt class="py-line">                <tt class="py-name">pos</tt> <tt class="py-op">=</tt> <tt class="py-name">pos</tt> <tt class="py-op">+</tt> <tt class="py-name">lensect</tt> </tt>
+<a name="L1060"></a><tt class="py-lineno">1060</tt>  <tt class="py-line">        <tt class="py-comment"># extend by repeating last value for all remaining fields.</tt> </tt>
+<a name="L1061"></a><tt class="py-lineno">1061</tt>  <tt class="py-line">        <tt class="py-name">gdtnum</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">_repeatlast</tt><tt class="py-op">(</tt><tt class="py-name">numfields</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">gdtnums</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
+<a name="L1062"></a><tt class="py-lineno">1062</tt>  <tt class="py-line">        <tt class="py-name">gdtmpl</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">_repeatlast</tt><tt class="py-op">(</tt><tt class="py-name">numfields</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">gdtmpls</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
+<a name="L1063"></a><tt class="py-lineno">1063</tt>  <tt class="py-line">        <tt class="py-name">gdeflist</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">_repeatlast</tt><tt class="py-op">(</tt><tt class="py-name">numfields</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">gdeflists</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
+<a name="L1064"></a><tt class="py-lineno">1064</tt>  <tt class="py-line">        <tt class="py-name">gdsinfo</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">_repeatlast</tt><tt class="py-op">(</tt><tt class="py-name">numfields</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">gdsinfos</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
+<a name="L1065"></a><tt class="py-lineno">1065</tt>  <tt class="py-line">        <tt class="py-name">pdtmpl</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">_repeatlast</tt><tt class="py-op">(</tt><tt class="py-name">numfields</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">pdtmpls</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
+<a name="L1066"></a><tt class="py-lineno">1066</tt>  <tt class="py-line">        <tt class="py-name">pdtnum</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">_repeatlast</tt><tt class="py-op">(</tt><tt class="py-name">numfields</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">pdtnums</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
+<a name="L1067"></a><tt class="py-lineno">1067</tt>  <tt class="py-line">        <tt class="py-name">coordlist</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">_repeatlast</tt><tt class="py-op">(</tt><tt class="py-name">numfields</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">coordlists</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
+<a name="L1068"></a><tt class="py-lineno">1068</tt>  <tt class="py-line">        <tt class="py-name">drtmpl</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">_repeatlast</tt><tt class="py-op">(</tt><tt class="py-name">numfields</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">drtmpls</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
+<a name="L1069"></a><tt class="py-lineno">1069</tt>  <tt class="py-line">        <tt class="py-name">drtnum</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">_repeatlast</tt><tt class="py-op">(</tt><tt class="py-name">numfields</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">drtnums</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
+<a name="L1070"></a><tt class="py-lineno">1070</tt>  <tt class="py-line">        <tt class="py-name">ndpts</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">_repeatlast</tt><tt class="py-op">(</tt><tt class="py-name">numfields</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">ndptslist</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
+<a name="L1071"></a><tt class="py-lineno">1071</tt>  <tt class="py-line">        <tt class="py-name">bitmapflag</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">_repeatlast</tt><tt class="py-op">(</tt><tt class="py-name">numfields</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">bitmapflags</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
+<a name="L1072"></a><tt class="py-lineno">1072</tt>  <tt class="py-line">        <tt class="py-name">bitmap</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">_repeatlast</tt><tt class="py-op">(</tt><tt class="py-name">numfields</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">bitmaps</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
+<a name="L1073"></a><tt class="py-lineno">1073</tt>  <tt class="py-line">        <tt class="py-name">pos7</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">_repeatlast</tt><tt class="py-op">(</tt><tt class="py-name">numfields</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">sxn7pos</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
+<a name="L1074"></a><tt class="py-lineno">1074</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">localsxns</tt><tt class="py-op">)</tt> <tt class="py-op">==</tt> <tt class="py-number">0</tt><tt class="py-op">:</tt> </tt>
+<a name="L1075"></a><tt class="py-lineno">1075</tt>  <tt class="py-line">            <tt class="py-name">localsxns</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-name">None</tt><tt class="py-op">]</tt> </tt>
+<a name="L1076"></a><tt class="py-lineno">1076</tt>  <tt class="py-line">        <tt class="py-name">localsxn</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">_repeatlast</tt><tt class="py-op">(</tt><tt class="py-name">numfields</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">localsxns</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
+<a name="L1077"></a><tt class="py-lineno">1077</tt>  <tt class="py-line">        <tt class="py-name">msgstart</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">_repeatlast</tt><tt class="py-op">(</tt><tt class="py-name">numfields</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-op">[</tt><tt class="py-name">spos</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt cl [...]
+<a name="L1078"></a><tt class="py-lineno">1078</tt>  <tt class="py-line">        <tt class="py-name">msglength</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">_repeatlast</tt><tt class="py-op">(</tt><tt class="py-name">numfields</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-op">[</tt><tt class="py-name">lengrib</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><t [...]
+<a name="L1079"></a><tt class="py-lineno">1079</tt>  <tt class="py-line">        <tt class="py-name">identsect</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">_repeatlast</tt><tt class="py-op">(</tt><tt class="py-name">numfields</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-op">[</tt><tt class="py-name">idsect</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt [...]
+<a name="L1080"></a><tt class="py-lineno">1080</tt>  <tt class="py-line">        <tt class="py-name">discipline</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">_repeatlast</tt><tt class="py-op">(</tt><tt class="py-name">numfields</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-op">[</tt><tt class="py-name">discipl</tt><tt class="py-op">]</tt><tt class="py-op">)</tt>< [...]
+<a name="L1081"></a><tt class="py-lineno">1081</tt>  <tt class="py-line"> </tt>
+<a name="L1082"></a><tt class="py-lineno">1082</tt>  <tt class="py-line">    <tt class="py-name">gdtnum</tt> <tt class="py-op">=</tt> <tt class="py-name">_flatten</tt><tt class="py-op">(</tt><tt class="py-name">gdtnum</tt><tt class="py-op">)</tt> </tt>
+<a name="L1083"></a><tt class="py-lineno">1083</tt>  <tt class="py-line">    <tt class="py-name">gdtmpl</tt> <tt class="py-op">=</tt> <tt class="py-name">_flatten</tt><tt class="py-op">(</tt><tt class="py-name">gdtmpl</tt><tt class="py-op">)</tt> </tt>
+<a name="L1084"></a><tt class="py-lineno">1084</tt>  <tt class="py-line">    <tt class="py-name">gdeflist</tt> <tt class="py-op">=</tt> <tt class="py-name">_flatten</tt><tt class="py-op">(</tt><tt class="py-name">gdeflist</tt><tt class="py-op">)</tt> </tt>
+<a name="L1085"></a><tt class="py-lineno">1085</tt>  <tt class="py-line">    <tt class="py-name">gdsinfo</tt> <tt class="py-op">=</tt> <tt class="py-name">_flatten</tt><tt class="py-op">(</tt><tt class="py-name">gdsinfo</tt><tt class="py-op">)</tt> </tt>
+<a name="L1086"></a><tt class="py-lineno">1086</tt>  <tt class="py-line">    <tt class="py-name">pdtmpl</tt> <tt class="py-op">=</tt> <tt class="py-name">_flatten</tt><tt class="py-op">(</tt><tt class="py-name">pdtmpl</tt><tt class="py-op">)</tt> </tt>
+<a name="L1087"></a><tt class="py-lineno">1087</tt>  <tt class="py-line">    <tt class="py-name">pdtnum</tt> <tt class="py-op">=</tt> <tt class="py-name">_flatten</tt><tt class="py-op">(</tt><tt class="py-name">pdtnum</tt><tt class="py-op">)</tt> </tt>
+<a name="L1088"></a><tt class="py-lineno">1088</tt>  <tt class="py-line">    <tt class="py-name">coordlist</tt> <tt class="py-op">=</tt> <tt class="py-name">_flatten</tt><tt class="py-op">(</tt><tt class="py-name">coordlist</tt><tt class="py-op">)</tt> </tt>
+<a name="L1089"></a><tt class="py-lineno">1089</tt>  <tt class="py-line">    <tt class="py-name">drtmpl</tt> <tt class="py-op">=</tt> <tt class="py-name">_flatten</tt><tt class="py-op">(</tt><tt class="py-name">drtmpl</tt><tt class="py-op">)</tt> </tt>
+<a name="L1090"></a><tt class="py-lineno">1090</tt>  <tt class="py-line">    <tt class="py-name">drtnum</tt> <tt class="py-op">=</tt> <tt class="py-name">_flatten</tt><tt class="py-op">(</tt><tt class="py-name">drtnum</tt><tt class="py-op">)</tt> </tt>
+<a name="L1091"></a><tt class="py-lineno">1091</tt>  <tt class="py-line">    <tt class="py-name">ndpts</tt> <tt class="py-op">=</tt> <tt class="py-name">_flatten</tt><tt class="py-op">(</tt><tt class="py-name">ndpts</tt><tt class="py-op">)</tt> </tt>
+<a name="L1092"></a><tt class="py-lineno">1092</tt>  <tt class="py-line">    <tt class="py-name">bitmapflag</tt> <tt class="py-op">=</tt> <tt class="py-name">_flatten</tt><tt class="py-op">(</tt><tt class="py-name">bitmapflag</tt><tt class="py-op">)</tt> </tt>
+<a name="L1093"></a><tt class="py-lineno">1093</tt>  <tt class="py-line">    <tt class="py-name">bitmap</tt> <tt class="py-op">=</tt> <tt class="py-name">_flatten</tt><tt class="py-op">(</tt><tt class="py-name">bitmap</tt><tt class="py-op">)</tt> </tt>
+<a name="L1094"></a><tt class="py-lineno">1094</tt>  <tt class="py-line">    <tt class="py-name">pos7</tt> <tt class="py-op">=</tt> <tt class="py-name">_flatten</tt><tt class="py-op">(</tt><tt class="py-name">pos7</tt><tt class="py-op">)</tt> </tt>
+<a name="L1095"></a><tt class="py-lineno">1095</tt>  <tt class="py-line">    <tt class="py-name">localsxn</tt> <tt class="py-op">=</tt> <tt class="py-name">_flatten</tt><tt class="py-op">(</tt><tt class="py-name">localsxn</tt><tt class="py-op">)</tt> </tt>
+<a name="L1096"></a><tt class="py-lineno">1096</tt>  <tt class="py-line">    <tt class="py-name">msgstart</tt> <tt class="py-op">=</tt> <tt class="py-name">_flatten</tt><tt class="py-op">(</tt><tt class="py-name">msgstart</tt><tt class="py-op">)</tt> </tt>
+<a name="L1097"></a><tt class="py-lineno">1097</tt>  <tt class="py-line">    <tt class="py-name">msglength</tt> <tt class="py-op">=</tt> <tt class="py-name">_flatten</tt><tt class="py-op">(</tt><tt class="py-name">msglength</tt><tt class="py-op">)</tt> </tt>
+<a name="L1098"></a><tt class="py-lineno">1098</tt>  <tt class="py-line">    <tt class="py-name">identsect</tt> <tt class="py-op">=</tt> <tt class="py-name">_flatten</tt><tt class="py-op">(</tt><tt class="py-name">identsect</tt><tt class="py-op">)</tt> </tt>
+<a name="L1099"></a><tt class="py-lineno">1099</tt>  <tt class="py-line">    <tt class="py-name">discipline</tt> <tt class="py-op">=</tt> <tt class="py-name">_flatten</tt><tt class="py-op">(</tt><tt class="py-name">discipline</tt><tt class="py-op">)</tt> </tt>
+<a name="L1100"></a><tt class="py-lineno">1100</tt>  <tt class="py-line"> </tt>
+<a name="L1101"></a><tt class="py-lineno">1101</tt>  <tt class="py-line">    <tt class="py-name">gribs</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
+<a name="L1102"></a><tt class="py-lineno">1102</tt>  <tt class="py-line">    <tt class="py-keyword">for</tt> <tt class="py-name">n</tt> <tt class="py-keyword">in</tt> <tt class="py-name">range</tt><tt class="py-op">(</tt><tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">msgstart</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
+<a name="L1103"></a><tt class="py-lineno">1103</tt>  <tt class="py-line">        <tt class="py-name">kwargs</tt> <tt class="py-op">=</tt> <tt class="py-op">{</tt><tt class="py-op">}</tt> </tt>
+<a name="L1104"></a><tt class="py-lineno">1104</tt>  <tt class="py-line">        <tt class="py-name">kwargs</tt><tt class="py-op">[</tt><tt class="py-string">'originating_center'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt id="link-16" class="py-name"><a title="ncepgrib2._table0" class="py-name" href="#" onclick="return doclink('link-16', '_table0', 'link-9');">_table0</a></tt><tt class="py-op">[</tt><tt class="py-name">identsect</tt><tt class="py-op">[</tt><tt class="py-name [...]
+<a name="L1105"></a><tt class="py-lineno">1105</tt>  <tt class="py-line">        <tt class="py-name">wmo_code</tt> <tt class="py-op">=</tt> <tt id="link-17" class="py-name"><a title="ncepgrib2._table0" class="py-name" href="#" onclick="return doclink('link-17', '_table0', 'link-9');">_table0</a></tt><tt class="py-op">[</tt><tt class="py-name">identsect</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt cla [...]
+<a name="L1106"></a><tt class="py-lineno">1106</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">wmo_code</tt> <tt class="py-keyword">is</tt> <tt class="py-keyword">not</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
+<a name="L1107"></a><tt class="py-lineno">1107</tt>  <tt class="py-line">            <tt class="py-name">kwargs</tt><tt class="py-op">[</tt><tt class="py-string">'center_wmo_code'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">wmo_code</tt> </tt>
+<a name="L1108"></a><tt class="py-lineno">1108</tt>  <tt class="py-line">        <tt class="py-name">kwargs</tt><tt class="py-op">[</tt><tt class="py-string">'grid_definition_template_number'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">gdtnum</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt> </tt>
+<a name="L1109"></a><tt class="py-lineno">1109</tt>  <tt class="py-line">        <tt class="py-name">kwargs</tt><tt class="py-op">[</tt><tt class="py-string">'grid_definition_template'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">gdtmpl</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt> </tt>
+<a name="L1110"></a><tt class="py-lineno">1110</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">gdeflist</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt> <tt class="py-op">!=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt><tt class="py-op">:</tt> </tt>
+<a name="L1111"></a><tt class="py-lineno">1111</tt>  <tt class="py-line">            <tt class="py-name">kwargs</tt><tt class="py-op">[</tt><tt class="py-string">'grid_definition_list'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">gdeflist</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt> </tt>
+<a name="L1112"></a><tt class="py-lineno">1112</tt>  <tt class="py-line">        <tt class="py-name">kwargs</tt><tt class="py-op">[</tt><tt class="py-string">'grid_definition_info'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">gdsinfo</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt> </tt>
+<a name="L1113"></a><tt class="py-lineno">1113</tt>  <tt class="py-line">        <tt class="py-name">kwargs</tt><tt class="py-op">[</tt><tt class="py-string">'discipline_code'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">discipline</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt> </tt>
+<a name="L1114"></a><tt class="py-lineno">1114</tt>  <tt class="py-line">        <tt class="py-name">kwargs</tt><tt class="py-op">[</tt><tt class="py-string">'product_definition_template_number'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">pdtnum</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt> </tt>
+<a name="L1115"></a><tt class="py-lineno">1115</tt>  <tt class="py-line">        <tt class="py-name">kwargs</tt><tt class="py-op">[</tt><tt class="py-string">'product_definition_template'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">pdtmpl</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt> </tt>
+<a name="L1116"></a><tt class="py-lineno">1116</tt>  <tt class="py-line">        <tt class="py-name">kwargs</tt><tt class="py-op">[</tt><tt class="py-string">'data_representation_template_number'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">drtnum</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt> </tt>
+<a name="L1117"></a><tt class="py-lineno">1117</tt>  <tt class="py-line">        <tt class="py-name">kwargs</tt><tt class="py-op">[</tt><tt class="py-string">'data_representation_template'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">drtmpl</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt> </tt>
+<a name="L1118"></a><tt class="py-lineno">1118</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">coordlist</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt> <tt class="py-op">!=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt><tt class="py-op">:</tt> </tt>
+<a name="L1119"></a><tt class="py-lineno">1119</tt>  <tt class="py-line">            <tt class="py-name">kwargs</tt><tt class="py-op">[</tt><tt class="py-string">'extra_vertical_coordinate_info'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">coordlist</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt> </tt>
+<a name="L1120"></a><tt class="py-lineno">1120</tt>  <tt class="py-line">        <tt class="py-name">kwargs</tt><tt class="py-op">[</tt><tt class="py-string">'number_of_data_points_to_unpack'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">ndpts</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt> </tt>
+<a name="L1121"></a><tt class="py-lineno">1121</tt>  <tt class="py-line">        <tt class="py-name">kwargs</tt><tt class="py-op">[</tt><tt class="py-string">'bitmap_indicator_flag'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">bitmapflag</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt> </tt>
+<a name="L1122"></a><tt class="py-lineno">1122</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">bitmap</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt> <tt class="py-keyword">is</tt> <tt class="py-keyword">not</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt><tt class="py-op">:</tt> </tt>
+<a name="L1123"></a><tt class="py-lineno">1123</tt>  <tt class="py-line">            <tt class="py-name">kwargs</tt><tt class="py-op">[</tt><tt class="py-string">'_bitmap'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">bitmap</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt> </tt>
+<a name="L1124"></a><tt class="py-lineno">1124</tt>  <tt class="py-line">        <tt class="py-name">kwargs</tt><tt class="py-op">[</tt><tt class="py-string">'_section7_byte_offset'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">pos7</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt> </tt>
+<a name="L1125"></a><tt class="py-lineno">1125</tt>  <tt class="py-line">        <tt class="py-name">kwargs</tt><tt class="py-op">[</tt><tt class="py-string">'_grib_message_byteoffset'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">msgstart</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt> </tt>
+<a name="L1126"></a><tt class="py-lineno">1126</tt>  <tt class="py-line">        <tt class="py-name">kwargs</tt><tt class="py-op">[</tt><tt class="py-string">'_grib_message_length'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">msglength</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt> </tt>
+<a name="L1127"></a><tt class="py-lineno">1127</tt>  <tt class="py-line">        <tt class="py-name">kwargs</tt><tt class="py-op">[</tt><tt class="py-string">'_grib_filename'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">filename</tt> </tt>
+<a name="L1128"></a><tt class="py-lineno">1128</tt>  <tt class="py-line">        <tt class="py-name">kwargs</tt><tt class="py-op">[</tt><tt class="py-string">'identification_section'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">identsect</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt> </tt>
+<a name="L1129"></a><tt class="py-lineno">1129</tt>  <tt class="py-line">        <tt class="py-name">kwargs</tt><tt class="py-op">[</tt><tt class="py-string">'_grib_message_number'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">n</tt><tt class="py-op">+</tt><tt class="py-number">1</tt> </tt>
+<a name="L1130"></a><tt class="py-lineno">1130</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">localsxn</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt> <tt class="py-keyword">is</tt> <tt class="py-keyword">not</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
+<a name="L1131"></a><tt class="py-lineno">1131</tt>  <tt class="py-line">            <tt class="py-name">kwargs</tt><tt class="py-op">[</tt><tt class="py-string">'has_local_use_section'</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">True</tt> </tt>
+<a name="L1132"></a><tt class="py-lineno">1132</tt>  <tt class="py-line">            <tt class="py-name">kwargs</tt><tt class="py-op">[</tt><tt class="py-string">'_local_use_section'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">localsxn</tt><tt class="py-op">[</tt><tt class="py-name">n</tt><tt class="py-op">]</tt> </tt>
+<a name="L1133"></a><tt class="py-lineno">1133</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
+<a name="L1134"></a><tt class="py-lineno">1134</tt>  <tt class="py-line">            <tt class="py-name">kwargs</tt><tt class="py-op">[</tt><tt class="py-string">'has_local_use_section'</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">False</tt> </tt>
+<a name="L1135"></a><tt class="py-lineno">1135</tt>  <tt class="py-line">        <tt class="py-name">gribs</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt id="link-18" class="py-name" targets="Class ncepgrib2.Grib2Message=ncepgrib2.Grib2Message-class.html"><a title="ncepgrib2.Grib2Message" class="py-name" href="#" onclick="return doclink('link-18', 'Grib2Message', 'link-18');">Grib2Message</a></tt><tt class="py-op">(</tt><tt class="py-op">**</tt><tt [...]
+<a name="L1136"></a><tt class="py-lineno">1136</tt>  <tt class="py-line">    <tt class="py-name">f</tt><tt class="py-op">.</tt><tt class="py-name">close</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
+<a name="L1137"></a><tt class="py-lineno">1137</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">gribs</tt><tt class="py-op">)</tt> <tt class="py-op">==</tt> <tt class="py-number">1</tt><tt class="py-op">:</tt> </tt>
+<a name="L1138"></a><tt class="py-lineno">1138</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">gribs</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> </tt>
+<a name="L1139"></a><tt class="py-lineno">1139</tt>  <tt class="py-line">    <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
+<a name="L1140"></a><tt class="py-lineno">1140</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">gribs</tt> </tt>
+</div><a name="L1141"></a><tt class="py-lineno">1141</tt>  <tt class="py-line"> </tt>
+<a name="dump"></a><div id="dump-def"><a name="L1142"></a><tt class="py-lineno">1142</tt> <a class="py-toggle" href="#" id="dump-toggle" onclick="return toggle('dump');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="ncepgrib2-module.html#dump">dump</a><tt class="py-op">(</tt><tt class="py-param">filename</tt><tt class="py-op">,</tt> <tt class="py-param">grbs</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
+</div><div id="dump-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="dump-expanded"><a name="L1143"></a><tt class="py-lineno">1143</tt>  <tt class="py-line">    <tt class="py-docstring">"""</tt> </tt>
+<a name="L1144"></a><tt class="py-lineno">1144</tt>  <tt class="py-line"><tt class="py-docstring"> write the given L{Grib2Message} instances to a grib file.</tt> </tt>
+<a name="L1145"></a><tt class="py-lineno">1145</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
+<a name="L1146"></a><tt class="py-lineno">1146</tt>  <tt class="py-line"><tt class="py-docstring"> @param filename: file to write grib data to.</tt> </tt>
+<a name="L1147"></a><tt class="py-lineno">1147</tt>  <tt class="py-line"><tt class="py-docstring"> @param grbs: a list of L{Grib2Message} instances.</tt> </tt>
+<a name="L1148"></a><tt class="py-lineno">1148</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
+<a name="L1149"></a><tt class="py-lineno">1149</tt>  <tt class="py-line">    <tt class="py-name">gribfile</tt> <tt class="py-op">=</tt> <tt class="py-name">open</tt><tt class="py-op">(</tt><tt class="py-name">filename</tt><tt class="py-op">,</tt><tt class="py-string">'wb'</tt><tt class="py-op">)</tt> </tt>
+<a name="L1150"></a><tt class="py-lineno">1150</tt>  <tt class="py-line">    <tt class="py-keyword">for</tt> <tt class="py-name">grb</tt> <tt class="py-keyword">in</tt> <tt class="py-name">grbs</tt><tt class="py-op">:</tt> </tt>
+<a name="L1151"></a><tt class="py-lineno">1151</tt>  <tt class="py-line">        <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
+<a name="L1152"></a><tt class="py-lineno">1152</tt>  <tt class="py-line">            <tt class="py-name">f</tt> <tt class="py-op">=</tt> <tt class="py-name">open</tt><tt class="py-op">(</tt><tt class="py-name">grb</tt><tt class="py-op">.</tt><tt class="py-name">_grib_filename</tt><tt class="py-op">,</tt><tt class="py-string">'rb'</tt><tt class="py-op">)</tt> </tt>
+<a name="L1153"></a><tt class="py-lineno">1153</tt>  <tt class="py-line">        <tt class="py-keyword">except</tt> <tt class="py-name">TypeError</tt><tt class="py-op">:</tt> </tt>
+<a name="L1154"></a><tt class="py-lineno">1154</tt>  <tt class="py-line">            <tt class="py-name">f</tt> <tt class="py-op">=</tt> <tt class="py-name">StringIO</tt><tt class="py-op">(</tt><tt class="py-name">grb</tt><tt class="py-op">.</tt><tt class="py-name">_grib_filename</tt><tt class="py-op">)</tt> </tt>
+<a name="L1155"></a><tt class="py-lineno">1155</tt>  <tt class="py-line">        <tt class="py-name">f</tt><tt class="py-op">.</tt><tt class="py-name">seek</tt><tt class="py-op">(</tt><tt class="py-name">grb</tt><tt class="py-op">.</tt><tt class="py-name">_grib_message_byteoffset</tt><tt class="py-op">)</tt> </tt>
+<a name="L1156"></a><tt class="py-lineno">1156</tt>  <tt class="py-line">        <tt class="py-name">gribmsg</tt> <tt class="py-op">=</tt> <tt class="py-name">f</tt><tt class="py-op">.</tt><tt class="py-name">read</tt><tt class="py-op">(</tt><tt class="py-name">grb</tt><tt class="py-op">.</tt><tt class="py-name">_grib_message_length</tt><tt class="py-op">)</tt> </tt>
+<a name="L1157"></a><tt class="py-lineno">1157</tt>  <tt class="py-line">        <tt class="py-name">f</tt><tt class="py-op">.</tt><tt class="py-name">close</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
+<a name="L1158"></a><tt class="py-lineno">1158</tt>  <tt class="py-line">        <tt class="py-name">gribfile</tt><tt class="py-op">.</tt><tt class="py-name">write</tt><tt class="py-op">(</tt><tt class="py-name">gribmsg</tt><tt class="py-op">)</tt> </tt>
+<a name="L1159"></a><tt class="py-lineno">1159</tt>  <tt class="py-line">    <tt class="py-name">gribfile</tt><tt class="py-op">.</tt><tt class="py-name">close</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
+</div><a name="L1160"></a><tt class="py-lineno">1160</tt>  <tt class="py-line"> </tt>
+<a name="L1161"></a><tt class="py-lineno">1161</tt>  <tt class="py-line"><tt class="py-comment"># private methods and functions below here.</tt> </tt>
+<a name="L1162"></a><tt class="py-lineno">1162</tt>  <tt class="py-line"> </tt>
+<a name="_getdate"></a><div id="_getdate-def"><a name="L1163"></a><tt class="py-lineno">1163</tt> <a class="py-toggle" href="#" id="_getdate-toggle" onclick="return toggle('_getdate');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="ncepgrib2-module.html#_getdate">_getdate</a><tt class="py-op">(</tt><tt class="py-param">idsect</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
+</div><div id="_getdate-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="_getdate-expanded"><a name="L1164"></a><tt class="py-lineno">1164</tt>  <tt class="py-line">    <tt class="py-docstring">"""return yyyy,mm,dd,min,ss from section 1"""</tt> </tt>
+<a name="L1165"></a><tt class="py-lineno">1165</tt>  <tt class="py-line">    <tt class="py-name">yyyy</tt><tt class="py-op">=</tt><tt class="py-name">idsect</tt><tt class="py-op">[</tt><tt class="py-number">5</tt><tt class="py-op">]</tt> </tt>
+<a name="L1166"></a><tt class="py-lineno">1166</tt>  <tt class="py-line">    <tt class="py-name">mm</tt><tt class="py-op">=</tt><tt class="py-name">idsect</tt><tt class="py-op">[</tt><tt class="py-number">6</tt><tt class="py-op">]</tt> </tt>
+<a name="L1167"></a><tt class="py-lineno">1167</tt>  <tt class="py-line">    <tt class="py-name">dd</tt><tt class="py-op">=</tt><tt class="py-name">idsect</tt><tt class="py-op">[</tt><tt class="py-number">7</tt><tt class="py-op">]</tt> </tt>
+<a name="L1168"></a><tt class="py-lineno">1168</tt>  <tt class="py-line">    <tt class="py-name">hh</tt><tt class="py-op">=</tt><tt class="py-name">idsect</tt><tt class="py-op">[</tt><tt class="py-number">8</tt><tt class="py-op">]</tt> </tt>
+<a name="L1169"></a><tt class="py-lineno">1169</tt>  <tt class="py-line">    <tt class="py-name">min</tt><tt class="py-op">=</tt><tt class="py-name">idsect</tt><tt class="py-op">[</tt><tt class="py-number">9</tt><tt class="py-op">]</tt> </tt>
+<a name="L1170"></a><tt class="py-lineno">1170</tt>  <tt class="py-line">    <tt class="py-name">ss</tt><tt class="py-op">=</tt><tt class="py-name">idsect</tt><tt class="py-op">[</tt><tt class="py-number">10</tt><tt class="py-op">]</tt> </tt>
+<a name="L1171"></a><tt class="py-lineno">1171</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt class="py-name">yyyy</tt><tt class="py-op">,</tt><tt class="py-name">mm</tt><tt class="py-op">,</tt><tt class="py-name">dd</tt><tt class="py-op">,</tt><tt class="py-name">hh</tt><tt class="py-op">,</tt><tt class="py-name">min</tt><tt class="py-op">,</tt><tt class="py-name">ss</tt> </tt>
+</div><a name="L1172"></a><tt class="py-lineno">1172</tt>  <tt class="py-line"> </tt>
+<a name="_unpack1"></a><div id="_unpack1-def"><a name="L1173"></a><tt class="py-lineno">1173</tt> <a class="py-toggle" href="#" id="_unpack1-toggle" onclick="return toggle('_unpack1');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="ncepgrib2-module.html#_unpack1">_unpack1</a><tt class="py-op">(</tt><tt class="py-param">gribmsg</tt><tt class="py-op">,</tt><tt class="py-param">pos</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
+</div><div id="_unpack1-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="_unpack1-expanded"><a name="L1174"></a><tt class="py-lineno">1174</tt>  <tt class="py-line">    <tt class="py-docstring">"""unpack section 1 given starting point in bytes</tt> </tt>
+<a name="L1175"></a><tt class="py-lineno">1175</tt>  <tt class="py-line"><tt class="py-docstring">    used to test pyrex interface to g2_unpack1"""</tt> </tt>
+<a name="L1176"></a><tt class="py-lineno">1176</tt>  <tt class="py-line">    <tt class="py-name">idsect</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
+<a name="L1177"></a><tt class="py-lineno">1177</tt>  <tt class="py-line">    <tt class="py-name">pos</tt> <tt class="py-op">=</tt> <tt class="py-name">pos</tt> <tt class="py-op">+</tt> <tt class="py-number">5</tt> </tt>
+<a name="L1178"></a><tt class="py-lineno">1178</tt>  <tt class="py-line">    <tt class="py-name">idsect</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">struct</tt><tt class="py-op">.</tt><tt class="py-name">unpack</tt><tt class="py-op">(</tt><tt class="py-string">'>h'</tt><tt class="py-op">,</tt><tt class="py-name">gribmsg</tt><tt class="py-op">[</tt><tt class="py-name">pos</tt><tt class="py-op">:</tt><tt class="py-name">pos</tt>< [...]
+<a name="L1179"></a><tt class="py-lineno">1179</tt>  <tt class="py-line">    <tt class="py-name">pos</tt> <tt class="py-op">=</tt> <tt class="py-name">pos</tt> <tt class="py-op">+</tt> <tt class="py-number">2</tt> </tt>
+<a name="L1180"></a><tt class="py-lineno">1180</tt>  <tt class="py-line">    <tt class="py-name">idsect</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">struct</tt><tt class="py-op">.</tt><tt class="py-name">unpack</tt><tt class="py-op">(</tt><tt class="py-string">'>h'</tt><tt class="py-op">,</tt><tt class="py-name">gribmsg</tt><tt class="py-op">[</tt><tt class="py-name">pos</tt><tt class="py-op">:</tt><tt class="py-name">pos</tt>< [...]
+<a name="L1181"></a><tt class="py-lineno">1181</tt>  <tt class="py-line">    <tt class="py-name">pos</tt> <tt class="py-op">=</tt> <tt class="py-name">pos</tt> <tt class="py-op">+</tt> <tt class="py-number">2</tt> </tt>
+<a name="L1182"></a><tt class="py-lineno">1182</tt>  <tt class="py-line">    <tt class="py-name">idsect</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">struct</tt><tt class="py-op">.</tt><tt class="py-name">unpack</tt><tt class="py-op">(</tt><tt class="py-string">'>B'</tt><tt class="py-op">,</tt><tt class="py-name">gribmsg</tt><tt class="py-op">[</tt><tt class="py-name">pos</tt><tt class="py-op">:</tt><tt class="py-name">pos</tt>< [...]
+<a name="L1183"></a><tt class="py-lineno">1183</tt>  <tt class="py-line">    <tt class="py-name">pos</tt> <tt class="py-op">=</tt> <tt class="py-name">pos</tt> <tt class="py-op">+</tt> <tt class="py-number">1</tt> </tt>
+<a name="L1184"></a><tt class="py-lineno">1184</tt>  <tt class="py-line">    <tt class="py-name">idsect</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">struct</tt><tt class="py-op">.</tt><tt class="py-name">unpack</tt><tt class="py-op">(</tt><tt class="py-string">'>B'</tt><tt class="py-op">,</tt><tt class="py-name">gribmsg</tt><tt class="py-op">[</tt><tt class="py-name">pos</tt><tt class="py-op">:</tt><tt class="py-name">pos</tt>< [...]
+<a name="L1185"></a><tt class="py-lineno">1185</tt>  <tt class="py-line">    <tt class="py-name">pos</tt> <tt class="py-op">=</tt> <tt class="py-name">pos</tt> <tt class="py-op">+</tt> <tt class="py-number">1</tt> </tt>
+<a name="L1186"></a><tt class="py-lineno">1186</tt>  <tt class="py-line">    <tt class="py-name">idsect</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">struct</tt><tt class="py-op">.</tt><tt class="py-name">unpack</tt><tt class="py-op">(</tt><tt class="py-string">'>B'</tt><tt class="py-op">,</tt><tt class="py-name">gribmsg</tt><tt class="py-op">[</tt><tt class="py-name">pos</tt><tt class="py-op">:</tt><tt class="py-name">pos</tt>< [...]
+<a name="L1187"></a><tt class="py-lineno">1187</tt>  <tt class="py-line">    <tt class="py-name">pos</tt> <tt class="py-op">=</tt> <tt class="py-name">pos</tt> <tt class="py-op">+</tt> <tt class="py-number">1</tt> </tt>
+<a name="L1188"></a><tt class="py-lineno">1188</tt>  <tt class="py-line">    <tt class="py-name">idsect</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">struct</tt><tt class="py-op">.</tt><tt class="py-name">unpack</tt><tt class="py-op">(</tt><tt class="py-string">'>h'</tt><tt class="py-op">,</tt><tt class="py-name">gribmsg</tt><tt class="py-op">[</tt><tt class="py-name">pos</tt><tt class="py-op">:</tt><tt class="py-name">pos</tt>< [...]
+<a name="L1189"></a><tt class="py-lineno">1189</tt>  <tt class="py-line">    <tt class="py-name">pos</tt> <tt class="py-op">=</tt> <tt class="py-name">pos</tt> <tt class="py-op">+</tt> <tt class="py-number">2</tt> </tt>
+<a name="L1190"></a><tt class="py-lineno">1190</tt>  <tt class="py-line">    <tt class="py-name">idsect</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">struct</tt><tt class="py-op">.</tt><tt class="py-name">unpack</tt><tt class="py-op">(</tt><tt class="py-string">'>B'</tt><tt class="py-op">,</tt><tt class="py-name">gribmsg</tt><tt class="py-op">[</tt><tt class="py-name">pos</tt><tt class="py-op">:</tt><tt class="py-name">pos</tt>< [...]
+<a name="L1191"></a><tt class="py-lineno">1191</tt>  <tt class="py-line">    <tt class="py-name">pos</tt> <tt class="py-op">=</tt> <tt class="py-name">pos</tt> <tt class="py-op">+</tt> <tt class="py-number">1</tt> </tt>
+<a name="L1192"></a><tt class="py-lineno">1192</tt>  <tt class="py-line">    <tt class="py-name">idsect</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">struct</tt><tt class="py-op">.</tt><tt class="py-name">unpack</tt><tt class="py-op">(</tt><tt class="py-string">'>B'</tt><tt class="py-op">,</tt><tt class="py-name">gribmsg</tt><tt class="py-op">[</tt><tt class="py-name">pos</tt><tt class="py-op">:</tt><tt class="py-name">pos</tt>< [...]
+<a name="L1193"></a><tt class="py-lineno">1193</tt>  <tt class="py-line">    <tt class="py-name">pos</tt> <tt class="py-op">=</tt> <tt class="py-name">pos</tt> <tt class="py-op">+</tt> <tt class="py-number">1</tt> </tt>
+<a name="L1194"></a><tt class="py-lineno">1194</tt>  <tt class="py-line">    <tt class="py-name">idsect</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">struct</tt><tt class="py-op">.</tt><tt class="py-name">unpack</tt><tt class="py-op">(</tt><tt class="py-string">'>B'</tt><tt class="py-op">,</tt><tt class="py-name">gribmsg</tt><tt class="py-op">[</tt><tt class="py-name">pos</tt><tt class="py-op">:</tt><tt class="py-name">pos</tt>< [...]
+<a name="L1195"></a><tt class="py-lineno">1195</tt>  <tt class="py-line">    <tt class="py-name">pos</tt> <tt class="py-op">=</tt> <tt class="py-name">pos</tt> <tt class="py-op">+</tt> <tt class="py-number">1</tt> </tt>
+<a name="L1196"></a><tt class="py-lineno">1196</tt>  <tt class="py-line">    <tt class="py-name">idsect</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">struct</tt><tt class="py-op">.</tt><tt class="py-name">unpack</tt><tt class="py-op">(</tt><tt class="py-string">'>B'</tt><tt class="py-op">,</tt><tt class="py-name">gribmsg</tt><tt class="py-op">[</tt><tt class="py-name">pos</tt><tt class="py-op">:</tt><tt class="py-name">pos</tt>< [...]
+<a name="L1197"></a><tt class="py-lineno">1197</tt>  <tt class="py-line">    <tt class="py-name">pos</tt> <tt class="py-op">=</tt> <tt class="py-name">pos</tt> <tt class="py-op">+</tt> <tt class="py-number">1</tt> </tt>
+<a name="L1198"></a><tt class="py-lineno">1198</tt>  <tt class="py-line">    <tt class="py-name">idsect</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">struct</tt><tt class="py-op">.</tt><tt class="py-name">unpack</tt><tt class="py-op">(</tt><tt class="py-string">'>B'</tt><tt class="py-op">,</tt><tt class="py-name">gribmsg</tt><tt class="py-op">[</tt><tt class="py-name">pos</tt><tt class="py-op">:</tt><tt class="py-name">pos</tt>< [...]
+<a name="L1199"></a><tt class="py-lineno">1199</tt>  <tt class="py-line">    <tt class="py-name">pos</tt> <tt class="py-op">=</tt> <tt class="py-name">pos</tt> <tt class="py-op">+</tt> <tt class="py-number">1</tt> </tt>
+<a name="L1200"></a><tt class="py-lineno">1200</tt>  <tt class="py-line">    <tt class="py-name">idsect</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">struct</tt><tt class="py-op">.</tt><tt class="py-name">unpack</tt><tt class="py-op">(</tt><tt class="py-string">'>B'</tt><tt class="py-op">,</tt><tt class="py-name">gribmsg</tt><tt class="py-op">[</tt><tt class="py-name">pos</tt><tt class="py-op">:</tt><tt class="py-name">pos</tt>< [...]
+<a name="L1201"></a><tt class="py-lineno">1201</tt>  <tt class="py-line">    <tt class="py-name">pos</tt> <tt class="py-op">=</tt> <tt class="py-name">pos</tt> <tt class="py-op">+</tt> <tt class="py-number">1</tt> </tt>
+<a name="L1202"></a><tt class="py-lineno">1202</tt>  <tt class="py-line">    <tt class="py-name">idsect</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">struct</tt><tt class="py-op">.</tt><tt class="py-name">unpack</tt><tt class="py-op">(</tt><tt class="py-string">'>B'</tt><tt class="py-op">,</tt><tt class="py-name">gribmsg</tt><tt class="py-op">[</tt><tt class="py-name">pos</tt><tt class="py-op">:</tt><tt class="py-name">pos</tt>< [...]
+<a name="L1203"></a><tt class="py-lineno">1203</tt>  <tt class="py-line">    <tt class="py-name">pos</tt> <tt class="py-op">=</tt> <tt class="py-name">pos</tt> <tt class="py-op">+</tt> <tt class="py-number">1</tt> </tt>
+<a name="L1204"></a><tt class="py-lineno">1204</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">array</tt><tt class="py-op">(</tt><tt class="py-name">idsect</tt><tt class="py-op">,</tt><tt class="py-string">'i'</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-name">pos</tt> </tt>
+</div><a name="L1205"></a><tt class="py-lineno">1205</tt>  <tt class="py-line"> </tt>
+<a name="_repeatlast"></a><div id="_repeatlast-def"><a name="L1206"></a><tt class="py-lineno">1206</tt> <a class="py-toggle" href="#" id="_repeatlast-toggle" onclick="return toggle('_repeatlast');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="ncepgrib2-module.html#_repeatlast">_repeatlast</a><tt class="py-op">(</tt><tt class="py-param">numfields</tt><tt class="py-op">,</tt><tt class="py-param">listin</tt><tt class="py-op">)</tt><tt class="py-op">: [...]
+</div><div id="_repeatlast-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="_repeatlast-expanded"><a name="L1207"></a><tt class="py-lineno">1207</tt>  <tt class="py-line">    <tt class="py-docstring">"""repeat last item in listin, until len(listin) = numfields"""</tt> </tt>
+<a name="L1208"></a><tt class="py-lineno">1208</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">listin</tt><tt class="py-op">)</tt> <tt class="py-op"><</tt> <tt class="py-name">numfields</tt><tt class="py-op">:</tt> </tt>
+<a name="L1209"></a><tt class="py-lineno">1209</tt>  <tt class="py-line">        <tt class="py-name">last</tt> <tt class="py-op">=</tt> <tt class="py-name">listin</tt><tt class="py-op">[</tt><tt class="py-op">-</tt><tt class="py-number">1</tt><tt class="py-op">]</tt> </tt>
+<a name="L1210"></a><tt class="py-lineno">1210</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt class="py-name">n</tt> <tt class="py-keyword">in</tt> <tt class="py-name">range</tt><tt class="py-op">(</tt><tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">listin</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-name">numfields</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
+<a name="L1211"></a><tt class="py-lineno">1211</tt>  <tt class="py-line">            <tt class="py-name">listin</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">last</tt><tt class="py-op">)</tt> </tt>
+<a name="L1212"></a><tt class="py-lineno">1212</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt class="py-name">listin</tt> </tt>
+</div><a name="L1213"></a><tt class="py-lineno">1213</tt>  <tt class="py-line"> </tt>
+<a name="_flatten"></a><div id="_flatten-def"><a name="L1214"></a><tt class="py-lineno">1214</tt> <a class="py-toggle" href="#" id="_flatten-toggle" onclick="return toggle('_flatten');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="ncepgrib2-module.html#_flatten">_flatten</a><tt class="py-op">(</tt><tt class="py-param">lst</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
+</div><div id="_flatten-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="_flatten-expanded"><a name="L1215"></a><tt class="py-lineno">1215</tt>  <tt class="py-line">    <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
+<a name="L1216"></a><tt class="py-lineno">1216</tt>  <tt class="py-line">        <tt class="py-name">flist</tt> <tt class="py-op">=</tt> <tt class="py-name">functools</tt><tt class="py-op">.</tt><tt class="py-name">reduce</tt><tt class="py-op">(</tt><tt class="py-name">operator</tt><tt class="py-op">.</tt><tt class="py-name">add</tt><tt class="py-op">,</tt><tt class="py-name">lst</tt><tt class="py-op">)</tt> </tt>
+<a name="L1217"></a><tt class="py-lineno">1217</tt>  <tt class="py-line">    <tt class="py-keyword">except</tt> <tt class="py-name">NameError</tt><tt class="py-op">:</tt> <tt class="py-comment"># no reduce in python 3.</tt> </tt>
+<a name="L1218"></a><tt class="py-lineno">1218</tt>  <tt class="py-line">        <tt class="py-keyword">import</tt> <tt class="py-name">functools</tt> </tt>
+<a name="L1219"></a><tt class="py-lineno">1219</tt>  <tt class="py-line">        <tt class="py-name">flist</tt> <tt class="py-op">=</tt> <tt class="py-name">functools</tt><tt class="py-op">.</tt><tt class="py-name">reduce</tt><tt class="py-op">(</tt><tt class="py-name">operator</tt><tt class="py-op">.</tt><tt class="py-name">add</tt><tt class="py-op">,</tt><tt class="py-name">lst</tt><tt class="py-op">)</tt> </tt>
+<a name="L1220"></a><tt class="py-lineno">1220</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt class="py-name">flist</tt> </tt>
+</div><a name="L1221"></a><tt class="py-lineno">1221</tt>  <tt class="py-line"> </tt>
+<a name="L1222"></a><tt class="py-lineno">1222</tt>  <tt class="py-line"> </tt>
+<a name="Grib2Encode"></a><div id="Grib2Encode-def"><a name="L1223"></a><tt class="py-lineno">1223</tt> <a class="py-toggle" href="#" id="Grib2Encode-toggle" onclick="return toggle('Grib2Encode');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="ncepgrib2.Grib2Encode-class.html">Grib2Encode</a><tt class="py-op">:</tt> </tt>
+</div><div id="Grib2Encode-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="Grib2Encode-expanded"><a name="L1224"></a><tt class="py-lineno">1224</tt>  <tt class="py-line">    <tt class="py-docstring">"""</tt> </tt>
+<a name="L1225"></a><tt class="py-lineno">1225</tt>  <tt class="py-line"><tt class="py-docstring"> Class for encoding data into a GRIB2 message.</tt> </tt>
+<a name="L1226"></a><tt class="py-lineno">1226</tt>  <tt class="py-line"><tt class="py-docstring">  - Creating a class instance (L{__init__}) initializes the message and adds</tt> </tt>
+<a name="L1227"></a><tt class="py-lineno">1227</tt>  <tt class="py-line"><tt class="py-docstring">    sections 0 and 1 (the indicator and identification sections),</tt> </tt>
+<a name="L1228"></a><tt class="py-lineno">1228</tt>  <tt class="py-line"><tt class="py-docstring">  - method L{addgrid} adds a grid definition (section 3) to the messsage.</tt> </tt>
+<a name="L1229"></a><tt class="py-lineno">1229</tt>  <tt class="py-line"><tt class="py-docstring">  - method L{addfield} adds sections 4-7 to the message (the product</tt> </tt>
+<a name="L1230"></a><tt class="py-lineno">1230</tt>  <tt class="py-line"><tt class="py-docstring">    definition, data representation, bitmap and data sections).</tt> </tt>
+<a name="L1231"></a><tt class="py-lineno">1231</tt>  <tt class="py-line"><tt class="py-docstring">  - method L{end} adds the end section (section 8) and terminates the message.</tt> </tt>
+<a name="L1232"></a><tt class="py-lineno">1232</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
 <a name="L1233"></a><tt class="py-lineno">1233</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
-<a name="L1234"></a><tt class="py-lineno">1234</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
-<a name="L1235"></a><tt class="py-lineno">1235</tt>  <tt class="py-line"><tt class="py-docstring"> A GRIB Edition 2 message is a machine independent format for storing</tt> </tt>
-<a name="L1236"></a><tt class="py-lineno">1236</tt>  <tt class="py-line"><tt class="py-docstring"> one or more gridded data fields.  Each GRIB2 message consists of the</tt> </tt>
-<a name="L1237"></a><tt class="py-lineno">1237</tt>  <tt class="py-line"><tt class="py-docstring"> following sections:</tt> </tt>
-<a name="L1238"></a><tt class="py-lineno">1238</tt>  <tt class="py-line"><tt class="py-docstring">  - SECTION 0: Indicator Section - only one per message</tt> </tt>
-<a name="L1239"></a><tt class="py-lineno">1239</tt>  <tt class="py-line"><tt class="py-docstring">  - SECTION 1: Identification Section - only one per message</tt> </tt>
-<a name="L1240"></a><tt class="py-lineno">1240</tt>  <tt class="py-line"><tt class="py-docstring">  - SECTION 2: (Local Use Section) - optional</tt> </tt>
-<a name="L1241"></a><tt class="py-lineno">1241</tt>  <tt class="py-line"><tt class="py-docstring">  - SECTION 3: Grid Definition Section</tt> </tt>
-<a name="L1242"></a><tt class="py-lineno">1242</tt>  <tt class="py-line"><tt class="py-docstring">  - SECTION 4: Product Definition Section</tt> </tt>
-<a name="L1243"></a><tt class="py-lineno">1243</tt>  <tt class="py-line"><tt class="py-docstring">  - SECTION 5: Data Representation Section</tt> </tt>
-<a name="L1244"></a><tt class="py-lineno">1244</tt>  <tt class="py-line"><tt class="py-docstring">  - SECTION 6: Bit-map Section</tt> </tt>
-<a name="L1245"></a><tt class="py-lineno">1245</tt>  <tt class="py-line"><tt class="py-docstring">  - SECTION 7: Data Section</tt> </tt>
-<a name="L1246"></a><tt class="py-lineno">1246</tt>  <tt class="py-line"><tt class="py-docstring">  - SECTION 8: End Section</tt> </tt>
-<a name="L1247"></a><tt class="py-lineno">1247</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
-<a name="L1248"></a><tt class="py-lineno">1248</tt>  <tt class="py-line"><tt class="py-docstring"> Sequences of GRIB sections 2 to 7, 3 to 7, or sections 4 to 7 may be repeated</tt> </tt>
-<a name="L1249"></a><tt class="py-lineno">1249</tt>  <tt class="py-line"><tt class="py-docstring"> within a single GRIB message.  All sections within such repeated sequences</tt> </tt>
-<a name="L1250"></a><tt class="py-lineno">1250</tt>  <tt class="py-line"><tt class="py-docstring"> must be present and shall appear in the numerical order noted above.</tt> </tt>
-<a name="L1251"></a><tt class="py-lineno">1251</tt>  <tt class="py-line"><tt class="py-docstring"> Unrepeated sections remain in effect until redefined.</tt> </tt>
-<a name="L1252"></a><tt class="py-lineno">1252</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
-<a name="L1253"></a><tt class="py-lineno">1253</tt>  <tt class="py-line"><tt class="py-docstring"> Note:  Writing section 2 (the 'local use section') is</tt> </tt>
-<a name="L1254"></a><tt class="py-lineno">1254</tt>  <tt class="py-line"><tt class="py-docstring"> not yet supported.</tt> </tt>
-<a name="L1255"></a><tt class="py-lineno">1255</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
-<a name="L1256"></a><tt class="py-lineno">1256</tt>  <tt class="py-line"><tt class="py-docstring"> @ivar msg: A binary string containing the GRIB2 message.</tt> </tt>
-<a name="L1257"></a><tt class="py-lineno">1257</tt>  <tt class="py-line"><tt class="py-docstring"> After the message has been terminated by calling</tt> </tt>
-<a name="L1258"></a><tt class="py-lineno">1258</tt>  <tt class="py-line"><tt class="py-docstring"> the L{end} method, this string can be written to a file.</tt> </tt>
-<a name="L1259"></a><tt class="py-lineno">1259</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
-<a name="L1260"></a><tt class="py-lineno">1260</tt>  <tt class="py-line"> </tt>
-<a name="Grib2Encode.__init__"></a><div id="Grib2Encode.__init__-def"><a name="L1261"></a><tt class="py-lineno">1261</tt> <a class="py-toggle" href="#" id="Grib2Encode.__init__-toggle" onclick="return toggle('Grib2Encode.__init__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="ncepgrib2.Grib2Encode-class.html#__init__">__init__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">discipline</t [...]
-</div><div id="Grib2Encode.__init__-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Grib2Encode.__init__-expanded"><a name="L1262"></a><tt class="py-lineno">1262</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
-<a name="L1263"></a><tt class="py-lineno">1263</tt>  <tt class="py-line"><tt class="py-docstring"> create a Grib2Enecode class instance given the GRIB2 discipline</tt> </tt>
-<a name="L1264"></a><tt class="py-lineno">1264</tt>  <tt class="py-line"><tt class="py-docstring"> parameter and the identification section (sections 0 and 1).</tt> </tt>
-<a name="L1265"></a><tt class="py-lineno">1265</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
-<a name="L1266"></a><tt class="py-lineno">1266</tt>  <tt class="py-line"><tt class="py-docstring"> The GRIB2 message is stored as a binary string in instance variable L{msg}.</tt> </tt>
-<a name="L1267"></a><tt class="py-lineno">1267</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
-<a name="L1268"></a><tt class="py-lineno">1268</tt>  <tt class="py-line"><tt class="py-docstring"> L{addgrid}, L{addfield} and L{end} class methods must be called to complete</tt> </tt>
-<a name="L1269"></a><tt class="py-lineno">1269</tt>  <tt class="py-line"><tt class="py-docstring"> the GRIB2 message.</tt> </tt>
-<a name="L1270"></a><tt class="py-lineno">1270</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
-<a name="L1271"></a><tt class="py-lineno">1271</tt>  <tt class="py-line"><tt class="py-docstring"> @param discipline:  Discipline or GRIB Master Table Number (Code Table 0.0).</tt> </tt>
-<a name="L1272"></a><tt class="py-lineno">1272</tt>  <tt class="py-line"><tt class="py-docstring"> (0 for meteorlogical, 1 for hydrological, 2 for land surface, 3 for space,</tt> </tt>
-<a name="L1273"></a><tt class="py-lineno">1273</tt>  <tt class="py-line"><tt class="py-docstring"> 10 for oceanographic products).</tt> </tt>
-<a name="L1274"></a><tt class="py-lineno">1274</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
-<a name="L1275"></a><tt class="py-lineno">1275</tt>  <tt class="py-line"><tt class="py-docstring"> @param idsect:  Sequence containing identification section (section 1).</tt> </tt>
-<a name="L1276"></a><tt class="py-lineno">1276</tt>  <tt class="py-line"><tt class="py-docstring">  - idsect[0]=Id of orginating centre (Common Code</tt> </tt>
-<a name="L1277"></a><tt class="py-lineno">1277</tt>  <tt class="py-line"><tt class="py-docstring">    U{Table C-1<http://www.nws.noaa.gov/tg/GRIB_C1.htm>})</tt> </tt>
-<a name="L1278"></a><tt class="py-lineno">1278</tt>  <tt class="py-line"><tt class="py-docstring">  - idsect[1]=Id of orginating sub-centre (local table)</tt> </tt>
-<a name="L1279"></a><tt class="py-lineno">1279</tt>  <tt class="py-line"><tt class="py-docstring">  - idsect[2]=GRIB Master Tables Version Number (Code</tt> </tt>
-<a name="L1280"></a><tt class="py-lineno">1280</tt>  <tt class="py-line"><tt class="py-docstring">    U{Table 1.0</tt> </tt>
-<a name="L1281"></a><tt class="py-lineno">1281</tt>  <tt class="py-line"><tt class="py-docstring">    <http://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_table1-0.shtml>})</tt> </tt>
-<a name="L1282"></a><tt class="py-lineno">1282</tt>  <tt class="py-line"><tt class="py-docstring">  - idsect[3]=GRIB Local Tables Version Number (Code</tt> </tt>
-<a name="L1283"></a><tt class="py-lineno">1283</tt>  <tt class="py-line"><tt class="py-docstring">    U{Table 1.1</tt> </tt>
-<a name="L1284"></a><tt class="py-lineno">1284</tt>  <tt class="py-line"><tt class="py-docstring">    <http://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_table1-1.shtml>})</tt> </tt>
-<a name="L1285"></a><tt class="py-lineno">1285</tt>  <tt class="py-line"><tt class="py-docstring">  - idsect[4]=Significance of Reference Time (Code</tt> </tt>
-<a name="L1286"></a><tt class="py-lineno">1286</tt>  <tt class="py-line"><tt class="py-docstring">    U{Table 1.2</tt> </tt>
-<a name="L1287"></a><tt class="py-lineno">1287</tt>  <tt class="py-line"><tt class="py-docstring">    <http://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_table1-2.shtml>})</tt> </tt>
-<a name="L1288"></a><tt class="py-lineno">1288</tt>  <tt class="py-line"><tt class="py-docstring">  - idsect[5]=Reference Time - Year (4 digits)</tt> </tt>
-<a name="L1289"></a><tt class="py-lineno">1289</tt>  <tt class="py-line"><tt class="py-docstring">  - idsect[6]=Reference Time - Month</tt> </tt>
-<a name="L1290"></a><tt class="py-lineno">1290</tt>  <tt class="py-line"><tt class="py-docstring">  - idsect[7]=Reference Time - Day</tt> </tt>
-<a name="L1291"></a><tt class="py-lineno">1291</tt>  <tt class="py-line"><tt class="py-docstring">  - idsect[8]=Reference Time - Hour</tt> </tt>
-<a name="L1292"></a><tt class="py-lineno">1292</tt>  <tt class="py-line"><tt class="py-docstring">  - idsect[9]=Reference Time - Minute</tt> </tt>
-<a name="L1293"></a><tt class="py-lineno">1293</tt>  <tt class="py-line"><tt class="py-docstring">  - idsect[10]=Reference Time - Second</tt> </tt>
-<a name="L1294"></a><tt class="py-lineno">1294</tt>  <tt class="py-line"><tt class="py-docstring">  - idsect[11]=Production status of data (Code</tt> </tt>
-<a name="L1295"></a><tt class="py-lineno">1295</tt>  <tt class="py-line"><tt class="py-docstring">    U{Table 1.3</tt> </tt>
-<a name="L1296"></a><tt class="py-lineno">1296</tt>  <tt class="py-line"><tt class="py-docstring">    <http://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_table1-3.shtml>})</tt> </tt>
-<a name="L1297"></a><tt class="py-lineno">1297</tt>  <tt class="py-line"><tt class="py-docstring">  - idsect[12]=Type of processed data (Code</tt> </tt>
-<a name="L1298"></a><tt class="py-lineno">1298</tt>  <tt class="py-line"><tt class="py-docstring">    U{Table</tt> </tt>
-<a name="L1299"></a><tt class="py-lineno">1299</tt>  <tt class="py-line"><tt class="py-docstring">    1.4<http://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_table1-4.shtml>})</tt> </tt>
-<a name="L1300"></a><tt class="py-lineno">1300</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
-<a name="L1301"></a><tt class="py-lineno">1301</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">msg</tt><tt class="py-op">,</tt><tt class="py-name">msglen</tt><tt class="py-op">=</tt><tt class="py-name">g2clib</tt><tt class="py-op">.</tt><tt class="py-name">grib2_create</tt><tt class="py-op">(</tt><tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">array</tt><tt class="py-op">(</tt><tt class="py-op">[</tt><tt cl [...]
-</div><a name="L1302"></a><tt class="py-lineno">1302</tt>  <tt class="py-line"> </tt>
-<a name="Grib2Encode.addgrid"></a><div id="Grib2Encode.addgrid-def"><a name="L1303"></a><tt class="py-lineno">1303</tt> <a class="py-toggle" href="#" id="Grib2Encode.addgrid-toggle" onclick="return toggle('Grib2Encode.addgrid');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="ncepgrib2.Grib2Encode-class.html#addgrid">addgrid</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">gdsinfo</tt><tt clas [...]
-</div><div id="Grib2Encode.addgrid-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Grib2Encode.addgrid-expanded"><a name="L1304"></a><tt class="py-lineno">1304</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
-<a name="L1305"></a><tt class="py-lineno">1305</tt>  <tt class="py-line"><tt class="py-docstring"> Add a grid definition section (section 3) to the GRIB2 message.</tt> </tt>
-<a name="L1306"></a><tt class="py-lineno">1306</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
-<a name="L1307"></a><tt class="py-lineno">1307</tt>  <tt class="py-line"><tt class="py-docstring"> @param gdsinfo: Sequence containing information needed for the grid definition section.</tt> </tt>
-<a name="L1308"></a><tt class="py-lineno">1308</tt>  <tt class="py-line"><tt class="py-docstring">  - gdsinfo[0] = Source of grid definition (see Code</tt> </tt>
-<a name="L1309"></a><tt class="py-lineno">1309</tt>  <tt class="py-line"><tt class="py-docstring">    U{Table 3.0</tt> </tt>
-<a name="L1310"></a><tt class="py-lineno">1310</tt>  <tt class="py-line"><tt class="py-docstring">    <http://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_table3-0.shtml>})</tt> </tt>
-<a name="L1311"></a><tt class="py-lineno">1311</tt>  <tt class="py-line"><tt class="py-docstring">  - gdsinfo[1] = Number of grid points in the defined grid.</tt> </tt>
-<a name="L1312"></a><tt class="py-lineno">1312</tt>  <tt class="py-line"><tt class="py-docstring">  - gdsinfo[2] = Number of octets needed for each additional grid points defn.</tt> </tt>
-<a name="L1313"></a><tt class="py-lineno">1313</tt>  <tt class="py-line"><tt class="py-docstring">    Used to define number of points in each row for non-reg grids (=0 for</tt> </tt>
-<a name="L1314"></a><tt class="py-lineno">1314</tt>  <tt class="py-line"><tt class="py-docstring">    regular grid).</tt> </tt>
-<a name="L1315"></a><tt class="py-lineno">1315</tt>  <tt class="py-line"><tt class="py-docstring">  - gdsinfo[3] = Interp. of list for optional points defn (Code</tt> </tt>
-<a name="L1316"></a><tt class="py-lineno">1316</tt>  <tt class="py-line"><tt class="py-docstring">    U{Table 3.11</tt> </tt>
-<a name="L1317"></a><tt class="py-lineno">1317</tt>  <tt class="py-line"><tt class="py-docstring">    <http://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_table3-11.shtml>})</tt> </tt>
-<a name="L1318"></a><tt class="py-lineno">1318</tt>  <tt class="py-line"><tt class="py-docstring">  - gdsinfo[4] = Grid Definition Template Number (Code</tt> </tt>
-<a name="L1319"></a><tt class="py-lineno">1319</tt>  <tt class="py-line"><tt class="py-docstring">    U{Table 3.1</tt> </tt>
-<a name="L1320"></a><tt class="py-lineno">1320</tt>  <tt class="py-line"><tt class="py-docstring">    <http://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_table3-1.shtml>})</tt> </tt>
-<a name="L1321"></a><tt class="py-lineno">1321</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
-<a name="L1322"></a><tt class="py-lineno">1322</tt>  <tt class="py-line"><tt class="py-docstring"> @param gdtmpl: Contains the data values for the specified Grid Definition</tt> </tt>
-<a name="L1323"></a><tt class="py-lineno">1323</tt>  <tt class="py-line"><tt class="py-docstring"> Template ( NN=gdsinfo[4] ).  Each element of this integer</tt> </tt>
-<a name="L1324"></a><tt class="py-lineno">1324</tt>  <tt class="py-line"><tt class="py-docstring"> array contains an entry (in the order specified) of Grid</tt> </tt>
-<a name="L1325"></a><tt class="py-lineno">1325</tt>  <tt class="py-line"><tt class="py-docstring"> Definition Template 3.NN</tt> </tt>
-<a name="L1326"></a><tt class="py-lineno">1326</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
-<a name="L1327"></a><tt class="py-lineno">1327</tt>  <tt class="py-line"><tt class="py-docstring"> @param deflist: (Used if gdsinfo[2] != 0)  Sequence containing the</tt> </tt>
-<a name="L1328"></a><tt class="py-lineno">1328</tt>  <tt class="py-line"><tt class="py-docstring"> number of grid points contained in each row (or column)</tt> </tt>
-<a name="L1329"></a><tt class="py-lineno">1329</tt>  <tt class="py-line"><tt class="py-docstring"> of a non-regular grid.</tt> </tt>
-<a name="L1330"></a><tt class="py-lineno">1330</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
-<a name="L1331"></a><tt class="py-lineno">1331</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">deflist</tt> <tt class="py-keyword">is</tt> <tt class="py-keyword">not</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
-<a name="L1332"></a><tt class="py-lineno">1332</tt>  <tt class="py-line">            <tt class="py-name">dflist</tt> <tt class="py-op">=</tt> <tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">array</tt><tt class="py-op">(</tt><tt class="py-name">deflist</tt><tt class="py-op">,</tt><tt class="py-string">'i'</tt><tt class="py-op">)</tt> </tt>
-<a name="L1333"></a><tt class="py-lineno">1333</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
-<a name="L1334"></a><tt class="py-lineno">1334</tt>  <tt class="py-line">            <tt class="py-name">dflist</tt> <tt class="py-op">=</tt> <tt class="py-name">None</tt> </tt>
-<a name="L1335"></a><tt class="py-lineno">1335</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">scanmodeflags</tt> <tt class="py-op">=</tt> <tt class="py-name">None</tt> </tt>
-<a name="L1336"></a><tt class="py-lineno">1336</tt>  <tt class="py-line">        <tt class="py-name">gdtnum</tt> <tt class="py-op">=</tt> <tt class="py-name">gdsinfo</tt><tt class="py-op">[</tt><tt class="py-number">4</tt><tt class="py-op">]</tt> </tt>
-<a name="L1337"></a><tt class="py-lineno">1337</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">gdtnum</tt> <tt class="py-keyword">in</tt> <tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">,</tt><tt class="py-number">1</tt><tt class="py-op">,</tt><tt class="py-number">2</tt><tt class="py-op">,</tt><tt class="py-number">3</tt><tt class="py-op">,</tt><tt class="py-number">40</tt><tt class="py-op">,</tt><tt class="py-number">41</tt><tt [...]
-<a name="L1338"></a><tt class="py-lineno">1338</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">scanmodeflags</tt> <tt class="py-op">=</tt> <tt class="py-name">_dec2bin</tt><tt class="py-op">(</tt><tt class="py-name">gdtmpl</tt><tt class="py-op">[</tt><tt class="py-number">18</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">:</tt><tt class="py-number">4</ [...]
-<a name="L1339"></a><tt class="py-lineno">1339</tt>  <tt class="py-line">        <tt class="py-keyword">elif</tt> <tt class="py-name">gdtnum</tt> <tt class="py-op">==</tt> <tt class="py-number">10</tt><tt class="py-op">:</tt> <tt class="py-comment"># mercator</tt> </tt>
-<a name="L1340"></a><tt class="py-lineno">1340</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">scanmodeflags</tt> <tt class="py-op">=</tt> <tt class="py-name">_dec2bin</tt><tt class="py-op">(</tt><tt class="py-name">gdtmpl</tt><tt class="py-op">[</tt><tt class="py-number">15</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">:</tt><tt class="py-number">4</ [...]
-<a name="L1341"></a><tt class="py-lineno">1341</tt>  <tt class="py-line">        <tt class="py-keyword">elif</tt> <tt class="py-name">gdtnum</tt> <tt class="py-op">==</tt> <tt class="py-number">20</tt><tt class="py-op">:</tt> <tt class="py-comment"># stereographic</tt> </tt>
-<a name="L1342"></a><tt class="py-lineno">1342</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">scanmodeflags</tt> <tt class="py-op">=</tt> <tt class="py-name">_dec2bin</tt><tt class="py-op">(</tt><tt class="py-name">gdtmpl</tt><tt class="py-op">[</tt><tt class="py-number">17</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">:</tt><tt class="py-number">4</ [...]
-<a name="L1343"></a><tt class="py-lineno">1343</tt>  <tt class="py-line">        <tt class="py-keyword">elif</tt> <tt class="py-name">gdtnum</tt> <tt class="py-op">==</tt> <tt class="py-number">30</tt><tt class="py-op">:</tt> <tt class="py-comment"># lambert conformal</tt> </tt>
-<a name="L1344"></a><tt class="py-lineno">1344</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">scanmodeflags</tt> <tt class="py-op">=</tt> <tt class="py-name">_dec2bin</tt><tt class="py-op">(</tt><tt class="py-name">gdtmpl</tt><tt class="py-op">[</tt><tt class="py-number">17</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">:</tt><tt class="py-number">4</ [...]
-<a name="L1345"></a><tt class="py-lineno">1345</tt>  <tt class="py-line">        <tt class="py-keyword">elif</tt> <tt class="py-name">gdtnum</tt> <tt class="py-op">==</tt> <tt class="py-number">31</tt><tt class="py-op">:</tt> <tt class="py-comment"># albers equal area.</tt> </tt>
-<a name="L1346"></a><tt class="py-lineno">1346</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">scanmodeflags</tt> <tt class="py-op">=</tt> <tt class="py-name">_dec2bin</tt><tt class="py-op">(</tt><tt class="py-name">gdtmpl</tt><tt class="py-op">[</tt><tt class="py-number">17</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">:</tt><tt class="py-number">4</ [...]
-<a name="L1347"></a><tt class="py-lineno">1347</tt>  <tt class="py-line">        <tt class="py-keyword">elif</tt> <tt class="py-name">gdtnum</tt> <tt class="py-op">==</tt> <tt class="py-number">90</tt><tt class="py-op">:</tt> <tt class="py-comment"># near-sided vertical perspective satellite projection</tt> </tt>
-<a name="L1348"></a><tt class="py-lineno">1348</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">scanmodeflags</tt> <tt class="py-op">=</tt> <tt class="py-name">_dec2bin</tt><tt class="py-op">(</tt><tt class="py-name">gdtmpl</tt><tt class="py-op">[</tt><tt class="py-number">16</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">:</tt><tt class="py-number">4</ [...]
-<a name="L1349"></a><tt class="py-lineno">1349</tt>  <tt class="py-line">        <tt class="py-keyword">elif</tt> <tt class="py-name">gdtnum</tt> <tt class="py-op">==</tt> <tt class="py-number">110</tt><tt class="py-op">:</tt> <tt class="py-comment"># azimuthal equidistant.</tt> </tt>
-<a name="L1350"></a><tt class="py-lineno">1350</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">scanmodeflags</tt> <tt class="py-op">=</tt> <tt class="py-name">_dec2bin</tt><tt class="py-op">(</tt><tt class="py-name">gdtmpl</tt><tt class="py-op">[</tt><tt class="py-number">15</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">:</tt><tt class="py-number">4</ [...]
-<a name="L1351"></a><tt class="py-lineno">1351</tt>  <tt class="py-line">        <tt class="py-keyword">elif</tt> <tt class="py-name">gdtnum</tt> <tt class="py-op">==</tt> <tt class="py-number">120</tt><tt class="py-op">:</tt> </tt>
-<a name="L1352"></a><tt class="py-lineno">1352</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">scanmodeflags</tt> <tt class="py-op">=</tt> <tt class="py-name">_dec2bin</tt><tt class="py-op">(</tt><tt class="py-name">gdtmpl</tt><tt class="py-op">[</tt><tt class="py-number">6</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">:</tt><tt class="py-number">4</t [...]
-<a name="L1353"></a><tt class="py-lineno">1353</tt>  <tt class="py-line">        <tt class="py-keyword">elif</tt> <tt class="py-name">gdtnum</tt> <tt class="py-op">==</tt> <tt class="py-number">204</tt><tt class="py-op">:</tt> <tt class="py-comment"># curvilinear orthogonal</tt> </tt>
-<a name="L1354"></a><tt class="py-lineno">1354</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">scanmodeflags</tt> <tt class="py-op">=</tt> <tt class="py-name">_dec2bin</tt><tt class="py-op">(</tt><tt class="py-name">gdtmpl</tt><tt class="py-op">[</tt><tt class="py-number">18</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">:</tt><tt class="py-number">4</ [...]
-<a name="L1355"></a><tt class="py-lineno">1355</tt>  <tt class="py-line">        <tt class="py-keyword">elif</tt> <tt class="py-name">gdtnum</tt> <tt class="py-keyword">in</tt> <tt class="py-op">[</tt><tt class="py-number">1000</tt><tt class="py-op">,</tt><tt class="py-number">1100</tt><tt class="py-op">]</tt><tt class="py-op">:</tt> </tt>
-<a name="L1356"></a><tt class="py-lineno">1356</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">scanmodeflags</tt> <tt class="py-op">=</tt> <tt class="py-name">_dec2bin</tt><tt class="py-op">(</tt><tt class="py-name">gdtmpl</tt><tt class="py-op">[</tt><tt class="py-number">12</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">:</tt><tt class="py-number">4</ [...]
-<a name="L1357"></a><tt class="py-lineno">1357</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">msg</tt><tt class="py-op">,</tt><tt class="py-name">msglen</tt><tt class="py-op">=</tt><tt class="py-name">g2clib</tt><tt class="py-op">.</tt><tt class="py-name">grib2_addgrid</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">msg</tt><tt class="py-op">,</tt><tt class="py-name">np</tt><t [...]
-</div><a name="L1358"></a><tt class="py-lineno">1358</tt>  <tt class="py-line"> </tt>
-<a name="Grib2Encode.addfield"></a><div id="Grib2Encode.addfield-def"><a name="L1359"></a><tt class="py-lineno">1359</tt> <a class="py-toggle" href="#" id="Grib2Encode.addfield-toggle" onclick="return toggle('Grib2Encode.addfield');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="ncepgrib2.Grib2Encode-class.html#addfield">addfield</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">pdtnum</tt><tt [...]
-</div><div id="Grib2Encode.addfield-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Grib2Encode.addfield-expanded"><a name="L1360"></a><tt class="py-lineno">1360</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
-<a name="L1361"></a><tt class="py-lineno">1361</tt>  <tt class="py-line"><tt class="py-docstring"> Add a product definition section, data representation section,</tt> </tt>
-<a name="L1362"></a><tt class="py-lineno">1362</tt>  <tt class="py-line"><tt class="py-docstring"> bitmap section and data section to the GRIB2 message (sections 4-7).</tt> </tt>
-<a name="L1363"></a><tt class="py-lineno">1363</tt>  <tt class="py-line"><tt class="py-docstring"> Must be called after grid definition section is created with L{addgrid}.</tt> </tt>
-<a name="L1364"></a><tt class="py-lineno">1364</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
-<a name="L1365"></a><tt class="py-lineno">1365</tt>  <tt class="py-line"><tt class="py-docstring"> @param pdtnum: Product Definition Template Number (see Code U{Table</tt> </tt>
-<a name="L1366"></a><tt class="py-lineno">1366</tt>  <tt class="py-line"><tt class="py-docstring"> 4.0<http://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_table4-0.shtml>})</tt> </tt>
-<a name="L1367"></a><tt class="py-lineno">1367</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
-<a name="L1368"></a><tt class="py-lineno">1368</tt>  <tt class="py-line"><tt class="py-docstring"> @param pdtmpl: Sequence with the data values for the specified Product Definition</tt> </tt>
-<a name="L1369"></a><tt class="py-lineno">1369</tt>  <tt class="py-line"><tt class="py-docstring"> Template (N=pdtnum).  Each element of this integer</tt> </tt>
-<a name="L1370"></a><tt class="py-lineno">1370</tt>  <tt class="py-line"><tt class="py-docstring"> array contains an entry (in the order specified) of Product</tt> </tt>
-<a name="L1371"></a><tt class="py-lineno">1371</tt>  <tt class="py-line"><tt class="py-docstring"> Definition Template 4.N</tt> </tt>
-<a name="L1372"></a><tt class="py-lineno">1372</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
-<a name="L1373"></a><tt class="py-lineno">1373</tt>  <tt class="py-line"><tt class="py-docstring"> @param drtnum: Data Representation Template Number (see Code</tt> </tt>
-<a name="L1374"></a><tt class="py-lineno">1374</tt>  <tt class="py-line"><tt class="py-docstring"> U{Table 5.0</tt> </tt>
-<a name="L1375"></a><tt class="py-lineno">1375</tt>  <tt class="py-line"><tt class="py-docstring"> <http://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_table5-0.shtml>})</tt> </tt>
-<a name="L1376"></a><tt class="py-lineno">1376</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
-<a name="L1377"></a><tt class="py-lineno">1377</tt>  <tt class="py-line"><tt class="py-docstring"> @param drtmpl: Sequence with the data values for the specified Data Representation</tt> </tt>
-<a name="L1378"></a><tt class="py-lineno">1378</tt>  <tt class="py-line"><tt class="py-docstring"> Template (N=drtnum).  Each element of this integer</tt> </tt>
-<a name="L1379"></a><tt class="py-lineno">1379</tt>  <tt class="py-line"><tt class="py-docstring"> array contains an entry (in the order specified) of Data</tt> </tt>
-<a name="L1380"></a><tt class="py-lineno">1380</tt>  <tt class="py-line"><tt class="py-docstring"> Representation Template 5.N</tt> </tt>
-<a name="L1381"></a><tt class="py-lineno">1381</tt>  <tt class="py-line"><tt class="py-docstring"> Note that some values in this template (eg. reference</tt> </tt>
-<a name="L1382"></a><tt class="py-lineno">1382</tt>  <tt class="py-line"><tt class="py-docstring"> values, number of bits, etc...) may be changed by the</tt> </tt>
-<a name="L1383"></a><tt class="py-lineno">1383</tt>  <tt class="py-line"><tt class="py-docstring"> data packing algorithms.</tt> </tt>
-<a name="L1384"></a><tt class="py-lineno">1384</tt>  <tt class="py-line"><tt class="py-docstring"> Use this to specify scaling factors and order of</tt> </tt>
-<a name="L1385"></a><tt class="py-lineno">1385</tt>  <tt class="py-line"><tt class="py-docstring"> spatial differencing, if desired.</tt> </tt>
-<a name="L1386"></a><tt class="py-lineno">1386</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
-<a name="L1387"></a><tt class="py-lineno">1387</tt>  <tt class="py-line"><tt class="py-docstring"> @param field:  numpy array of data points to pack.</tt> </tt>
-<a name="L1388"></a><tt class="py-lineno">1388</tt>  <tt class="py-line"><tt class="py-docstring"> If field is a masked array, then a bitmap is created from</tt> </tt>
-<a name="L1389"></a><tt class="py-lineno">1389</tt>  <tt class="py-line"><tt class="py-docstring"> the mask.</tt> </tt>
-<a name="L1390"></a><tt class="py-lineno">1390</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
-<a name="L1391"></a><tt class="py-lineno">1391</tt>  <tt class="py-line"><tt class="py-docstring"> @param coordlist: Sequence containing floating point values intended to document</tt> </tt>
-<a name="L1392"></a><tt class="py-lineno">1392</tt>  <tt class="py-line"><tt class="py-docstring"> the vertical discretization with model data</tt> </tt>
-<a name="L1393"></a><tt class="py-lineno">1393</tt>  <tt class="py-line"><tt class="py-docstring"> on hybrid coordinate vertical levels. Default None.</tt> </tt>
-<a name="L1394"></a><tt class="py-lineno">1394</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
-<a name="L1395"></a><tt class="py-lineno">1395</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">hasattr</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">,</tt><tt class="py-string">'scanmodeflags'</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
-<a name="L1396"></a><tt class="py-lineno">1396</tt>  <tt class="py-line">            <tt class="py-keyword">raise</tt> <tt class="py-name">ValueError</tt><tt class="py-op">(</tt><tt class="py-string">'addgrid must be called before addfield'</tt><tt class="py-op">)</tt> </tt>
-<a name="L1397"></a><tt class="py-lineno">1397</tt>  <tt class="py-line">        <tt class="py-comment"># reorder array to be consistent with</tt> </tt>
-<a name="L1398"></a><tt class="py-lineno">1398</tt>  <tt class="py-line">        <tt class="py-comment"># specified scan order.</tt> </tt>
-<a name="L1399"></a><tt class="py-lineno">1399</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">scanmodeflags</tt> <tt class="py-keyword">is</tt> <tt class="py-keyword">not</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
-<a name="L1400"></a><tt class="py-lineno">1400</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">scanmodeflags</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">:</tt> </tt>
-<a name="L1401"></a><tt class="py-lineno">1401</tt>  <tt class="py-line">            <tt class="py-comment"># rows scan in the -x direction (so flip)</tt> </tt>
-<a name="L1402"></a><tt class="py-lineno">1402</tt>  <tt class="py-line">                <tt class="py-name">fieldsave</tt> <tt class="py-op">=</tt> <tt class="py-name">field</tt><tt class="py-op">.</tt><tt class="py-name">astype</tt><tt class="py-op">(</tt><tt class="py-string">'f'</tt><tt class="py-op">)</tt> <tt class="py-comment"># casting makes a copy</tt> </tt>
-<a name="L1403"></a><tt class="py-lineno">1403</tt>  <tt class="py-line">                <tt class="py-name">field</tt><tt class="py-op">[</tt><tt class="py-op">:</tt><tt class="py-op">,</tt><tt class="py-op">:</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">fieldsave</tt><tt class="py-op">[</tt><tt class="py-op">:</tt><tt class="py-op">,</tt><tt class="py-op">:</tt><tt class="py-op">:</tt><tt class="py-op">-</tt><tt class="py-number">1</tt><tt class="py-op">]</ [...]
-<a name="L1404"></a><tt class="py-lineno">1404</tt>  <tt class="py-line">            <tt class="py-comment"># columns scan in the -y direction (so flip)</tt> </tt>
-<a name="L1405"></a><tt class="py-lineno">1405</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">scanmodeflags</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">:</tt> </tt>
-<a name="L1406"></a><tt class="py-lineno">1406</tt>  <tt class="py-line">                <tt class="py-name">fieldsave</tt> <tt class="py-op">=</tt> <tt class="py-name">field</tt><tt class="py-op">.</tt><tt class="py-name">astype</tt><tt class="py-op">(</tt><tt class="py-string">'f'</tt><tt class="py-op">)</tt> <tt class="py-comment"># casting makes a copy</tt> </tt>
-<a name="L1407"></a><tt class="py-lineno">1407</tt>  <tt class="py-line">                <tt class="py-name">field</tt><tt class="py-op">[</tt><tt class="py-op">:</tt><tt class="py-op">,</tt><tt class="py-op">:</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">fieldsave</tt><tt class="py-op">[</tt><tt class="py-op">:</tt><tt class="py-op">:</tt><tt class="py-op">-</tt><tt class="py-number">1</tt><tt class="py-op">,</tt><tt class="py-op">:</tt><tt class="py-op">]</ [...]
-<a name="L1408"></a><tt class="py-lineno">1408</tt>  <tt class="py-line">            <tt class="py-comment"># adjacent rows scan in opposite direction.</tt> </tt>
-<a name="L1409"></a><tt class="py-lineno">1409</tt>  <tt class="py-line">            <tt class="py-comment"># (flip every other row)</tt> </tt>
-<a name="L1410"></a><tt class="py-lineno">1410</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">scanmodeflags</tt><tt class="py-op">[</tt><tt class="py-number">3</tt><tt class="py-op">]</tt><tt class="py-op">:</tt> </tt>
-<a name="L1411"></a><tt class="py-lineno">1411</tt>  <tt class="py-line">                <tt class="py-name">fieldsave</tt> <tt class="py-op">=</tt> <tt class="py-name">field</tt><tt class="py-op">.</tt><tt class="py-name">astype</tt><tt class="py-op">(</tt><tt class="py-string">'f'</tt><tt class="py-op">)</tt> <tt class="py-comment"># casting makes a copy</tt> </tt>
-<a name="L1412"></a><tt class="py-lineno">1412</tt>  <tt class="py-line">                <tt class="py-name">field</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">:</tt><tt class="py-op">:</tt><tt class="py-number">2</tt><tt class="py-op">,</tt><tt class="py-op">:</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">fieldsave</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">:</tt><tt class="py-op">:</tt><tt class="py [...]
-<a name="L1413"></a><tt class="py-lineno">1413</tt>  <tt class="py-line">        <tt class="py-name">fld</tt> <tt class="py-op">=</tt> <tt class="py-name">field</tt><tt class="py-op">.</tt><tt class="py-name">astype</tt><tt class="py-op">(</tt><tt class="py-string">'f'</tt><tt class="py-op">)</tt> </tt>
-<a name="L1414"></a><tt class="py-lineno">1414</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">ma</tt><tt class="py-op">.</tt><tt class="py-name">isMA</tt><tt class="py-op">(</tt><tt class="py-name">field</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
-<a name="L1415"></a><tt class="py-lineno">1415</tt>  <tt class="py-line">            <tt class="py-name">bmap</tt> <tt class="py-op">=</tt> <tt class="py-number">1</tt> <tt class="py-op">-</tt> <tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">ravel</tt><tt class="py-op">(</tt><tt class="py-name">field</tt><tt class="py-op">.</tt><tt class="py-name">mask</tt><tt class="py-op">.</tt><tt class="py-name">astype</tt><tt class="py-op">(</tt><tt class="py-string">'i'</tt>< [...]
-<a name="L1416"></a><tt class="py-lineno">1416</tt>  <tt class="py-line">            <tt class="py-name">bitmapflag</tt>  <tt class="py-op">=</tt> <tt class="py-number">0</tt> </tt>
-<a name="L1417"></a><tt class="py-lineno">1417</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
-<a name="L1418"></a><tt class="py-lineno">1418</tt>  <tt class="py-line">            <tt class="py-name">bitmapflag</tt> <tt class="py-op">=</tt> <tt class="py-number">255</tt> </tt>
-<a name="L1419"></a><tt class="py-lineno">1419</tt>  <tt class="py-line">            <tt class="py-name">bmap</tt> <tt class="py-op">=</tt> <tt class="py-name">None</tt> </tt>
-<a name="L1420"></a><tt class="py-lineno">1420</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">coordlist</tt> <tt class="py-keyword">is</tt> <tt class="py-keyword">not</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
-<a name="L1421"></a><tt class="py-lineno">1421</tt>  <tt class="py-line">            <tt class="py-name">crdlist</tt> <tt class="py-op">=</tt> <tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">array</tt><tt class="py-op">(</tt><tt class="py-name">coordlist</tt><tt class="py-op">,</tt><tt class="py-string">'f'</tt><tt class="py-op">)</tt> </tt>
-<a name="L1422"></a><tt class="py-lineno">1422</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
-<a name="L1423"></a><tt class="py-lineno">1423</tt>  <tt class="py-line">            <tt class="py-name">crdlist</tt> <tt class="py-op">=</tt> <tt class="py-name">None</tt> </tt>
-<a name="L1424"></a><tt class="py-lineno">1424</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">msg</tt><tt class="py-op">,</tt><tt class="py-name">msglen</tt><tt class="py-op">=</tt><tt class="py-name">g2clib</tt><tt class="py-op">.</tt><tt class="py-name">grib2_addfield</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">msg</tt><tt class="py-op">,</tt><tt class="py-name">pdtnum</ [...]
-</div><a name="L1425"></a><tt class="py-lineno">1425</tt>  <tt class="py-line"> </tt>
-<a name="Grib2Encode.end"></a><div id="Grib2Encode.end-def"><a name="L1426"></a><tt class="py-lineno">1426</tt> <a class="py-toggle" href="#" id="Grib2Encode.end-toggle" onclick="return toggle('Grib2Encode.end');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="ncepgrib2.Grib2Encode-class.html#end">end</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
-</div><div id="Grib2Encode.end-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Grib2Encode.end-expanded"><a name="L1427"></a><tt class="py-lineno">1427</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
-<a name="L1428"></a><tt class="py-lineno">1428</tt>  <tt class="py-line"><tt class="py-docstring"> Add an end section (section 8) to the GRIB2 message.</tt> </tt>
-<a name="L1429"></a><tt class="py-lineno">1429</tt>  <tt class="py-line"><tt class="py-docstring"> A GRIB2 message is not complete without an end section.</tt> </tt>
-<a name="L1430"></a><tt class="py-lineno">1430</tt>  <tt class="py-line"><tt class="py-docstring"> Once an end section is added, the GRIB2 message can be</tt> </tt>
-<a name="L1431"></a><tt class="py-lineno">1431</tt>  <tt class="py-line"><tt class="py-docstring"> output to a file.</tt> </tt>
-<a name="L1432"></a><tt class="py-lineno">1432</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
-<a name="L1433"></a><tt class="py-lineno">1433</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">msg</tt><tt class="py-op">,</tt><tt class="py-name">msglen</tt><tt class="py-op">=</tt><tt class="py-name">g2clib</tt><tt class="py-op">.</tt><tt class="py-name">grib2_end</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">msg</tt><tt class="py-op">)</tt> </tt>
-</div></div><a name="L1434"></a><tt class="py-lineno">1434</tt>  <tt class="py-line"> </tt><script type="text/javascript">
+<a name="L1234"></a><tt class="py-lineno">1234</tt>  <tt class="py-line"><tt class="py-docstring"> A GRIB Edition 2 message is a machine independent format for storing</tt> </tt>
+<a name="L1235"></a><tt class="py-lineno">1235</tt>  <tt class="py-line"><tt class="py-docstring"> one or more gridded data fields.  Each GRIB2 message consists of the</tt> </tt>
+<a name="L1236"></a><tt class="py-lineno">1236</tt>  <tt class="py-line"><tt class="py-docstring"> following sections:</tt> </tt>
+<a name="L1237"></a><tt class="py-lineno">1237</tt>  <tt class="py-line"><tt class="py-docstring">  - SECTION 0: Indicator Section - only one per message</tt> </tt>
+<a name="L1238"></a><tt class="py-lineno">1238</tt>  <tt class="py-line"><tt class="py-docstring">  - SECTION 1: Identification Section - only one per message</tt> </tt>
+<a name="L1239"></a><tt class="py-lineno">1239</tt>  <tt class="py-line"><tt class="py-docstring">  - SECTION 2: (Local Use Section) - optional</tt> </tt>
+<a name="L1240"></a><tt class="py-lineno">1240</tt>  <tt class="py-line"><tt class="py-docstring">  - SECTION 3: Grid Definition Section</tt> </tt>
+<a name="L1241"></a><tt class="py-lineno">1241</tt>  <tt class="py-line"><tt class="py-docstring">  - SECTION 4: Product Definition Section</tt> </tt>
+<a name="L1242"></a><tt class="py-lineno">1242</tt>  <tt class="py-line"><tt class="py-docstring">  - SECTION 5: Data Representation Section</tt> </tt>
+<a name="L1243"></a><tt class="py-lineno">1243</tt>  <tt class="py-line"><tt class="py-docstring">  - SECTION 6: Bit-map Section</tt> </tt>
+<a name="L1244"></a><tt class="py-lineno">1244</tt>  <tt class="py-line"><tt class="py-docstring">  - SECTION 7: Data Section</tt> </tt>
+<a name="L1245"></a><tt class="py-lineno">1245</tt>  <tt class="py-line"><tt class="py-docstring">  - SECTION 8: End Section</tt> </tt>
+<a name="L1246"></a><tt class="py-lineno">1246</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
+<a name="L1247"></a><tt class="py-lineno">1247</tt>  <tt class="py-line"><tt class="py-docstring"> Sequences of GRIB sections 2 to 7, 3 to 7, or sections 4 to 7 may be repeated</tt> </tt>
+<a name="L1248"></a><tt class="py-lineno">1248</tt>  <tt class="py-line"><tt class="py-docstring"> within a single GRIB message.  All sections within such repeated sequences</tt> </tt>
+<a name="L1249"></a><tt class="py-lineno">1249</tt>  <tt class="py-line"><tt class="py-docstring"> must be present and shall appear in the numerical order noted above.</tt> </tt>
+<a name="L1250"></a><tt class="py-lineno">1250</tt>  <tt class="py-line"><tt class="py-docstring"> Unrepeated sections remain in effect until redefined.</tt> </tt>
+<a name="L1251"></a><tt class="py-lineno">1251</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
+<a name="L1252"></a><tt class="py-lineno">1252</tt>  <tt class="py-line"><tt class="py-docstring"> Note:  Writing section 2 (the 'local use section') is</tt> </tt>
+<a name="L1253"></a><tt class="py-lineno">1253</tt>  <tt class="py-line"><tt class="py-docstring"> not yet supported.</tt> </tt>
+<a name="L1254"></a><tt class="py-lineno">1254</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
+<a name="L1255"></a><tt class="py-lineno">1255</tt>  <tt class="py-line"><tt class="py-docstring"> @ivar msg: A binary string containing the GRIB2 message.</tt> </tt>
+<a name="L1256"></a><tt class="py-lineno">1256</tt>  <tt class="py-line"><tt class="py-docstring"> After the message has been terminated by calling</tt> </tt>
+<a name="L1257"></a><tt class="py-lineno">1257</tt>  <tt class="py-line"><tt class="py-docstring"> the L{end} method, this string can be written to a file.</tt> </tt>
+<a name="L1258"></a><tt class="py-lineno">1258</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
+<a name="L1259"></a><tt class="py-lineno">1259</tt>  <tt class="py-line"> </tt>
+<a name="Grib2Encode.__init__"></a><div id="Grib2Encode.__init__-def"><a name="L1260"></a><tt class="py-lineno">1260</tt> <a class="py-toggle" href="#" id="Grib2Encode.__init__-toggle" onclick="return toggle('Grib2Encode.__init__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="ncepgrib2.Grib2Encode-class.html#__init__">__init__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">discipline</t [...]
+</div><div id="Grib2Encode.__init__-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Grib2Encode.__init__-expanded"><a name="L1261"></a><tt class="py-lineno">1261</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
+<a name="L1262"></a><tt class="py-lineno">1262</tt>  <tt class="py-line"><tt class="py-docstring"> create a Grib2Enecode class instance given the GRIB2 discipline</tt> </tt>
+<a name="L1263"></a><tt class="py-lineno">1263</tt>  <tt class="py-line"><tt class="py-docstring"> parameter and the identification section (sections 0 and 1).</tt> </tt>
+<a name="L1264"></a><tt class="py-lineno">1264</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
+<a name="L1265"></a><tt class="py-lineno">1265</tt>  <tt class="py-line"><tt class="py-docstring"> The GRIB2 message is stored as a binary string in instance variable L{msg}.</tt> </tt>
+<a name="L1266"></a><tt class="py-lineno">1266</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
+<a name="L1267"></a><tt class="py-lineno">1267</tt>  <tt class="py-line"><tt class="py-docstring"> L{addgrid}, L{addfield} and L{end} class methods must be called to complete</tt> </tt>
+<a name="L1268"></a><tt class="py-lineno">1268</tt>  <tt class="py-line"><tt class="py-docstring"> the GRIB2 message.</tt> </tt>
+<a name="L1269"></a><tt class="py-lineno">1269</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
+<a name="L1270"></a><tt class="py-lineno">1270</tt>  <tt class="py-line"><tt class="py-docstring"> @param discipline:  Discipline or GRIB Master Table Number (Code Table 0.0).</tt> </tt>
+<a name="L1271"></a><tt class="py-lineno">1271</tt>  <tt class="py-line"><tt class="py-docstring"> (0 for meteorlogical, 1 for hydrological, 2 for land surface, 3 for space,</tt> </tt>
+<a name="L1272"></a><tt class="py-lineno">1272</tt>  <tt class="py-line"><tt class="py-docstring"> 10 for oceanographic products).</tt> </tt>
+<a name="L1273"></a><tt class="py-lineno">1273</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
+<a name="L1274"></a><tt class="py-lineno">1274</tt>  <tt class="py-line"><tt class="py-docstring"> @param idsect:  Sequence containing identification section (section 1).</tt> </tt>
+<a name="L1275"></a><tt class="py-lineno">1275</tt>  <tt class="py-line"><tt class="py-docstring">  - idsect[0]=Id of orginating centre (Common Code</tt> </tt>
+<a name="L1276"></a><tt class="py-lineno">1276</tt>  <tt class="py-line"><tt class="py-docstring">    U{Table C-1<http://www.nws.noaa.gov/tg/GRIB_C1.htm>})</tt> </tt>
+<a name="L1277"></a><tt class="py-lineno">1277</tt>  <tt class="py-line"><tt class="py-docstring">  - idsect[1]=Id of orginating sub-centre (local table)</tt> </tt>
+<a name="L1278"></a><tt class="py-lineno">1278</tt>  <tt class="py-line"><tt class="py-docstring">  - idsect[2]=GRIB Master Tables Version Number (Code</tt> </tt>
+<a name="L1279"></a><tt class="py-lineno">1279</tt>  <tt class="py-line"><tt class="py-docstring">    U{Table 1.0</tt> </tt>
+<a name="L1280"></a><tt class="py-lineno">1280</tt>  <tt class="py-line"><tt class="py-docstring">    <http://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_table1-0.shtml>})</tt> </tt>
+<a name="L1281"></a><tt class="py-lineno">1281</tt>  <tt class="py-line"><tt class="py-docstring">  - idsect[3]=GRIB Local Tables Version Number (Code</tt> </tt>
+<a name="L1282"></a><tt class="py-lineno">1282</tt>  <tt class="py-line"><tt class="py-docstring">    U{Table 1.1</tt> </tt>
+<a name="L1283"></a><tt class="py-lineno">1283</tt>  <tt class="py-line"><tt class="py-docstring">    <http://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_table1-1.shtml>})</tt> </tt>
+<a name="L1284"></a><tt class="py-lineno">1284</tt>  <tt class="py-line"><tt class="py-docstring">  - idsect[4]=Significance of Reference Time (Code</tt> </tt>
+<a name="L1285"></a><tt class="py-lineno">1285</tt>  <tt class="py-line"><tt class="py-docstring">    U{Table 1.2</tt> </tt>
+<a name="L1286"></a><tt class="py-lineno">1286</tt>  <tt class="py-line"><tt class="py-docstring">    <http://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_table1-2.shtml>})</tt> </tt>
+<a name="L1287"></a><tt class="py-lineno">1287</tt>  <tt class="py-line"><tt class="py-docstring">  - idsect[5]=Reference Time - Year (4 digits)</tt> </tt>
+<a name="L1288"></a><tt class="py-lineno">1288</tt>  <tt class="py-line"><tt class="py-docstring">  - idsect[6]=Reference Time - Month</tt> </tt>
+<a name="L1289"></a><tt class="py-lineno">1289</tt>  <tt class="py-line"><tt class="py-docstring">  - idsect[7]=Reference Time - Day</tt> </tt>
+<a name="L1290"></a><tt class="py-lineno">1290</tt>  <tt class="py-line"><tt class="py-docstring">  - idsect[8]=Reference Time - Hour</tt> </tt>
+<a name="L1291"></a><tt class="py-lineno">1291</tt>  <tt class="py-line"><tt class="py-docstring">  - idsect[9]=Reference Time - Minute</tt> </tt>
+<a name="L1292"></a><tt class="py-lineno">1292</tt>  <tt class="py-line"><tt class="py-docstring">  - idsect[10]=Reference Time - Second</tt> </tt>
+<a name="L1293"></a><tt class="py-lineno">1293</tt>  <tt class="py-line"><tt class="py-docstring">  - idsect[11]=Production status of data (Code</tt> </tt>
+<a name="L1294"></a><tt class="py-lineno">1294</tt>  <tt class="py-line"><tt class="py-docstring">    U{Table 1.3</tt> </tt>
+<a name="L1295"></a><tt class="py-lineno">1295</tt>  <tt class="py-line"><tt class="py-docstring">    <http://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_table1-3.shtml>})</tt> </tt>
+<a name="L1296"></a><tt class="py-lineno">1296</tt>  <tt class="py-line"><tt class="py-docstring">  - idsect[12]=Type of processed data (Code</tt> </tt>
+<a name="L1297"></a><tt class="py-lineno">1297</tt>  <tt class="py-line"><tt class="py-docstring">    U{Table</tt> </tt>
+<a name="L1298"></a><tt class="py-lineno">1298</tt>  <tt class="py-line"><tt class="py-docstring">    1.4<http://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_table1-4.shtml>})</tt> </tt>
+<a name="L1299"></a><tt class="py-lineno">1299</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
+<a name="L1300"></a><tt class="py-lineno">1300</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">msg</tt><tt class="py-op">,</tt><tt class="py-name">msglen</tt><tt class="py-op">=</tt><tt class="py-name">g2clib</tt><tt class="py-op">.</tt><tt class="py-name">grib2_create</tt><tt class="py-op">(</tt><tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">array</tt><tt class="py-op">(</tt><tt class="py-op">[</tt><tt cl [...]
+</div><a name="L1301"></a><tt class="py-lineno">1301</tt>  <tt class="py-line"> </tt>
+<a name="Grib2Encode.addgrid"></a><div id="Grib2Encode.addgrid-def"><a name="L1302"></a><tt class="py-lineno">1302</tt> <a class="py-toggle" href="#" id="Grib2Encode.addgrid-toggle" onclick="return toggle('Grib2Encode.addgrid');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="ncepgrib2.Grib2Encode-class.html#addgrid">addgrid</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">gdsinfo</tt><tt clas [...]
+</div><div id="Grib2Encode.addgrid-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Grib2Encode.addgrid-expanded"><a name="L1303"></a><tt class="py-lineno">1303</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
+<a name="L1304"></a><tt class="py-lineno">1304</tt>  <tt class="py-line"><tt class="py-docstring"> Add a grid definition section (section 3) to the GRIB2 message.</tt> </tt>
+<a name="L1305"></a><tt class="py-lineno">1305</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
+<a name="L1306"></a><tt class="py-lineno">1306</tt>  <tt class="py-line"><tt class="py-docstring"> @param gdsinfo: Sequence containing information needed for the grid definition section.</tt> </tt>
+<a name="L1307"></a><tt class="py-lineno">1307</tt>  <tt class="py-line"><tt class="py-docstring">  - gdsinfo[0] = Source of grid definition (see Code</tt> </tt>
+<a name="L1308"></a><tt class="py-lineno">1308</tt>  <tt class="py-line"><tt class="py-docstring">    U{Table 3.0</tt> </tt>
+<a name="L1309"></a><tt class="py-lineno">1309</tt>  <tt class="py-line"><tt class="py-docstring">    <http://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_table3-0.shtml>})</tt> </tt>
+<a name="L1310"></a><tt class="py-lineno">1310</tt>  <tt class="py-line"><tt class="py-docstring">  - gdsinfo[1] = Number of grid points in the defined grid.</tt> </tt>
+<a name="L1311"></a><tt class="py-lineno">1311</tt>  <tt class="py-line"><tt class="py-docstring">  - gdsinfo[2] = Number of octets needed for each additional grid points defn.</tt> </tt>
+<a name="L1312"></a><tt class="py-lineno">1312</tt>  <tt class="py-line"><tt class="py-docstring">    Used to define number of points in each row for non-reg grids (=0 for</tt> </tt>
+<a name="L1313"></a><tt class="py-lineno">1313</tt>  <tt class="py-line"><tt class="py-docstring">    regular grid).</tt> </tt>
+<a name="L1314"></a><tt class="py-lineno">1314</tt>  <tt class="py-line"><tt class="py-docstring">  - gdsinfo[3] = Interp. of list for optional points defn (Code</tt> </tt>
+<a name="L1315"></a><tt class="py-lineno">1315</tt>  <tt class="py-line"><tt class="py-docstring">    U{Table 3.11</tt> </tt>
+<a name="L1316"></a><tt class="py-lineno">1316</tt>  <tt class="py-line"><tt class="py-docstring">    <http://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_table3-11.shtml>})</tt> </tt>
+<a name="L1317"></a><tt class="py-lineno">1317</tt>  <tt class="py-line"><tt class="py-docstring">  - gdsinfo[4] = Grid Definition Template Number (Code</tt> </tt>
+<a name="L1318"></a><tt class="py-lineno">1318</tt>  <tt class="py-line"><tt class="py-docstring">    U{Table 3.1</tt> </tt>
+<a name="L1319"></a><tt class="py-lineno">1319</tt>  <tt class="py-line"><tt class="py-docstring">    <http://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_table3-1.shtml>})</tt> </tt>
+<a name="L1320"></a><tt class="py-lineno">1320</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
+<a name="L1321"></a><tt class="py-lineno">1321</tt>  <tt class="py-line"><tt class="py-docstring"> @param gdtmpl: Contains the data values for the specified Grid Definition</tt> </tt>
+<a name="L1322"></a><tt class="py-lineno">1322</tt>  <tt class="py-line"><tt class="py-docstring"> Template ( NN=gdsinfo[4] ).  Each element of this integer</tt> </tt>
+<a name="L1323"></a><tt class="py-lineno">1323</tt>  <tt class="py-line"><tt class="py-docstring"> array contains an entry (in the order specified) of Grid</tt> </tt>
+<a name="L1324"></a><tt class="py-lineno">1324</tt>  <tt class="py-line"><tt class="py-docstring"> Definition Template 3.NN</tt> </tt>
+<a name="L1325"></a><tt class="py-lineno">1325</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
+<a name="L1326"></a><tt class="py-lineno">1326</tt>  <tt class="py-line"><tt class="py-docstring"> @param deflist: (Used if gdsinfo[2] != 0)  Sequence containing the</tt> </tt>
+<a name="L1327"></a><tt class="py-lineno">1327</tt>  <tt class="py-line"><tt class="py-docstring"> number of grid points contained in each row (or column)</tt> </tt>
+<a name="L1328"></a><tt class="py-lineno">1328</tt>  <tt class="py-line"><tt class="py-docstring"> of a non-regular grid.</tt> </tt>
+<a name="L1329"></a><tt class="py-lineno">1329</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
+<a name="L1330"></a><tt class="py-lineno">1330</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">deflist</tt> <tt class="py-keyword">is</tt> <tt class="py-keyword">not</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
+<a name="L1331"></a><tt class="py-lineno">1331</tt>  <tt class="py-line">            <tt class="py-name">dflist</tt> <tt class="py-op">=</tt> <tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">array</tt><tt class="py-op">(</tt><tt class="py-name">deflist</tt><tt class="py-op">,</tt><tt class="py-string">'i'</tt><tt class="py-op">)</tt> </tt>
+<a name="L1332"></a><tt class="py-lineno">1332</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
+<a name="L1333"></a><tt class="py-lineno">1333</tt>  <tt class="py-line">            <tt class="py-name">dflist</tt> <tt class="py-op">=</tt> <tt class="py-name">None</tt> </tt>
+<a name="L1334"></a><tt class="py-lineno">1334</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">scanmodeflags</tt> <tt class="py-op">=</tt> <tt class="py-name">None</tt> </tt>
+<a name="L1335"></a><tt class="py-lineno">1335</tt>  <tt class="py-line">        <tt class="py-name">gdtnum</tt> <tt class="py-op">=</tt> <tt class="py-name">gdsinfo</tt><tt class="py-op">[</tt><tt class="py-number">4</tt><tt class="py-op">]</tt> </tt>
+<a name="L1336"></a><tt class="py-lineno">1336</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">gdtnum</tt> <tt class="py-keyword">in</tt> <tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">,</tt><tt class="py-number">1</tt><tt class="py-op">,</tt><tt class="py-number">2</tt><tt class="py-op">,</tt><tt class="py-number">3</tt><tt class="py-op">,</tt><tt class="py-number">40</tt><tt class="py-op">,</tt><tt class="py-number">41</tt><tt [...]
+<a name="L1337"></a><tt class="py-lineno">1337</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">scanmodeflags</tt> <tt class="py-op">=</tt> <tt class="py-name">_dec2bin</tt><tt class="py-op">(</tt><tt class="py-name">gdtmpl</tt><tt class="py-op">[</tt><tt class="py-number">18</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">:</tt><tt class="py-number">4</ [...]
+<a name="L1338"></a><tt class="py-lineno">1338</tt>  <tt class="py-line">        <tt class="py-keyword">elif</tt> <tt class="py-name">gdtnum</tt> <tt class="py-op">==</tt> <tt class="py-number">10</tt><tt class="py-op">:</tt> <tt class="py-comment"># mercator</tt> </tt>
+<a name="L1339"></a><tt class="py-lineno">1339</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">scanmodeflags</tt> <tt class="py-op">=</tt> <tt class="py-name">_dec2bin</tt><tt class="py-op">(</tt><tt class="py-name">gdtmpl</tt><tt class="py-op">[</tt><tt class="py-number">15</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">:</tt><tt class="py-number">4</ [...]
+<a name="L1340"></a><tt class="py-lineno">1340</tt>  <tt class="py-line">        <tt class="py-keyword">elif</tt> <tt class="py-name">gdtnum</tt> <tt class="py-op">==</tt> <tt class="py-number">20</tt><tt class="py-op">:</tt> <tt class="py-comment"># stereographic</tt> </tt>
+<a name="L1341"></a><tt class="py-lineno">1341</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">scanmodeflags</tt> <tt class="py-op">=</tt> <tt class="py-name">_dec2bin</tt><tt class="py-op">(</tt><tt class="py-name">gdtmpl</tt><tt class="py-op">[</tt><tt class="py-number">17</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">:</tt><tt class="py-number">4</ [...]
+<a name="L1342"></a><tt class="py-lineno">1342</tt>  <tt class="py-line">        <tt class="py-keyword">elif</tt> <tt class="py-name">gdtnum</tt> <tt class="py-op">==</tt> <tt class="py-number">30</tt><tt class="py-op">:</tt> <tt class="py-comment"># lambert conformal</tt> </tt>
+<a name="L1343"></a><tt class="py-lineno">1343</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">scanmodeflags</tt> <tt class="py-op">=</tt> <tt class="py-name">_dec2bin</tt><tt class="py-op">(</tt><tt class="py-name">gdtmpl</tt><tt class="py-op">[</tt><tt class="py-number">17</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">:</tt><tt class="py-number">4</ [...]
+<a name="L1344"></a><tt class="py-lineno">1344</tt>  <tt class="py-line">        <tt class="py-keyword">elif</tt> <tt class="py-name">gdtnum</tt> <tt class="py-op">==</tt> <tt class="py-number">31</tt><tt class="py-op">:</tt> <tt class="py-comment"># albers equal area.</tt> </tt>
+<a name="L1345"></a><tt class="py-lineno">1345</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">scanmodeflags</tt> <tt class="py-op">=</tt> <tt class="py-name">_dec2bin</tt><tt class="py-op">(</tt><tt class="py-name">gdtmpl</tt><tt class="py-op">[</tt><tt class="py-number">17</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">:</tt><tt class="py-number">4</ [...]
+<a name="L1346"></a><tt class="py-lineno">1346</tt>  <tt class="py-line">        <tt class="py-keyword">elif</tt> <tt class="py-name">gdtnum</tt> <tt class="py-op">==</tt> <tt class="py-number">90</tt><tt class="py-op">:</tt> <tt class="py-comment"># near-sided vertical perspective satellite projection</tt> </tt>
+<a name="L1347"></a><tt class="py-lineno">1347</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">scanmodeflags</tt> <tt class="py-op">=</tt> <tt class="py-name">_dec2bin</tt><tt class="py-op">(</tt><tt class="py-name">gdtmpl</tt><tt class="py-op">[</tt><tt class="py-number">16</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">:</tt><tt class="py-number">4</ [...]
+<a name="L1348"></a><tt class="py-lineno">1348</tt>  <tt class="py-line">        <tt class="py-keyword">elif</tt> <tt class="py-name">gdtnum</tt> <tt class="py-op">==</tt> <tt class="py-number">110</tt><tt class="py-op">:</tt> <tt class="py-comment"># azimuthal equidistant.</tt> </tt>
+<a name="L1349"></a><tt class="py-lineno">1349</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">scanmodeflags</tt> <tt class="py-op">=</tt> <tt class="py-name">_dec2bin</tt><tt class="py-op">(</tt><tt class="py-name">gdtmpl</tt><tt class="py-op">[</tt><tt class="py-number">15</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">:</tt><tt class="py-number">4</ [...]
+<a name="L1350"></a><tt class="py-lineno">1350</tt>  <tt class="py-line">        <tt class="py-keyword">elif</tt> <tt class="py-name">gdtnum</tt> <tt class="py-op">==</tt> <tt class="py-number">120</tt><tt class="py-op">:</tt> </tt>
+<a name="L1351"></a><tt class="py-lineno">1351</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">scanmodeflags</tt> <tt class="py-op">=</tt> <tt class="py-name">_dec2bin</tt><tt class="py-op">(</tt><tt class="py-name">gdtmpl</tt><tt class="py-op">[</tt><tt class="py-number">6</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">:</tt><tt class="py-number">4</t [...]
+<a name="L1352"></a><tt class="py-lineno">1352</tt>  <tt class="py-line">        <tt class="py-keyword">elif</tt> <tt class="py-name">gdtnum</tt> <tt class="py-op">==</tt> <tt class="py-number">204</tt><tt class="py-op">:</tt> <tt class="py-comment"># curvilinear orthogonal</tt> </tt>
+<a name="L1353"></a><tt class="py-lineno">1353</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">scanmodeflags</tt> <tt class="py-op">=</tt> <tt class="py-name">_dec2bin</tt><tt class="py-op">(</tt><tt class="py-name">gdtmpl</tt><tt class="py-op">[</tt><tt class="py-number">18</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">:</tt><tt class="py-number">4</ [...]
+<a name="L1354"></a><tt class="py-lineno">1354</tt>  <tt class="py-line">        <tt class="py-keyword">elif</tt> <tt class="py-name">gdtnum</tt> <tt class="py-keyword">in</tt> <tt class="py-op">[</tt><tt class="py-number">1000</tt><tt class="py-op">,</tt><tt class="py-number">1100</tt><tt class="py-op">]</tt><tt class="py-op">:</tt> </tt>
+<a name="L1355"></a><tt class="py-lineno">1355</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">scanmodeflags</tt> <tt class="py-op">=</tt> <tt class="py-name">_dec2bin</tt><tt class="py-op">(</tt><tt class="py-name">gdtmpl</tt><tt class="py-op">[</tt><tt class="py-number">12</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">:</tt><tt class="py-number">4</ [...]
+<a name="L1356"></a><tt class="py-lineno">1356</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">msg</tt><tt class="py-op">,</tt><tt class="py-name">msglen</tt><tt class="py-op">=</tt><tt class="py-name">g2clib</tt><tt class="py-op">.</tt><tt class="py-name">grib2_addgrid</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">msg</tt><tt class="py-op">,</tt><tt class="py-name">np</tt><t [...]
+</div><a name="L1357"></a><tt class="py-lineno">1357</tt>  <tt class="py-line"> </tt>
+<a name="Grib2Encode.addfield"></a><div id="Grib2Encode.addfield-def"><a name="L1358"></a><tt class="py-lineno">1358</tt> <a class="py-toggle" href="#" id="Grib2Encode.addfield-toggle" onclick="return toggle('Grib2Encode.addfield');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="ncepgrib2.Grib2Encode-class.html#addfield">addfield</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">pdtnum</tt><tt [...]
+</div><div id="Grib2Encode.addfield-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Grib2Encode.addfield-expanded"><a name="L1359"></a><tt class="py-lineno">1359</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
+<a name="L1360"></a><tt class="py-lineno">1360</tt>  <tt class="py-line"><tt class="py-docstring"> Add a product definition section, data representation section,</tt> </tt>
+<a name="L1361"></a><tt class="py-lineno">1361</tt>  <tt class="py-line"><tt class="py-docstring"> bitmap section and data section to the GRIB2 message (sections 4-7).</tt> </tt>
+<a name="L1362"></a><tt class="py-lineno">1362</tt>  <tt class="py-line"><tt class="py-docstring"> Must be called after grid definition section is created with L{addgrid}.</tt> </tt>
+<a name="L1363"></a><tt class="py-lineno">1363</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
+<a name="L1364"></a><tt class="py-lineno">1364</tt>  <tt class="py-line"><tt class="py-docstring"> @param pdtnum: Product Definition Template Number (see Code U{Table</tt> </tt>
+<a name="L1365"></a><tt class="py-lineno">1365</tt>  <tt class="py-line"><tt class="py-docstring"> 4.0<http://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_table4-0.shtml>})</tt> </tt>
+<a name="L1366"></a><tt class="py-lineno">1366</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
+<a name="L1367"></a><tt class="py-lineno">1367</tt>  <tt class="py-line"><tt class="py-docstring"> @param pdtmpl: Sequence with the data values for the specified Product Definition</tt> </tt>
+<a name="L1368"></a><tt class="py-lineno">1368</tt>  <tt class="py-line"><tt class="py-docstring"> Template (N=pdtnum).  Each element of this integer</tt> </tt>
+<a name="L1369"></a><tt class="py-lineno">1369</tt>  <tt class="py-line"><tt class="py-docstring"> array contains an entry (in the order specified) of Product</tt> </tt>
+<a name="L1370"></a><tt class="py-lineno">1370</tt>  <tt class="py-line"><tt class="py-docstring"> Definition Template 4.N</tt> </tt>
+<a name="L1371"></a><tt class="py-lineno">1371</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
+<a name="L1372"></a><tt class="py-lineno">1372</tt>  <tt class="py-line"><tt class="py-docstring"> @param drtnum: Data Representation Template Number (see Code</tt> </tt>
+<a name="L1373"></a><tt class="py-lineno">1373</tt>  <tt class="py-line"><tt class="py-docstring"> U{Table 5.0</tt> </tt>
+<a name="L1374"></a><tt class="py-lineno">1374</tt>  <tt class="py-line"><tt class="py-docstring"> <http://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_table5-0.shtml>})</tt> </tt>
+<a name="L1375"></a><tt class="py-lineno">1375</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
+<a name="L1376"></a><tt class="py-lineno">1376</tt>  <tt class="py-line"><tt class="py-docstring"> @param drtmpl: Sequence with the data values for the specified Data Representation</tt> </tt>
+<a name="L1377"></a><tt class="py-lineno">1377</tt>  <tt class="py-line"><tt class="py-docstring"> Template (N=drtnum).  Each element of this integer</tt> </tt>
+<a name="L1378"></a><tt class="py-lineno">1378</tt>  <tt class="py-line"><tt class="py-docstring"> array contains an entry (in the order specified) of Data</tt> </tt>
+<a name="L1379"></a><tt class="py-lineno">1379</tt>  <tt class="py-line"><tt class="py-docstring"> Representation Template 5.N</tt> </tt>
+<a name="L1380"></a><tt class="py-lineno">1380</tt>  <tt class="py-line"><tt class="py-docstring"> Note that some values in this template (eg. reference</tt> </tt>
+<a name="L1381"></a><tt class="py-lineno">1381</tt>  <tt class="py-line"><tt class="py-docstring"> values, number of bits, etc...) may be changed by the</tt> </tt>
+<a name="L1382"></a><tt class="py-lineno">1382</tt>  <tt class="py-line"><tt class="py-docstring"> data packing algorithms.</tt> </tt>
+<a name="L1383"></a><tt class="py-lineno">1383</tt>  <tt class="py-line"><tt class="py-docstring"> Use this to specify scaling factors and order of</tt> </tt>
+<a name="L1384"></a><tt class="py-lineno">1384</tt>  <tt class="py-line"><tt class="py-docstring"> spatial differencing, if desired.</tt> </tt>
+<a name="L1385"></a><tt class="py-lineno">1385</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
+<a name="L1386"></a><tt class="py-lineno">1386</tt>  <tt class="py-line"><tt class="py-docstring"> @param field:  numpy array of data points to pack.</tt> </tt>
+<a name="L1387"></a><tt class="py-lineno">1387</tt>  <tt class="py-line"><tt class="py-docstring"> If field is a masked array, then a bitmap is created from</tt> </tt>
+<a name="L1388"></a><tt class="py-lineno">1388</tt>  <tt class="py-line"><tt class="py-docstring"> the mask.</tt> </tt>
+<a name="L1389"></a><tt class="py-lineno">1389</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
+<a name="L1390"></a><tt class="py-lineno">1390</tt>  <tt class="py-line"><tt class="py-docstring"> @param coordlist: Sequence containing floating point values intended to document</tt> </tt>
+<a name="L1391"></a><tt class="py-lineno">1391</tt>  <tt class="py-line"><tt class="py-docstring"> the vertical discretization with model data</tt> </tt>
+<a name="L1392"></a><tt class="py-lineno">1392</tt>  <tt class="py-line"><tt class="py-docstring"> on hybrid coordinate vertical levels. Default None.</tt> </tt>
+<a name="L1393"></a><tt class="py-lineno">1393</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
+<a name="L1394"></a><tt class="py-lineno">1394</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">hasattr</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">,</tt><tt class="py-string">'scanmodeflags'</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
+<a name="L1395"></a><tt class="py-lineno">1395</tt>  <tt class="py-line">            <tt class="py-keyword">raise</tt> <tt class="py-name">ValueError</tt><tt class="py-op">(</tt><tt class="py-string">'addgrid must be called before addfield'</tt><tt class="py-op">)</tt> </tt>
+<a name="L1396"></a><tt class="py-lineno">1396</tt>  <tt class="py-line">        <tt class="py-comment"># reorder array to be consistent with</tt> </tt>
+<a name="L1397"></a><tt class="py-lineno">1397</tt>  <tt class="py-line">        <tt class="py-comment"># specified scan order.</tt> </tt>
+<a name="L1398"></a><tt class="py-lineno">1398</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">scanmodeflags</tt> <tt class="py-keyword">is</tt> <tt class="py-keyword">not</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
+<a name="L1399"></a><tt class="py-lineno">1399</tt>  <tt class="py-line">            <tt class="py-comment">#if self.scanmodeflags[0]:</tt> </tt>
+<a name="L1400"></a><tt class="py-lineno">1400</tt>  <tt class="py-line">            <tt class="py-comment">## rows scan in the -x direction (so flip)</tt> </tt>
+<a name="L1401"></a><tt class="py-lineno">1401</tt>  <tt class="py-line">            <tt class="py-comment">#    fieldsave = field.astype('f') # casting makes a copy</tt> </tt>
+<a name="L1402"></a><tt class="py-lineno">1402</tt>  <tt class="py-line">            <tt class="py-comment">#    field[:,:] = fieldsave[:,::-1]</tt> </tt>
+<a name="L1403"></a><tt class="py-lineno">1403</tt>  <tt class="py-line">            <tt class="py-comment">## columns scan in the -y direction (so flip)</tt> </tt>
+<a name="L1404"></a><tt class="py-lineno">1404</tt>  <tt class="py-line">            <tt class="py-comment">#if not self.scanmodeflags[1]:</tt> </tt>
+<a name="L1405"></a><tt class="py-lineno">1405</tt>  <tt class="py-line">            <tt class="py-comment">#    fieldsave = field.astype('f') # casting makes a copy</tt> </tt>
+<a name="L1406"></a><tt class="py-lineno">1406</tt>  <tt class="py-line">            <tt class="py-comment">#    field[:,:] = fieldsave[::-1,:]</tt> </tt>
+<a name="L1407"></a><tt class="py-lineno">1407</tt>  <tt class="py-line">            <tt class="py-comment"># adjacent rows scan in opposite direction.</tt> </tt>
+<a name="L1408"></a><tt class="py-lineno">1408</tt>  <tt class="py-line">            <tt class="py-comment"># (flip every other row)</tt> </tt>
+<a name="L1409"></a><tt class="py-lineno">1409</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">scanmodeflags</tt><tt class="py-op">[</tt><tt class="py-number">3</tt><tt class="py-op">]</tt><tt class="py-op">:</tt> </tt>
+<a name="L1410"></a><tt class="py-lineno">1410</tt>  <tt class="py-line">                <tt class="py-name">fieldsave</tt> <tt class="py-op">=</tt> <tt class="py-name">field</tt><tt class="py-op">.</tt><tt class="py-name">astype</tt><tt class="py-op">(</tt><tt class="py-string">'f'</tt><tt class="py-op">)</tt> <tt class="py-comment"># casting makes a copy</tt> </tt>
+<a name="L1411"></a><tt class="py-lineno">1411</tt>  <tt class="py-line">                <tt class="py-name">field</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">:</tt><tt class="py-op">:</tt><tt class="py-number">2</tt><tt class="py-op">,</tt><tt class="py-op">:</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">fieldsave</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">:</tt><tt class="py-op">:</tt><tt class="py [...]
+<a name="L1412"></a><tt class="py-lineno">1412</tt>  <tt class="py-line">        <tt class="py-name">fld</tt> <tt class="py-op">=</tt> <tt class="py-name">field</tt><tt class="py-op">.</tt><tt class="py-name">astype</tt><tt class="py-op">(</tt><tt class="py-string">'f'</tt><tt class="py-op">)</tt> </tt>
+<a name="L1413"></a><tt class="py-lineno">1413</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">ma</tt><tt class="py-op">.</tt><tt class="py-name">isMA</tt><tt class="py-op">(</tt><tt class="py-name">field</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
+<a name="L1414"></a><tt class="py-lineno">1414</tt>  <tt class="py-line">            <tt class="py-name">bmap</tt> <tt class="py-op">=</tt> <tt class="py-number">1</tt> <tt class="py-op">-</tt> <tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">ravel</tt><tt class="py-op">(</tt><tt class="py-name">field</tt><tt class="py-op">.</tt><tt class="py-name">mask</tt><tt class="py-op">.</tt><tt class="py-name">astype</tt><tt class="py-op">(</tt><tt class="py-string">'i'</tt>< [...]
+<a name="L1415"></a><tt class="py-lineno">1415</tt>  <tt class="py-line">            <tt class="py-name">bitmapflag</tt>  <tt class="py-op">=</tt> <tt class="py-number">0</tt> </tt>
+<a name="L1416"></a><tt class="py-lineno">1416</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
+<a name="L1417"></a><tt class="py-lineno">1417</tt>  <tt class="py-line">            <tt class="py-name">bitmapflag</tt> <tt class="py-op">=</tt> <tt class="py-number">255</tt> </tt>
+<a name="L1418"></a><tt class="py-lineno">1418</tt>  <tt class="py-line">            <tt class="py-name">bmap</tt> <tt class="py-op">=</tt> <tt class="py-name">None</tt> </tt>
+<a name="L1419"></a><tt class="py-lineno">1419</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">coordlist</tt> <tt class="py-keyword">is</tt> <tt class="py-keyword">not</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
+<a name="L1420"></a><tt class="py-lineno">1420</tt>  <tt class="py-line">            <tt class="py-name">crdlist</tt> <tt class="py-op">=</tt> <tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">array</tt><tt class="py-op">(</tt><tt class="py-name">coordlist</tt><tt class="py-op">,</tt><tt class="py-string">'f'</tt><tt class="py-op">)</tt> </tt>
+<a name="L1421"></a><tt class="py-lineno">1421</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
+<a name="L1422"></a><tt class="py-lineno">1422</tt>  <tt class="py-line">            <tt class="py-name">crdlist</tt> <tt class="py-op">=</tt> <tt class="py-name">None</tt> </tt>
+<a name="L1423"></a><tt class="py-lineno">1423</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">msg</tt><tt class="py-op">,</tt><tt class="py-name">msglen</tt><tt class="py-op">=</tt><tt class="py-name">g2clib</tt><tt class="py-op">.</tt><tt class="py-name">grib2_addfield</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">msg</tt><tt class="py-op">,</tt><tt class="py-name">pdtnum</ [...]
+</div><a name="L1424"></a><tt class="py-lineno">1424</tt>  <tt class="py-line"> </tt>
+<a name="Grib2Encode.end"></a><div id="Grib2Encode.end-def"><a name="L1425"></a><tt class="py-lineno">1425</tt> <a class="py-toggle" href="#" id="Grib2Encode.end-toggle" onclick="return toggle('Grib2Encode.end');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="ncepgrib2.Grib2Encode-class.html#end">end</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
+</div><div id="Grib2Encode.end-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Grib2Encode.end-expanded"><a name="L1426"></a><tt class="py-lineno">1426</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
+<a name="L1427"></a><tt class="py-lineno">1427</tt>  <tt class="py-line"><tt class="py-docstring"> Add an end section (section 8) to the GRIB2 message.</tt> </tt>
+<a name="L1428"></a><tt class="py-lineno">1428</tt>  <tt class="py-line"><tt class="py-docstring"> A GRIB2 message is not complete without an end section.</tt> </tt>
+<a name="L1429"></a><tt class="py-lineno">1429</tt>  <tt class="py-line"><tt class="py-docstring"> Once an end section is added, the GRIB2 message can be</tt> </tt>
+<a name="L1430"></a><tt class="py-lineno">1430</tt>  <tt class="py-line"><tt class="py-docstring"> output to a file.</tt> </tt>
+<a name="L1431"></a><tt class="py-lineno">1431</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
+<a name="L1432"></a><tt class="py-lineno">1432</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">msg</tt><tt class="py-op">,</tt><tt class="py-name">msglen</tt><tt class="py-op">=</tt><tt class="py-name">g2clib</tt><tt class="py-op">.</tt><tt class="py-name">grib2_end</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">msg</tt><tt class="py-op">)</tt> </tt>
+</div></div><a name="L1433"></a><tt class="py-lineno">1433</tt>  <tt class="py-line"> </tt><script type="text/javascript">
 <!--
 expandto(location.href);
 // -->
@@ -1515,8 +1514,7 @@ expandto(location.href);
 <table border="0" cellpadding="0" cellspacing="0" width="100%%">
   <tr>
     <td align="left" class="footer">
-    Generated by Epydoc 3.0.1
-    on Wed Nov 20 14:10:14 2013
+    Generated by Epydoc 3.0.1 on Mon Dec 29 14:23:17 2014
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
diff --git a/ncepgrib2_docs/ncepgrib2.Grib2Encode-class.html b/ncepgrib2_docs/ncepgrib2.Grib2Encode-class.html
index 4f7b9dc..76525bc 100644
--- a/ncepgrib2_docs/ncepgrib2.Grib2Encode-class.html
+++ b/ncepgrib2_docs/ncepgrib2.Grib2Encode-class.html
@@ -504,8 +504,7 @@
 <table border="0" cellpadding="0" cellspacing="0" width="100%%">
   <tr>
     <td align="left" class="footer">
-    Generated by Epydoc 3.0.1
-    on Wed Nov 20 14:10:14 2013
+    Generated by Epydoc 3.0.1 on Mon Dec 29 14:23:16 2014
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
diff --git a/ncepgrib2_docs/ncepgrib2.Grib2Message-class.html b/ncepgrib2_docs/ncepgrib2.Grib2Message-class.html
index 0ef344b..b20c00a 100644
--- a/ncepgrib2_docs/ncepgrib2.Grib2Message-class.html
+++ b/ncepgrib2_docs/ncepgrib2.Grib2Message-class.html
@@ -751,8 +751,7 @@
 <table border="0" cellpadding="0" cellspacing="0" width="100%%">
   <tr>
     <td align="left" class="footer">
-    Generated by Epydoc 3.0.1
-    on Wed Nov 20 14:10:14 2013
+    Generated by Epydoc 3.0.1 on Mon Dec 29 14:23:16 2014
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
diff --git a/pygrib.c b/pygrib.c
index 26db020..98e8cd5 100644
--- a/pygrib.c
+++ b/pygrib.c
@@ -1,4 +1,4 @@
-/* Generated by Cython 0.19.2 on Mon Jan 27 16:12:05 2014 */
+/* Generated by Cython 0.21.1 */
 
 #define PY_SSIZE_T_CLEAN
 #ifndef CYTHON_USE_PYLONG_INTERNALS
@@ -16,10 +16,11 @@
 #include "Python.h"
 #ifndef Py_PYTHON_H
     #error Python headers needed to compile C extensions, please install development version of Python.
-#elif PY_VERSION_HEX < 0x02040000
-    #error Cython requires Python 2.4+.
+#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
+    #error Cython requires Python 2.6+ or Python 3.2+.
 #else
-#include <stddef.h> /* For offsetof */
+#define CYTHON_ABI "0_21_1"
+#include <stddef.h>
 #ifndef offsetof
 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
 #endif
@@ -53,83 +54,29 @@
 #define CYTHON_COMPILING_IN_PYPY 0
 #define CYTHON_COMPILING_IN_CPYTHON 1
 #endif
-#if PY_VERSION_HEX < 0x02050000
-  typedef int Py_ssize_t;
-  #define PY_SSIZE_T_MAX INT_MAX
-  #define PY_SSIZE_T_MIN INT_MIN
-  #define PY_FORMAT_SIZE_T ""
-  #define CYTHON_FORMAT_SSIZE_T ""
-  #define PyInt_FromSsize_t(z) PyInt_FromLong(z)
-  #define PyInt_AsSsize_t(o)   __Pyx_PyInt_AsInt(o)
-  #define PyNumber_Index(o)    ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \
-                                (PyErr_Format(PyExc_TypeError, \
-                                              "expected index value, got %.200s", Py_TYPE(o)->tp_name), \
-                                 (PyObject*)0))
-  #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \
-                                  !PyComplex_Check(o))
-  #define PyIndex_Check __Pyx_PyIndex_Check
-  #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message)
-  #define __PYX_BUILD_PY_SSIZE_T "i"
-#else
-  #define __PYX_BUILD_PY_SSIZE_T "n"
-  #define CYTHON_FORMAT_SSIZE_T "z"
-  #define __Pyx_PyIndex_Check PyIndex_Check
-#endif
-#if PY_VERSION_HEX < 0x02060000
-  #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)
-  #define Py_TYPE(ob)   (((PyObject*)(ob))->ob_type)
-  #define Py_SIZE(ob)   (((PyVarObject*)(ob))->ob_size)
-  #define PyVarObject_HEAD_INIT(type, size) \
-          PyObject_HEAD_INIT(type) size,
-  #define PyType_Modified(t)
-  typedef struct {
-     void *buf;
-     PyObject *obj;
-     Py_ssize_t len;
-     Py_ssize_t itemsize;
-     int readonly;
-     int ndim;
-     char *format;
-     Py_ssize_t *shape;
-     Py_ssize_t *strides;
-     Py_ssize_t *suboffsets;
-     void *internal;
-  } Py_buffer;
-  #define PyBUF_SIMPLE 0
-  #define PyBUF_WRITABLE 0x0001
-  #define PyBUF_FORMAT 0x0004
-  #define PyBUF_ND 0x0008
-  #define PyBUF_STRIDES (0x0010 | PyBUF_ND)
-  #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES)
-  #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES)
-  #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES)
-  #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES)
-  #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE)
-  #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE)
-  typedef int (*getbufferproc)(PyObject *, Py_buffer *, int);
-  typedef void (*releasebufferproc)(PyObject *, Py_buffer *);
+#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600
+#define Py_OptimizeFlag 0
 #endif
+#define __PYX_BUILD_PY_SSIZE_T "n"
+#define CYTHON_FORMAT_SSIZE_T "z"
 #if PY_MAJOR_VERSION < 3
   #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
   #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
-          PyCode_New(a, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
+          PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
+  #define __Pyx_DefaultClassType PyClass_Type
 #else
   #define __Pyx_BUILTIN_MODULE_NAME "builtins"
   #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
           PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
-#endif
-#if PY_MAJOR_VERSION < 3 && PY_MINOR_VERSION < 6
-  #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict")
+  #define __Pyx_DefaultClassType PyType_Type
 #endif
 #if PY_MAJOR_VERSION >= 3
   #define Py_TPFLAGS_CHECKTYPES 0
   #define Py_TPFLAGS_HAVE_INDEX 0
-#endif
-#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3)
   #define Py_TPFLAGS_HAVE_NEWBUFFER 0
 #endif
-#if PY_VERSION_HEX < 0x02060000
-  #define Py_TPFLAGS_HAVE_VERSION_TAG 0
+#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE)
+  #define Py_TPFLAGS_HAVE_FINALIZE 0
 #endif
 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
   #define CYTHON_PEP393_ENABLED 1
@@ -137,13 +84,34 @@
                                               0 : _PyUnicode_Ready((PyObject *)(op)))
   #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
   #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
+  #define __Pyx_PyUnicode_KIND(u)         PyUnicode_KIND(u)
+  #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
   #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
 #else
   #define CYTHON_PEP393_ENABLED 0
   #define __Pyx_PyUnicode_READY(op)       (0)
   #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
   #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
-  #define __Pyx_PyUnicode_READ(k, d, i)   ((k=k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
+  #define __Pyx_PyUnicode_KIND(u)         (sizeof(Py_UNICODE))
+  #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
+  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
+#endif
+#if CYTHON_COMPILING_IN_PYPY
+  #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
+  #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
+  #define __Pyx_PyFrozenSet_Size(s)         PyObject_Size(s)
+#else
+  #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
+  #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ? \
+      PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
+  #define __Pyx_PyFrozenSet_Size(s)         PySet_Size(s)
+#endif
+#define __Pyx_PyString_FormatSafe(a, b)   ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
+#define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
+#if PY_MAJOR_VERSION >= 3
+  #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
+#else
+  #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
 #endif
 #if PY_MAJOR_VERSION >= 3
   #define PyBaseString_Type            PyUnicode_Type
@@ -152,35 +120,12 @@
   #define PyString_Check               PyUnicode_Check
   #define PyString_CheckExact          PyUnicode_CheckExact
 #endif
-#if PY_VERSION_HEX < 0x02060000
-  #define PyBytesObject                PyStringObject
-  #define PyBytes_Type                 PyString_Type
-  #define PyBytes_Check                PyString_Check
-  #define PyBytes_CheckExact           PyString_CheckExact
-  #define PyBytes_FromString           PyString_FromString
-  #define PyBytes_FromStringAndSize    PyString_FromStringAndSize
-  #define PyBytes_FromFormat           PyString_FromFormat
-  #define PyBytes_DecodeEscape         PyString_DecodeEscape
-  #define PyBytes_AsString             PyString_AsString
-  #define PyBytes_AsStringAndSize      PyString_AsStringAndSize
-  #define PyBytes_Size                 PyString_Size
-  #define PyBytes_AS_STRING            PyString_AS_STRING
-  #define PyBytes_GET_SIZE             PyString_GET_SIZE
-  #define PyBytes_Repr                 PyString_Repr
-  #define PyBytes_Concat               PyString_Concat
-  #define PyBytes_ConcatAndDel         PyString_ConcatAndDel
-#endif
 #if PY_MAJOR_VERSION >= 3
   #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
   #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
 #else
-  #define __Pyx_PyBaseString_Check(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj) || \
-                                         PyString_Check(obj) || PyUnicode_Check(obj))
-  #define __Pyx_PyBaseString_CheckExact(obj) (Py_TYPE(obj) == &PyBaseString_Type)
-#endif
-#if PY_VERSION_HEX < 0x02060000
-  #define PySet_Check(obj)             PyObject_TypeCheck(obj, &PySet_Type)
-  #define PyFrozenSet_Check(obj)       PyObject_TypeCheck(obj, &PyFrozenSet_Type)
+  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
+  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
 #endif
 #ifndef PySet_CheckExact
   #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
@@ -201,11 +146,17 @@
   #define PyInt_AsSsize_t              PyLong_AsSsize_t
   #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
   #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
+  #define PyNumber_Int                 PyNumber_Long
 #endif
 #if PY_MAJOR_VERSION >= 3
   #define PyBoolObject                 PyLongObject
 #endif
-#if PY_VERSION_HEX < 0x03020000
+#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
+  #ifndef PyUnicode_InternFromString
+    #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
+  #endif
+#endif
+#if PY_VERSION_HEX < 0x030200A4
   typedef long Py_hash_t;
   #define __Pyx_PyInt_FromHash_t PyInt_FromLong
   #define __Pyx_PyInt_AsHash_t   PyInt_AsLong
@@ -213,42 +164,10 @@
   #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
   #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
 #endif
-#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300)
-  #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b)
-  #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value)
-  #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b)
-#else
-  #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \
-        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \
-        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \
-            (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0)))
-  #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \
-        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
-        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \
-            (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1)))
-  #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \
-        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
-        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \
-            (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1)))
-#endif
 #if PY_MAJOR_VERSION >= 3
-  #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
-#endif
-#if PY_VERSION_HEX < 0x02050000
-  #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),((char *)(n)))
-  #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a))
-  #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),((char *)(n)))
-#else
-  #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),(n))
-  #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a))
-  #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),(n))
-#endif
-#if PY_VERSION_HEX < 0x02050000
-  #define __Pyx_NAMESTR(n) ((char *)(n))
-  #define __Pyx_DOCSTR(n)  ((char *)(n))
+  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
 #else
-  #define __Pyx_NAMESTR(n) (n)
-  #define __Pyx_DOCSTR(n)  (n)
+  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
 #endif
 #ifndef CYTHON_INLINE
   #if defined(__GNUC__)
@@ -284,6 +203,12 @@ static CYTHON_INLINE float __PYX_NAN() {
   return value;
 }
 #endif
+#ifdef __cplusplus
+template<typename T>
+void __Pyx_call_destructor(T* x) {
+    x->~T();
+}
+#endif
 
 
 #if PY_MAJOR_VERSION >= 3
@@ -334,18 +259,30 @@ static CYTHON_INLINE float __PYX_NAN() {
 # endif
 #endif
 typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding;
-                const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/
+                const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
 
 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
 #define __PYX_DEFAULT_STRING_ENCODING ""
 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
+#define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (    \
+    (sizeof(type) < sizeof(Py_ssize_t))  ||             \
+    (sizeof(type) > sizeof(Py_ssize_t) &&               \
+          likely(v < (type)PY_SSIZE_T_MAX ||            \
+                 v == (type)PY_SSIZE_T_MAX)  &&         \
+          (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||       \
+                                v == (type)PY_SSIZE_T_MIN)))  ||  \
+    (sizeof(type) == sizeof(Py_ssize_t) &&              \
+          (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||        \
+                               v == (type)PY_SSIZE_T_MAX)))  )
 static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
 static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
+#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
+#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
 #define __Pyx_PyBytes_FromString        PyBytes_FromString
 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
-static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char*);
+static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
 #if PY_MAJOR_VERSION < 3
     #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
     #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
@@ -353,17 +290,19 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char*);
     #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
     #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
 #endif
+#define __Pyx_PyObject_AsSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
 #define __Pyx_PyObject_AsUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
-#define __Pyx_PyObject_FromUString(s)  __Pyx_PyObject_FromString((char*)s)
-#define __Pyx_PyBytes_FromUString(s)   __Pyx_PyBytes_FromString((char*)s)
-#define __Pyx_PyStr_FromUString(s)     __Pyx_PyStr_FromString((char*)s)
-#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((char*)s)
+#define __Pyx_PyObject_FromUString(s)  __Pyx_PyObject_FromString((const char*)s)
+#define __Pyx_PyBytes_FromUString(s)   __Pyx_PyBytes_FromString((const char*)s)
+#define __Pyx_PyByteArray_FromUString(s)   __Pyx_PyByteArray_FromString((const char*)s)
+#define __Pyx_PyStr_FromUString(s)     __Pyx_PyStr_FromString((const char*)s)
+#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((const char*)s)
 #if PY_MAJOR_VERSION < 3
 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
 {
     const Py_UNICODE *u_end = u;
     while (*u_end++) ;
-    return u_end - u - 1;
+    return (size_t)(u_end - u - 1);
 }
 #else
 #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
@@ -377,7 +316,6 @@ static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
 static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
-static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);
 #if CYTHON_COMPILING_IN_CPYTHON
 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
 #else
@@ -386,19 +324,22 @@ static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);
 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
 static int __Pyx_sys_getdefaultencoding_not_ascii;
-static int __Pyx_init_sys_getdefaultencoding_params() {
-    PyObject* sys = NULL;
+static int __Pyx_init_sys_getdefaultencoding_params(void) {
+    PyObject* sys;
     PyObject* default_encoding = NULL;
     PyObject* ascii_chars_u = NULL;
     PyObject* ascii_chars_b = NULL;
+    const char* default_encoding_c;
     sys = PyImport_ImportModule("sys");
-    if (sys == NULL) goto bad;
+    if (!sys) goto bad;
     default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
-    if (default_encoding == NULL) goto bad;
-    if (strcmp(PyBytes_AsString(default_encoding), "ascii") == 0) {
+    Py_DECREF(sys);
+    if (!default_encoding) goto bad;
+    default_encoding_c = PyBytes_AsString(default_encoding);
+    if (!default_encoding_c) goto bad;
+    if (strcmp(default_encoding_c, "ascii") == 0) {
         __Pyx_sys_getdefaultencoding_not_ascii = 0;
     } else {
-        const char* default_encoding_c = PyBytes_AS_STRING(default_encoding);
         char ascii_chars[128];
         int c;
         for (c = 0; c < 128; c++) {
@@ -406,23 +347,21 @@ static int __Pyx_init_sys_getdefaultencoding_params() {
         }
         __Pyx_sys_getdefaultencoding_not_ascii = 1;
         ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
-        if (ascii_chars_u == NULL) goto bad;
+        if (!ascii_chars_u) goto bad;
         ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
-        if (ascii_chars_b == NULL || strncmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
+        if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
             PyErr_Format(
                 PyExc_ValueError,
-                "This module compiled with c_string_encoding=ascii, but default encoding '%s' is not a superset of ascii.",
+                "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
                 default_encoding_c);
             goto bad;
         }
+        Py_DECREF(ascii_chars_u);
+        Py_DECREF(ascii_chars_b);
     }
-    Py_XDECREF(sys);
-    Py_XDECREF(default_encoding);
-    Py_XDECREF(ascii_chars_u);
-    Py_XDECREF(ascii_chars_b);
+    Py_DECREF(default_encoding);
     return 0;
 bad:
-    Py_XDECREF(sys);
     Py_XDECREF(default_encoding);
     Py_XDECREF(ascii_chars_u);
     Py_XDECREF(ascii_chars_b);
@@ -435,22 +374,23 @@ bad:
 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
 static char* __PYX_DEFAULT_STRING_ENCODING;
-static int __Pyx_init_sys_getdefaultencoding_params() {
-    PyObject* sys = NULL;
+static int __Pyx_init_sys_getdefaultencoding_params(void) {
+    PyObject* sys;
     PyObject* default_encoding = NULL;
     char* default_encoding_c;
     sys = PyImport_ImportModule("sys");
-    if (sys == NULL) goto bad;
+    if (!sys) goto bad;
     default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
-    if (default_encoding == NULL) goto bad;
-    default_encoding_c = PyBytes_AS_STRING(default_encoding);
+    Py_DECREF(sys);
+    if (!default_encoding) goto bad;
+    default_encoding_c = PyBytes_AsString(default_encoding);
+    if (!default_encoding_c) goto bad;
     __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c));
+    if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
     strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
-    Py_DECREF(sys);
     Py_DECREF(default_encoding);
     return 0;
 bad:
-    Py_XDECREF(sys);
     Py_XDECREF(default_encoding);
     return -1;
 }
@@ -458,16 +398,11 @@ bad:
 #endif
 
 
-#ifdef __GNUC__
-  /* Test for GCC > 2.95 */
-  #if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))
-    #define likely(x)   __builtin_expect(!!(x), 1)
-    #define unlikely(x) __builtin_expect(!!(x), 0)
-  #else /* __GNUC__ > 2 ... */
-    #define likely(x)   (x)
-    #define unlikely(x) (x)
-  #endif /* __GNUC__ > 2 ... */
-#else /* __GNUC__ */
+/* Test for GCC > 2.95 */
+#if defined(__GNUC__)     && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
+  #define likely(x)   __builtin_expect(!!(x), 1)
+  #define unlikely(x) __builtin_expect(!!(x), 0)
+#else /* !__GNUC__ or GCC < 2.95 */
   #define likely(x)   (x)
   #define unlikely(x) (x)
 #endif /* __GNUC__ */
@@ -488,8 +423,8 @@ static const char *__pyx_f[] = {
 };
 
 /*--- Type declarations ---*/
-struct __pyx_obj_6pygrib_gribmessage;
 struct __pyx_obj_6pygrib_open;
+struct __pyx_obj_6pygrib_gribmessage;
 struct __pyx_obj_6pygrib_index;
 struct __pyx_opt_args_6pygrib__strencode;
 
@@ -505,7 +440,26 @@ struct __pyx_opt_args_6pygrib__strencode {
   PyObject *encoding;
 };
 
-/* "pygrib.pyx":800
+/* "pygrib.pyx":362
+ *     grib_multi_support_off(NULL)
+ * 
+ * cdef class open(object):             # <<<<<<<<<<<<<<
+ *     """
+ *     open(filename)
+ */
+struct __pyx_obj_6pygrib_open {
+  PyObject_HEAD
+  FILE *_fd;
+  grib_handle *_gh;
+  PyObject *name;
+  PyObject *messagenumber;
+  PyObject *messages;
+  PyObject *closed;
+  PyObject *has_multi_field_msgs;
+};
+
+
+/* "pygrib.pyx":794
  *     return fromstring(grb.tostring())
  * 
  * cdef class gribmessage(object):             # <<<<<<<<<<<<<<
@@ -526,26 +480,7 @@ struct __pyx_obj_6pygrib_gribmessage {
 };
 
 
-/* "pygrib.pyx":368
- *     grib_multi_support_off(NULL)
- * 
- * cdef class open(object):             # <<<<<<<<<<<<<<
- *     """
- *     open(filename)
- */
-struct __pyx_obj_6pygrib_open {
-  PyObject_HEAD
-  FILE *_fd;
-  grib_handle *_gh;
-  PyObject *name;
-  PyObject *messagenumber;
-  PyObject *messages;
-  PyObject *closed;
-  PyObject *has_multi_field_msgs;
-};
-
-
-/* "pygrib.pyx":1816
+/* "pygrib.pyx":1808
  *         return lats, lons
  * 
  * cdef class index(object):             # <<<<<<<<<<<<<<
@@ -573,7 +508,7 @@ struct __pyx_obj_6pygrib_index {
     void (*FinishContext)(void**);
   } __Pyx_RefNannyAPIStruct;
   static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
-  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/
+  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
   #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
 #ifdef WITH_THREAD
   #define __Pyx_RefNannySetupContext(name, acquire_gil) \
@@ -610,7 +545,7 @@ struct __pyx_obj_6pygrib_index {
   #define __Pyx_XDECREF(r) Py_XDECREF(r)
   #define __Pyx_XGOTREF(r)
   #define __Pyx_XGIVEREF(r)
-#endif /* CYTHON_REFNANNY */
+#endif
 #define __Pyx_XDECREF_SET(r, v) do {                            \
         PyObject *tmp = (PyObject *) r;                         \
         r = v; __Pyx_XDECREF(tmp);                              \
@@ -637,16 +572,18 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject
 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
 #endif
 
-static PyObject *__Pyx_GetBuiltinName(PyObject *name); /*proto*/
+static PyObject *__Pyx_GetBuiltinName(PyObject *name);
 
 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
-    Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/
+    Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
 
-static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/
+static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
 
 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \
     PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \
-    const char* function_name); /*proto*/
+    const char* function_name);
+
+static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
 
 #define __Pyx_CyFunction_USED 1
 #include <structmember.h>
@@ -663,28 +600,32 @@ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \
     ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
 typedef struct {
     PyCFunctionObject func;
-    int flags;
-    PyObject *func_dict;
+#if PY_VERSION_HEX < 0x030500A0
     PyObject *func_weakreflist;
+#endif
+    PyObject *func_dict;
     PyObject *func_name;
     PyObject *func_qualname;
     PyObject *func_doc;
+    PyObject *func_globals;
     PyObject *func_code;
     PyObject *func_closure;
-    PyObject *func_classobj; /* No-args super() class cell */
+    PyObject *func_classobj;
     void *defaults;
     int defaults_pyobjects;
-    PyObject *defaults_tuple;   /* Const defaults tuple */
-    PyObject *defaults_kwdict;  /* Const kwonly defaults dict */
+    int flags;
+    PyObject *defaults_tuple;
+    PyObject *defaults_kwdict;
     PyObject *(*defaults_getter)(PyObject *);
-    PyObject *func_annotations; /* function annotations dict */
+    PyObject *func_annotations;
 } __pyx_CyFunctionObject;
 static PyTypeObject *__pyx_CyFunctionType = 0;
-#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, code) \
-    __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, code)
+#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code) \
+    __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code)
 static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml,
                                       int flags, PyObject* qualname,
-                                      PyObject *self, PyObject *module,
+                                      PyObject *self,
+                                      PyObject *module, PyObject *globals,
                                       PyObject* code);
 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
                                                          size_t size,
@@ -701,22 +642,40 @@ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
 
 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
 
-static CYTHON_INLINE int __Pyx_IterFinish(void); /*proto*/
+static CYTHON_INLINE int __Pyx_IterFinish(void);
 
-static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /*proto*/
+static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
+#else
+#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
+#endif
 
-static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
-static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
+static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb);
+static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb);
 
-static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
 
-static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*proto*/
+static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);
 
-static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/
+static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
 
 static CYTHON_INLINE long __Pyx_div_long(long, long); /* proto */
 
 #if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
+#endif
+
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
+#else
+#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
+#endif
+
+#if CYTHON_COMPILING_IN_CPYTHON
 static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
     PyListObject* L = (PyListObject*) list;
     Py_ssize_t len = Py_SIZE(list);
@@ -732,12 +691,15 @@ static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
 #endif
 
-static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); /*proto*/
+static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed);
 
 #define __Pyx_PyIter_Next(obj) __Pyx_PyIter_Next2(obj, NULL)
-static CYTHON_INLINE PyObject *__Pyx_PyIter_Next2(PyObject *, PyObject *); /*proto*/
+static CYTHON_INLINE PyObject *__Pyx_PyIter_Next2(PyObject *, PyObject *);
 
-static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
+static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb);
+static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb);
+
+static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
 
 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
 
@@ -757,8 +719,8 @@ static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
 #endif
 
-static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
-    const char *name, int exact); /*proto*/
+static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
+    const char *name, int exact);
 
 static CYTHON_INLINE int __Pyx_PySequence_Contains(PyObject* item, PyObject* seq, int eq) {
     int result = PySequence_Contains(seq, item);
@@ -782,7 +744,7 @@ static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr
 #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
 #endif
 
-static double __Pyx__PyObject_AsDouble(PyObject* obj); /* proto */
+static double __Pyx__PyObject_AsDouble(PyObject* obj);
 #if CYTHON_COMPILING_IN_PYPY
 #define __Pyx_PyObject_AsDouble(obj) \
 (likely(PyFloat_CheckExact(obj)) ? PyFloat_AS_DOUBLE(obj) : \
@@ -794,107 +756,106 @@ static double __Pyx__PyObject_AsDouble(PyObject* obj); /* proto */
  PyFloat_AS_DOUBLE(obj) : __Pyx__PyObject_AsDouble(obj))
 #endif
 
-#define __Pyx_GetItemInt(o, i, size, to_py_func, is_list, wraparound, boundscheck) \
-    (((size) <= sizeof(Py_ssize_t)) ? \
-    __Pyx_GetItemInt_Fast(o, i, is_list, wraparound, boundscheck) : \
-    __Pyx_GetItemInt_Generic(o, to_py_func(i)))
-#define __Pyx_GetItemInt_List(o, i, size, to_py_func, is_list, wraparound, boundscheck) \
-    (((size) <= sizeof(Py_ssize_t)) ? \
-    __Pyx_GetItemInt_List_Fast(o, i, wraparound, boundscheck) : \
-    __Pyx_GetItemInt_Generic(o, to_py_func(i)))
+#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
+    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
+    __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) : \
+    (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) : \
+               __Pyx_GetItemInt_Generic(o, to_py_func(i))))
+#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
+    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
+    __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \
+    (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                               int wraparound, int boundscheck);
-#define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func, is_list, wraparound, boundscheck) \
-    (((size) <= sizeof(Py_ssize_t)) ? \
-    __Pyx_GetItemInt_Tuple_Fast(o, i, wraparound, boundscheck) : \
-    __Pyx_GetItemInt_Generic(o, to_py_func(i)))
+#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
+    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
+    __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \
+    (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                               int wraparound, int boundscheck);
 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
                                                      int is_list, int wraparound, int boundscheck);
 
-static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
-         const char* cstring, Py_ssize_t start, Py_ssize_t stop,
-         const char* encoding, const char* errors,
-         PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
-
 #include <string.h>
 
-static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /*proto*/
+static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
 
-static PyObject* __Pyx_PyObject_CallMethodTuple(PyObject* obj, PyObject* method_name, PyObject* args) {
-    PyObject *method, *result = NULL;
-    if (unlikely(!args)) return NULL;
-    method = __Pyx_PyObject_GetAttrStr(obj, method_name);
-    if (unlikely(!method)) goto bad;
-    result = PyObject_Call(method, args, NULL);
-    Py_DECREF(method);
-bad:
-    Py_DECREF(args);
-    return result;
-}
-#define __Pyx_PyObject_CallMethod3(obj, name, arg1, arg2, arg3) \
-    __Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(3, arg1, arg2, arg3))
-#define __Pyx_PyObject_CallMethod2(obj, name, arg1, arg2) \
-    __Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(2, arg1, arg2))
-#define __Pyx_PyObject_CallMethod1(obj, name, arg1) \
-    __Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(1, arg1))
-#define __Pyx_PyObject_CallMethod0(obj, name) \
-    __Pyx_PyObject_CallMethodTuple(obj, name, (Py_INCREF(__pyx_empty_tuple), __pyx_empty_tuple))
+static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
 
 #if PY_MAJOR_VERSION >= 3
-static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d); /*proto*/
+#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
 #else
-#define __Pyx_PyDict_Items(d) PyDict_Items(d)
+#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
 #endif
 
-static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); /*proto*/
-
-#define __Pyx_SetItemInt(o, i, v, size, to_py_func, is_list, wraparound, boundscheck) \
-    (((size) <= sizeof(Py_ssize_t)) ? \
-    __Pyx_SetItemInt_Fast(o, i, v, is_list, wraparound, boundscheck) : \
-    __Pyx_SetItemInt_Generic(o, to_py_func(i), v))
-static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
-static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
-                                               int is_list, int wraparound, int boundscheck);
-
-static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
-static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
-
-static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/
-
-static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);
-
-static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);
+#if PY_MAJOR_VERSION < 3
+#define __Pyx_PyString_Join __Pyx_PyBytes_Join
+#define __Pyx_PyBaseString_Join(s, v) (PyUnicode_CheckExact(s) ? PyUnicode_Join(s, v) : __Pyx_PyBytes_Join(s, v))
+#else
+#define __Pyx_PyString_Join PyUnicode_Join
+#define __Pyx_PyBaseString_Join PyUnicode_Join
+#endif
+#if CYTHON_COMPILING_IN_CPYTHON
+    #if PY_MAJOR_VERSION < 3
+    #define __Pyx_PyBytes_Join _PyString_Join
+    #else
+    #define __Pyx_PyBytes_Join _PyBytes_Join
+    #endif
+#else
+static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values);
+#endif
 
-static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);
+static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
+         const char* cstring, Py_ssize_t start, Py_ssize_t stop,
+         const char* encoding, const char* errors,
+         PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
 
-static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *);
+static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
 
-static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *);
+static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);
 
-static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *);
+static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d);
 
-static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);
+static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
 
-static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);
+#define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
+    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
+    __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) : \
+    (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) : \
+               __Pyx_SetItemInt_Generic(o, to_py_func(i), v)))
+static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
+static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
+                                               int is_list, int wraparound, int boundscheck);
 
-static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);
+typedef struct {
+    int code_line;
+    PyCodeObject* code_object;
+} __Pyx_CodeObjectCacheEntry;
+struct __Pyx_CodeObjectCache {
+    int count;
+    int max_count;
+    __Pyx_CodeObjectCacheEntry* entries;
+};
+static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
+static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
+static PyCodeObject *__pyx_find_code_object(int code_line);
+static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
 
-static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *);
+static void __Pyx_AddTraceback(const char *funcname, int c_line,
+                               int py_line, const char *filename);
 
-static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);
+static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
 
-static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
 
-static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *);
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
 
-static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);
+static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
 
-static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);
+static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *);
 
-static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);
+static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
 
 static int __Pyx_check_binary_version(void);
 
@@ -906,36 +867,19 @@ static int __Pyx_check_binary_version(void);
 #endif
 #endif
 
-static PyObject *__Pyx_ImportModule(const char *name); /*proto*/
-
-static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict);  /*proto*/
-
-typedef struct {
-    int code_line;
-    PyCodeObject* code_object;
-} __Pyx_CodeObjectCacheEntry;
-struct __Pyx_CodeObjectCache {
-    int count;
-    int max_count;
-    __Pyx_CodeObjectCacheEntry* entries;
-};
-static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
-static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
-static PyCodeObject *__pyx_find_code_object(int code_line);
-static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
+static PyObject *__Pyx_ImportModule(const char *name);
 
-static void __Pyx_AddTraceback(const char *funcname, int c_line,
-                               int py_line, const char *filename); /*proto*/
+static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict);
 
-static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
+static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
 
 
 /* Module declarations from 'numpy' */
 
 /* Module declarations from 'pygrib' */
 static PyTypeObject *__pyx_ptype_6pygrib_ndarray = 0;
-static PyTypeObject *__pyx_ptype_6pygrib_gribmessage = 0;
 static PyTypeObject *__pyx_ptype_6pygrib_open = 0;
+static PyTypeObject *__pyx_ptype_6pygrib_gribmessage = 0;
 static PyTypeObject *__pyx_ptype_6pygrib_index = 0;
 static PyObject *__pyx_f_6pygrib__create_gribmessage(grib_handle *, PyObject *); /*proto*/
 static PyObject *__pyx_f_6pygrib__strencode(PyObject *, struct __pyx_opt_args_6pygrib__strencode *__pyx_optional_args); /*proto*/
@@ -1062,774 +1006,801 @@ static int __pyx_pf_6pygrib_5index_4name_4__del__(struct __pyx_obj_6pygrib_index
 static PyObject *__pyx_pf_6pygrib_22_is_stringlike(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_a); /* proto */
 static PyObject *__pyx_pf_6pygrib_24_is_container(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_a); /* proto */
 static PyObject *__pyx_pf_6pygrib_26_find(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_grb, PyObject *__pyx_v_kwargs); /* proto */
-static PyObject *__pyx_tp_new_6pygrib_gribmessage(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
 static PyObject *__pyx_tp_new_6pygrib_open(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static PyObject *__pyx_tp_new_6pygrib_gribmessage(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
 static PyObject *__pyx_tp_new_6pygrib_index(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static char __pyx_k_1[] = "_get_grib_api_version.<locals>.<lambda>";
-static char __pyx_k_2[] = "%d.%d.%d";
-static char __pyx_k_3[] = "nlats must be even";
-static char __pyx_k_5[] = "could not open %s";
-static char __pyx_k_6[] = "key must be an integer message number or a slice";
-static char __pyx_k_8[] = "from_what keyword arg to seek must be 0,1 or 2";
-static char __pyx_k_10[] = "grb message numbers start at 1";
-static char __pyx_k_12[] = "no matches found";
-static char __pyx_k_15[] = "nmsgs must be >= 0 in _advance";
-static char __pyx_k_17[] = "not that many messages in file";
-static char __pyx_k_19[] = "";
-static char __pyx_k_20[] = "indicatorOfUnitOfTimeRange";
-static char __pyx_k_24[] = "-";
-static char __pyx_k_27[] = "3 hr periods";
-static char __pyx_k_28[] = "6 hr periods";
-static char __pyx_k_29[] = "12 hr periods";
-static char __pyx_k_30[] = "This class cannot be instantiated from Python";
-static char __pyx_k_33[] = ":";
-static char __pyx_k_38[] = " (";
-static char __pyx_k_39[] = ")";
-static char __pyx_k_46[] = "unitsOfFirstFixedSurface";
-static char __pyx_k_48[] = "typeOfFirstFixedSurface";
-static char __pyx_k_50[] = "scaledValueOfFirstFixedSurface";
-static char __pyx_k_52[] = "scaleFactorOfFirstFixedSurface";
-static char __pyx_k_54[] = "typeOfSecondFixedSurface";
-static char __pyx_k_56[] = "scaledValueOfSecondFixedSurface";
-static char __pyx_k_58[] = "scaleFactorOfSecondFixedSurface";
-static char __pyx_k_60[] = ":level %s";
-static char __pyx_k_61[] = ":levels %s-%s";
-static char __pyx_k_62[] = " %s";
-static char __pyx_k_66[] = ":fcst time %s %s (%s)";
-static char __pyx_k_67[] = ":fcst time %s %s";
-static char __pyx_k_71[] = ":from ";
-static char __pyx_k_72[] = "%04i";
-static char __pyx_k_74[] = "typeOfEnsembleForecast";
-static char __pyx_k_76[] = ":lo res cntl fcst";
-static char __pyx_k_77[] = ":hi res cntl fcst";
-static char __pyx_k_78[] = ":neg ens pert %d";
-static char __pyx_k_79[] = ":pos ens pert %d";
-static char __pyx_k_81[] = ":ens mean";
-static char __pyx_k_82[] = ":weighted ens mean";
-static char __pyx_k_83[] = ":ens std dev";
-static char __pyx_k_84[] = ":normalized ens std dev";
-static char __pyx_k_85[] = ":ens spread";
-static char __pyx_k_86[] = ":ens large anomaly index";
-static char __pyx_k_87[] = ":ens mean of cluster";
-static char __pyx_k_89[] = "scaledValueOfLowerLimit";
-static char __pyx_k_91[] = "scaleFactorOfLowerLimit";
-static char __pyx_k_93[] = "scaledValueOfUpperLimit";
-static char __pyx_k_95[] = "scaleFactorOfUpperLimit";
-static char __pyx_k_97[] = " (%s-%s)";
-static char __pyx_k_98[] = " (> %s)";
-static char __pyx_k_99[] = " (< %s)";
-static char __pyx_k__C[] = "C";
-static char __pyx_k__F[] = "F";
-static char __pyx_k__a[] = "a";
-static char __pyx_k__b[] = "b";
-static char __pyx_k__d[] = "d";
-static char __pyx_k__h[] = "h";
-static char __pyx_k__k[] = "k";
-static char __pyx_k__l[] = "l";
-static char __pyx_k__s[] = "s";
-static char __pyx_k__v[] = "v";
-static char __pyx_k_104[] = "key \"%s\" is read only";
-static char __pyx_k_105[] = "can only modify existing grib keys (key \"%s\" not found)";
-static char __pyx_k_106[] = "unrecognized grib type % d";
-static char __pyx_k_108[] = "jPointsAreConsecutive";
-static char __pyx_k_112[] = "array must be 1d or 2d";
-static char __pyx_k_115[] = "reduced grid data array must be 1d";
-static char __pyx_k_117[] = "alternativeRowScanning";
-static char __pyx_k_139[] = "scaleFactorOfMajorAxisOfOblateSpheroidEarth";
-static char __pyx_k_141[] = "scaleFactorOfMinorAxisOfOblateSpheroidEarth";
-static char __pyx_k_142[] = "scaledValueOfMajorAxisOfOblateSpheroidEarth";
-static char __pyx_k_143[] = "scaledValueOfMinorAxisOfOblateSpheroidEarth";
-static char __pyx_k_144[] = "scaledValueOfEarthMajorAxis";
-static char __pyx_k_145[] = "scaledValueOfEarthMinorAxis";
-static char __pyx_k_146[] = "scaleFactorOfRadiusOfSphericalEarth";
-static char __pyx_k_148[] = "scaledValueOfRadiusOfSphericalEarth";
-static char __pyx_k_149[] = "unknown shape of the earth flag";
-static char __pyx_k_151[] = "latitudeWhereDxAndDyAreSpecifiedInDegrees";
-static char __pyx_k_152[] = "projectionCentreFlag";
-static char __pyx_k_154[] = "projectionCenterFlag";
-static char __pyx_k_156[] = "cannot find projection center flag";
-static char __pyx_k_158[] = "orientationOfTheGridInDegrees";
-static char __pyx_k_159[] = "longitudeOfSubSatellitePointInDegrees";
-static char __pyx_k_160[] = "latitudeOfSubSatellitePointInDegrees";
-static char __pyx_k_161[] = "equatorial_azimuthal_equidistant";
-static char __pyx_k_162[] = "lambert_azimuthal_equal_area";
-static char __pyx_k_163[] = "longitudeOfFirstGridPoint";
-static char __pyx_k_164[] = "longitudeOfLastGridPoint";
-static char __pyx_k_165[] = "angleOfRotationInDegrees";
-static char __pyx_k_166[] = "latitudeOfSouthernPoleInDegrees";
-static char __pyx_k_167[] = "longitudeOfSouthernPoleInDegrees";
-static char __pyx_k_168[] = "unsupported grid %s";
-static char __pyx_k_169[] = "longitudeOfFirstGridPointInDegrees";
-static char __pyx_k_170[] = "longitudeOfLastGridPointInDegrees";
-static char __pyx_k_171[] = "latitudeOfFirstGridPointInDegrees";
-static char __pyx_k_172[] = "latitudeOfLastGridPointInDegrees";
-static char __pyx_k_176[] = "xDirectionGridLengthInMetres";
-static char __pyx_k_177[] = "yDirectionGridLengthInMetres";
-static char __pyx_k_178[] = "unsupported grid - earth not a perfect sphere";
-static char __pyx_k_180[] = "latitudeOfFirstGridPoint";
-static char __pyx_k_181[] = "latitudeOfLastGridPoint";
-static char __pyx_k_182[] = ",";
-static char __pyx_k_183[] = "\nfile %s has multi-field messages, keys inside multi-field\nmessages will not be indexed correctly";
-static char __pyx_k_186[] = "key not part of grib index";
-static char __pyx_k_188[] = "value must be float, int or string";
-static char __pyx_k_192[] = "\nIntroduction\n============\n\nPython module for reading and writing GRIB (editions 1 and 2) files.\nGRIB is the World Meterological Organization\nU{standard<http://www.wmo.ch/pages/prog/www/WMOCodes/GRIB.html>} \nfor distributing gridded data. \nThe module is a python interface to the\nU{GRIB API<https://software.ecmwf.int/wiki/display/GRIB/Home>} C library\nfrom the European Centre for Medium-Range Weather Forecasts\n(U{ECMWF<http://www.ecmwf.int>}).\n\nRe [...]
-static char __pyx_k_193[] = "1.9.9";
-static char __pyx_k_194[] = "mpl_toolkits.basemap";
-static char __pyx_k_195[] = "either pyproj or basemap required";
-static char __pyx_k_199[] = "_get_grib_api_version";
-static char __pyx_k_200[] = "/Volumes/User/jwhitaker/python/pygrib/pygrib.pyx";
-static char __pyx_k_203[] = "tolerate_badgrib_off";
-static char __pyx_k_206[] = "30 yr periods";
-static char __pyx_k__Dx[] = "Dx";
-static char __pyx_k__Dy[] = "Dy";
-static char __pyx_k__Ni[] = "Ni";
-static char __pyx_k__Nj[] = "Nj";
-static char __pyx_k__Nr[] = "Nr";
-static char __pyx_k__Nx[] = "Nx";
-static char __pyx_k__Ny[] = "Ny";
-static char __pyx_k__dx[] = "dx";
-static char __pyx_k__dy[] = "dy";
-static char __pyx_k__gh[] = "gh";
-static char __pyx_k__jd[] = "jd";
-static char __pyx_k__ma[] = "ma";
-static char __pyx_k__np[] = "np";
-static char __pyx_k__pi[] = "pi";
-static char __pyx_k__pl[] = "pl";
-static char __pyx_k__rb[] = "rb";
-static char __pyx_k__LaD[] = "LaD";
-static char __pyx_k__LoV[] = "LoV";
-static char __pyx_k___gh[] = "_gh";
-static char __pyx_k__aea[] = "aea";
-static char __pyx_k__cyl[] = "cyl";
-static char __pyx_k__day[] = "day";
-static char __pyx_k__div[] = "div";
-static char __pyx_k__err[] = "err";
-static char __pyx_k__grb[] = "grb";
-static char __pyx_k__hrs[] = "hrs";
-static char __pyx_k__int[] = "int";
-static char __pyx_k__key[] = "key";
-static char __pyx_k__lcc[] = "lcc";
-static char __pyx_k__max[] = "max";
-static char __pyx_k__min[] = "min";
-static char __pyx_k__msg[] = "msg";
-static char __pyx_k__one[] = "one";
-static char __pyx_k__sum[] = "sum";
-static char __pyx_k__yrs[] = "yrs";
-static char __pyx_k__7777[] = "7777";
-static char __pyx_k__Proj[] = "Proj";
-static char __pyx_k__aeqd[] = "aeqd";
-static char __pyx_k__copy[] = "copy";
-static char __pyx_k__data[] = "data";
-static char __pyx_k__days[] = "days";
-static char __pyx_k__fabs[] = "fabs";
-static char __pyx_k__file[] = "file";
-static char __pyx_k__geos[] = "geos";
-static char __pyx_k__hour[] = "hour";
-static char __pyx_k__isMA[] = "isMA";
-static char __pyx_k__join[] = "join";
-static char __pyx_k__keys[] = "keys";
-static char __pyx_k__laea[] = "laea";
-static char __pyx_k__lat1[] = "lat1";
-static char __pyx_k__lat2[] = "lat2";
-static char __pyx_k__lats[] = "lats";
-static char __pyx_k__lon1[] = "lon1";
-static char __pyx_k__lon2[] = "lon2";
-static char __pyx_k__merc[] = "merc";
-static char __pyx_k__mins[] = "mins";
-static char __pyx_k__msgs[] = "msgs";
-static char __pyx_k__name[] = "name";
-static char __pyx_k__ndim[] = "ndim";
-static char __pyx_k__next[] = "next";
-static char __pyx_k__proj[] = "proj";
-static char __pyx_k__secs[] = "secs";
-static char __pyx_k__seek[] = "seek";
-static char __pyx_k__size[] = "size";
-static char __pyx_k__tell[] = "tell";
-static char __pyx_k__warn[] = "warn";
-static char __pyx_k__year[] = "year";
-static char __pyx_k__zero[] = "zero";
-static char __pyx_k__Latin[] = "Latin";
-static char __pyx_k___find[] = "_find";
-static char __pyx_k__ascii[] = "ascii";
-static char __pyx_k__atype[] = "atype";
-static char __pyx_k__close[] = "close";
-static char __pyx_k__eight[] = "eight";
-static char __pyx_k__empty[] = "empty";
-static char __pyx_k__false[] = "false";
-static char __pyx_k__float[] = "float";
-static char __pyx_k__ftime[] = "ftime";
-static char __pyx_k__index[] = "index";
-static char __pyx_k__items[] = "items";
-static char __pyx_k__lat_0[] = "lat_0";
-static char __pyx_k__lat_1[] = "lat_1";
-static char __pyx_k__lat_2[] = "lat_2";
-static char __pyx_k__level[] = "level";
-static char __pyx_k__lon_0[] = "lon_0";
-static char __pyx_k__major[] = "major";
-static char __pyx_k__minor[] = "minor";
-static char __pyx_k__month[] = "month";
-static char __pyx_k__nlats[] = "nlats";
-static char __pyx_k__nmsgs[] = "nmsgs";
-static char __pyx_k__nsper[] = "nsper";
-static char __pyx_k__numpy[] = "numpy";
-static char __pyx_k__order[] = "order";
-static char __pyx_k__power[] = "power";
-static char __pyx_k__range[] = "range";
-static char __pyx_k__shape[] = "shape";
-static char __pyx_k__split[] = "split";
-static char __pyx_k__stere[] = "stere";
-static char __pyx_k__units[] = "units";
-static char __pyx_k__value[] = "value";
-static char __pyx_k__where[] = "where";
-static char __pyx_k__zeros[] = "zeros";
-static char __pyx_k__Latin1[] = "Latin1";
-static char __pyx_k__Latin2[] = "Latin2";
-static char __pyx_k__albers[] = "albers";
-static char __pyx_k__arange[] = "arange";
-static char __pyx_k__arcsin[] = "arcsin";
-static char __pyx_k__decode[] = "decode";
-static char __pyx_k__double[] = "double";
-static char __pyx_k__eleven[] = "eleven";
-static char __pyx_k__encode[] = "encode";
-static char __pyx_k__filled[] = "filled";
-static char __pyx_k__julday[] = "julday";
-static char __pyx_k__kwargs[] = "kwargs";
-static char __pyx_k__lat_ts[] = "lat_ts";
-static char __pyx_k__minute[] = "minute";
-static char __pyx_k__months[] = "months";
-static char __pyx_k__o_proj[] = "o_proj";
-static char __pyx_k__pygrib[] = "pygrib";
-static char __pyx_k__pyproj[] = "pyproj";
-static char __pyx_k__radius[] = "radius";
-static char __pyx_k__reload[] = "reload";
-static char __pyx_k__rewind[] = "rewind";
-static char __pyx_k__rstrip[] = "rstrip";
-static char __pyx_k__second[] = "second";
-static char __pyx_k__select[] = "select";
-static char __pyx_k__values[] = "values";
-static char __pyx_k__xrange[] = "xrange";
-static char __pyx_k__IOError[] = "IOError";
-static char __pyx_k__asarray[] = "asarray";
-static char __pyx_k__decades[] = "decades";
-static char __pyx_k__default[] = "default";
-static char __pyx_k__float64[] = "float64";
-static char __pyx_k__gaulats[] = "gaulats";
-static char __pyx_k__gribmsg[] = "gribmsg";
-static char __pyx_k__gribstr[] = "gribstr";
-static char __pyx_k__has_key[] = "has_key";
-static char __pyx_k__indices[] = "indices";
-static char __pyx_k__instant[] = "instant";
-static char __pyx_k__inverse[] = "inverse";
-static char __pyx_k__lambert[] = "lambert";
-static char __pyx_k__latlons[] = "latlons";
-static char __pyx_k__longlat[] = "longlat";
-static char __pyx_k__message[] = "message";
-static char __pyx_k__o_lat_p[] = "o_lat_p";
-static char __pyx_k__o_lon_p[] = "o_lon_p";
-static char __pyx_k__ob_tran[] = "ob_tran";
-static char __pyx_k__paramId[] = "paramId";
-static char __pyx_k__reduced[] = "reduced";
-static char __pyx_k__reshape[] = "reshape";
-static char __pyx_k__unknown[] = "unknown";
-static char __pyx_k__KeyError[] = "KeyError";
-static char __pyx_k____call__[] = "__call__";
-static char __pyx_k____dict__[] = "__dict__";
-static char __pyx_k____main__[] = "__main__";
-static char __pyx_k____test__[] = "__test__";
-static char __pyx_k___advance[] = "_advance";
-static char __pyx_k___get_key[] = "_get_key";
-static char __pyx_k___ro_keys[] = "_ro_keys";
-static char __pyx_k__analDate[] = "analDate";
-static char __pyx_k__dataDate[] = "dataDate";
-static char __pyx_k__dataTime[] = "dataTime";
-static char __pyx_k__datetime[] = "datetime";
-static char __pyx_k__filename[] = "filename";
-static char __pyx_k__gridType[] = "gridType";
-static char __pyx_k__linspace[] = "linspace";
-static char __pyx_k__localDir[] = "localDir";
-static char __pyx_k__mercator[] = "mercator";
-static char __pyx_k__meshgrid[] = "meshgrid";
-static char __pyx_k__redtoreg[] = "redtoreg";
-static char __pyx_k__revision[] = "revision";
-static char __pyx_k__setdates[] = "setdates";
-static char __pyx_k__stepType[] = "stepType";
-static char __pyx_k__thousand[] = "thousand";
-static char __pyx_k__topLevel[] = "topLevel";
-static char __pyx_k__tostring[] = "tostring";
-static char __pyx_k__warnings[] = "warnings";
-static char __pyx_k__TypeError[] = "TypeError";
-static char __pyx_k___all_keys[] = "_all_keys";
-static char __pyx_k___redtoreg[] = "_redtoreg";
-static char __pyx_k__centuries[] = "centuries";
-static char __pyx_k__from_what[] = "from_what";
-static char __pyx_k__julianDay[] = "julianDay";
-static char __pyx_k__latitudes[] = "latitudes";
-static char __pyx_k__ncepgrib2[] = "ncepgrib2";
-static char __pyx_k__stepRange[] = "stepRange";
-static char __pyx_k__stepUnits[] = "stepUnits";
-static char __pyx_k__traceback[] = "traceback";
-static char __pyx_k__validDate[] = "validDate";
-static char __pyx_k__valid_key[] = "valid_key";
-static char __pyx_k__DxInMetres[] = "DxInMetres";
-static char __pyx_k__DyInMetres[] = "DyInMetres";
-static char __pyx_k__IndexError[] = "IndexError";
-static char __pyx_k__ValueError[] = "ValueError";
-static char __pyx_k____import__[] = "__import__";
-static char __pyx_k___ftimedict[] = "_ftimedict";
-static char __pyx_k__fromstring[] = "fromstring";
-static char __pyx_k__gribstring[] = "gribstring";
-static char __pyx_k__is_missing[] = "is_missing";
-static char __pyx_k__iscallable[] = "iscallable";
-static char __pyx_k__longitudes[] = "longitudes";
-static char __pyx_k__projparams[] = "projparams";
-static char __pyx_k__reduced_gg[] = "reduced_gg";
-static char __pyx_k__reduced_ll[] = "reduced_ll";
-static char __pyx_k__regular_gg[] = "regular_gg";
-static char __pyx_k__regular_ll[] = "regular_ll";
-static char __pyx_k__rotated_gg[] = "rotated_gg";
-static char __pyx_k__rotated_ll[] = "rotated_ll";
-static char __pyx_k__space_view[] = "space_view";
-static char __pyx_k__startswith[] = "startswith";
-static char __pyx_k__typeOfGrid[] = "typeOfGrid";
-static char __pyx_k__Grib2Decode[] = "Grib2Decode";
-static char __pyx_k__ImportError[] = "ImportError";
-static char __pyx_k____getitem__[] = "__getitem__";
-static char __pyx_k____version__[] = "__version__";
-static char __pyx_k__bottomLevel[] = "bottomLevel";
-static char __pyx_k__iscontainer[] = "iscontainer";
-static char __pyx_k__oneThousand[] = "oneThousand";
-static char __pyx_k__packingType[] = "packingType";
-static char __pyx_k__return_msgs[] = "return_msgs";
-static char __pyx_k__typeOfLevel[] = "typeOfLevel";
-static char __pyx_k__LaDInDegrees[] = "LaDInDegrees";
-static char __pyx_k__LoVInDegrees[] = "LoVInDegrees";
-static char __pyx_k__RuntimeError[] = "RuntimeError";
-static char __pyx_k__fcstimeunits[] = "fcstimeunits";
-static char __pyx_k__forecastTime[] = "forecastTime";
-static char __pyx_k__grib2divider[] = "grib2divider";
-static char __pyx_k__grid_complex[] = "grid_complex";
-static char __pyx_k__missingValue[] = "missingValue";
-static char __pyx_k__StopIteration[] = "StopIteration";
-static char __pyx_k___is_container[] = "_is_container";
-static char __pyx_k___private_atts[] = "_private_atts";
-static char __pyx_k___reshape_mask[] = "_reshape_mask";
-static char __pyx_k___unshape_mask[] = "_unshape_mask";
-static char __pyx_k__masked_values[] = "masked_values";
-static char __pyx_k__messagenumber[] = "messagenumber";
-static char __pyx_k__parameterName[] = "parameterName";
-static char __pyx_k__AttributeError[] = "AttributeError";
-static char __pyx_k___is_stringlike[] = "_is_stringlike";
-static char __pyx_k__expand_reduced[] = "expand_reduced";
-static char __pyx_k__numberOfValues[] = "numberOfValues";
-static char __pyx_k__parameterUnits[] = "parameterUnits";
-static char __pyx_k__Latin1InDegrees[] = "Latin1InDegrees";
-static char __pyx_k__Latin2InDegrees[] = "Latin2InDegrees";
-static char __pyx_k___read_only_keys[] = "_read_only_keys";
-static char __pyx_k___set_projparams[] = "_set_projparams";
-static char __pyx_k__derivedForecast[] = "derivedForecast";
-static char __pyx_k__numberOfMissing[] = "numberOfMissing";
-static char __pyx_k__shapeOfTheEarth[] = "shapeOfTheEarth";
-static char __pyx_k__truncateDegrees[] = "truncateDegrees";
-static char __pyx_k__centralLongitude[] = "centralLongitude";
-static char __pyx_k__default_encoding[] = "default_encoding";
-static char __pyx_k__grib_api_version[] = "grib_api_version";
-static char __pyx_k__missingvalue_int[] = "missingvalue_int";
-static char __pyx_k__multi_support_on[] = "multi_support_on";
-static char __pyx_k__standardParallel[] = "standardParallel";
-static char __pyx_k__tolerate_badgrib[] = "tolerate_badgrib";
-static char __pyx_k__distinctLatitudes[] = "distinctLatitudes";
-static char __pyx_k__multi_support_off[] = "multi_support_off";
-static char __pyx_k__datetime_to_julian[] = "datetime_to_julian";
-static char __pyx_k__distinctLongitudes[] = "distinctLongitudes";
-static char __pyx_k__julian_to_datetime[] = "julian_to_datetime";
-static char __pyx_k__missingvalue_float[] = "missingvalue_float";
-static char __pyx_k__perturbationNumber[] = "perturbationNumber";
-static char __pyx_k__iDirectionIncrement[] = "iDirectionIncrement";
-static char __pyx_k__polar_stereographic[] = "polar_stereographic";
-static char __pyx_k__probabilityTypeName[] = "probabilityTypeName";
-static char __pyx_k__tolerate_badgrib_on[] = "tolerate_badgrib_on";
-static PyObject *__pyx_n_s_1;
-static PyObject *__pyx_kp_s_10;
-static PyObject *__pyx_kp_s_104;
-static PyObject *__pyx_kp_s_105;
-static PyObject *__pyx_kp_s_106;
-static PyObject *__pyx_n_s_108;
-static PyObject *__pyx_kp_s_112;
-static PyObject *__pyx_kp_s_115;
-static PyObject *__pyx_n_s_117;
-static PyObject *__pyx_kp_s_12;
-static PyObject *__pyx_n_s_139;
-static PyObject *__pyx_n_s_141;
-static PyObject *__pyx_n_s_142;
-static PyObject *__pyx_n_s_143;
-static PyObject *__pyx_n_s_144;
-static PyObject *__pyx_n_s_145;
-static PyObject *__pyx_n_s_146;
-static PyObject *__pyx_n_s_148;
-static PyObject *__pyx_kp_s_149;
-static PyObject *__pyx_kp_s_15;
-static PyObject *__pyx_n_s_151;
-static PyObject *__pyx_n_s_152;
-static PyObject *__pyx_n_s_154;
-static PyObject *__pyx_kp_s_156;
-static PyObject *__pyx_n_s_158;
-static PyObject *__pyx_n_s_159;
-static PyObject *__pyx_n_s_160;
-static PyObject *__pyx_n_s_161;
-static PyObject *__pyx_n_s_162;
-static PyObject *__pyx_n_s_163;
-static PyObject *__pyx_n_s_164;
-static PyObject *__pyx_n_s_165;
-static PyObject *__pyx_n_s_166;
-static PyObject *__pyx_n_s_167;
-static PyObject *__pyx_kp_s_168;
-static PyObject *__pyx_n_s_169;
-static PyObject *__pyx_kp_s_17;
-static PyObject *__pyx_n_s_170;
-static PyObject *__pyx_n_s_171;
-static PyObject *__pyx_n_s_172;
-static PyObject *__pyx_n_s_176;
-static PyObject *__pyx_n_s_177;
-static PyObject *__pyx_kp_s_178;
-static PyObject *__pyx_n_s_180;
-static PyObject *__pyx_n_s_181;
-static PyObject *__pyx_kp_s_182;
-static PyObject *__pyx_kp_s_183;
-static PyObject *__pyx_kp_s_186;
-static PyObject *__pyx_kp_s_188;
-static PyObject *__pyx_kp_s_19;
-static PyObject *__pyx_kp_s_193;
-static PyObject *__pyx_n_s_194;
-static PyObject *__pyx_kp_s_195;
-static PyObject *__pyx_n_s_199;
-static PyObject *__pyx_kp_s_2;
-static PyObject *__pyx_n_s_20;
-static PyObject *__pyx_kp_s_200;
-static PyObject *__pyx_n_s_203;
-static PyObject *__pyx_kp_s_206;
-static PyObject *__pyx_kp_s_24;
-static PyObject *__pyx_kp_s_27;
-static PyObject *__pyx_kp_s_28;
-static PyObject *__pyx_kp_s_29;
-static PyObject *__pyx_kp_s_3;
-static PyObject *__pyx_kp_s_30;
-static PyObject *__pyx_kp_s_33;
-static PyObject *__pyx_kp_s_38;
-static PyObject *__pyx_kp_s_39;
-static PyObject *__pyx_n_s_46;
-static PyObject *__pyx_n_s_48;
-static PyObject *__pyx_kp_s_5;
-static PyObject *__pyx_n_s_50;
-static PyObject *__pyx_n_s_52;
-static PyObject *__pyx_n_s_54;
-static PyObject *__pyx_n_s_56;
-static PyObject *__pyx_n_s_58;
-static PyObject *__pyx_kp_s_6;
-static PyObject *__pyx_kp_s_60;
-static PyObject *__pyx_kp_s_61;
-static PyObject *__pyx_kp_s_62;
-static PyObject *__pyx_kp_s_66;
-static PyObject *__pyx_kp_s_67;
-static PyObject *__pyx_kp_s_71;
-static PyObject *__pyx_kp_s_72;
-static PyObject *__pyx_n_s_74;
-static PyObject *__pyx_kp_s_76;
-static PyObject *__pyx_kp_s_77;
-static PyObject *__pyx_kp_s_78;
-static PyObject *__pyx_kp_s_79;
-static PyObject *__pyx_kp_s_8;
-static PyObject *__pyx_kp_s_81;
-static PyObject *__pyx_kp_s_82;
-static PyObject *__pyx_kp_s_83;
-static PyObject *__pyx_kp_s_84;
-static PyObject *__pyx_kp_s_85;
-static PyObject *__pyx_kp_s_86;
-static PyObject *__pyx_kp_s_87;
-static PyObject *__pyx_n_s_89;
-static PyObject *__pyx_n_s_91;
-static PyObject *__pyx_n_s_93;
-static PyObject *__pyx_n_s_95;
-static PyObject *__pyx_kp_s_97;
-static PyObject *__pyx_kp_s_98;
-static PyObject *__pyx_kp_s_99;
-static PyObject *__pyx_kp_s__7777;
-static PyObject *__pyx_n_s__AttributeError;
-static PyObject *__pyx_n_s__C;
-static PyObject *__pyx_n_s__Dx;
-static PyObject *__pyx_n_s__DxInMetres;
-static PyObject *__pyx_n_s__Dy;
-static PyObject *__pyx_n_s__DyInMetres;
-static PyObject *__pyx_n_s__F;
-static PyObject *__pyx_n_s__Grib2Decode;
-static PyObject *__pyx_n_s__IOError;
-static PyObject *__pyx_n_s__ImportError;
-static PyObject *__pyx_n_s__IndexError;
-static PyObject *__pyx_n_s__KeyError;
-static PyObject *__pyx_n_s__LaD;
-static PyObject *__pyx_n_s__LaDInDegrees;
-static PyObject *__pyx_n_s__Latin;
-static PyObject *__pyx_n_s__Latin1;
-static PyObject *__pyx_n_s__Latin1InDegrees;
-static PyObject *__pyx_n_s__Latin2;
-static PyObject *__pyx_n_s__Latin2InDegrees;
-static PyObject *__pyx_n_s__LoV;
-static PyObject *__pyx_n_s__LoVInDegrees;
-static PyObject *__pyx_n_s__Ni;
-static PyObject *__pyx_n_s__Nj;
-static PyObject *__pyx_n_s__Nr;
-static PyObject *__pyx_n_s__Nx;
-static PyObject *__pyx_n_s__Ny;
-static PyObject *__pyx_n_s__Proj;
-static PyObject *__pyx_n_s__RuntimeError;
-static PyObject *__pyx_n_s__StopIteration;
-static PyObject *__pyx_n_s__TypeError;
-static PyObject *__pyx_n_s__ValueError;
-static PyObject *__pyx_n_s____call__;
-static PyObject *__pyx_n_s____dict__;
-static PyObject *__pyx_n_s____getitem__;
-static PyObject *__pyx_n_s____import__;
-static PyObject *__pyx_n_s____main__;
-static PyObject *__pyx_n_s____test__;
-static PyObject *__pyx_n_s____version__;
-static PyObject *__pyx_n_s___advance;
-static PyObject *__pyx_n_s___all_keys;
-static PyObject *__pyx_n_s___find;
-static PyObject *__pyx_n_s___ftimedict;
-static PyObject *__pyx_n_s___get_key;
-static PyObject *__pyx_n_s___gh;
-static PyObject *__pyx_n_s___is_container;
-static PyObject *__pyx_n_s___is_stringlike;
-static PyObject *__pyx_n_s___private_atts;
-static PyObject *__pyx_n_s___read_only_keys;
-static PyObject *__pyx_n_s___redtoreg;
-static PyObject *__pyx_n_s___reshape_mask;
-static PyObject *__pyx_n_s___ro_keys;
-static PyObject *__pyx_n_s___set_projparams;
-static PyObject *__pyx_n_s___unshape_mask;
-static PyObject *__pyx_n_s__a;
-static PyObject *__pyx_n_s__aea;
-static PyObject *__pyx_n_s__aeqd;
-static PyObject *__pyx_n_s__albers;
-static PyObject *__pyx_n_s__analDate;
-static PyObject *__pyx_n_s__arange;
-static PyObject *__pyx_n_s__arcsin;
-static PyObject *__pyx_n_s__asarray;
-static PyObject *__pyx_n_s__ascii;
-static PyObject *__pyx_n_s__atype;
-static PyObject *__pyx_n_s__b;
-static PyObject *__pyx_n_s__bottomLevel;
-static PyObject *__pyx_n_s__centralLongitude;
-static PyObject *__pyx_n_s__centuries;
-static PyObject *__pyx_n_s__close;
-static PyObject *__pyx_n_s__copy;
-static PyObject *__pyx_n_s__cyl;
-static PyObject *__pyx_n_s__d;
-static PyObject *__pyx_n_s__data;
-static PyObject *__pyx_n_s__dataDate;
-static PyObject *__pyx_n_s__dataTime;
-static PyObject *__pyx_n_s__datetime;
-static PyObject *__pyx_n_s__datetime_to_julian;
-static PyObject *__pyx_n_s__day;
-static PyObject *__pyx_n_s__days;
-static PyObject *__pyx_n_s__decades;
-static PyObject *__pyx_n_s__decode;
-static PyObject *__pyx_n_s__default;
-static PyObject *__pyx_n_s__default_encoding;
-static PyObject *__pyx_n_s__derivedForecast;
-static PyObject *__pyx_n_s__distinctLatitudes;
-static PyObject *__pyx_n_s__distinctLongitudes;
-static PyObject *__pyx_n_s__div;
-static PyObject *__pyx_n_s__double;
-static PyObject *__pyx_n_s__dx;
-static PyObject *__pyx_n_s__dy;
-static PyObject *__pyx_n_s__eight;
-static PyObject *__pyx_n_s__eleven;
-static PyObject *__pyx_n_s__empty;
-static PyObject *__pyx_n_s__encode;
-static PyObject *__pyx_n_s__err;
-static PyObject *__pyx_n_s__expand_reduced;
-static PyObject *__pyx_n_s__fabs;
-static PyObject *__pyx_n_s__false;
-static PyObject *__pyx_n_s__fcstimeunits;
-static PyObject *__pyx_n_s__file;
-static PyObject *__pyx_n_s__filename;
-static PyObject *__pyx_n_s__filled;
-static PyObject *__pyx_n_s__float;
-static PyObject *__pyx_n_s__float64;
-static PyObject *__pyx_n_s__forecastTime;
-static PyObject *__pyx_n_s__from_what;
-static PyObject *__pyx_n_s__fromstring;
-static PyObject *__pyx_n_s__ftime;
-static PyObject *__pyx_n_s__gaulats;
-static PyObject *__pyx_n_s__geos;
-static PyObject *__pyx_n_s__gh;
-static PyObject *__pyx_n_s__grb;
-static PyObject *__pyx_n_s__grib2divider;
-static PyObject *__pyx_n_s__grib_api_version;
-static PyObject *__pyx_n_s__gribmsg;
-static PyObject *__pyx_n_s__gribstr;
-static PyObject *__pyx_n_s__gribstring;
-static PyObject *__pyx_n_s__gridType;
-static PyObject *__pyx_n_s__grid_complex;
-static PyObject *__pyx_n_s__h;
-static PyObject *__pyx_n_s__has_key;
-static PyObject *__pyx_n_s__hour;
-static PyObject *__pyx_n_s__hrs;
-static PyObject *__pyx_n_s__iDirectionIncrement;
-static PyObject *__pyx_n_s__index;
-static PyObject *__pyx_n_s__indices;
-static PyObject *__pyx_n_s__instant;
-static PyObject *__pyx_n_s__int;
-static PyObject *__pyx_n_s__inverse;
-static PyObject *__pyx_n_s__isMA;
-static PyObject *__pyx_n_s__is_missing;
-static PyObject *__pyx_n_s__iscallable;
-static PyObject *__pyx_n_s__iscontainer;
-static PyObject *__pyx_n_s__items;
-static PyObject *__pyx_n_s__jd;
-static PyObject *__pyx_n_s__join;
-static PyObject *__pyx_n_s__julday;
-static PyObject *__pyx_n_s__julianDay;
-static PyObject *__pyx_n_s__julian_to_datetime;
-static PyObject *__pyx_n_s__k;
-static PyObject *__pyx_n_s__key;
-static PyObject *__pyx_n_s__keys;
-static PyObject *__pyx_n_s__kwargs;
-static PyObject *__pyx_n_s__l;
-static PyObject *__pyx_n_s__laea;
-static PyObject *__pyx_n_s__lambert;
-static PyObject *__pyx_n_s__lat1;
-static PyObject *__pyx_n_s__lat2;
-static PyObject *__pyx_n_s__lat_0;
-static PyObject *__pyx_n_s__lat_1;
-static PyObject *__pyx_n_s__lat_2;
-static PyObject *__pyx_n_s__lat_ts;
-static PyObject *__pyx_n_s__latitudes;
-static PyObject *__pyx_n_s__latlons;
-static PyObject *__pyx_n_s__lats;
-static PyObject *__pyx_n_s__lcc;
-static PyObject *__pyx_n_s__level;
-static PyObject *__pyx_n_s__linspace;
-static PyObject *__pyx_n_s__localDir;
-static PyObject *__pyx_n_s__lon1;
-static PyObject *__pyx_n_s__lon2;
-static PyObject *__pyx_n_s__lon_0;
-static PyObject *__pyx_n_s__longitudes;
-static PyObject *__pyx_n_s__longlat;
-static PyObject *__pyx_n_s__ma;
-static PyObject *__pyx_n_s__major;
-static PyObject *__pyx_n_s__masked_values;
-static PyObject *__pyx_n_s__max;
-static PyObject *__pyx_n_s__merc;
-static PyObject *__pyx_n_s__mercator;
-static PyObject *__pyx_n_s__meshgrid;
-static PyObject *__pyx_n_s__message;
-static PyObject *__pyx_n_s__messagenumber;
-static PyObject *__pyx_n_s__min;
-static PyObject *__pyx_n_s__minor;
-static PyObject *__pyx_n_s__mins;
-static PyObject *__pyx_n_s__minute;
-static PyObject *__pyx_n_s__missingValue;
-static PyObject *__pyx_n_s__missingvalue_float;
-static PyObject *__pyx_n_s__missingvalue_int;
-static PyObject *__pyx_n_s__month;
-static PyObject *__pyx_n_s__months;
-static PyObject *__pyx_n_s__msg;
-static PyObject *__pyx_n_s__msgs;
-static PyObject *__pyx_n_s__multi_support_off;
-static PyObject *__pyx_n_s__multi_support_on;
-static PyObject *__pyx_n_s__name;
-static PyObject *__pyx_n_s__ncepgrib2;
-static PyObject *__pyx_n_s__ndim;
-static PyObject *__pyx_n_s__next;
-static PyObject *__pyx_n_s__nlats;
-static PyObject *__pyx_n_s__nmsgs;
-static PyObject *__pyx_n_s__np;
-static PyObject *__pyx_n_s__nsper;
-static PyObject *__pyx_n_s__numberOfMissing;
-static PyObject *__pyx_n_s__numberOfValues;
-static PyObject *__pyx_n_s__numpy;
-static PyObject *__pyx_n_s__o_lat_p;
-static PyObject *__pyx_n_s__o_lon_p;
-static PyObject *__pyx_n_s__o_proj;
-static PyObject *__pyx_n_s__ob_tran;
-static PyObject *__pyx_n_s__one;
-static PyObject *__pyx_n_s__oneThousand;
-static PyObject *__pyx_n_s__order;
-static PyObject *__pyx_n_s__packingType;
-static PyObject *__pyx_n_s__paramId;
-static PyObject *__pyx_n_s__parameterName;
-static PyObject *__pyx_n_s__parameterUnits;
-static PyObject *__pyx_n_s__perturbationNumber;
-static PyObject *__pyx_n_s__pi;
-static PyObject *__pyx_n_s__pl;
-static PyObject *__pyx_n_s__polar_stereographic;
-static PyObject *__pyx_n_s__power;
-static PyObject *__pyx_n_s__probabilityTypeName;
-static PyObject *__pyx_n_s__proj;
-static PyObject *__pyx_n_s__projparams;
-static PyObject *__pyx_n_s__pygrib;
-static PyObject *__pyx_n_s__pyproj;
-static PyObject *__pyx_n_s__radius;
-static PyObject *__pyx_n_s__range;
-static PyObject *__pyx_n_s__redtoreg;
-static PyObject *__pyx_n_s__reduced;
-static PyObject *__pyx_n_s__reduced_gg;
-static PyObject *__pyx_n_s__reduced_ll;
-static PyObject *__pyx_n_s__regular_gg;
-static PyObject *__pyx_n_s__regular_ll;
-static PyObject *__pyx_n_s__reload;
-static PyObject *__pyx_n_s__reshape;
-static PyObject *__pyx_n_s__return_msgs;
-static PyObject *__pyx_n_s__revision;
-static PyObject *__pyx_n_s__rewind;
-static PyObject *__pyx_n_s__rotated_gg;
-static PyObject *__pyx_n_s__rotated_ll;
-static PyObject *__pyx_n_s__rstrip;
-static PyObject *__pyx_n_s__s;
-static PyObject *__pyx_n_s__second;
-static PyObject *__pyx_n_s__secs;
-static PyObject *__pyx_n_s__seek;
-static PyObject *__pyx_n_s__select;
-static PyObject *__pyx_n_s__setdates;
-static PyObject *__pyx_n_s__shape;
-static PyObject *__pyx_n_s__shapeOfTheEarth;
-static PyObject *__pyx_n_s__size;
-static PyObject *__pyx_n_s__space_view;
-static PyObject *__pyx_n_s__split;
-static PyObject *__pyx_n_s__standardParallel;
-static PyObject *__pyx_n_s__startswith;
-static PyObject *__pyx_n_s__stepRange;
-static PyObject *__pyx_n_s__stepType;
-static PyObject *__pyx_n_s__stepUnits;
-static PyObject *__pyx_n_s__stere;
-static PyObject *__pyx_n_s__sum;
-static PyObject *__pyx_n_s__tell;
-static PyObject *__pyx_n_s__thousand;
-static PyObject *__pyx_n_s__tolerate_badgrib;
-static PyObject *__pyx_n_s__tolerate_badgrib_on;
-static PyObject *__pyx_n_s__topLevel;
-static PyObject *__pyx_n_s__tostring;
-static PyObject *__pyx_n_s__traceback;
-static PyObject *__pyx_n_s__truncateDegrees;
-static PyObject *__pyx_n_s__typeOfGrid;
-static PyObject *__pyx_n_s__typeOfLevel;
-static PyObject *__pyx_n_s__units;
-static PyObject *__pyx_n_s__unknown;
-static PyObject *__pyx_n_s__v;
-static PyObject *__pyx_n_s__validDate;
-static PyObject *__pyx_n_s__valid_key;
-static PyObject *__pyx_n_s__value;
-static PyObject *__pyx_n_b__values;
-static PyObject *__pyx_n_s__values;
-static PyObject *__pyx_n_s__warn;
-static PyObject *__pyx_n_s__warnings;
-static PyObject *__pyx_n_s__where;
-static PyObject *__pyx_n_s__xrange;
-static PyObject *__pyx_n_s__year;
-static PyObject *__pyx_n_s__yrs;
-static PyObject *__pyx_n_s__zero;
-static PyObject *__pyx_n_s__zeros;
+static char __pyx_k_C[] = "C";
+static char __pyx_k_F[] = "F";
+static char __pyx_k_a[] = "a";
+static char __pyx_k_b[] = "b";
+static char __pyx_k_d[] = "d";
+static char __pyx_k_h[] = "h";
+static char __pyx_k_k[] = "k";
+static char __pyx_k_l[] = "l";
+static char __pyx_k_s[] = " %s";
+static char __pyx_k_v[] = "v";
+static char __pyx_k_Dx[] = "Dx";
+static char __pyx_k_Dy[] = "Dy";
+static char __pyx_k_Ni[] = "Ni";
+static char __pyx_k_Nj[] = "Nj";
+static char __pyx_k_Nr[] = "Nr";
+static char __pyx_k_Nx[] = "Nx";
+static char __pyx_k_Ny[] = "Ny";
+static char __pyx_k__8[] = "";
+static char __pyx_k_dx[] = "dx";
+static char __pyx_k_dy[] = "dy";
+static char __pyx_k_gh[] = "_gh";
+static char __pyx_k_jd[] = "jd";
+static char __pyx_k_ma[] = "ma";
+static char __pyx_k_np[] = "np";
+static char __pyx_k_pi[] = "pi";
+static char __pyx_k_pl[] = "pl";
+static char __pyx_k_rb[] = "rb";
+static char __pyx_k_04i[] = "%04i";
+static char __pyx_k_LaD[] = "LaD";
+static char __pyx_k_LoV[] = "LoV";
+static char __pyx_k__12[] = "-";
+static char __pyx_k__17[] = ":";
+static char __pyx_k__22[] = " (";
+static char __pyx_k__23[] = ")";
+static char __pyx_k__99[] = ",";
+static char __pyx_k_aea[] = "aea";
+static char __pyx_k_cyl[] = "cyl";
+static char __pyx_k_day[] = "day";
+static char __pyx_k_div[] = "div";
+static char __pyx_k_err[] = "err";
+static char __pyx_k_grb[] = "grb";
+static char __pyx_k_hrs[] = "hrs";
+static char __pyx_k_int[] = "int";
+static char __pyx_k_key[] = "key";
+static char __pyx_k_lcc[] = "lcc";
+static char __pyx_k_max[] = "max";
+static char __pyx_k_min[] = "min";
+static char __pyx_k_msg[] = "msg";
+static char __pyx_k_one[] = "one";
+static char __pyx_k_s_2[] = " (> %s)";
+static char __pyx_k_s_3[] = " (< %s)";
+static char __pyx_k_s_4[] = "s";
+static char __pyx_k_s_s[] = " (%s-%s)";
+static char __pyx_k_sum[] = "sum";
+static char __pyx_k_yrs[] = "yrs";
+static char __pyx_k_7777[] = "7777";
+static char __pyx_k_Proj[] = "Proj";
+static char __pyx_k_aeqd[] = "aeqd";
+static char __pyx_k_call[] = "__call__";
+static char __pyx_k_copy[] = "copy";
+static char __pyx_k_data[] = "data";
+static char __pyx_k_days[] = "days";
+static char __pyx_k_dict[] = "__dict__";
+static char __pyx_k_fabs[] = "fabs";
+static char __pyx_k_file[] = "file";
+static char __pyx_k_find[] = "_find";
+static char __pyx_k_from[] = ":from ";
+static char __pyx_k_geos[] = "geos";
+static char __pyx_k_gh_2[] = "gh";
+static char __pyx_k_hour[] = "hour";
+static char __pyx_k_isMA[] = "isMA";
+static char __pyx_k_join[] = "join";
+static char __pyx_k_keys[] = "keys";
+static char __pyx_k_laea[] = "laea";
+static char __pyx_k_lat1[] = "lat1";
+static char __pyx_k_lat2[] = "lat2";
+static char __pyx_k_lats[] = "lats";
+static char __pyx_k_lon1[] = "lon1";
+static char __pyx_k_lon2[] = "lon2";
+static char __pyx_k_main[] = "__main__";
+static char __pyx_k_merc[] = "merc";
+static char __pyx_k_mins[] = "mins";
+static char __pyx_k_msgs[] = "msgs";
+static char __pyx_k_name[] = "name";
+static char __pyx_k_ndim[] = "ndim";
+static char __pyx_k_next[] = "next";
+static char __pyx_k_proj[] = "proj";
+static char __pyx_k_secs[] = "secs";
+static char __pyx_k_seek[] = "seek";
+static char __pyx_k_size[] = "size";
+static char __pyx_k_tell[] = "tell";
+static char __pyx_k_test[] = "__test__";
+static char __pyx_k_warn[] = "warn";
+static char __pyx_k_year[] = "year";
+static char __pyx_k_zero[] = "zero";
+static char __pyx_k_2_0_0[] = "2.0.0";
+static char __pyx_k_Latin[] = "Latin";
+static char __pyx_k_ascii[] = "ascii";
+static char __pyx_k_atype[] = "atype";
+static char __pyx_k_close[] = "close";
+static char __pyx_k_d_d_d[] = "%d.%d.%d";
+static char __pyx_k_eight[] = "eight";
+static char __pyx_k_empty[] = "empty";
+static char __pyx_k_false[] = "false";
+static char __pyx_k_float[] = "float";
+static char __pyx_k_ftime[] = "ftime";
+static char __pyx_k_index[] = "index";
+static char __pyx_k_items[] = "items";
+static char __pyx_k_lat_0[] = "lat_0";
+static char __pyx_k_lat_1[] = "lat_1";
+static char __pyx_k_lat_2[] = "lat_2";
+static char __pyx_k_level[] = "level";
+static char __pyx_k_lon_0[] = "lon_0";
+static char __pyx_k_major[] = "major";
+static char __pyx_k_minor[] = "minor";
+static char __pyx_k_month[] = "month";
+static char __pyx_k_nlats[] = "nlats";
+static char __pyx_k_nmsgs[] = "nmsgs";
+static char __pyx_k_nsper[] = "nsper";
+static char __pyx_k_numpy[] = "numpy";
+static char __pyx_k_order[] = "order";
+static char __pyx_k_power[] = "power";
+static char __pyx_k_range[] = "range";
+static char __pyx_k_shape[] = "shape";
+static char __pyx_k_split[] = "split";
+static char __pyx_k_stere[] = "stere";
+static char __pyx_k_units[] = "units";
+static char __pyx_k_value[] = "value";
+static char __pyx_k_where[] = "where";
+static char __pyx_k_zeros[] = "zeros";
+static char __pyx_k_Latin1[] = "Latin1";
+static char __pyx_k_Latin2[] = "Latin2";
+static char __pyx_k_albers[] = "albers";
+static char __pyx_k_arange[] = "arange";
+static char __pyx_k_arcsin[] = "arcsin";
+static char __pyx_k_decode[] = "decode";
+static char __pyx_k_double[] = "double";
+static char __pyx_k_eleven[] = "eleven";
+static char __pyx_k_encode[] = "encode";
+static char __pyx_k_filled[] = "filled";
+static char __pyx_k_import[] = "__import__";
+static char __pyx_k_julday[] = "julday";
+static char __pyx_k_kwargs[] = "kwargs";
+static char __pyx_k_lat_ts[] = "lat_ts";
+static char __pyx_k_minute[] = "minute";
+static char __pyx_k_months[] = "months";
+static char __pyx_k_o_proj[] = "o_proj";
+static char __pyx_k_pygrib[] = "pygrib";
+static char __pyx_k_pyproj[] = "pyproj";
+static char __pyx_k_radius[] = "radius";
+static char __pyx_k_reload[] = "reload";
+static char __pyx_k_rewind[] = "rewind";
+static char __pyx_k_rstrip[] = "rstrip";
+static char __pyx_k_second[] = "second";
+static char __pyx_k_select[] = "select";
+static char __pyx_k_values[] = "values";
+static char __pyx_k_xrange[] = "xrange";
+static char __pyx_k_IOError[] = "IOError";
+static char __pyx_k_advance[] = "_advance";
+static char __pyx_k_asarray[] = "asarray";
+static char __pyx_k_decades[] = "decades";
+static char __pyx_k_default[] = "default";
+static char __pyx_k_float64[] = "float64";
+static char __pyx_k_gaulats[] = "gaulats";
+static char __pyx_k_get_key[] = "_get_key";
+static char __pyx_k_getitem[] = "__getitem__";
+static char __pyx_k_gribmsg[] = "gribmsg";
+static char __pyx_k_gribstr[] = "gribstr";
+static char __pyx_k_has_key[] = "has_key";
+static char __pyx_k_indices[] = "indices";
+static char __pyx_k_instant[] = "instant";
+static char __pyx_k_inverse[] = "inverse";
+static char __pyx_k_lambert[] = "lambert";
+static char __pyx_k_latlons[] = "latlons";
+static char __pyx_k_level_s[] = ":level %s";
+static char __pyx_k_longlat[] = "longlat";
+static char __pyx_k_message[] = "message";
+static char __pyx_k_o_lat_p[] = "o_lat_p";
+static char __pyx_k_o_lon_p[] = "o_lon_p";
+static char __pyx_k_ob_tran[] = "ob_tran";
+static char __pyx_k_paramId[] = "paramId";
+static char __pyx_k_reduced[] = "reduced";
+static char __pyx_k_reshape[] = "reshape";
+static char __pyx_k_ro_keys[] = "_ro_keys";
+static char __pyx_k_unknown[] = "unknown";
+static char __pyx_k_version[] = "__version__";
+static char __pyx_k_KeyError[] = "KeyError";
+static char __pyx_k_all_keys[] = "_all_keys";
+static char __pyx_k_analDate[] = "analDate";
+static char __pyx_k_dataDate[] = "dataDate";
+static char __pyx_k_dataTime[] = "dataTime";
+static char __pyx_k_datetime[] = "datetime";
+static char __pyx_k_ens_mean[] = ":ens mean";
+static char __pyx_k_filename[] = "filename";
+static char __pyx_k_gridType[] = "gridType";
+static char __pyx_k_linspace[] = "linspace";
+static char __pyx_k_localDir[] = "localDir";
+static char __pyx_k_mercator[] = "mercator";
+static char __pyx_k_meshgrid[] = "meshgrid";
+static char __pyx_k_redtoreg[] = "redtoreg";
+static char __pyx_k_revision[] = "revision";
+static char __pyx_k_setdates[] = "setdates";
+static char __pyx_k_stepType[] = "stepType";
+static char __pyx_k_thousand[] = "thousand";
+static char __pyx_k_topLevel[] = "topLevel";
+static char __pyx_k_tostring[] = "tostring";
+static char __pyx_k_warnings[] = "warnings";
+static char __pyx_k_TypeError[] = "TypeError";
+static char __pyx_k_centuries[] = "centuries";
+static char __pyx_k_from_what[] = "from_what";
+static char __pyx_k_ftimedict[] = "_ftimedict";
+static char __pyx_k_julianDay[] = "julianDay";
+static char __pyx_k_latitudes[] = "latitudes";
+static char __pyx_k_ncepgrib2[] = "ncepgrib2";
+static char __pyx_k_stepRange[] = "stepRange";
+static char __pyx_k_stepUnits[] = "stepUnits";
+static char __pyx_k_traceback[] = "traceback";
+static char __pyx_k_validDate[] = "validDate";
+static char __pyx_k_valid_key[] = "valid_key";
+static char __pyx_k_DxInMetres[] = "DxInMetres";
+static char __pyx_k_DyInMetres[] = "DyInMetres";
+static char __pyx_k_IndexError[] = "IndexError";
+static char __pyx_k_ValueError[] = "ValueError";
+static char __pyx_k_ens_spread[] = ":ens spread";
+static char __pyx_k_fromstring[] = "fromstring";
+static char __pyx_k_gribstring[] = "gribstring";
+static char __pyx_k_is_missing[] = "is_missing";
+static char __pyx_k_iscallable[] = "iscallable";
+static char __pyx_k_levels_s_s[] = ":levels %s-%s";
+static char __pyx_k_longitudes[] = "longitudes";
+static char __pyx_k_projparams[] = "projparams";
+static char __pyx_k_redtoreg_2[] = "_redtoreg";
+static char __pyx_k_reduced_gg[] = "reduced_gg";
+static char __pyx_k_reduced_ll[] = "reduced_ll";
+static char __pyx_k_regular_gg[] = "regular_gg";
+static char __pyx_k_regular_ll[] = "regular_ll";
+static char __pyx_k_rotated_gg[] = "rotated_gg";
+static char __pyx_k_rotated_ll[] = "rotated_ll";
+static char __pyx_k_space_view[] = "space_view";
+static char __pyx_k_startswith[] = "startswith";
+static char __pyx_k_typeOfGrid[] = "typeOfGrid";
+static char __pyx_k_Grib2Decode[] = "Grib2Decode";
+static char __pyx_k_ImportError[] = "ImportError";
+static char __pyx_k_bottomLevel[] = "bottomLevel";
+static char __pyx_k_ens_std_dev[] = ":ens std dev";
+static char __pyx_k_iscontainer[] = "iscontainer";
+static char __pyx_k_oneThousand[] = "oneThousand";
+static char __pyx_k_packingType[] = "packingType";
+static char __pyx_k_return_msgs[] = "return_msgs";
+static char __pyx_k_typeOfLevel[] = "typeOfLevel";
+static char __pyx_k_3_hr_periods[] = "3 hr periods";
+static char __pyx_k_6_hr_periods[] = "6 hr periods";
+static char __pyx_k_LaDInDegrees[] = "LaDInDegrees";
+static char __pyx_k_LoVInDegrees[] = "LoVInDegrees";
+static char __pyx_k_RuntimeError[] = "RuntimeError";
+static char __pyx_k_fcstimeunits[] = "fcstimeunits";
+static char __pyx_k_forecastTime[] = "forecastTime";
+static char __pyx_k_grib2divider[] = "grib2divider";
+static char __pyx_k_grid_complex[] = "grid_complex";
+static char __pyx_k_is_container[] = "_is_container";
+static char __pyx_k_missingValue[] = "missingValue";
+static char __pyx_k_private_atts[] = "_private_atts";
+static char __pyx_k_reshape_mask[] = "_reshape_mask";
+static char __pyx_k_unshape_mask[] = "_unshape_mask";
+static char __pyx_k_12_hr_periods[] = "12 hr periods";
+static char __pyx_k_30_yr_periods[] = "30 yr periods";
+static char __pyx_k_StopIteration[] = "StopIteration";
+static char __pyx_k_fcst_time_s_s[] = ":fcst time %s %s";
+static char __pyx_k_is_stringlike[] = "_is_stringlike";
+static char __pyx_k_masked_values[] = "masked_values";
+static char __pyx_k_messagenumber[] = "messagenumber";
+static char __pyx_k_parameterName[] = "parameterName";
+static char __pyx_k_AttributeError[] = "AttributeError";
+static char __pyx_k_expand_reduced[] = "expand_reduced";
+static char __pyx_k_neg_ens_pert_d[] = ":neg ens pert %d";
+static char __pyx_k_numberOfValues[] = "numberOfValues";
+static char __pyx_k_parameterUnits[] = "parameterUnits";
+static char __pyx_k_pos_ens_pert_d[] = ":pos ens pert %d";
+static char __pyx_k_read_only_keys[] = "_read_only_keys";
+static char __pyx_k_set_projparams[] = "_set_projparams";
+static char __pyx_k_Latin1InDegrees[] = "Latin1InDegrees";
+static char __pyx_k_Latin2InDegrees[] = "Latin2InDegrees";
+static char __pyx_k_derivedForecast[] = "derivedForecast";
+static char __pyx_k_fcst_time_s_s_s[] = ":fcst time %s %s (%s)";
+static char __pyx_k_numberOfMissing[] = "numberOfMissing";
+static char __pyx_k_shapeOfTheEarth[] = "shapeOfTheEarth";
+static char __pyx_k_truncateDegrees[] = "truncateDegrees";
+static char __pyx_k_centralLongitude[] = "centralLongitude";
+static char __pyx_k_could_not_open_s[] = "could not open %s";
+static char __pyx_k_default_encoding[] = "default_encoding";
+static char __pyx_k_grib_api_version[] = "grib_api_version";
+static char __pyx_k_hi_res_cntl_fcst[] = ":hi res cntl fcst";
+static char __pyx_k_lo_res_cntl_fcst[] = ":lo res cntl fcst";
+static char __pyx_k_missingvalue_int[] = "missingvalue_int";
+static char __pyx_k_multi_support_on[] = "multi_support_on";
+static char __pyx_k_no_matches_found[] = "no matches found";
+static char __pyx_k_standardParallel[] = "standardParallel";
+static char __pyx_k_tolerate_badgrib[] = "tolerate_badgrib";
+static char __pyx_k_distinctLatitudes[] = "distinctLatitudes";
+static char __pyx_k_multi_support_off[] = "multi_support_off";
+static char __pyx_k_weighted_ens_mean[] = ":weighted ens mean";
+static char __pyx_k_datetime_to_julian[] = "datetime_to_julian";
+static char __pyx_k_distinctLongitudes[] = "distinctLongitudes";
+static char __pyx_k_julian_to_datetime[] = "julian_to_datetime";
+static char __pyx_k_key_s_is_read_only[] = "key \"%s\" is read only";
+static char __pyx_k_missingvalue_float[] = "missingvalue_float";
+static char __pyx_k_nlats_must_be_even[] = "nlats must be even";
+static char __pyx_k_perturbationNumber[] = "perturbationNumber";
+static char __pyx_k_unsupported_grid_s[] = "unsupported grid %s";
+static char __pyx_k_ens_mean_of_cluster[] = ":ens mean of cluster";
+static char __pyx_k_iDirectionIncrement[] = "iDirectionIncrement";
+static char __pyx_k_polar_stereographic[] = "polar_stereographic";
+static char __pyx_k_probabilityTypeName[] = "probabilityTypeName";
+static char __pyx_k_tolerate_badgrib_on[] = "tolerate_badgrib_on";
+static char __pyx_k_get_grib_api_version[] = "_get_grib_api_version";
+static char __pyx_k_mpl_toolkits_basemap[] = "mpl_toolkits.basemap";
+static char __pyx_k_projectionCenterFlag[] = "projectionCenterFlag";
+static char __pyx_k_projectionCentreFlag[] = "projectionCentreFlag";
+static char __pyx_k_tolerate_badgrib_off[] = "tolerate_badgrib_off";
+static char __pyx_k_jPointsAreConsecutive[] = "jPointsAreConsecutive";
+static char __pyx_k_alternativeRowScanning[] = "alternativeRowScanning";
+static char __pyx_k_array_must_be_1d_or_2d[] = "array must be 1d or 2d";
+static char __pyx_k_normalized_ens_std_dev[] = ":normalized ens std dev";
+static char __pyx_k_typeOfEnsembleForecast[] = "typeOfEnsembleForecast";
+static char __pyx_k_ens_large_anomaly_index[] = ":ens large anomaly index";
+static char __pyx_k_latitudeOfLastGridPoint[] = "latitudeOfLastGridPoint";
+static char __pyx_k_scaleFactorOfLowerLimit[] = "scaleFactorOfLowerLimit";
+static char __pyx_k_scaleFactorOfUpperLimit[] = "scaleFactorOfUpperLimit";
+static char __pyx_k_scaledValueOfLowerLimit[] = "scaledValueOfLowerLimit";
+static char __pyx_k_scaledValueOfUpperLimit[] = "scaledValueOfUpperLimit";
+static char __pyx_k_typeOfFirstFixedSurface[] = "typeOfFirstFixedSurface";
+static char __pyx_k_angleOfRotationInDegrees[] = "angleOfRotationInDegrees";
+static char __pyx_k_latitudeOfFirstGridPoint[] = "latitudeOfFirstGridPoint";
+static char __pyx_k_longitudeOfLastGridPoint[] = "longitudeOfLastGridPoint";
+static char __pyx_k_typeOfSecondFixedSurface[] = "typeOfSecondFixedSurface";
+static char __pyx_k_unitsOfFirstFixedSurface[] = "unitsOfFirstFixedSurface";
+static char __pyx_k_unrecognized_grib_type_d[] = "unrecognized grib type % d";
+static char __pyx_k_longitudeOfFirstGridPoint[] = "longitudeOfFirstGridPoint";
+static char __pyx_k_indicatorOfUnitOfTimeRange[] = "indicatorOfUnitOfTimeRange";
+static char __pyx_k_key_not_part_of_grib_index[] = "key not part of grib index";
+static char __pyx_k_nmsgs_must_be_0_in__advance[] = "nmsgs must be >= 0 in _advance";
+static char __pyx_k_scaledValueOfEarthMajorAxis[] = "scaledValueOfEarthMajorAxis";
+static char __pyx_k_scaledValueOfEarthMinorAxis[] = "scaledValueOfEarthMinorAxis";
+static char __pyx_k_lambert_azimuthal_equal_area[] = "lambert_azimuthal_equal_area";
+static char __pyx_k_xDirectionGridLengthInMetres[] = "xDirectionGridLengthInMetres";
+static char __pyx_k_yDirectionGridLengthInMetres[] = "yDirectionGridLengthInMetres";
+static char __pyx_k_orientationOfTheGridInDegrees[] = "orientationOfTheGridInDegrees";
+static char __pyx_k_Introduction_Python_module_for[] = "\nIntroduction\n============\n\nPython module for reading and writing GRIB (editions 1 and 2) files.\nGRIB is the World Meterological Organization\nU{standard<http://www.wmo.ch/pages/prog/www/WMOCodes/GRIB.html>} \nfor distributing gridded data. \nThe module is a python interface to the\nU{GRIB API<https://software.ecmwf.int/wiki/display/GRIB/Home>} C library\nfrom the European Centre for Medium-Range Weather Forecasts\n(U{ECMWF<htt [...]
+static char __pyx_k_grb_message_numbers_start_at_1[] = "grb message numbers start at 1";
+static char __pyx_k_not_that_many_messages_in_file[] = "not that many messages in file";
+static char __pyx_k_scaleFactorOfFirstFixedSurface[] = "scaleFactorOfFirstFixedSurface";
+static char __pyx_k_scaledValueOfFirstFixedSurface[] = "scaledValueOfFirstFixedSurface";
+static char __pyx_k_Volumes_User_jwhitaker_python_p[] = "/Volumes/User/jwhitaker/python/pygrib.git/pygrib.pyx";
+static char __pyx_k_file_s_has_multi_field_messages[] = "\nfile %s has multi-field messages, keys inside multi-field\nmessages will not be indexed correctly";
+static char __pyx_k_get_grib_api_version_locals_lam[] = "_get_grib_api_version.<locals>.<lambda>";
+static char __pyx_k_latitudeOfSouthernPoleInDegrees[] = "latitudeOfSouthernPoleInDegrees";
+static char __pyx_k_reduced_grid_data_array_must_be[] = "reduced grid data array must be 1d";
+static char __pyx_k_scaleFactorOfSecondFixedSurface[] = "scaleFactorOfSecondFixedSurface";
+static char __pyx_k_scaledValueOfSecondFixedSurface[] = "scaledValueOfSecondFixedSurface";
+static char __pyx_k_unknown_shape_of_the_earth_flag[] = "unknown shape of the earth flag";
+static char __pyx_k_This_class_cannot_be_instantiate[] = "This class cannot be instantiated from Python";
+static char __pyx_k_can_only_modify_existing_grib_ke[] = "can only modify existing grib keys (key \"%s\" not found)";
+static char __pyx_k_cannot_find_projection_center_fl[] = "cannot find projection center flag";
+static char __pyx_k_either_pyproj_or_basemap_require[] = "either pyproj or basemap required";
+static char __pyx_k_equatorial_azimuthal_equidistant[] = "equatorial_azimuthal_equidistant";
+static char __pyx_k_from_what_keyword_arg_to_seek_mu[] = "from_what keyword arg to seek must be 0,1 or 2";
+static char __pyx_k_key_must_be_an_integer_message_n[] = "key must be an integer message number or a slice";
+static char __pyx_k_latitudeOfFirstGridPointInDegree[] = "latitudeOfFirstGridPointInDegrees";
+static char __pyx_k_latitudeOfLastGridPointInDegrees[] = "latitudeOfLastGridPointInDegrees";
+static char __pyx_k_latitudeOfSubSatellitePointInDeg[] = "latitudeOfSubSatellitePointInDegrees";
+static char __pyx_k_latitudeWhereDxAndDyAreSpecified[] = "latitudeWhereDxAndDyAreSpecifiedInDegrees";
+static char __pyx_k_longitudeOfFirstGridPointInDegre[] = "longitudeOfFirstGridPointInDegrees";
+static char __pyx_k_longitudeOfLastGridPointInDegree[] = "longitudeOfLastGridPointInDegrees";
+static char __pyx_k_longitudeOfSouthernPoleInDegrees[] = "longitudeOfSouthernPoleInDegrees";
+static char __pyx_k_longitudeOfSubSatellitePointInDe[] = "longitudeOfSubSatellitePointInDegrees";
+static char __pyx_k_scaleFactorOfMajorAxisOfOblateSp[] = "scaleFactorOfMajorAxisOfOblateSpheroidEarth";
+static char __pyx_k_scaleFactorOfMinorAxisOfOblateSp[] = "scaleFactorOfMinorAxisOfOblateSpheroidEarth";
+static char __pyx_k_scaleFactorOfRadiusOfSphericalEa[] = "scaleFactorOfRadiusOfSphericalEarth";
+static char __pyx_k_scaledValueOfMajorAxisOfOblateSp[] = "scaledValueOfMajorAxisOfOblateSpheroidEarth";
+static char __pyx_k_scaledValueOfMinorAxisOfOblateSp[] = "scaledValueOfMinorAxisOfOblateSpheroidEarth";
+static char __pyx_k_scaledValueOfRadiusOfSphericalEa[] = "scaledValueOfRadiusOfSphericalEarth";
+static char __pyx_k_unsupported_grid_earth_not_a_per[] = "unsupported grid - earth not a perfect sphere";
+static char __pyx_k_value_must_be_float_int_or_strin[] = "value must be float, int or string";
+static PyObject *__pyx_kp_s_04i;
+static PyObject *__pyx_kp_s_12_hr_periods;
+static PyObject *__pyx_kp_s_2_0_0;
+static PyObject *__pyx_kp_s_30_yr_periods;
+static PyObject *__pyx_kp_s_3_hr_periods;
+static PyObject *__pyx_kp_s_6_hr_periods;
+static PyObject *__pyx_kp_s_7777;
+static PyObject *__pyx_n_s_AttributeError;
+static PyObject *__pyx_n_s_C;
+static PyObject *__pyx_n_s_Dx;
+static PyObject *__pyx_n_s_DxInMetres;
+static PyObject *__pyx_n_s_Dy;
+static PyObject *__pyx_n_s_DyInMetres;
+static PyObject *__pyx_n_s_F;
+static PyObject *__pyx_n_s_Grib2Decode;
+static PyObject *__pyx_n_s_IOError;
+static PyObject *__pyx_n_s_ImportError;
+static PyObject *__pyx_n_s_IndexError;
+static PyObject *__pyx_n_s_KeyError;
+static PyObject *__pyx_n_s_LaD;
+static PyObject *__pyx_n_s_LaDInDegrees;
+static PyObject *__pyx_n_s_Latin;
+static PyObject *__pyx_n_s_Latin1;
+static PyObject *__pyx_n_s_Latin1InDegrees;
+static PyObject *__pyx_n_s_Latin2;
+static PyObject *__pyx_n_s_Latin2InDegrees;
+static PyObject *__pyx_n_s_LoV;
+static PyObject *__pyx_n_s_LoVInDegrees;
+static PyObject *__pyx_n_s_Ni;
+static PyObject *__pyx_n_s_Nj;
+static PyObject *__pyx_n_s_Nr;
+static PyObject *__pyx_n_s_Nx;
+static PyObject *__pyx_n_s_Ny;
+static PyObject *__pyx_n_s_Proj;
+static PyObject *__pyx_n_s_RuntimeError;
+static PyObject *__pyx_n_s_StopIteration;
+static PyObject *__pyx_kp_s_This_class_cannot_be_instantiate;
+static PyObject *__pyx_n_s_TypeError;
+static PyObject *__pyx_n_s_ValueError;
+static PyObject *__pyx_kp_s_Volumes_User_jwhitaker_python_p;
+static PyObject *__pyx_kp_s__12;
+static PyObject *__pyx_kp_s__17;
+static PyObject *__pyx_kp_s__22;
+static PyObject *__pyx_kp_s__23;
+static PyObject *__pyx_kp_s__8;
+static PyObject *__pyx_kp_s__99;
+static PyObject *__pyx_n_s_a;
+static PyObject *__pyx_n_s_advance;
+static PyObject *__pyx_n_s_aea;
+static PyObject *__pyx_n_s_aeqd;
+static PyObject *__pyx_n_s_albers;
+static PyObject *__pyx_n_s_all_keys;
+static PyObject *__pyx_n_s_alternativeRowScanning;
+static PyObject *__pyx_n_s_analDate;
+static PyObject *__pyx_n_s_angleOfRotationInDegrees;
+static PyObject *__pyx_n_s_arange;
+static PyObject *__pyx_n_s_arcsin;
+static PyObject *__pyx_kp_s_array_must_be_1d_or_2d;
+static PyObject *__pyx_n_s_asarray;
+static PyObject *__pyx_n_s_ascii;
+static PyObject *__pyx_n_s_atype;
+static PyObject *__pyx_n_s_b;
+static PyObject *__pyx_n_s_bottomLevel;
+static PyObject *__pyx_n_s_call;
+static PyObject *__pyx_kp_s_can_only_modify_existing_grib_ke;
+static PyObject *__pyx_kp_s_cannot_find_projection_center_fl;
+static PyObject *__pyx_n_s_centralLongitude;
+static PyObject *__pyx_n_s_centuries;
+static PyObject *__pyx_n_s_close;
+static PyObject *__pyx_n_s_copy;
+static PyObject *__pyx_kp_s_could_not_open_s;
+static PyObject *__pyx_n_s_cyl;
+static PyObject *__pyx_n_s_d;
+static PyObject *__pyx_kp_s_d_d_d;
+static PyObject *__pyx_n_s_data;
+static PyObject *__pyx_n_s_dataDate;
+static PyObject *__pyx_n_s_dataTime;
+static PyObject *__pyx_n_s_datetime;
+static PyObject *__pyx_n_s_datetime_to_julian;
+static PyObject *__pyx_n_s_day;
+static PyObject *__pyx_n_s_days;
+static PyObject *__pyx_n_s_decades;
+static PyObject *__pyx_n_s_decode;
+static PyObject *__pyx_n_s_default;
+static PyObject *__pyx_n_s_default_encoding;
+static PyObject *__pyx_n_s_derivedForecast;
+static PyObject *__pyx_n_s_dict;
+static PyObject *__pyx_n_s_distinctLatitudes;
+static PyObject *__pyx_n_s_distinctLongitudes;
+static PyObject *__pyx_n_s_div;
+static PyObject *__pyx_n_s_double;
+static PyObject *__pyx_n_s_dx;
+static PyObject *__pyx_n_s_dy;
+static PyObject *__pyx_n_s_eight;
+static PyObject *__pyx_kp_s_either_pyproj_or_basemap_require;
+static PyObject *__pyx_n_s_eleven;
+static PyObject *__pyx_n_s_empty;
+static PyObject *__pyx_n_s_encode;
+static PyObject *__pyx_kp_s_ens_large_anomaly_index;
+static PyObject *__pyx_kp_s_ens_mean;
+static PyObject *__pyx_kp_s_ens_mean_of_cluster;
+static PyObject *__pyx_kp_s_ens_spread;
+static PyObject *__pyx_kp_s_ens_std_dev;
+static PyObject *__pyx_n_s_equatorial_azimuthal_equidistant;
+static PyObject *__pyx_n_s_err;
+static PyObject *__pyx_n_s_expand_reduced;
+static PyObject *__pyx_n_s_fabs;
+static PyObject *__pyx_n_s_false;
+static PyObject *__pyx_kp_s_fcst_time_s_s;
+static PyObject *__pyx_kp_s_fcst_time_s_s_s;
+static PyObject *__pyx_n_s_fcstimeunits;
+static PyObject *__pyx_n_s_file;
+static PyObject *__pyx_kp_s_file_s_has_multi_field_messages;
+static PyObject *__pyx_n_s_filename;
+static PyObject *__pyx_n_s_filled;
+static PyObject *__pyx_n_s_find;
+static PyObject *__pyx_n_s_float;
+static PyObject *__pyx_n_s_float64;
+static PyObject *__pyx_n_s_forecastTime;
+static PyObject *__pyx_kp_s_from;
+static PyObject *__pyx_n_s_from_what;
+static PyObject *__pyx_kp_s_from_what_keyword_arg_to_seek_mu;
+static PyObject *__pyx_n_s_fromstring;
+static PyObject *__pyx_n_s_ftime;
+static PyObject *__pyx_n_s_ftimedict;
+static PyObject *__pyx_n_s_gaulats;
+static PyObject *__pyx_n_s_geos;
+static PyObject *__pyx_n_s_get_grib_api_version;
+static PyObject *__pyx_n_s_get_grib_api_version_locals_lam;
+static PyObject *__pyx_n_s_get_key;
+static PyObject *__pyx_n_s_getitem;
+static PyObject *__pyx_n_s_gh;
+static PyObject *__pyx_n_s_gh_2;
+static PyObject *__pyx_n_s_grb;
+static PyObject *__pyx_kp_s_grb_message_numbers_start_at_1;
+static PyObject *__pyx_n_s_grib2divider;
+static PyObject *__pyx_n_s_grib_api_version;
+static PyObject *__pyx_n_s_gribmsg;
+static PyObject *__pyx_n_s_gribstr;
+static PyObject *__pyx_n_s_gribstring;
+static PyObject *__pyx_n_s_gridType;
+static PyObject *__pyx_n_s_grid_complex;
+static PyObject *__pyx_n_s_h;
+static PyObject *__pyx_n_s_has_key;
+static PyObject *__pyx_kp_s_hi_res_cntl_fcst;
+static PyObject *__pyx_n_s_hour;
+static PyObject *__pyx_n_s_hrs;
+static PyObject *__pyx_n_s_iDirectionIncrement;
+static PyObject *__pyx_n_s_import;
+static PyObject *__pyx_n_s_index;
+static PyObject *__pyx_n_s_indicatorOfUnitOfTimeRange;
+static PyObject *__pyx_n_s_indices;
+static PyObject *__pyx_n_s_instant;
+static PyObject *__pyx_n_s_int;
+static PyObject *__pyx_n_s_inverse;
+static PyObject *__pyx_n_s_isMA;
+static PyObject *__pyx_n_s_is_container;
+static PyObject *__pyx_n_s_is_missing;
+static PyObject *__pyx_n_s_is_stringlike;
+static PyObject *__pyx_n_s_iscallable;
+static PyObject *__pyx_n_s_iscontainer;
+static PyObject *__pyx_n_s_items;
+static PyObject *__pyx_n_s_jPointsAreConsecutive;
+static PyObject *__pyx_n_s_jd;
+static PyObject *__pyx_n_s_join;
+static PyObject *__pyx_n_s_julday;
+static PyObject *__pyx_n_s_julianDay;
+static PyObject *__pyx_n_s_julian_to_datetime;
+static PyObject *__pyx_n_s_k;
+static PyObject *__pyx_n_s_key;
+static PyObject *__pyx_kp_s_key_must_be_an_integer_message_n;
+static PyObject *__pyx_kp_s_key_not_part_of_grib_index;
+static PyObject *__pyx_kp_s_key_s_is_read_only;
+static PyObject *__pyx_n_s_keys;
+static PyObject *__pyx_n_s_kwargs;
+static PyObject *__pyx_n_s_l;
+static PyObject *__pyx_n_s_laea;
+static PyObject *__pyx_n_s_lambert;
+static PyObject *__pyx_n_s_lambert_azimuthal_equal_area;
+static PyObject *__pyx_n_s_lat1;
+static PyObject *__pyx_n_s_lat2;
+static PyObject *__pyx_n_s_lat_0;
+static PyObject *__pyx_n_s_lat_1;
+static PyObject *__pyx_n_s_lat_2;
+static PyObject *__pyx_n_s_lat_ts;
+static PyObject *__pyx_n_s_latitudeOfFirstGridPoint;
+static PyObject *__pyx_n_s_latitudeOfFirstGridPointInDegree;
+static PyObject *__pyx_n_s_latitudeOfLastGridPoint;
+static PyObject *__pyx_n_s_latitudeOfLastGridPointInDegrees;
+static PyObject *__pyx_n_s_latitudeOfSouthernPoleInDegrees;
+static PyObject *__pyx_n_s_latitudeOfSubSatellitePointInDeg;
+static PyObject *__pyx_n_s_latitudeWhereDxAndDyAreSpecified;
+static PyObject *__pyx_n_s_latitudes;
+static PyObject *__pyx_n_s_latlons;
+static PyObject *__pyx_n_s_lats;
+static PyObject *__pyx_n_s_lcc;
+static PyObject *__pyx_n_s_level;
+static PyObject *__pyx_kp_s_level_s;
+static PyObject *__pyx_kp_s_levels_s_s;
+static PyObject *__pyx_n_s_linspace;
+static PyObject *__pyx_kp_s_lo_res_cntl_fcst;
+static PyObject *__pyx_n_s_localDir;
+static PyObject *__pyx_n_s_lon1;
+static PyObject *__pyx_n_s_lon2;
+static PyObject *__pyx_n_s_lon_0;
+static PyObject *__pyx_n_s_longitudeOfFirstGridPoint;
+static PyObject *__pyx_n_s_longitudeOfFirstGridPointInDegre;
+static PyObject *__pyx_n_s_longitudeOfLastGridPoint;
+static PyObject *__pyx_n_s_longitudeOfLastGridPointInDegree;
+static PyObject *__pyx_n_s_longitudeOfSouthernPoleInDegrees;
+static PyObject *__pyx_n_s_longitudeOfSubSatellitePointInDe;
+static PyObject *__pyx_n_s_longitudes;
+static PyObject *__pyx_n_s_longlat;
+static PyObject *__pyx_n_s_ma;
+static PyObject *__pyx_n_s_main;
+static PyObject *__pyx_n_s_major;
+static PyObject *__pyx_n_s_masked_values;
+static PyObject *__pyx_n_s_max;
+static PyObject *__pyx_n_s_merc;
+static PyObject *__pyx_n_s_mercator;
+static PyObject *__pyx_n_s_meshgrid;
+static PyObject *__pyx_n_s_message;
+static PyObject *__pyx_n_s_messagenumber;
+static PyObject *__pyx_n_s_min;
+static PyObject *__pyx_n_s_minor;
+static PyObject *__pyx_n_s_mins;
+static PyObject *__pyx_n_s_minute;
+static PyObject *__pyx_n_s_missingValue;
+static PyObject *__pyx_n_s_missingvalue_float;
+static PyObject *__pyx_n_s_missingvalue_int;
+static PyObject *__pyx_n_s_month;
+static PyObject *__pyx_n_s_months;
+static PyObject *__pyx_n_s_mpl_toolkits_basemap;
+static PyObject *__pyx_n_s_msg;
+static PyObject *__pyx_n_s_msgs;
+static PyObject *__pyx_n_s_multi_support_off;
+static PyObject *__pyx_n_s_multi_support_on;
+static PyObject *__pyx_n_s_name;
+static PyObject *__pyx_n_s_ncepgrib2;
+static PyObject *__pyx_n_s_ndim;
+static PyObject *__pyx_kp_s_neg_ens_pert_d;
+static PyObject *__pyx_n_s_next;
+static PyObject *__pyx_n_s_nlats;
+static PyObject *__pyx_kp_s_nlats_must_be_even;
+static PyObject *__pyx_n_s_nmsgs;
+static PyObject *__pyx_kp_s_nmsgs_must_be_0_in__advance;
+static PyObject *__pyx_kp_s_no_matches_found;
+static PyObject *__pyx_kp_s_normalized_ens_std_dev;
+static PyObject *__pyx_kp_s_not_that_many_messages_in_file;
+static PyObject *__pyx_n_s_np;
+static PyObject *__pyx_n_s_nsper;
+static PyObject *__pyx_n_s_numberOfMissing;
+static PyObject *__pyx_n_s_numberOfValues;
+static PyObject *__pyx_n_s_numpy;
+static PyObject *__pyx_n_s_o_lat_p;
+static PyObject *__pyx_n_s_o_lon_p;
+static PyObject *__pyx_n_s_o_proj;
+static PyObject *__pyx_n_s_ob_tran;
+static PyObject *__pyx_n_s_one;
+static PyObject *__pyx_n_s_oneThousand;
+static PyObject *__pyx_n_s_order;
+static PyObject *__pyx_n_s_orientationOfTheGridInDegrees;
+static PyObject *__pyx_n_s_packingType;
+static PyObject *__pyx_n_s_paramId;
+static PyObject *__pyx_n_s_parameterName;
+static PyObject *__pyx_n_s_parameterUnits;
+static PyObject *__pyx_n_s_perturbationNumber;
+static PyObject *__pyx_n_s_pi;
+static PyObject *__pyx_n_s_pl;
+static PyObject *__pyx_n_s_polar_stereographic;
+static PyObject *__pyx_kp_s_pos_ens_pert_d;
+static PyObject *__pyx_n_s_power;
+static PyObject *__pyx_n_s_private_atts;
+static PyObject *__pyx_n_s_probabilityTypeName;
+static PyObject *__pyx_n_s_proj;
+static PyObject *__pyx_n_s_projectionCenterFlag;
+static PyObject *__pyx_n_s_projectionCentreFlag;
+static PyObject *__pyx_n_s_projparams;
+static PyObject *__pyx_n_s_pygrib;
+static PyObject *__pyx_n_s_pyproj;
+static PyObject *__pyx_n_s_radius;
+static PyObject *__pyx_n_s_range;
+static PyObject *__pyx_n_s_read_only_keys;
+static PyObject *__pyx_n_s_redtoreg;
+static PyObject *__pyx_n_s_redtoreg_2;
+static PyObject *__pyx_n_s_reduced;
+static PyObject *__pyx_n_s_reduced_gg;
+static PyObject *__pyx_kp_s_reduced_grid_data_array_must_be;
+static PyObject *__pyx_n_s_reduced_ll;
+static PyObject *__pyx_n_s_regular_gg;
+static PyObject *__pyx_n_s_regular_ll;
+static PyObject *__pyx_n_s_reload;
+static PyObject *__pyx_n_s_reshape;
+static PyObject *__pyx_n_s_reshape_mask;
+static PyObject *__pyx_n_s_return_msgs;
+static PyObject *__pyx_n_s_revision;
+static PyObject *__pyx_n_s_rewind;
+static PyObject *__pyx_n_s_ro_keys;
+static PyObject *__pyx_n_s_rotated_gg;
+static PyObject *__pyx_n_s_rotated_ll;
+static PyObject *__pyx_n_s_rstrip;
+static PyObject *__pyx_kp_s_s;
+static PyObject *__pyx_kp_s_s_2;
+static PyObject *__pyx_kp_s_s_3;
+static PyObject *__pyx_n_s_s_4;
+static PyObject *__pyx_kp_s_s_s;
+static PyObject *__pyx_n_s_scaleFactorOfFirstFixedSurface;
+static PyObject *__pyx_n_s_scaleFactorOfLowerLimit;
+static PyObject *__pyx_n_s_scaleFactorOfMajorAxisOfOblateSp;
+static PyObject *__pyx_n_s_scaleFactorOfMinorAxisOfOblateSp;
+static PyObject *__pyx_n_s_scaleFactorOfRadiusOfSphericalEa;
+static PyObject *__pyx_n_s_scaleFactorOfSecondFixedSurface;
+static PyObject *__pyx_n_s_scaleFactorOfUpperLimit;
+static PyObject *__pyx_n_s_scaledValueOfEarthMajorAxis;
+static PyObject *__pyx_n_s_scaledValueOfEarthMinorAxis;
+static PyObject *__pyx_n_s_scaledValueOfFirstFixedSurface;
+static PyObject *__pyx_n_s_scaledValueOfLowerLimit;
+static PyObject *__pyx_n_s_scaledValueOfMajorAxisOfOblateSp;
+static PyObject *__pyx_n_s_scaledValueOfMinorAxisOfOblateSp;
+static PyObject *__pyx_n_s_scaledValueOfRadiusOfSphericalEa;
+static PyObject *__pyx_n_s_scaledValueOfSecondFixedSurface;
+static PyObject *__pyx_n_s_scaledValueOfUpperLimit;
+static PyObject *__pyx_n_s_second;
+static PyObject *__pyx_n_s_secs;
+static PyObject *__pyx_n_s_seek;
+static PyObject *__pyx_n_s_select;
+static PyObject *__pyx_n_s_set_projparams;
+static PyObject *__pyx_n_s_setdates;
+static PyObject *__pyx_n_s_shape;
+static PyObject *__pyx_n_s_shapeOfTheEarth;
+static PyObject *__pyx_n_s_size;
+static PyObject *__pyx_n_s_space_view;
+static PyObject *__pyx_n_s_split;
+static PyObject *__pyx_n_s_standardParallel;
+static PyObject *__pyx_n_s_startswith;
+static PyObject *__pyx_n_s_stepRange;
+static PyObject *__pyx_n_s_stepType;
+static PyObject *__pyx_n_s_stepUnits;
+static PyObject *__pyx_n_s_stere;
+static PyObject *__pyx_n_s_sum;
+static PyObject *__pyx_n_s_tell;
+static PyObject *__pyx_n_s_test;
+static PyObject *__pyx_n_s_thousand;
+static PyObject *__pyx_n_s_tolerate_badgrib;
+static PyObject *__pyx_n_s_tolerate_badgrib_off;
+static PyObject *__pyx_n_s_tolerate_badgrib_on;
+static PyObject *__pyx_n_s_topLevel;
+static PyObject *__pyx_n_s_tostring;
+static PyObject *__pyx_n_s_traceback;
+static PyObject *__pyx_n_s_truncateDegrees;
+static PyObject *__pyx_n_s_typeOfEnsembleForecast;
+static PyObject *__pyx_n_s_typeOfFirstFixedSurface;
+static PyObject *__pyx_n_s_typeOfGrid;
+static PyObject *__pyx_n_s_typeOfLevel;
+static PyObject *__pyx_n_s_typeOfSecondFixedSurface;
+static PyObject *__pyx_n_s_units;
+static PyObject *__pyx_n_s_unitsOfFirstFixedSurface;
+static PyObject *__pyx_n_s_unknown;
+static PyObject *__pyx_kp_s_unknown_shape_of_the_earth_flag;
+static PyObject *__pyx_kp_s_unrecognized_grib_type_d;
+static PyObject *__pyx_n_s_unshape_mask;
+static PyObject *__pyx_kp_s_unsupported_grid_earth_not_a_per;
+static PyObject *__pyx_kp_s_unsupported_grid_s;
+static PyObject *__pyx_n_s_v;
+static PyObject *__pyx_n_s_validDate;
+static PyObject *__pyx_n_s_valid_key;
+static PyObject *__pyx_n_s_value;
+static PyObject *__pyx_kp_s_value_must_be_float_int_or_strin;
+static PyObject *__pyx_n_b_values;
+static PyObject *__pyx_n_s_values;
+static PyObject *__pyx_n_s_version;
+static PyObject *__pyx_n_s_warn;
+static PyObject *__pyx_n_s_warnings;
+static PyObject *__pyx_kp_s_weighted_ens_mean;
+static PyObject *__pyx_n_s_where;
+static PyObject *__pyx_n_s_xDirectionGridLengthInMetres;
+static PyObject *__pyx_n_s_xrange;
+static PyObject *__pyx_n_s_yDirectionGridLengthInMetres;
+static PyObject *__pyx_n_s_year;
+static PyObject *__pyx_n_s_yrs;
+static PyObject *__pyx_n_s_zero;
+static PyObject *__pyx_n_s_zeros;
+static PyObject *__pyx_float_0_;
+static PyObject *__pyx_float_1_;
+static PyObject *__pyx_float_2_;
+static PyObject *__pyx_float_4_;
+static PyObject *__pyx_float_8_;
+static PyObject *__pyx_float_0_5;
+static PyObject *__pyx_float_24_;
+static PyObject *__pyx_float_90_;
+static PyObject *__pyx_float_1_e3;
+static PyObject *__pyx_float_1_e6;
+static PyObject *__pyx_float_10_0;
+static PyObject *__pyx_float_180_;
+static PyObject *__pyx_float_1_e20;
+static PyObject *__pyx_float_1_e30;
+static PyObject *__pyx_float_1000_;
+static PyObject *__pyx_float_1440_;
+static PyObject *__pyx_float_86400_;
+static PyObject *__pyx_float_6356775_0;
+static PyObject *__pyx_float_6367470_0;
+static PyObject *__pyx_float_6371200_0;
+static PyObject *__pyx_float_6371229_0;
+static PyObject *__pyx_float_6378137_0;
+static PyObject *__pyx_float_6378160_0;
+static PyObject *__pyx_float_6356752_3142;
+static PyObject *__pyx_float_neg_0_5;
+static PyObject *__pyx_float_neg_90_;
+static PyObject *__pyx_float_neg_1_e100;
 static PyObject *__pyx_int_0;
 static PyObject *__pyx_int_1;
 static PyObject *__pyx_int_2;
@@ -1839,147 +1810,170 @@ static PyObject *__pyx_int_5;
 static PyObject *__pyx_int_6;
 static PyObject *__pyx_int_7;
 static PyObject *__pyx_int_8;
-static PyObject *__pyx_int_neg_1;
 static PyObject *__pyx_int_100;
 static PyObject *__pyx_int_255;
 static PyObject *__pyx_int_360;
 static PyObject *__pyx_int_1000;
 static PyObject *__pyx_int_10900;
-static PyObject *__pyx_k_14;
-static PyObject *__pyx_k_tuple_4;
-static PyObject *__pyx_k_tuple_7;
-static PyObject *__pyx_k_tuple_9;
-static PyObject *__pyx_k_tuple_11;
-static PyObject *__pyx_k_tuple_13;
-static PyObject *__pyx_k_tuple_16;
-static PyObject *__pyx_k_tuple_18;
-static PyObject *__pyx_k_tuple_21;
-static PyObject *__pyx_k_tuple_22;
-static PyObject *__pyx_k_tuple_23;
-static PyObject *__pyx_k_tuple_25;
-static PyObject *__pyx_k_tuple_26;
-static PyObject *__pyx_k_tuple_31;
-static PyObject *__pyx_k_tuple_32;
-static PyObject *__pyx_k_tuple_34;
-static PyObject *__pyx_k_tuple_35;
-static PyObject *__pyx_k_tuple_36;
-static PyObject *__pyx_k_tuple_37;
-static PyObject *__pyx_k_tuple_40;
-static PyObject *__pyx_k_tuple_41;
-static PyObject *__pyx_k_tuple_42;
-static PyObject *__pyx_k_tuple_43;
-static PyObject *__pyx_k_tuple_44;
-static PyObject *__pyx_k_tuple_45;
-static PyObject *__pyx_k_tuple_47;
-static PyObject *__pyx_k_tuple_49;
-static PyObject *__pyx_k_tuple_51;
-static PyObject *__pyx_k_tuple_53;
-static PyObject *__pyx_k_tuple_55;
-static PyObject *__pyx_k_tuple_57;
-static PyObject *__pyx_k_tuple_59;
-static PyObject *__pyx_k_tuple_63;
-static PyObject *__pyx_k_tuple_64;
-static PyObject *__pyx_k_tuple_65;
-static PyObject *__pyx_k_tuple_68;
-static PyObject *__pyx_k_tuple_69;
-static PyObject *__pyx_k_tuple_70;
-static PyObject *__pyx_k_tuple_73;
-static PyObject *__pyx_k_tuple_75;
-static PyObject *__pyx_k_tuple_80;
-static PyObject *__pyx_k_tuple_88;
-static PyObject *__pyx_k_tuple_90;
-static PyObject *__pyx_k_tuple_92;
-static PyObject *__pyx_k_tuple_94;
-static PyObject *__pyx_k_tuple_96;
-static PyObject *__pyx_k_slice_100;
-static PyObject *__pyx_k_slice_102;
-static PyObject *__pyx_k_slice_118;
-static PyObject *__pyx_k_slice_119;
-static PyObject *__pyx_k_slice_121;
-static PyObject *__pyx_k_slice_122;
-static PyObject *__pyx_k_slice_131;
-static PyObject *__pyx_k_slice_132;
-static PyObject *__pyx_k_slice_134;
-static PyObject *__pyx_k_slice_135;
-static PyObject *__pyx_k_slice_174;
-static PyObject *__pyx_k_slice_175;
-static PyObject *__pyx_k_tuple_101;
-static PyObject *__pyx_k_tuple_103;
-static PyObject *__pyx_k_tuple_107;
-static PyObject *__pyx_k_tuple_109;
-static PyObject *__pyx_k_tuple_110;
-static PyObject *__pyx_k_tuple_111;
-static PyObject *__pyx_k_tuple_113;
-static PyObject *__pyx_k_tuple_114;
-static PyObject *__pyx_k_tuple_116;
-static PyObject *__pyx_k_tuple_120;
-static PyObject *__pyx_k_tuple_123;
-static PyObject *__pyx_k_tuple_124;
-static PyObject *__pyx_k_tuple_125;
-static PyObject *__pyx_k_tuple_126;
-static PyObject *__pyx_k_tuple_127;
-static PyObject *__pyx_k_tuple_128;
-static PyObject *__pyx_k_tuple_129;
-static PyObject *__pyx_k_tuple_130;
-static PyObject *__pyx_k_tuple_133;
-static PyObject *__pyx_k_tuple_136;
-static PyObject *__pyx_k_tuple_137;
-static PyObject *__pyx_k_tuple_138;
-static PyObject *__pyx_k_tuple_140;
-static PyObject *__pyx_k_tuple_147;
-static PyObject *__pyx_k_tuple_150;
-static PyObject *__pyx_k_tuple_153;
-static PyObject *__pyx_k_tuple_155;
-static PyObject *__pyx_k_tuple_157;
-static PyObject *__pyx_k_tuple_173;
-static PyObject *__pyx_k_tuple_179;
-static PyObject *__pyx_k_tuple_184;
-static PyObject *__pyx_k_tuple_185;
-static PyObject *__pyx_k_tuple_187;
-static PyObject *__pyx_k_tuple_189;
-static PyObject *__pyx_k_tuple_190;
-static PyObject *__pyx_k_tuple_191;
-static PyObject *__pyx_k_tuple_196;
-static PyObject *__pyx_k_tuple_197;
-static PyObject *__pyx_k_tuple_204;
-static PyObject *__pyx_k_tuple_209;
-static PyObject *__pyx_k_tuple_211;
-static PyObject *__pyx_k_tuple_213;
-static PyObject *__pyx_k_tuple_215;
-static PyObject *__pyx_k_tuple_217;
-static PyObject *__pyx_k_tuple_219;
-static PyObject *__pyx_k_tuple_221;
-static PyObject *__pyx_k_tuple_223;
-static PyObject *__pyx_k_codeobj_198;
-static PyObject *__pyx_k_codeobj_201;
-static PyObject *__pyx_k_codeobj_202;
-static PyObject *__pyx_k_codeobj_205;
-static PyObject *__pyx_k_codeobj_207;
-static PyObject *__pyx_k_codeobj_208;
-static PyObject *__pyx_k_codeobj_210;
-static PyObject *__pyx_k_codeobj_212;
-static PyObject *__pyx_k_codeobj_214;
-static PyObject *__pyx_k_codeobj_216;
-static PyObject *__pyx_k_codeobj_218;
-static PyObject *__pyx_k_codeobj_220;
-static PyObject *__pyx_k_codeobj_222;
-static PyObject *__pyx_k_codeobj_224;
+static PyObject *__pyx_int_neg_1;
+static PyObject *__pyx_tuple_;
+static PyObject *__pyx_tuple__2;
+static PyObject *__pyx_tuple__3;
+static PyObject *__pyx_tuple__4;
+static PyObject *__pyx_tuple__5;
+static PyObject *__pyx_tuple__6;
+static PyObject *__pyx_tuple__7;
+static PyObject *__pyx_tuple__9;
+static PyObject *__pyx_slice__51;
+static PyObject *__pyx_slice__53;
+static PyObject *__pyx_slice__62;
+static PyObject *__pyx_slice__63;
+static PyObject *__pyx_slice__65;
+static PyObject *__pyx_slice__66;
+static PyObject *__pyx_slice__75;
+static PyObject *__pyx_slice__76;
+static PyObject *__pyx_slice__78;
+static PyObject *__pyx_slice__79;
+static PyObject *__pyx_slice__93;
+static PyObject *__pyx_slice__94;
+static PyObject *__pyx_tuple__10;
+static PyObject *__pyx_tuple__11;
+static PyObject *__pyx_tuple__13;
+static PyObject *__pyx_tuple__14;
+static PyObject *__pyx_tuple__15;
+static PyObject *__pyx_tuple__16;
+static PyObject *__pyx_tuple__18;
+static PyObject *__pyx_tuple__19;
+static PyObject *__pyx_tuple__20;
+static PyObject *__pyx_tuple__21;
+static PyObject *__pyx_tuple__24;
+static PyObject *__pyx_tuple__25;
+static PyObject *__pyx_tuple__26;
+static PyObject *__pyx_tuple__27;
+static PyObject *__pyx_tuple__28;
+static PyObject *__pyx_tuple__29;
+static PyObject *__pyx_tuple__30;
+static PyObject *__pyx_tuple__31;
+static PyObject *__pyx_tuple__32;
+static PyObject *__pyx_tuple__33;
+static PyObject *__pyx_tuple__34;
+static PyObject *__pyx_tuple__35;
+static PyObject *__pyx_tuple__36;
+static PyObject *__pyx_tuple__37;
+static PyObject *__pyx_tuple__38;
+static PyObject *__pyx_tuple__39;
+static PyObject *__pyx_tuple__40;
+static PyObject *__pyx_tuple__41;
+static PyObject *__pyx_tuple__42;
+static PyObject *__pyx_tuple__43;
+static PyObject *__pyx_tuple__44;
+static PyObject *__pyx_tuple__45;
+static PyObject *__pyx_tuple__46;
+static PyObject *__pyx_tuple__47;
+static PyObject *__pyx_tuple__48;
+static PyObject *__pyx_tuple__49;
+static PyObject *__pyx_tuple__50;
+static PyObject *__pyx_tuple__52;
+static PyObject *__pyx_tuple__54;
+static PyObject *__pyx_tuple__55;
+static PyObject *__pyx_tuple__56;
+static PyObject *__pyx_tuple__57;
+static PyObject *__pyx_tuple__58;
+static PyObject *__pyx_tuple__59;
+static PyObject *__pyx_tuple__60;
+static PyObject *__pyx_tuple__61;
+static PyObject *__pyx_tuple__64;
+static PyObject *__pyx_tuple__67;
+static PyObject *__pyx_tuple__68;
+static PyObject *__pyx_tuple__69;
+static PyObject *__pyx_tuple__70;
+static PyObject *__pyx_tuple__71;
+static PyObject *__pyx_tuple__72;
+static PyObject *__pyx_tuple__73;
+static PyObject *__pyx_tuple__74;
+static PyObject *__pyx_tuple__77;
+static PyObject *__pyx_tuple__80;
+static PyObject *__pyx_tuple__81;
+static PyObject *__pyx_tuple__82;
+static PyObject *__pyx_tuple__83;
+static PyObject *__pyx_tuple__84;
+static PyObject *__pyx_tuple__85;
+static PyObject *__pyx_tuple__86;
+static PyObject *__pyx_tuple__87;
+static PyObject *__pyx_tuple__88;
+static PyObject *__pyx_tuple__89;
+static PyObject *__pyx_tuple__90;
+static PyObject *__pyx_tuple__91;
+static PyObject *__pyx_tuple__92;
+static PyObject *__pyx_tuple__95;
+static PyObject *__pyx_tuple__96;
+static PyObject *__pyx_tuple__97;
+static PyObject *__pyx_tuple__98;
+static PyObject *__pyx_tuple__100;
+static PyObject *__pyx_tuple__101;
+static PyObject *__pyx_tuple__102;
+static PyObject *__pyx_tuple__103;
+static PyObject *__pyx_tuple__104;
+static PyObject *__pyx_tuple__105;
+static PyObject *__pyx_tuple__106;
+static PyObject *__pyx_tuple__107;
+static PyObject *__pyx_tuple__111;
+static PyObject *__pyx_tuple__115;
+static PyObject *__pyx_tuple__117;
+static PyObject *__pyx_tuple__119;
+static PyObject *__pyx_tuple__121;
+static PyObject *__pyx_tuple__123;
+static PyObject *__pyx_tuple__125;
+static PyObject *__pyx_tuple__127;
+static PyObject *__pyx_tuple__129;
+static PyObject *__pyx_codeobj__108;
+static PyObject *__pyx_codeobj__109;
+static PyObject *__pyx_codeobj__110;
+static PyObject *__pyx_codeobj__112;
+static PyObject *__pyx_codeobj__113;
+static PyObject *__pyx_codeobj__114;
+static PyObject *__pyx_codeobj__116;
+static PyObject *__pyx_codeobj__118;
+static PyObject *__pyx_codeobj__120;
+static PyObject *__pyx_codeobj__122;
+static PyObject *__pyx_codeobj__124;
+static PyObject *__pyx_codeobj__126;
+static PyObject *__pyx_codeobj__128;
+static PyObject *__pyx_codeobj__130;
+
+/* "pygrib.pyx":298
+ * #missingvalue_float = GRIB_MISSING_DOUBLE
+ * missingvalue_float = -1.e100 # value given in grib_api.h version 1.90
+ * def _get_grib_api_version():             # <<<<<<<<<<<<<<
+ *     div = lambda v,d: (v/d,v%d)
+ *     v = grib_get_api_version()
+ */
 
 /* Python wrapper */
 static PyObject *__pyx_pw_6pygrib_1_get_grib_api_version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static PyMethodDef __pyx_mdef_6pygrib_1_get_grib_api_version = {__Pyx_NAMESTR("_get_grib_api_version"), (PyCFunction)__pyx_pw_6pygrib_1_get_grib_api_version, METH_NOARGS, __Pyx_DOCSTR(0)};
+static PyMethodDef __pyx_mdef_6pygrib_1_get_grib_api_version = {"_get_grib_api_version", (PyCFunction)__pyx_pw_6pygrib_1_get_grib_api_version, METH_NOARGS, 0};
 static PyObject *__pyx_pw_6pygrib_1_get_grib_api_version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("_get_grib_api_version (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib__get_grib_api_version(__pyx_self);
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
+/* "pygrib.pyx":299
+ * missingvalue_float = -1.e100 # value given in grib_api.h version 1.90
+ * def _get_grib_api_version():
+ *     div = lambda v,d: (v/d,v%d)             # <<<<<<<<<<<<<<
+ *     v = grib_get_api_version()
+ *     v,revision = div(v,100)
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_6pygrib_21_get_grib_api_version_lambda1(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_mdef_6pygrib_21_get_grib_api_version_lambda1 = {__Pyx_NAMESTR("lambda1"), (PyCFunction)__pyx_pw_6pygrib_21_get_grib_api_version_lambda1, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
+static PyMethodDef __pyx_mdef_6pygrib_21_get_grib_api_version_lambda1 = {"lambda1", (PyCFunction)__pyx_pw_6pygrib_21_get_grib_api_version_lambda1, METH_VARARGS|METH_KEYWORDS, 0};
 static PyObject *__pyx_pw_6pygrib_21_get_grib_api_version_lambda1(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyObject *__pyx_v_v = 0;
   PyObject *__pyx_v_d = 0;
@@ -1990,7 +1984,7 @@ static PyObject *__pyx_pw_6pygrib_21_get_grib_api_version_lambda1(PyObject *__py
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("lambda1 (wrapper)", 0);
   {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__v,&__pyx_n_s__d,0};
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_v,&__pyx_n_s_d,0};
     PyObject* values[2] = {0,0};
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
@@ -2004,16 +1998,16 @@ static PyObject *__pyx_pw_6pygrib_21_get_grib_api_version_lambda1(PyObject *__py
       kw_args = PyDict_Size(__pyx_kwds);
       switch (pos_args) {
         case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__v)) != 0)) kw_args--;
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
         else goto __pyx_L5_argtuple_error;
         case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__d)) != 0)) kw_args--;
+        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_d)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("lambda1", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+          __Pyx_RaiseArgtupleInvalid("lambda1", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda1") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda1") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
       goto __pyx_L5_argtuple_error;
@@ -2026,25 +2020,19 @@ static PyObject *__pyx_pw_6pygrib_21_get_grib_api_version_lambda1(PyObject *__py
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("lambda1", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+  __Pyx_RaiseArgtupleInvalid("lambda1", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
   __pyx_L3_error:;
   __Pyx_AddTraceback("pygrib._get_grib_api_version.lambda1", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
   return NULL;
   __pyx_L4_argument_unpacking_done:;
   __pyx_r = __pyx_lambda_funcdef_lambda1(__pyx_self, __pyx_v_v, __pyx_v_d);
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "pygrib.pyx":305
- * missingvalue_float = -1.e100 # value given in grib_api.h version 1.90
- * def _get_grib_api_version():
- *     div = lambda v,d: (v/d,v%d)             # <<<<<<<<<<<<<<
- *     v = grib_get_api_version()
- *     v,revision = div(v,100)
- */
-
 static PyObject *__pyx_lambda_funcdef_lambda1(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_v, PyObject *__pyx_v_d) {
   PyObject *__pyx_r = NULL;
   __Pyx_RefNannyDeclarations
@@ -2056,11 +2044,11 @@ static PyObject *__pyx_lambda_funcdef_lambda1(CYTHON_UNUSED PyObject *__pyx_self
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("lambda1", 0);
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_v_v, __pyx_v_d); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_v_v, __pyx_v_d); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyNumber_Remainder(__pyx_v_v, __pyx_v_d); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyNumber_Remainder(__pyx_v_v, __pyx_v_d); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
   __Pyx_GIVEREF(__pyx_t_1);
@@ -2068,12 +2056,11 @@ static PyObject *__pyx_lambda_funcdef_lambda1(CYTHON_UNUSED PyObject *__pyx_self
   __Pyx_GIVEREF(__pyx_t_2);
   __pyx_t_1 = 0;
   __pyx_t_2 = 0;
-  __pyx_r = ((PyObject *)__pyx_t_3);
+  __pyx_r = __pyx_t_3;
   __pyx_t_3 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_XDECREF(__pyx_t_2);
@@ -2086,7 +2073,7 @@ static PyObject *__pyx_lambda_funcdef_lambda1(CYTHON_UNUSED PyObject *__pyx_self
   return __pyx_r;
 }
 
-/* "pygrib.pyx":304
+/* "pygrib.pyx":298
  * #missingvalue_float = GRIB_MISSING_DOUBLE
  * missingvalue_float = -1.e100 # value given in grib_api.h version 1.90
  * def _get_grib_api_version():             # <<<<<<<<<<<<<<
@@ -2112,38 +2099,38 @@ static PyObject *__pyx_pf_6pygrib__get_grib_api_version(CYTHON_UNUSED PyObject *
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("_get_grib_api_version", 0);
 
-  /* "pygrib.pyx":305
+  /* "pygrib.pyx":299
  * missingvalue_float = -1.e100 # value given in grib_api.h version 1.90
  * def _get_grib_api_version():
  *     div = lambda v,d: (v/d,v%d)             # <<<<<<<<<<<<<<
  *     v = grib_get_api_version()
  *     v,revision = div(v,100)
  */
-  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pygrib_21_get_grib_api_version_lambda1, 0, __pyx_n_s_1, NULL, __pyx_n_s__pygrib, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pygrib_21_get_grib_api_version_lambda1, 0, __pyx_n_s_get_grib_api_version_locals_lam, NULL, __pyx_n_s_pygrib, __pyx_d, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_v_div = __pyx_t_1;
   __pyx_t_1 = 0;
 
-  /* "pygrib.pyx":306
+  /* "pygrib.pyx":300
  * def _get_grib_api_version():
  *     div = lambda v,d: (v/d,v%d)
  *     v = grib_get_api_version()             # <<<<<<<<<<<<<<
  *     v,revision = div(v,100)
  *     v,minor = div(v,100)
  */
-  __pyx_t_1 = PyInt_FromLong(grib_get_api_version()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_PyInt_From_long(grib_get_api_version()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_v_v = __pyx_t_1;
   __pyx_t_1 = 0;
 
-  /* "pygrib.pyx":307
+  /* "pygrib.pyx":301
  *     div = lambda v,d: (v/d,v%d)
  *     v = grib_get_api_version()
  *     v,revision = div(v,100)             # <<<<<<<<<<<<<<
  *     v,minor = div(v,100)
  *     major = v
  */
-  __pyx_t_1 = __pyx_lambda_funcdef_lambda1(__pyx_v_div, __pyx_v_v, __pyx_int_100); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __pyx_lambda_funcdef_lambda1(__pyx_v_div, __pyx_v_v, __pyx_int_100); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
     PyObject* sequence = __pyx_t_1;
@@ -2155,7 +2142,7 @@ static PyObject *__pyx_pf_6pygrib__get_grib_api_version(CYTHON_UNUSED PyObject *
     if (unlikely(size != 2)) {
       if (size > 2) __Pyx_RaiseTooManyValuesError(2);
       else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     }
     #if CYTHON_COMPILING_IN_CPYTHON
     if (likely(PyTuple_CheckExact(sequence))) {
@@ -2168,16 +2155,15 @@ static PyObject *__pyx_pf_6pygrib__get_grib_api_version(CYTHON_UNUSED PyObject *
     __Pyx_INCREF(__pyx_t_2);
     __Pyx_INCREF(__pyx_t_3);
     #else
-    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
     #endif
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  } else
-  {
+  } else {
     Py_ssize_t index = -1;
-    __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
@@ -2185,7 +2171,7 @@ static PyObject *__pyx_pf_6pygrib__get_grib_api_version(CYTHON_UNUSED PyObject *
     __Pyx_GOTREF(__pyx_t_2);
     index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
     __Pyx_GOTREF(__pyx_t_3);
-    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __pyx_t_5 = NULL;
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     goto __pyx_L4_unpacking_done;
@@ -2193,7 +2179,7 @@ static PyObject *__pyx_pf_6pygrib__get_grib_api_version(CYTHON_UNUSED PyObject *
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __pyx_t_5 = NULL;
     if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __pyx_L4_unpacking_done:;
   }
   __Pyx_DECREF_SET(__pyx_v_v, __pyx_t_2);
@@ -2201,14 +2187,14 @@ static PyObject *__pyx_pf_6pygrib__get_grib_api_version(CYTHON_UNUSED PyObject *
   __pyx_v_revision = __pyx_t_3;
   __pyx_t_3 = 0;
 
-  /* "pygrib.pyx":308
+  /* "pygrib.pyx":302
  *     v = grib_get_api_version()
  *     v,revision = div(v,100)
  *     v,minor = div(v,100)             # <<<<<<<<<<<<<<
  *     major = v
  *     return "%d.%d.%d" % (major,minor,revision)
  */
-  __pyx_t_1 = __pyx_lambda_funcdef_lambda1(__pyx_v_div, __pyx_v_v, __pyx_int_100); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __pyx_lambda_funcdef_lambda1(__pyx_v_div, __pyx_v_v, __pyx_int_100); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
     PyObject* sequence = __pyx_t_1;
@@ -2220,7 +2206,7 @@ static PyObject *__pyx_pf_6pygrib__get_grib_api_version(CYTHON_UNUSED PyObject *
     if (unlikely(size != 2)) {
       if (size > 2) __Pyx_RaiseTooManyValuesError(2);
       else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     }
     #if CYTHON_COMPILING_IN_CPYTHON
     if (likely(PyTuple_CheckExact(sequence))) {
@@ -2233,16 +2219,15 @@ static PyObject *__pyx_pf_6pygrib__get_grib_api_version(CYTHON_UNUSED PyObject *
     __Pyx_INCREF(__pyx_t_3);
     __Pyx_INCREF(__pyx_t_2);
     #else
-    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_2);
     #endif
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  } else
-  {
+  } else {
     Py_ssize_t index = -1;
-    __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
@@ -2250,7 +2235,7 @@ static PyObject *__pyx_pf_6pygrib__get_grib_api_version(CYTHON_UNUSED PyObject *
     __Pyx_GOTREF(__pyx_t_3);
     index = 1; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
     __Pyx_GOTREF(__pyx_t_2);
-    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __pyx_t_5 = NULL;
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     goto __pyx_L6_unpacking_done;
@@ -2258,7 +2243,7 @@ static PyObject *__pyx_pf_6pygrib__get_grib_api_version(CYTHON_UNUSED PyObject *
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __pyx_t_5 = NULL;
     if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __pyx_L6_unpacking_done:;
   }
   __Pyx_DECREF_SET(__pyx_v_v, __pyx_t_3);
@@ -2266,7 +2251,7 @@ static PyObject *__pyx_pf_6pygrib__get_grib_api_version(CYTHON_UNUSED PyObject *
   __pyx_v_minor = __pyx_t_2;
   __pyx_t_2 = 0;
 
-  /* "pygrib.pyx":309
+  /* "pygrib.pyx":303
  *     v,revision = div(v,100)
  *     v,minor = div(v,100)
  *     major = v             # <<<<<<<<<<<<<<
@@ -2276,7 +2261,7 @@ static PyObject *__pyx_pf_6pygrib__get_grib_api_version(CYTHON_UNUSED PyObject *
   __Pyx_INCREF(__pyx_v_v);
   __pyx_v_major = __pyx_v_v;
 
-  /* "pygrib.pyx":310
+  /* "pygrib.pyx":304
  *     v,minor = div(v,100)
  *     major = v
  *     return "%d.%d.%d" % (major,minor,revision)             # <<<<<<<<<<<<<<
@@ -2284,7 +2269,7 @@ static PyObject *__pyx_pf_6pygrib__get_grib_api_version(CYTHON_UNUSED PyObject *
  * tolerate_badgrib = False
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_INCREF(__pyx_v_major);
   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_major);
@@ -2295,15 +2280,22 @@ static PyObject *__pyx_pf_6pygrib__get_grib_api_version(CYTHON_UNUSED PyObject *
   __Pyx_INCREF(__pyx_v_revision);
   PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_revision);
   __Pyx_GIVEREF(__pyx_v_revision);
-  __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_2), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
-  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
-  __pyx_r = ((PyObject *)__pyx_t_2);
+  __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_d_d_d, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_r = __pyx_t_2;
   __pyx_t_2 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "pygrib.pyx":298
+ * #missingvalue_float = GRIB_MISSING_DOUBLE
+ * missingvalue_float = -1.e100 # value given in grib_api.h version 1.90
+ * def _get_grib_api_version():             # <<<<<<<<<<<<<<
+ *     div = lambda v,d: (v/d,v%d)
+ *     v = grib_get_api_version()
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_XDECREF(__pyx_t_2);
@@ -2322,52 +2314,58 @@ static PyObject *__pyx_pf_6pygrib__get_grib_api_version(CYTHON_UNUSED PyObject *
   return __pyx_r;
 }
 
+/* "pygrib.pyx":308
+ * tolerate_badgrib = False
+ * 
+ * def tolerate_badgrib_on():             # <<<<<<<<<<<<<<
+ *     """
+ *     don't raise an exception when a missing or malformed key is encountered.
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_6pygrib_3tolerate_badgrib_on(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
 static char __pyx_doc_6pygrib_2tolerate_badgrib_on[] = "\n    don't raise an exception when a missing or malformed key is encountered.\n    ";
-static PyMethodDef __pyx_mdef_6pygrib_3tolerate_badgrib_on = {__Pyx_NAMESTR("tolerate_badgrib_on"), (PyCFunction)__pyx_pw_6pygrib_3tolerate_badgrib_on, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6pygrib_2tolerate_badgrib_on)};
+static PyMethodDef __pyx_mdef_6pygrib_3tolerate_badgrib_on = {"tolerate_badgrib_on", (PyCFunction)__pyx_pw_6pygrib_3tolerate_badgrib_on, METH_NOARGS, __pyx_doc_6pygrib_2tolerate_badgrib_on};
 static PyObject *__pyx_pw_6pygrib_3tolerate_badgrib_on(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("tolerate_badgrib_on (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_2tolerate_badgrib_on(__pyx_self);
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "pygrib.pyx":314
- * tolerate_badgrib = False
- * 
- * def tolerate_badgrib_on():             # <<<<<<<<<<<<<<
- *     """
- *     don't raise an exception when a missing or malformed key is encountered.
- */
-
 static PyObject *__pyx_pf_6pygrib_2tolerate_badgrib_on(CYTHON_UNUSED PyObject *__pyx_self) {
   PyObject *__pyx_r = NULL;
   __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("tolerate_badgrib_on", 0);
 
-  /* "pygrib.pyx":319
+  /* "pygrib.pyx":313
  *     """
  *     global tolerate_badgrib
  *     tolerate_badgrib = True             # <<<<<<<<<<<<<<
  * 
  * def tolerate_badgrib_off():
  */
-  __pyx_t_1 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s__tolerate_badgrib, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_tolerate_badgrib, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+  /* "pygrib.pyx":308
+ * tolerate_badgrib = False
+ * 
+ * def tolerate_badgrib_on():             # <<<<<<<<<<<<<<
+ *     """
+ *     don't raise an exception when a missing or malformed key is encountered.
+ */
 
+  /* function exit code */
   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
   goto __pyx_L0;
   __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
   __Pyx_AddTraceback("pygrib.tolerate_badgrib_on", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_r = NULL;
   __pyx_L0:;
@@ -2376,52 +2374,58 @@ static PyObject *__pyx_pf_6pygrib_2tolerate_badgrib_on(CYTHON_UNUSED PyObject *_
   return __pyx_r;
 }
 
+/* "pygrib.pyx":315
+ *     tolerate_badgrib = True
+ * 
+ * def tolerate_badgrib_off():             # <<<<<<<<<<<<<<
+ *     """
+ *     raise an exception when a missing or malformed key is encountered
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_6pygrib_5tolerate_badgrib_off(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
 static char __pyx_doc_6pygrib_4tolerate_badgrib_off[] = "\n    raise an exception when a missing or malformed key is encountered\n    (default behavior).\n    ";
-static PyMethodDef __pyx_mdef_6pygrib_5tolerate_badgrib_off = {__Pyx_NAMESTR("tolerate_badgrib_off"), (PyCFunction)__pyx_pw_6pygrib_5tolerate_badgrib_off, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6pygrib_4tolerate_badgrib_off)};
+static PyMethodDef __pyx_mdef_6pygrib_5tolerate_badgrib_off = {"tolerate_badgrib_off", (PyCFunction)__pyx_pw_6pygrib_5tolerate_badgrib_off, METH_NOARGS, __pyx_doc_6pygrib_4tolerate_badgrib_off};
 static PyObject *__pyx_pw_6pygrib_5tolerate_badgrib_off(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("tolerate_badgrib_off (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_4tolerate_badgrib_off(__pyx_self);
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "pygrib.pyx":321
- *     tolerate_badgrib = True
- * 
- * def tolerate_badgrib_off():             # <<<<<<<<<<<<<<
- *     """
- *     raise an exception when a missing or malformed key is encountered
- */
-
 static PyObject *__pyx_pf_6pygrib_4tolerate_badgrib_off(CYTHON_UNUSED PyObject *__pyx_self) {
   PyObject *__pyx_r = NULL;
   __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("tolerate_badgrib_off", 0);
 
-  /* "pygrib.pyx":327
+  /* "pygrib.pyx":321
  *     """
  *     global tolerate_badgrib
  *     tolerate_badgrib = False             # <<<<<<<<<<<<<<
  * 
  * def gaulats(object nlats):
  */
-  __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s__tolerate_badgrib, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_tolerate_badgrib, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
+  /* "pygrib.pyx":315
+ *     tolerate_badgrib = True
+ * 
+ * def tolerate_badgrib_off():             # <<<<<<<<<<<<<<
+ *     """
+ *     raise an exception when a missing or malformed key is encountered
+ */
+
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
   __Pyx_AddTraceback("pygrib.tolerate_badgrib_off", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_r = NULL;
   __pyx_L0:;
@@ -2430,27 +2434,29 @@ static PyObject *__pyx_pf_6pygrib_4tolerate_badgrib_off(CYTHON_UNUSED PyObject *
   return __pyx_r;
 }
 
+/* "pygrib.pyx":323
+ *     tolerate_badgrib = False
+ * 
+ * def gaulats(object nlats):             # <<<<<<<<<<<<<<
+ *     """
+ *     gaulats(nlats)
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_6pygrib_7gaulats(PyObject *__pyx_self, PyObject *__pyx_v_nlats); /*proto*/
 static char __pyx_doc_6pygrib_6gaulats[] = "\n    gaulats(nlats)\n\n    Returns nlats gaussian latitudes, in degrees, oriented from\n    north to south.  nlats must be even.";
-static PyMethodDef __pyx_mdef_6pygrib_7gaulats = {__Pyx_NAMESTR("gaulats"), (PyCFunction)__pyx_pw_6pygrib_7gaulats, METH_O, __Pyx_DOCSTR(__pyx_doc_6pygrib_6gaulats)};
+static PyMethodDef __pyx_mdef_6pygrib_7gaulats = {"gaulats", (PyCFunction)__pyx_pw_6pygrib_7gaulats, METH_O, __pyx_doc_6pygrib_6gaulats};
 static PyObject *__pyx_pw_6pygrib_7gaulats(PyObject *__pyx_self, PyObject *__pyx_v_nlats) {
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("gaulats (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_6gaulats(__pyx_self, ((PyObject *)__pyx_v_nlats));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "pygrib.pyx":329
- *     tolerate_badgrib = False
- * 
- * def gaulats(object nlats):             # <<<<<<<<<<<<<<
- *     """
- *     gaulats(nlats)
- */
-
 static PyObject *__pyx_pf_6pygrib_6gaulats(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_nlats) {
   PyArrayObject *__pyx_v_lats = 0;
   PyObject *__pyx_r = NULL;
@@ -2459,85 +2465,101 @@ static PyObject *__pyx_pf_6pygrib_6gaulats(CYTHON_UNUSED PyObject *__pyx_self, P
   int __pyx_t_2;
   PyObject *__pyx_t_3 = NULL;
   PyObject *__pyx_t_4 = NULL;
-  long __pyx_t_5;
+  PyObject *__pyx_t_5 = NULL;
+  Py_ssize_t __pyx_t_6;
+  PyObject *__pyx_t_7 = NULL;
+  long __pyx_t_8;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("gaulats", 0);
 
-  /* "pygrib.pyx":336
+  /* "pygrib.pyx":330
  *     north to south.  nlats must be even."""
  *     cdef ndarray lats
  *     if nlats%2:             # <<<<<<<<<<<<<<
  *         raise ValueError('nlats must be even')
  *     lats = np.empty(nlats, np.float64)
  */
-  __pyx_t_1 = PyNumber_Remainder(__pyx_v_nlats, __pyx_int_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyNumber_Remainder(__pyx_v_nlats, __pyx_int_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (__pyx_t_2) {
 
-    /* "pygrib.pyx":337
+    /* "pygrib.pyx":331
  *     cdef ndarray lats
  *     if nlats%2:
  *         raise ValueError('nlats must be even')             # <<<<<<<<<<<<<<
  *     lats = np.empty(nlats, np.float64)
  *     grib_get_gaussian_latitudes(<long>nlats/2, <double *>lats.data)
  */
-    __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_Raise(__pyx_t_1, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L3;
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
-  __pyx_L3:;
 
-  /* "pygrib.pyx":338
+  /* "pygrib.pyx":332
  *     if nlats%2:
  *         raise ValueError('nlats must be even')
  *     lats = np.empty(nlats, np.float64)             # <<<<<<<<<<<<<<
  *     grib_get_gaussian_latitudes(<long>nlats/2, <double *>lats.data)
  *     return lats
  */
-  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__float64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_t_3 = NULL;
+  __pyx_t_6 = 0;
+  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_4, function);
+      __pyx_t_6 = 1;
+    }
+  }
+  __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_7);
+  if (__pyx_t_3) {
+    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
+  }
   __Pyx_INCREF(__pyx_v_nlats);
-  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_nlats);
+  PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_nlats);
   __Pyx_GIVEREF(__pyx_v_nlats);
-  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
-  __Pyx_GIVEREF(__pyx_t_4);
-  __pyx_t_4 = 0;
-  __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
-  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_6pygrib_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_v_lats = ((PyArrayObject *)__pyx_t_4);
-  __pyx_t_4 = 0;
+  PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_5);
+  __Pyx_GIVEREF(__pyx_t_5);
+  __pyx_t_5 = 0;
+  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6pygrib_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_v_lats = ((PyArrayObject *)__pyx_t_1);
+  __pyx_t_1 = 0;
 
-  /* "pygrib.pyx":339
+  /* "pygrib.pyx":333
  *         raise ValueError('nlats must be even')
  *     lats = np.empty(nlats, np.float64)
  *     grib_get_gaussian_latitudes(<long>nlats/2, <double *>lats.data)             # <<<<<<<<<<<<<<
  *     return lats
  * 
  */
-  __pyx_t_5 = __Pyx_PyInt_AsLong(__pyx_v_nlats); if (unlikely((__pyx_t_5 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  grib_get_gaussian_latitudes(__Pyx_div_long(((long)__pyx_t_5), 2), ((double *)__pyx_v_lats->data));
+  __pyx_t_8 = __Pyx_PyInt_As_long(__pyx_v_nlats); if (unlikely((__pyx_t_8 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  grib_get_gaussian_latitudes(__Pyx_div_long(((long)__pyx_t_8), 2), ((double *)__pyx_v_lats->data));
 
-  /* "pygrib.pyx":340
+  /* "pygrib.pyx":334
  *     lats = np.empty(nlats, np.float64)
  *     grib_get_gaussian_latitudes(<long>nlats/2, <double *>lats.data)
  *     return lats             # <<<<<<<<<<<<<<
@@ -2549,12 +2571,21 @@ static PyObject *__pyx_pf_6pygrib_6gaulats(CYTHON_UNUSED PyObject *__pyx_self, P
   __pyx_r = ((PyObject *)__pyx_v_lats);
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "pygrib.pyx":323
+ *     tolerate_badgrib = False
+ * 
+ * def gaulats(object nlats):             # <<<<<<<<<<<<<<
+ *     """
+ *     gaulats(nlats)
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_XDECREF(__pyx_t_3);
   __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_7);
   __Pyx_AddTraceback("pygrib.gaulats", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_r = NULL;
   __pyx_L0:;
@@ -2564,33 +2595,35 @@ static PyObject *__pyx_pf_6pygrib_6gaulats(CYTHON_UNUSED PyObject *__pyx_self, P
   return __pyx_r;
 }
 
+/* "pygrib.pyx":354
+ * grib_multi_support_on(NULL)
+ * 
+ * def multi_support_on():             # <<<<<<<<<<<<<<
+ *     """turn on support for multi-field grib messages (default)"""
+ *     grib_multi_support_on(NULL)
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_6pygrib_9multi_support_on(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
 static char __pyx_doc_6pygrib_8multi_support_on[] = "turn on support for multi-field grib messages (default)";
-static PyMethodDef __pyx_mdef_6pygrib_9multi_support_on = {__Pyx_NAMESTR("multi_support_on"), (PyCFunction)__pyx_pw_6pygrib_9multi_support_on, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6pygrib_8multi_support_on)};
+static PyMethodDef __pyx_mdef_6pygrib_9multi_support_on = {"multi_support_on", (PyCFunction)__pyx_pw_6pygrib_9multi_support_on, METH_NOARGS, __pyx_doc_6pygrib_8multi_support_on};
 static PyObject *__pyx_pw_6pygrib_9multi_support_on(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("multi_support_on (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_8multi_support_on(__pyx_self);
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "pygrib.pyx":360
- * grib_multi_support_on(NULL)
- * 
- * def multi_support_on():             # <<<<<<<<<<<<<<
- *     """turn on support for multi-field grib messages (default)"""
- *     grib_multi_support_on(NULL)
- */
-
 static PyObject *__pyx_pf_6pygrib_8multi_support_on(CYTHON_UNUSED PyObject *__pyx_self) {
   PyObject *__pyx_r = NULL;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("multi_support_on", 0);
 
-  /* "pygrib.pyx":362
+  /* "pygrib.pyx":356
  * def multi_support_on():
  *     """turn on support for multi-field grib messages (default)"""
  *     grib_multi_support_on(NULL)             # <<<<<<<<<<<<<<
@@ -2599,39 +2632,50 @@ static PyObject *__pyx_pf_6pygrib_8multi_support_on(CYTHON_UNUSED PyObject *__py
  */
   grib_multi_support_on(NULL);
 
+  /* "pygrib.pyx":354
+ * grib_multi_support_on(NULL)
+ * 
+ * def multi_support_on():             # <<<<<<<<<<<<<<
+ *     """turn on support for multi-field grib messages (default)"""
+ *     grib_multi_support_on(NULL)
+ */
+
+  /* function exit code */
   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
   __Pyx_XGIVEREF(__pyx_r);
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
+/* "pygrib.pyx":358
+ *     grib_multi_support_on(NULL)
+ * 
+ * def multi_support_off():             # <<<<<<<<<<<<<<
+ *     """turn off support for multi-field grib messages"""
+ *     grib_multi_support_off(NULL)
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_6pygrib_11multi_support_off(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
 static char __pyx_doc_6pygrib_10multi_support_off[] = "turn off support for multi-field grib messages";
-static PyMethodDef __pyx_mdef_6pygrib_11multi_support_off = {__Pyx_NAMESTR("multi_support_off"), (PyCFunction)__pyx_pw_6pygrib_11multi_support_off, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6pygrib_10multi_support_off)};
+static PyMethodDef __pyx_mdef_6pygrib_11multi_support_off = {"multi_support_off", (PyCFunction)__pyx_pw_6pygrib_11multi_support_off, METH_NOARGS, __pyx_doc_6pygrib_10multi_support_off};
 static PyObject *__pyx_pw_6pygrib_11multi_support_off(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("multi_support_off (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_10multi_support_off(__pyx_self);
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "pygrib.pyx":364
- *     grib_multi_support_on(NULL)
- * 
- * def multi_support_off():             # <<<<<<<<<<<<<<
- *     """turn off support for multi-field grib messages"""
- *     grib_multi_support_off(NULL)
- */
-
 static PyObject *__pyx_pf_6pygrib_10multi_support_off(CYTHON_UNUSED PyObject *__pyx_self) {
   PyObject *__pyx_r = NULL;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("multi_support_off", 0);
 
-  /* "pygrib.pyx":366
+  /* "pygrib.pyx":360
  * def multi_support_off():
  *     """turn off support for multi-field grib messages"""
  *     grib_multi_support_off(NULL)             # <<<<<<<<<<<<<<
@@ -2640,12 +2684,29 @@ static PyObject *__pyx_pf_6pygrib_10multi_support_off(CYTHON_UNUSED PyObject *__
  */
   grib_multi_support_off(NULL);
 
+  /* "pygrib.pyx":358
+ *     grib_multi_support_on(NULL)
+ * 
+ * def multi_support_off():             # <<<<<<<<<<<<<<
+ *     """turn off support for multi-field grib messages"""
+ *     grib_multi_support_off(NULL)
+ */
+
+  /* function exit code */
   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
   __Pyx_XGIVEREF(__pyx_r);
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
+/* "pygrib.pyx":387
+ *     cdef public object name, messagenumber, messages, closed,\
+ *                        has_multi_field_msgs
+ *     def __cinit__(self, filename):             # <<<<<<<<<<<<<<
+ *         # initialize C level objects.
+ *         cdef grib_handle *gh
+ */
+
 /* Python wrapper */
 static int __pyx_pw_6pygrib_4open_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static int __pyx_pw_6pygrib_4open_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
@@ -2657,7 +2718,7 @@ static int __pyx_pw_6pygrib_4open_1__cinit__(PyObject *__pyx_v_self, PyObject *_
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
   {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__filename,0};
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filename,0};
     PyObject* values[1] = {0};
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
@@ -2670,11 +2731,11 @@ static int __pyx_pw_6pygrib_4open_1__cinit__(PyObject *__pyx_v_self, PyObject *_
       kw_args = PyDict_Size(__pyx_kwds);
       switch (pos_args) {
         case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__filename)) != 0)) kw_args--;
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_filename)) != 0)) kw_args--;
         else goto __pyx_L5_argtuple_error;
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
       goto __pyx_L5_argtuple_error;
@@ -2685,25 +2746,19 @@ static int __pyx_pw_6pygrib_4open_1__cinit__(PyObject *__pyx_v_self, PyObject *_
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
   __pyx_L3_error:;
   __Pyx_AddTraceback("pygrib.open.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
   return -1;
   __pyx_L4_argument_unpacking_done:;
   __pyx_r = __pyx_pf_6pygrib_4open___cinit__(((struct __pyx_obj_6pygrib_open *)__pyx_v_self), __pyx_v_filename);
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "pygrib.pyx":393
- *     cdef public object name, messagenumber, messages, closed,\
- *                        has_multi_field_msgs
- *     def __cinit__(self, filename):             # <<<<<<<<<<<<<<
- *         # initialize C level objects.
- *         cdef grib_handle *gh
- */
-
 static int __pyx_pf_6pygrib_4open___cinit__(struct __pyx_obj_6pygrib_open *__pyx_v_self, PyObject *__pyx_v_filename) {
   PyObject *__pyx_v_bytestr = NULL;
   int __pyx_r;
@@ -2717,29 +2772,29 @@ static int __pyx_pf_6pygrib_4open___cinit__(struct __pyx_obj_6pygrib_open *__pyx
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("__cinit__", 0);
 
-  /* "pygrib.pyx":397
+  /* "pygrib.pyx":391
  *         cdef grib_handle *gh
  *         cdef FILE *_fd
  *         bytestr = _strencode(filename)             # <<<<<<<<<<<<<<
  *         self._fd = fopen(bytestr, "rb")
  *         if self._fd == NULL:
  */
-  __pyx_t_1 = __pyx_f_6pygrib__strencode(__pyx_v_filename, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __pyx_f_6pygrib__strencode(__pyx_v_filename, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_v_bytestr = __pyx_t_1;
   __pyx_t_1 = 0;
 
-  /* "pygrib.pyx":398
+  /* "pygrib.pyx":392
  *         cdef FILE *_fd
  *         bytestr = _strencode(filename)
  *         self._fd = fopen(bytestr, "rb")             # <<<<<<<<<<<<<<
  *         if self._fd == NULL:
  *             raise IOError("could not open %s", filename)
  */
-  __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_v_bytestr); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_v_self->_fd = fopen(__pyx_t_2, __pyx_k__rb);
+  __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_v_bytestr); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_v_self->_fd = fopen(__pyx_t_2, __pyx_k_rb);
 
-  /* "pygrib.pyx":399
+  /* "pygrib.pyx":393
  *         bytestr = _strencode(filename)
  *         self._fd = fopen(bytestr, "rb")
  *         if self._fd == NULL:             # <<<<<<<<<<<<<<
@@ -2749,32 +2804,30 @@ static int __pyx_pf_6pygrib_4open___cinit__(struct __pyx_obj_6pygrib_open *__pyx
   __pyx_t_3 = ((__pyx_v_self->_fd == NULL) != 0);
   if (__pyx_t_3) {
 
-    /* "pygrib.pyx":400
+    /* "pygrib.pyx":394
  *         self._fd = fopen(bytestr, "rb")
  *         if self._fd == NULL:
  *             raise IOError("could not open %s", filename)             # <<<<<<<<<<<<<<
  *         self._gh = NULL
  *     def __init__(self, filename):
  */
-    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_INCREF(((PyObject *)__pyx_kp_s_5));
-    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_kp_s_5));
-    __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_5));
+    __Pyx_INCREF(__pyx_kp_s_could_not_open_s);
+    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_s_could_not_open_s);
+    __Pyx_GIVEREF(__pyx_kp_s_could_not_open_s);
     __Pyx_INCREF(__pyx_v_filename);
     PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_filename);
     __Pyx_GIVEREF(__pyx_v_filename);
-    __pyx_t_4 = PyObject_Call(__pyx_builtin_IOError, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     __Pyx_Raise(__pyx_t_4, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L3;
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
-  __pyx_L3:;
 
-  /* "pygrib.pyx":401
+  /* "pygrib.pyx":395
  *         if self._fd == NULL:
  *             raise IOError("could not open %s", filename)
  *         self._gh = NULL             # <<<<<<<<<<<<<<
@@ -2783,6 +2836,15 @@ static int __pyx_pf_6pygrib_4open___cinit__(struct __pyx_obj_6pygrib_open *__pyx
  */
   __pyx_v_self->_gh = NULL;
 
+  /* "pygrib.pyx":387
+ *     cdef public object name, messagenumber, messages, closed,\
+ *                        has_multi_field_msgs
+ *     def __cinit__(self, filename):             # <<<<<<<<<<<<<<
+ *         # initialize C level objects.
+ *         cdef grib_handle *gh
+ */
+
+  /* function exit code */
   __pyx_r = 0;
   goto __pyx_L0;
   __pyx_L1_error:;
@@ -2796,6 +2858,14 @@ static int __pyx_pf_6pygrib_4open___cinit__(struct __pyx_obj_6pygrib_open *__pyx
   return __pyx_r;
 }
 
+/* "pygrib.pyx":396
+ *             raise IOError("could not open %s", filename)
+ *         self._gh = NULL
+ *     def __init__(self, filename):             # <<<<<<<<<<<<<<
+ *         cdef int err, ncount
+ *         cdef grib_handle *gh
+ */
+
 /* Python wrapper */
 static int __pyx_pw_6pygrib_4open_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static int __pyx_pw_6pygrib_4open_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
@@ -2807,7 +2877,7 @@ static int __pyx_pw_6pygrib_4open_3__init__(PyObject *__pyx_v_self, PyObject *__
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
   {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__filename,0};
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filename,0};
     PyObject* values[1] = {0};
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
@@ -2820,11 +2890,11 @@ static int __pyx_pw_6pygrib_4open_3__init__(PyObject *__pyx_v_self, PyObject *__
       kw_args = PyDict_Size(__pyx_kwds);
       switch (pos_args) {
         case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__filename)) != 0)) kw_args--;
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_filename)) != 0)) kw_args--;
         else goto __pyx_L5_argtuple_error;
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
       goto __pyx_L5_argtuple_error;
@@ -2835,25 +2905,19 @@ static int __pyx_pw_6pygrib_4open_3__init__(PyObject *__pyx_v_self, PyObject *__
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
   __pyx_L3_error:;
   __Pyx_AddTraceback("pygrib.open.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
   return -1;
   __pyx_L4_argument_unpacking_done:;
   __pyx_r = __pyx_pf_6pygrib_4open_2__init__(((struct __pyx_obj_6pygrib_open *)__pyx_v_self), __pyx_v_filename);
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "pygrib.pyx":402
- *             raise IOError("could not open %s", filename)
- *         self._gh = NULL
- *     def __init__(self, filename):             # <<<<<<<<<<<<<<
- *         cdef int err, ncount
- *         cdef grib_handle *gh
- */
-
 static int __pyx_pf_6pygrib_4open_2__init__(struct __pyx_obj_6pygrib_open *__pyx_v_self, PyObject *__pyx_v_filename) {
   int __pyx_v_err;
   int __pyx_v_ncount;
@@ -2861,15 +2925,15 @@ static int __pyx_pf_6pygrib_4open_2__init__(struct __pyx_obj_6pygrib_open *__pyx
   PyObject *__pyx_v_nmsgs = NULL;
   int __pyx_r;
   __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  int __pyx_t_2;
+  int __pyx_t_1;
+  PyObject *__pyx_t_2 = NULL;
   PyObject *__pyx_t_3 = NULL;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("__init__", 0);
 
-  /* "pygrib.pyx":406
+  /* "pygrib.pyx":400
  *         cdef grib_handle *gh
  *         # initalize Python level objects
  *         self.name = filename             # <<<<<<<<<<<<<<
@@ -2882,22 +2946,20 @@ static int __pyx_pf_6pygrib_4open_2__init__(struct __pyx_obj_6pygrib_open *__pyx
   __Pyx_DECREF(__pyx_v_self->name);
   __pyx_v_self->name = __pyx_v_filename;
 
-  /* "pygrib.pyx":407
+  /* "pygrib.pyx":401
  *         # initalize Python level objects
  *         self.name = filename
  *         self.closed = False             # <<<<<<<<<<<<<<
  *         self.messagenumber = 0
  *         # count number of messages in file.
  */
-  __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_INCREF(Py_False);
+  __Pyx_GIVEREF(Py_False);
   __Pyx_GOTREF(__pyx_v_self->closed);
   __Pyx_DECREF(__pyx_v_self->closed);
-  __pyx_v_self->closed = __pyx_t_1;
-  __pyx_t_1 = 0;
+  __pyx_v_self->closed = Py_False;
 
-  /* "pygrib.pyx":408
+  /* "pygrib.pyx":402
  *         self.name = filename
  *         self.closed = False
  *         self.messagenumber = 0             # <<<<<<<<<<<<<<
@@ -2910,7 +2972,7 @@ static int __pyx_pf_6pygrib_4open_2__init__(struct __pyx_obj_6pygrib_open *__pyx
   __Pyx_DECREF(__pyx_v_self->messagenumber);
   __pyx_v_self->messagenumber = __pyx_int_0;
 
-  /* "pygrib.pyx":410
+  /* "pygrib.pyx":404
  *         self.messagenumber = 0
  *         # count number of messages in file.
  *         nmsgs = 0             # <<<<<<<<<<<<<<
@@ -2920,7 +2982,7 @@ static int __pyx_pf_6pygrib_4open_2__init__(struct __pyx_obj_6pygrib_open *__pyx
   __Pyx_INCREF(__pyx_int_0);
   __pyx_v_nmsgs = __pyx_int_0;
 
-  /* "pygrib.pyx":411
+  /* "pygrib.pyx":405
  *         # count number of messages in file.
  *         nmsgs = 0
  *         while 1:             # <<<<<<<<<<<<<<
@@ -2928,9 +2990,8 @@ static int __pyx_pf_6pygrib_4open_2__init__(struct __pyx_obj_6pygrib_open *__pyx
  *             err = grib_handle_delete(gh)
  */
   while (1) {
-    if (!1) break;
 
-    /* "pygrib.pyx":412
+    /* "pygrib.pyx":406
  *         nmsgs = 0
  *         while 1:
  *             gh = grib_handle_new_from_file(NULL, self._fd, &err)             # <<<<<<<<<<<<<<
@@ -2939,7 +3000,7 @@ static int __pyx_pf_6pygrib_4open_2__init__(struct __pyx_obj_6pygrib_open *__pyx
  */
     __pyx_v_gh = grib_handle_new_from_file(NULL, __pyx_v_self->_fd, (&__pyx_v_err));
 
-    /* "pygrib.pyx":413
+    /* "pygrib.pyx":407
  *         while 1:
  *             gh = grib_handle_new_from_file(NULL, self._fd, &err)
  *             err = grib_handle_delete(gh)             # <<<<<<<<<<<<<<
@@ -2948,35 +3009,33 @@ static int __pyx_pf_6pygrib_4open_2__init__(struct __pyx_obj_6pygrib_open *__pyx
  */
     __pyx_v_err = grib_handle_delete(__pyx_v_gh);
 
-    /* "pygrib.pyx":414
+    /* "pygrib.pyx":408
  *             gh = grib_handle_new_from_file(NULL, self._fd, &err)
  *             err = grib_handle_delete(gh)
  *             if gh == NULL: break             # <<<<<<<<<<<<<<
  *             nmsgs = nmsgs + 1
  *         rewind(self._fd)
  */
-    __pyx_t_2 = ((__pyx_v_gh == NULL) != 0);
-    if (__pyx_t_2) {
+    __pyx_t_1 = ((__pyx_v_gh == NULL) != 0);
+    if (__pyx_t_1) {
       goto __pyx_L4_break;
-      goto __pyx_L5;
     }
-    __pyx_L5:;
 
-    /* "pygrib.pyx":415
+    /* "pygrib.pyx":409
  *             err = grib_handle_delete(gh)
  *             if gh == NULL: break
  *             nmsgs = nmsgs + 1             # <<<<<<<<<<<<<<
  *         rewind(self._fd)
  *         self.messages = nmsgs
  */
-    __pyx_t_1 = PyNumber_Add(__pyx_v_nmsgs, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF_SET(__pyx_v_nmsgs, __pyx_t_1);
-    __pyx_t_1 = 0;
+    __pyx_t_2 = PyNumber_Add(__pyx_v_nmsgs, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF_SET(__pyx_v_nmsgs, __pyx_t_2);
+    __pyx_t_2 = 0;
   }
   __pyx_L4_break:;
 
-  /* "pygrib.pyx":416
+  /* "pygrib.pyx":410
  *             if gh == NULL: break
  *             nmsgs = nmsgs + 1
  *         rewind(self._fd)             # <<<<<<<<<<<<<<
@@ -2985,7 +3044,7 @@ static int __pyx_pf_6pygrib_4open_2__init__(struct __pyx_obj_6pygrib_open *__pyx
  */
   rewind(__pyx_v_self->_fd);
 
-  /* "pygrib.pyx":417
+  /* "pygrib.pyx":411
  *             nmsgs = nmsgs + 1
  *         rewind(self._fd)
  *         self.messages = nmsgs             # <<<<<<<<<<<<<<
@@ -2998,7 +3057,7 @@ static int __pyx_pf_6pygrib_4open_2__init__(struct __pyx_obj_6pygrib_open *__pyx
   __Pyx_DECREF(__pyx_v_self->messages);
   __pyx_v_self->messages = __pyx_v_nmsgs;
 
-  /* "pygrib.pyx":418
+  /* "pygrib.pyx":412
  *         rewind(self._fd)
  *         self.messages = nmsgs
  *         err =  grib_count_in_file(NULL, self._fd, &ncount)             # <<<<<<<<<<<<<<
@@ -3007,60 +3066,65 @@ static int __pyx_pf_6pygrib_4open_2__init__(struct __pyx_obj_6pygrib_open *__pyx
  */
   __pyx_v_err = grib_count_in_file(NULL, __pyx_v_self->_fd, (&__pyx_v_ncount));
 
-  /* "pygrib.pyx":422
+  /* "pygrib.pyx":416
  *         # differs from brute-force method of counting, then
  *         # there must be multi-field messages in the file.
  *         if ncount != self.messages:             # <<<<<<<<<<<<<<
  *             self.has_multi_field_msgs=True
  *         else:
  */
-  __pyx_t_1 = PyInt_FromLong(__pyx_v_ncount); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_v_self->messages, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_ncount); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_v_self->messages, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  if (__pyx_t_2) {
+  if (__pyx_t_1) {
 
-    /* "pygrib.pyx":423
+    /* "pygrib.pyx":417
  *         # there must be multi-field messages in the file.
  *         if ncount != self.messages:
  *             self.has_multi_field_msgs=True             # <<<<<<<<<<<<<<
  *         else:
  *             self.has_multi_field_msgs=False
  */
-    __pyx_t_3 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_GIVEREF(__pyx_t_3);
+    __Pyx_INCREF(Py_True);
+    __Pyx_GIVEREF(Py_True);
     __Pyx_GOTREF(__pyx_v_self->has_multi_field_msgs);
     __Pyx_DECREF(__pyx_v_self->has_multi_field_msgs);
-    __pyx_v_self->has_multi_field_msgs = __pyx_t_3;
-    __pyx_t_3 = 0;
+    __pyx_v_self->has_multi_field_msgs = Py_True;
     goto __pyx_L6;
   }
   /*else*/ {
 
-    /* "pygrib.pyx":425
+    /* "pygrib.pyx":419
  *             self.has_multi_field_msgs=True
  *         else:
  *             self.has_multi_field_msgs=False             # <<<<<<<<<<<<<<
  *     def __iter__(self):
  *         return self
  */
-    __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_GIVEREF(__pyx_t_3);
+    __Pyx_INCREF(Py_False);
+    __Pyx_GIVEREF(Py_False);
     __Pyx_GOTREF(__pyx_v_self->has_multi_field_msgs);
     __Pyx_DECREF(__pyx_v_self->has_multi_field_msgs);
-    __pyx_v_self->has_multi_field_msgs = __pyx_t_3;
-    __pyx_t_3 = 0;
+    __pyx_v_self->has_multi_field_msgs = Py_False;
   }
   __pyx_L6:;
 
+  /* "pygrib.pyx":396
+ *             raise IOError("could not open %s", filename)
+ *         self._gh = NULL
+ *     def __init__(self, filename):             # <<<<<<<<<<<<<<
+ *         cdef int err, ncount
+ *         cdef grib_handle *gh
+ */
+
+  /* function exit code */
   __pyx_r = 0;
   goto __pyx_L0;
   __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
   __Pyx_XDECREF(__pyx_t_3);
   __Pyx_AddTraceback("pygrib.open.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_r = -1;
@@ -3070,6 +3134,14 @@ static int __pyx_pf_6pygrib_4open_2__init__(struct __pyx_obj_6pygrib_open *__pyx
   return __pyx_r;
 }
 
+/* "pygrib.pyx":420
+ *         else:
+ *             self.has_multi_field_msgs=False
+ *     def __iter__(self):             # <<<<<<<<<<<<<<
+ *         return self
+ *     def __next__(self):
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_6pygrib_4open_5__iter__(PyObject *__pyx_v_self); /*proto*/
 static PyObject *__pyx_pw_6pygrib_4open_5__iter__(PyObject *__pyx_v_self) {
@@ -3077,24 +3149,18 @@ static PyObject *__pyx_pw_6pygrib_4open_5__iter__(PyObject *__pyx_v_self) {
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_4open_4__iter__(((struct __pyx_obj_6pygrib_open *)__pyx_v_self));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "pygrib.pyx":426
- *         else:
- *             self.has_multi_field_msgs=False
- *     def __iter__(self):             # <<<<<<<<<<<<<<
- *         return self
- *     def __next__(self):
- */
-
 static PyObject *__pyx_pf_6pygrib_4open_4__iter__(struct __pyx_obj_6pygrib_open *__pyx_v_self) {
   PyObject *__pyx_r = NULL;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__iter__", 0);
 
-  /* "pygrib.pyx":427
+  /* "pygrib.pyx":421
  *             self.has_multi_field_msgs=False
  *     def __iter__(self):
  *         return self             # <<<<<<<<<<<<<<
@@ -3106,13 +3172,29 @@ static PyObject *__pyx_pf_6pygrib_4open_4__iter__(struct __pyx_obj_6pygrib_open
   __pyx_r = ((PyObject *)__pyx_v_self);
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  /* "pygrib.pyx":420
+ *         else:
+ *             self.has_multi_field_msgs=False
+ *     def __iter__(self):             # <<<<<<<<<<<<<<
+ *         return self
+ *     def __next__(self):
+ */
+
+  /* function exit code */
   __pyx_L0:;
   __Pyx_XGIVEREF(__pyx_r);
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
+/* "pygrib.pyx":422
+ *     def __iter__(self):
+ *         return self
+ *     def __next__(self):             # <<<<<<<<<<<<<<
+ *         cdef grib_handle* gh
+ *         cdef int err
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_6pygrib_4open_7__next__(PyObject *__pyx_v_self); /*proto*/
 static PyObject *__pyx_pw_6pygrib_4open_7__next__(PyObject *__pyx_v_self) {
@@ -3120,18 +3202,12 @@ static PyObject *__pyx_pw_6pygrib_4open_7__next__(PyObject *__pyx_v_self) {
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_4open_6__next__(((struct __pyx_obj_6pygrib_open *)__pyx_v_self));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "pygrib.pyx":428
- *     def __iter__(self):
- *         return self
- *     def __next__(self):             # <<<<<<<<<<<<<<
- *         cdef grib_handle* gh
- *         cdef int err
- */
-
 static PyObject *__pyx_pf_6pygrib_4open_6__next__(struct __pyx_obj_6pygrib_open *__pyx_v_self) {
   grib_handle *__pyx_v_gh;
   int __pyx_v_err;
@@ -3145,19 +3221,19 @@ static PyObject *__pyx_pf_6pygrib_4open_6__next__(struct __pyx_obj_6pygrib_open
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("__next__", 0);
 
-  /* "pygrib.pyx":431
+  /* "pygrib.pyx":425
  *         cdef grib_handle* gh
  *         cdef int err
  *         if self.messagenumber == self.messages:             # <<<<<<<<<<<<<<
  *             raise StopIteration
  *         if self._gh is not NULL:
  */
-  __pyx_t_1 = PyObject_RichCompare(__pyx_v_self->messagenumber, __pyx_v_self->messages, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyObject_RichCompare(__pyx_v_self->messagenumber, __pyx_v_self->messages, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (__pyx_t_2) {
 
-    /* "pygrib.pyx":432
+    /* "pygrib.pyx":426
  *         cdef int err
  *         if self.messagenumber == self.messages:
  *             raise StopIteration             # <<<<<<<<<<<<<<
@@ -3165,12 +3241,10 @@ static PyObject *__pyx_pf_6pygrib_4open_6__next__(struct __pyx_obj_6pygrib_open
  *             err = grib_handle_delete(self._gh)
  */
     __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L3;
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
-  __pyx_L3:;
 
-  /* "pygrib.pyx":433
+  /* "pygrib.pyx":427
  *         if self.messagenumber == self.messages:
  *             raise StopIteration
  *         if self._gh is not NULL:             # <<<<<<<<<<<<<<
@@ -3180,7 +3254,7 @@ static PyObject *__pyx_pf_6pygrib_4open_6__next__(struct __pyx_obj_6pygrib_open
   __pyx_t_2 = ((__pyx_v_self->_gh != NULL) != 0);
   if (__pyx_t_2) {
 
-    /* "pygrib.pyx":434
+    /* "pygrib.pyx":428
  *             raise StopIteration
  *         if self._gh is not NULL:
  *             err = grib_handle_delete(self._gh)             # <<<<<<<<<<<<<<
@@ -3189,7 +3263,7 @@ static PyObject *__pyx_pf_6pygrib_4open_6__next__(struct __pyx_obj_6pygrib_open
  */
     __pyx_v_err = grib_handle_delete(__pyx_v_self->_gh);
 
-    /* "pygrib.pyx":435
+    /* "pygrib.pyx":429
  *         if self._gh is not NULL:
  *             err = grib_handle_delete(self._gh)
  *             if err:             # <<<<<<<<<<<<<<
@@ -3199,34 +3273,32 @@ static PyObject *__pyx_pf_6pygrib_4open_6__next__(struct __pyx_obj_6pygrib_open
     __pyx_t_2 = (__pyx_v_err != 0);
     if (__pyx_t_2) {
 
-      /* "pygrib.pyx":436
+      /* "pygrib.pyx":430
  *             err = grib_handle_delete(self._gh)
  *             if err:
  *                 raise RuntimeError(grib_get_error_message(err))             # <<<<<<<<<<<<<<
  *         gh = grib_handle_new_from_file(NULL, self._fd, &err)
  *         if err:
  */
-      __pyx_t_1 = __Pyx_PyBytes_FromString(grib_get_error_message(__pyx_v_err)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(((PyObject *)__pyx_t_1));
-      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_1 = __Pyx_PyBytes_FromString(grib_get_error_message(__pyx_v_err)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_1);
+      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_3);
-      PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_1));
-      __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
+      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
+      __Pyx_GIVEREF(__pyx_t_1);
       __pyx_t_1 = 0;
-      __pyx_t_1 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_1);
-      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
       __Pyx_Raise(__pyx_t_1, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      goto __pyx_L5;
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     }
-    __pyx_L5:;
     goto __pyx_L4;
   }
   __pyx_L4:;
 
-  /* "pygrib.pyx":437
+  /* "pygrib.pyx":431
  *             if err:
  *                 raise RuntimeError(grib_get_error_message(err))
  *         gh = grib_handle_new_from_file(NULL, self._fd, &err)             # <<<<<<<<<<<<<<
@@ -3235,7 +3307,7 @@ static PyObject *__pyx_pf_6pygrib_4open_6__next__(struct __pyx_obj_6pygrib_open
  */
   __pyx_v_gh = grib_handle_new_from_file(NULL, __pyx_v_self->_fd, (&__pyx_v_err));
 
-  /* "pygrib.pyx":438
+  /* "pygrib.pyx":432
  *                 raise RuntimeError(grib_get_error_message(err))
  *         gh = grib_handle_new_from_file(NULL, self._fd, &err)
  *         if err:             # <<<<<<<<<<<<<<
@@ -3245,31 +3317,29 @@ static PyObject *__pyx_pf_6pygrib_4open_6__next__(struct __pyx_obj_6pygrib_open
   __pyx_t_2 = (__pyx_v_err != 0);
   if (__pyx_t_2) {
 
-    /* "pygrib.pyx":439
+    /* "pygrib.pyx":433
  *         gh = grib_handle_new_from_file(NULL, self._fd, &err)
  *         if err:
  *             raise RuntimeError(grib_get_error_message(err))             # <<<<<<<<<<<<<<
  *         if gh == NULL:
  *             raise StopIteration
  */
-    __pyx_t_1 = __Pyx_PyBytes_FromString(grib_get_error_message(__pyx_v_err)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
-    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = __Pyx_PyBytes_FromString(grib_get_error_message(__pyx_v_err)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
-    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_1));
-    __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
+    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
+    __Pyx_GIVEREF(__pyx_t_1);
     __pyx_t_1 = 0;
-    __pyx_t_1 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_Raise(__pyx_t_1, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L6;
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
-  __pyx_L6:;
 
-  /* "pygrib.pyx":440
+  /* "pygrib.pyx":434
  *         if err:
  *             raise RuntimeError(grib_get_error_message(err))
  *         if gh == NULL:             # <<<<<<<<<<<<<<
@@ -3279,7 +3349,7 @@ static PyObject *__pyx_pf_6pygrib_4open_6__next__(struct __pyx_obj_6pygrib_open
   __pyx_t_2 = ((__pyx_v_gh == NULL) != 0);
   if (__pyx_t_2) {
 
-    /* "pygrib.pyx":441
+    /* "pygrib.pyx":435
  *             raise RuntimeError(grib_get_error_message(err))
  *         if gh == NULL:
  *             raise StopIteration             # <<<<<<<<<<<<<<
@@ -3287,12 +3357,11 @@ static PyObject *__pyx_pf_6pygrib_4open_6__next__(struct __pyx_obj_6pygrib_open
  *             self._gh = gh
  */
     __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L7;
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
   /*else*/ {
 
-    /* "pygrib.pyx":443
+    /* "pygrib.pyx":437
  *             raise StopIteration
  *         else:
  *             self._gh = gh             # <<<<<<<<<<<<<<
@@ -3301,14 +3370,14 @@ static PyObject *__pyx_pf_6pygrib_4open_6__next__(struct __pyx_obj_6pygrib_open
  */
     __pyx_v_self->_gh = __pyx_v_gh;
 
-    /* "pygrib.pyx":444
+    /* "pygrib.pyx":438
  *         else:
  *             self._gh = gh
  *             self.messagenumber = self.messagenumber + 1             # <<<<<<<<<<<<<<
  *         return _create_gribmessage(self._gh, self.messagenumber)
  *     def __getitem__(self, key):
  */
-    __pyx_t_1 = PyNumber_Add(__pyx_v_self->messagenumber, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = PyNumber_Add(__pyx_v_self->messagenumber, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_GIVEREF(__pyx_t_1);
     __Pyx_GOTREF(__pyx_v_self->messagenumber);
@@ -3316,9 +3385,8 @@ static PyObject *__pyx_pf_6pygrib_4open_6__next__(struct __pyx_obj_6pygrib_open
     __pyx_v_self->messagenumber = __pyx_t_1;
     __pyx_t_1 = 0;
   }
-  __pyx_L7:;
 
-  /* "pygrib.pyx":445
+  /* "pygrib.pyx":439
  *             self._gh = gh
  *             self.messagenumber = self.messagenumber + 1
  *         return _create_gribmessage(self._gh, self.messagenumber)             # <<<<<<<<<<<<<<
@@ -3328,15 +3396,22 @@ static PyObject *__pyx_pf_6pygrib_4open_6__next__(struct __pyx_obj_6pygrib_open
   __Pyx_XDECREF(__pyx_r);
   __pyx_t_1 = __pyx_v_self->messagenumber;
   __Pyx_INCREF(__pyx_t_1);
-  __pyx_t_3 = __pyx_f_6pygrib__create_gribmessage(__pyx_v_self->_gh, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __pyx_f_6pygrib__create_gribmessage(__pyx_v_self->_gh, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_r = __pyx_t_3;
   __pyx_t_3 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "pygrib.pyx":422
+ *     def __iter__(self):
+ *         return self
+ *     def __next__(self):             # <<<<<<<<<<<<<<
+ *         cdef grib_handle* gh
+ *         cdef int err
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_XDECREF(__pyx_t_3);
@@ -3348,6 +3423,14 @@ static PyObject *__pyx_pf_6pygrib_4open_6__next__(struct __pyx_obj_6pygrib_open
   return __pyx_r;
 }
 
+/* "pygrib.pyx":440
+ *             self.messagenumber = self.messagenumber + 1
+ *         return _create_gribmessage(self._gh, self.messagenumber)
+ *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
+ *         if type(key) == slice:
+ *             # for a slice, return a list of grib messages.
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_6pygrib_4open_9__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
 static PyObject *__pyx_pw_6pygrib_4open_9__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
@@ -3355,18 +3438,12 @@ static PyObject *__pyx_pw_6pygrib_4open_9__getitem__(PyObject *__pyx_v_self, PyO
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_4open_8__getitem__(((struct __pyx_obj_6pygrib_open *)__pyx_v_self), ((PyObject *)__pyx_v_key));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "pygrib.pyx":446
- *             self.messagenumber = self.messagenumber + 1
- *         return _create_gribmessage(self._gh, self.messagenumber)
- *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
- *         if type(key) == slice:
- *             # for a slice, return a list of grib messages.
- */
-
 static PyObject *__pyx_pf_6pygrib_4open_8__getitem__(struct __pyx_obj_6pygrib_open *__pyx_v_self, PyObject *__pyx_v_key) {
   PyObject *__pyx_v_beg = NULL;
   PyObject *__pyx_v_end = NULL;
@@ -3386,45 +3463,62 @@ static PyObject *__pyx_pf_6pygrib_4open_8__getitem__(struct __pyx_obj_6pygrib_op
   PyObject *(*__pyx_t_7)(PyObject *);
   Py_ssize_t __pyx_t_8;
   PyObject *(*__pyx_t_9)(PyObject *);
-  int __pyx_t_10;
-  int __pyx_t_11;
+  PyObject *__pyx_t_10 = NULL;
+  PyObject *__pyx_t_11 = NULL;
+  int __pyx_t_12;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("__getitem__", 0);
 
-  /* "pygrib.pyx":447
+  /* "pygrib.pyx":441
  *         return _create_gribmessage(self._gh, self.messagenumber)
  *     def __getitem__(self, key):
  *         if type(key) == slice:             # <<<<<<<<<<<<<<
  *             # for a slice, return a list of grib messages.
  *             beg, end, inc = key.indices(self.messages)
  */
-  __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_key)), ((PyObject *)((PyObject*)(&PySlice_Type))), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_key)), ((PyObject *)((PyObject*)(&PySlice_Type))), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (__pyx_t_2) {
 
-    /* "pygrib.pyx":449
+    /* "pygrib.pyx":443
  *         if type(key) == slice:
  *             # for a slice, return a list of grib messages.
  *             beg, end, inc = key.indices(self.messages)             # <<<<<<<<<<<<<<
  *             msg = self.tell()
  *             grbs = [self.message(n+1) for n in xrange(beg,end,inc)]
  */
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s__indices); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_indices); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_INCREF(__pyx_v_self->messages);
-    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self->messages);
-    __Pyx_GIVEREF(__pyx_v_self->messages);
-    __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-    if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
-      PyObject* sequence = __pyx_t_4;
+    __pyx_t_4 = NULL;
+    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
+      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+      if (likely(__pyx_t_4)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+        __Pyx_INCREF(__pyx_t_4);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_3, function);
+      }
+    }
+    if (!__pyx_t_4) {
+      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_self->messages); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_1);
+    } else {
+      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_5);
+      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
+      __Pyx_INCREF(__pyx_v_self->messages);
+      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_self->messages);
+      __Pyx_GIVEREF(__pyx_v_self->messages);
+      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    }
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
+      PyObject* sequence = __pyx_t_1;
       #if CYTHON_COMPILING_IN_CPYTHON
       Py_ssize_t size = Py_SIZE(sequence);
       #else
@@ -3433,44 +3527,43 @@ static PyObject *__pyx_pf_6pygrib_4open_8__getitem__(struct __pyx_obj_6pygrib_op
       if (unlikely(size != 3)) {
         if (size > 3) __Pyx_RaiseTooManyValuesError(3);
         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       }
       #if CYTHON_COMPILING_IN_CPYTHON
       if (likely(PyTuple_CheckExact(sequence))) {
         __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
-        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
-        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); 
+        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
+        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); 
       } else {
         __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
-        __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
-        __pyx_t_5 = PyList_GET_ITEM(sequence, 2); 
+        __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
+        __pyx_t_4 = PyList_GET_ITEM(sequence, 2); 
       }
       __Pyx_INCREF(__pyx_t_3);
-      __Pyx_INCREF(__pyx_t_1);
       __Pyx_INCREF(__pyx_t_5);
+      __Pyx_INCREF(__pyx_t_4);
       #else
-      __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_5);
+      __pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
       #endif
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    } else
-    {
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    } else {
       Py_ssize_t index = -1;
-      __pyx_t_6 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_6);
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
       __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
       index = 0; __pyx_t_3 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed;
       __Pyx_GOTREF(__pyx_t_3);
-      index = 1; __pyx_t_1 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L4_unpacking_failed;
-      __Pyx_GOTREF(__pyx_t_1);
-      index = 2; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed;
+      index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed;
       __Pyx_GOTREF(__pyx_t_5);
-      if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      index = 2; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed;
+      __Pyx_GOTREF(__pyx_t_4);
+      if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __pyx_t_7 = NULL;
       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
       goto __pyx_L5_unpacking_done;
@@ -3478,41 +3571,56 @@ static PyObject *__pyx_pf_6pygrib_4open_8__getitem__(struct __pyx_obj_6pygrib_op
       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
       __pyx_t_7 = NULL;
       if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __pyx_L5_unpacking_done:;
     }
     __pyx_v_beg = __pyx_t_3;
     __pyx_t_3 = 0;
-    __pyx_v_end = __pyx_t_1;
-    __pyx_t_1 = 0;
-    __pyx_v_inc = __pyx_t_5;
+    __pyx_v_end = __pyx_t_5;
     __pyx_t_5 = 0;
+    __pyx_v_inc = __pyx_t_4;
+    __pyx_t_4 = 0;
 
-    /* "pygrib.pyx":450
+    /* "pygrib.pyx":444
  *             # for a slice, return a list of grib messages.
  *             beg, end, inc = key.indices(self.messages)
  *             msg = self.tell()             # <<<<<<<<<<<<<<
  *             grbs = [self.message(n+1) for n in xrange(beg,end,inc)]
  *             self.seek(msg) # put iterator back in original position
  */
-    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__tell); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_tell); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_5 = NULL;
+    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
+      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
+      if (likely(__pyx_t_5)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+        __Pyx_INCREF(__pyx_t_5);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_4, function);
+      }
+    }
+    if (__pyx_t_5) {
+      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    } else {
+      __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    }
+    __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_v_msg = __pyx_t_5;
-    __pyx_t_5 = 0;
+    __pyx_v_msg = __pyx_t_1;
+    __pyx_t_1 = 0;
 
-    /* "pygrib.pyx":451
+    /* "pygrib.pyx":445
  *             beg, end, inc = key.indices(self.messages)
  *             msg = self.tell()
  *             grbs = [self.message(n+1) for n in xrange(beg,end,inc)]             # <<<<<<<<<<<<<<
  *             self.seek(msg) # put iterator back in original position
  *             return grbs
  */
-    __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_INCREF(__pyx_v_beg);
     PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_beg);
@@ -3523,87 +3631,123 @@ static PyObject *__pyx_pf_6pygrib_4open_8__getitem__(struct __pyx_obj_6pygrib_op
     __Pyx_INCREF(__pyx_v_inc);
     PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_inc);
     __Pyx_GIVEREF(__pyx_v_inc);
-    __pyx_t_1 = PyObject_Call(__pyx_builtin_xrange, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-    if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
-      __pyx_t_4 = __pyx_t_1; __Pyx_INCREF(__pyx_t_4); __pyx_t_8 = 0;
+    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_xrange, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
+      __pyx_t_4 = __pyx_t_5; __Pyx_INCREF(__pyx_t_4); __pyx_t_8 = 0;
       __pyx_t_9 = NULL;
     } else {
-      __pyx_t_8 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_8 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_4);
-      __pyx_t_9 = Py_TYPE(__pyx_t_4)->tp_iternext;
+      __pyx_t_9 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     }
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     for (;;) {
-      if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_4)) {
-        if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_4)) break;
-        #if CYTHON_COMPILING_IN_CPYTHON
-        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #else
-        __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #endif
-      } else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_4)) {
-        if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
-        #if CYTHON_COMPILING_IN_CPYTHON
-        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #else
-        __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #endif
+      if (likely(!__pyx_t_9)) {
+        if (likely(PyList_CheckExact(__pyx_t_4))) {
+          if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_4)) break;
+          #if CYTHON_COMPILING_IN_CPYTHON
+          __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          #else
+          __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          #endif
+        } else {
+          if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
+          #if CYTHON_COMPILING_IN_CPYTHON
+          __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          #else
+          __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          #endif
+        }
       } else {
-        __pyx_t_1 = __pyx_t_9(__pyx_t_4);
-        if (unlikely(!__pyx_t_1)) {
-          if (PyErr_Occurred()) {
-            if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
-            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_t_5 = __pyx_t_9(__pyx_t_4);
+        if (unlikely(!__pyx_t_5)) {
+          PyObject* exc_type = PyErr_Occurred();
+          if (exc_type) {
+            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
           }
           break;
         }
-        __Pyx_GOTREF(__pyx_t_1);
+        __Pyx_GOTREF(__pyx_t_5);
       }
-      __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_1);
-      __pyx_t_1 = 0;
-      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__message); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_3 = PyNumber_Add(__pyx_v_n, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_5);
+      __pyx_t_5 = 0;
+      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_message); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_6 = PyNumber_Add(__pyx_v_n, __pyx_int_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_6);
-      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3);
-      __Pyx_GIVEREF(__pyx_t_3);
-      __pyx_t_3 = 0;
-      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
-      if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_3))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_10 = NULL;
+      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
+        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_3);
+        if (likely(__pyx_t_10)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+          __Pyx_INCREF(__pyx_t_10);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_3, function);
+        }
+      }
+      if (!__pyx_t_10) {
+        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+        __Pyx_GOTREF(__pyx_t_5);
+      } else {
+        __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_11);
+        PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); __pyx_t_10 = NULL;
+        PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_6);
+        __Pyx_GIVEREF(__pyx_t_6);
+        __pyx_t_6 = 0;
+        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_11, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_5);
+        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+      }
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     }
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_v_grbs = ((PyObject*)__pyx_t_5);
-    __pyx_t_5 = 0;
+    __pyx_v_grbs = ((PyObject*)__pyx_t_1);
+    __pyx_t_1 = 0;
 
-    /* "pygrib.pyx":452
+    /* "pygrib.pyx":446
  *             msg = self.tell()
  *             grbs = [self.message(n+1) for n in xrange(beg,end,inc)]
  *             self.seek(msg) # put iterator back in original position             # <<<<<<<<<<<<<<
  *             return grbs
  *         elif type(key) == int or type(key) == long:
  */
-    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__seek); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_seek); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_INCREF(__pyx_v_msg);
-    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_msg);
-    __Pyx_GIVEREF(__pyx_v_msg);
-    __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_t_5 = NULL;
+    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
+      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
+      if (likely(__pyx_t_5)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+        __Pyx_INCREF(__pyx_t_5);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_4, function);
+      }
+    }
+    if (!__pyx_t_5) {
+      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_msg); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_1);
+    } else {
+      __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
+      __Pyx_INCREF(__pyx_v_msg);
+      PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_v_msg);
+      __Pyx_GIVEREF(__pyx_v_msg);
+      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    }
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-    /* "pygrib.pyx":453
+    /* "pygrib.pyx":447
  *             grbs = [self.message(n+1) for n in xrange(beg,end,inc)]
  *             self.seek(msg) # put iterator back in original position
  *             return grbs             # <<<<<<<<<<<<<<
@@ -3611,89 +3755,137 @@ static PyObject *__pyx_pf_6pygrib_4open_8__getitem__(struct __pyx_obj_6pygrib_op
  *             # for an integer, return a single grib message.
  */
     __Pyx_XDECREF(__pyx_r);
-    __Pyx_INCREF(((PyObject *)__pyx_v_grbs));
-    __pyx_r = ((PyObject *)__pyx_v_grbs);
+    __Pyx_INCREF(__pyx_v_grbs);
+    __pyx_r = __pyx_v_grbs;
     goto __pyx_L0;
-    goto __pyx_L3;
   }
 
-  /* "pygrib.pyx":454
+  /* "pygrib.pyx":448
  *             self.seek(msg) # put iterator back in original position
  *             return grbs
  *         elif type(key) == int or type(key) == long:             # <<<<<<<<<<<<<<
  *             # for an integer, return a single grib message.
  *             msg = self.tell()
  */
-  __pyx_t_3 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_key)), ((PyObject *)((PyObject*)(&PyInt_Type))), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  if (!__pyx_t_2) {
-    __pyx_t_3 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_key)), ((PyObject *)((PyObject*)(&PyLong_Type))), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_11 = __pyx_t_10;
+  __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_key)), ((PyObject *)((PyObject*)(&PyInt_Type))), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  if (!__pyx_t_12) {
   } else {
-    __pyx_t_11 = __pyx_t_2;
+    __pyx_t_2 = __pyx_t_12;
+    goto __pyx_L8_bool_binop_done;
   }
-  if (__pyx_t_11) {
+  __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_key)), ((PyObject *)((PyObject*)(&PyLong_Type))), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_2 = __pyx_t_12;
+  __pyx_L8_bool_binop_done:;
+  if (__pyx_t_2) {
 
-    /* "pygrib.pyx":456
+    /* "pygrib.pyx":450
  *         elif type(key) == int or type(key) == long:
  *             # for an integer, return a single grib message.
  *             msg = self.tell()             # <<<<<<<<<<<<<<
  *             grb = self.message(key)
  *             self.seek(msg) # put iterator back in original position
  */
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__tell); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_tell); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_v_msg = __pyx_t_4;
-    __pyx_t_4 = 0;
+    __pyx_t_3 = NULL;
+    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
+      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
+      if (likely(__pyx_t_3)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+        __Pyx_INCREF(__pyx_t_3);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_4, function);
+      }
+    }
+    if (__pyx_t_3) {
+      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    } else {
+      __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    }
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_v_msg = __pyx_t_1;
+    __pyx_t_1 = 0;
 
-    /* "pygrib.pyx":457
+    /* "pygrib.pyx":451
  *             # for an integer, return a single grib message.
  *             msg = self.tell()
  *             grb = self.message(key)             # <<<<<<<<<<<<<<
  *             self.seek(msg) # put iterator back in original position
  *             return grb
  */
-    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__message); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_message); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_INCREF(__pyx_v_key);
-    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_key);
-    __Pyx_GIVEREF(__pyx_v_key);
-    __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_3 = NULL;
+    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
+      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
+      if (likely(__pyx_t_3)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+        __Pyx_INCREF(__pyx_t_3);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_4, function);
+      }
+    }
+    if (!__pyx_t_3) {
+      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_key); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_1);
+    } else {
+      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_5);
+      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
+      __Pyx_INCREF(__pyx_v_key);
+      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_key);
+      __Pyx_GIVEREF(__pyx_v_key);
+      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    }
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-    __pyx_v_grb = __pyx_t_5;
-    __pyx_t_5 = 0;
+    __pyx_v_grb = __pyx_t_1;
+    __pyx_t_1 = 0;
 
-    /* "pygrib.pyx":458
+    /* "pygrib.pyx":452
  *             msg = self.tell()
  *             grb = self.message(key)
  *             self.seek(msg) # put iterator back in original position             # <<<<<<<<<<<<<<
  *             return grb
  *         else:
  */
-    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__seek); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_INCREF(__pyx_v_msg);
-    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_msg);
-    __Pyx_GIVEREF(__pyx_v_msg);
-    __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_seek); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
+    __pyx_t_5 = NULL;
+    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
+      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
+      if (likely(__pyx_t_5)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+        __Pyx_INCREF(__pyx_t_5);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_4, function);
+      }
+    }
+    if (!__pyx_t_5) {
+      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_msg); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_1);
+    } else {
+      __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
+      __Pyx_INCREF(__pyx_v_msg);
+      PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_v_msg);
+      __Pyx_GIVEREF(__pyx_v_msg);
+      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    }
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-    /* "pygrib.pyx":459
+    /* "pygrib.pyx":453
  *             grb = self.message(key)
  *             self.seek(msg) # put iterator back in original position
  *             return grb             # <<<<<<<<<<<<<<
@@ -3704,33 +3896,40 @@ static PyObject *__pyx_pf_6pygrib_4open_8__getitem__(struct __pyx_obj_6pygrib_op
     __Pyx_INCREF(__pyx_v_grb);
     __pyx_r = __pyx_v_grb;
     goto __pyx_L0;
-    goto __pyx_L3;
   }
   /*else*/ {
 
-    /* "pygrib.pyx":461
+    /* "pygrib.pyx":455
  *             return grb
  *         else:
  *             raise KeyError('key must be an integer message number or a slice')             # <<<<<<<<<<<<<<
  *     def __call__(self, **kwargs):
  *         """same as L{select}"""
  */
-    __pyx_t_4 = PyObject_Call(__pyx_builtin_KeyError, ((PyObject *)__pyx_k_tuple_7), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
-  __pyx_L3:;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "pygrib.pyx":440
+ *             self.messagenumber = self.messagenumber + 1
+ *         return _create_gribmessage(self._gh, self.messagenumber)
+ *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
+ *         if type(key) == slice:
+ *             # for a slice, return a list of grib messages.
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_XDECREF(__pyx_t_3);
   __Pyx_XDECREF(__pyx_t_4);
   __Pyx_XDECREF(__pyx_t_5);
   __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_10);
+  __Pyx_XDECREF(__pyx_t_11);
   __Pyx_AddTraceback("pygrib.open.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_r = NULL;
   __pyx_L0:;
@@ -3746,6 +3945,14 @@ static PyObject *__pyx_pf_6pygrib_4open_8__getitem__(struct __pyx_obj_6pygrib_op
   return __pyx_r;
 }
 
+/* "pygrib.pyx":456
+ *         else:
+ *             raise KeyError('key must be an integer message number or a slice')
+ *     def __call__(self, **kwargs):             # <<<<<<<<<<<<<<
+ *         """same as L{select}"""
+ *         return self.select(**kwargs)
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_6pygrib_4open_11__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static char __pyx_doc_6pygrib_4open_10__call__[] = "same as L{select}";
@@ -3764,19 +3971,13 @@ static PyObject *__pyx_pw_6pygrib_4open_11__call__(PyObject *__pyx_v_self, PyObj
   if (unlikely(!__pyx_v_kwargs)) return NULL;
   __Pyx_GOTREF(__pyx_v_kwargs);
   __pyx_r = __pyx_pf_6pygrib_4open_10__call__(((struct __pyx_obj_6pygrib_open *)__pyx_v_self), __pyx_v_kwargs);
+
+  /* function exit code */
   __Pyx_XDECREF(__pyx_v_kwargs);
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "pygrib.pyx":462
- *         else:
- *             raise KeyError('key must be an integer message number or a slice')
- *     def __call__(self, **kwargs):             # <<<<<<<<<<<<<<
- *         """same as L{select}"""
- *         return self.select(**kwargs)
- */
-
 static PyObject *__pyx_pf_6pygrib_4open_10__call__(struct __pyx_obj_6pygrib_open *__pyx_v_self, PyObject *__pyx_v_kwargs) {
   PyObject *__pyx_r = NULL;
   __Pyx_RefNannyDeclarations
@@ -3788,7 +3989,7 @@ static PyObject *__pyx_pf_6pygrib_4open_10__call__(struct __pyx_obj_6pygrib_open
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("__call__", 0);
 
-  /* "pygrib.pyx":464
+  /* "pygrib.pyx":458
  *     def __call__(self, **kwargs):
  *         """same as L{select}"""
  *         return self.select(**kwargs)             # <<<<<<<<<<<<<<
@@ -3796,20 +3997,27 @@ static PyObject *__pyx_pf_6pygrib_4open_10__call__(struct __pyx_obj_6pygrib_open
  *         return self
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__select); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_select); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = ((PyObject *)__pyx_v_kwargs);
+  __pyx_t_2 = __pyx_v_kwargs;
   __Pyx_INCREF(__pyx_t_2);
-  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __pyx_r = __pyx_t_3;
   __pyx_t_3 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "pygrib.pyx":456
+ *         else:
+ *             raise KeyError('key must be an integer message number or a slice')
+ *     def __call__(self, **kwargs):             # <<<<<<<<<<<<<<
+ *         """same as L{select}"""
+ *         return self.select(**kwargs)
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_XDECREF(__pyx_t_2);
@@ -3822,6 +4030,14 @@ static PyObject *__pyx_pf_6pygrib_4open_10__call__(struct __pyx_obj_6pygrib_open
   return __pyx_r;
 }
 
+/* "pygrib.pyx":459
+ *         """same as L{select}"""
+ *         return self.select(**kwargs)
+ *     def __enter__(self):             # <<<<<<<<<<<<<<
+ *         return self
+ *     def __exit__(self,atype,value,traceback):
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_6pygrib_4open_13__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
 static PyObject *__pyx_pw_6pygrib_4open_13__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
@@ -3829,24 +4045,18 @@ static PyObject *__pyx_pw_6pygrib_4open_13__enter__(PyObject *__pyx_v_self, CYTH
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_4open_12__enter__(((struct __pyx_obj_6pygrib_open *)__pyx_v_self));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "pygrib.pyx":465
- *         """same as L{select}"""
- *         return self.select(**kwargs)
- *     def __enter__(self):             # <<<<<<<<<<<<<<
- *         return self
- *     def __exit__(self,atype,value,traceback):
- */
-
 static PyObject *__pyx_pf_6pygrib_4open_12__enter__(struct __pyx_obj_6pygrib_open *__pyx_v_self) {
   PyObject *__pyx_r = NULL;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__enter__", 0);
 
-  /* "pygrib.pyx":466
+  /* "pygrib.pyx":460
  *         return self.select(**kwargs)
  *     def __enter__(self):
  *         return self             # <<<<<<<<<<<<<<
@@ -3858,13 +4068,29 @@ static PyObject *__pyx_pf_6pygrib_4open_12__enter__(struct __pyx_obj_6pygrib_ope
   __pyx_r = ((PyObject *)__pyx_v_self);
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  /* "pygrib.pyx":459
+ *         """same as L{select}"""
+ *         return self.select(**kwargs)
+ *     def __enter__(self):             # <<<<<<<<<<<<<<
+ *         return self
+ *     def __exit__(self,atype,value,traceback):
+ */
+
+  /* function exit code */
   __pyx_L0:;
   __Pyx_XGIVEREF(__pyx_r);
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
+/* "pygrib.pyx":461
+ *     def __enter__(self):
+ *         return self
+ *     def __exit__(self,atype,value,traceback):             # <<<<<<<<<<<<<<
+ *         self.close()
+ *     def tell(self):
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_6pygrib_4open_15__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static PyObject *__pyx_pw_6pygrib_4open_15__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
@@ -3878,7 +4104,7 @@ static PyObject *__pyx_pw_6pygrib_4open_15__exit__(PyObject *__pyx_v_self, PyObj
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0);
   {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__atype,&__pyx_n_s__value,&__pyx_n_s__traceback,0};
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_atype,&__pyx_n_s_value,&__pyx_n_s_traceback,0};
     PyObject* values[3] = {0,0,0};
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
@@ -3893,21 +4119,21 @@ static PyObject *__pyx_pw_6pygrib_4open_15__exit__(PyObject *__pyx_v_self, PyObj
       kw_args = PyDict_Size(__pyx_kwds);
       switch (pos_args) {
         case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__atype)) != 0)) kw_args--;
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_atype)) != 0)) kw_args--;
         else goto __pyx_L5_argtuple_error;
         case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--;
+        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
         case  2:
-        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__traceback)) != 0)) kw_args--;
+        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_traceback)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__exit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__exit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
       goto __pyx_L5_argtuple_error;
@@ -3922,54 +4148,74 @@ static PyObject *__pyx_pw_6pygrib_4open_15__exit__(PyObject *__pyx_v_self, PyObj
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+  __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
   __pyx_L3_error:;
   __Pyx_AddTraceback("pygrib.open.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
   return NULL;
   __pyx_L4_argument_unpacking_done:;
   __pyx_r = __pyx_pf_6pygrib_4open_14__exit__(((struct __pyx_obj_6pygrib_open *)__pyx_v_self), __pyx_v_atype, __pyx_v_value, __pyx_v_traceback);
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "pygrib.pyx":467
- *     def __enter__(self):
- *         return self
- *     def __exit__(self,atype,value,traceback):             # <<<<<<<<<<<<<<
- *         self.close()
- *     def tell(self):
- */
-
 static PyObject *__pyx_pf_6pygrib_4open_14__exit__(struct __pyx_obj_6pygrib_open *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_atype, CYTHON_UNUSED PyObject *__pyx_v_value, CYTHON_UNUSED PyObject *__pyx_v_traceback) {
   PyObject *__pyx_r = NULL;
   __Pyx_RefNannyDeclarations
   PyObject *__pyx_t_1 = NULL;
   PyObject *__pyx_t_2 = NULL;
+  PyObject *__pyx_t_3 = NULL;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("__exit__", 0);
 
-  /* "pygrib.pyx":468
+  /* "pygrib.pyx":462
  *         return self
  *     def __exit__(self,atype,value,traceback):
  *         self.close()             # <<<<<<<<<<<<<<
  *     def tell(self):
  *         """returns position of iterator (grib message number, 0 means iterator
  */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__close); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_close); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_3 = NULL;
+  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  if (__pyx_t_3) {
+    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  } else {
+    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  }
+  __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+  /* "pygrib.pyx":461
+ *     def __enter__(self):
+ *         return self
+ *     def __exit__(self,atype,value,traceback):             # <<<<<<<<<<<<<<
+ *         self.close()
+ *     def tell(self):
+ */
 
+  /* function exit code */
   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
   goto __pyx_L0;
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
   __Pyx_AddTraceback("pygrib.open.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_r = NULL;
   __pyx_L0:;
@@ -3978,6 +4224,14 @@ static PyObject *__pyx_pf_6pygrib_4open_14__exit__(struct __pyx_obj_6pygrib_open
   return __pyx_r;
 }
 
+/* "pygrib.pyx":463
+ *     def __exit__(self,atype,value,traceback):
+ *         self.close()
+ *     def tell(self):             # <<<<<<<<<<<<<<
+ *         """returns position of iterator (grib message number, 0 means iterator
+ *         is positioned at beginning of file)."""
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_6pygrib_4open_17tell(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
 static char __pyx_doc_6pygrib_4open_16tell[] = "returns position of iterator (grib message number, 0 means iterator\n        is positioned at beginning of file).";
@@ -3986,24 +4240,18 @@ static PyObject *__pyx_pw_6pygrib_4open_17tell(PyObject *__pyx_v_self, CYTHON_UN
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("tell (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_4open_16tell(((struct __pyx_obj_6pygrib_open *)__pyx_v_self));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "pygrib.pyx":469
- *     def __exit__(self,atype,value,traceback):
- *         self.close()
- *     def tell(self):             # <<<<<<<<<<<<<<
- *         """returns position of iterator (grib message number, 0 means iterator
- *         is positioned at beginning of file)."""
- */
-
 static PyObject *__pyx_pf_6pygrib_4open_16tell(struct __pyx_obj_6pygrib_open *__pyx_v_self) {
   PyObject *__pyx_r = NULL;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("tell", 0);
 
-  /* "pygrib.pyx":472
+  /* "pygrib.pyx":466
  *         """returns position of iterator (grib message number, 0 means iterator
  *         is positioned at beginning of file)."""
  *         return self.messagenumber             # <<<<<<<<<<<<<<
@@ -4015,13 +4263,29 @@ static PyObject *__pyx_pf_6pygrib_4open_16tell(struct __pyx_obj_6pygrib_open *__
   __pyx_r = __pyx_v_self->messagenumber;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  /* "pygrib.pyx":463
+ *     def __exit__(self,atype,value,traceback):
+ *         self.close()
+ *     def tell(self):             # <<<<<<<<<<<<<<
+ *         """returns position of iterator (grib message number, 0 means iterator
+ *         is positioned at beginning of file)."""
+ */
+
+  /* function exit code */
   __pyx_L0:;
   __Pyx_XGIVEREF(__pyx_r);
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
+/* "pygrib.pyx":467
+ *         is positioned at beginning of file)."""
+ *         return self.messagenumber
+ *     def seek(self, msg, from_what=0):             # <<<<<<<<<<<<<<
+ *         """
+ *         seek(N,from_what=0)
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_6pygrib_4open_19seek(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static char __pyx_doc_6pygrib_4open_18seek[] = "\n        seek(N,from_what=0)\n        \n        advance iterator N grib messages from beginning of file \n        (if C{from_what=0}), from current position (if C{from_what=1})\n        or from the end of file (if C{from_what=2}).";
@@ -4035,7 +4299,7 @@ static PyObject *__pyx_pw_6pygrib_4open_19seek(PyObject *__pyx_v_self, PyObject
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("seek (wrapper)", 0);
   {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__msg,&__pyx_n_s__from_what,0};
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_msg,&__pyx_n_s_from_what,0};
     PyObject* values[2] = {0,0};
     values[1] = ((PyObject *)__pyx_int_0);
     if (unlikely(__pyx_kwds)) {
@@ -4050,16 +4314,16 @@ static PyObject *__pyx_pw_6pygrib_4open_19seek(PyObject *__pyx_v_self, PyObject
       kw_args = PyDict_Size(__pyx_kwds);
       switch (pos_args) {
         case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__msg)) != 0)) kw_args--;
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_msg)) != 0)) kw_args--;
         else goto __pyx_L5_argtuple_error;
         case  1:
         if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__from_what);
+          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_from_what);
           if (value) { values[1] = value; kw_args--; }
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "seek") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "seek") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -4074,40 +4338,35 @@ static PyObject *__pyx_pw_6pygrib_4open_19seek(PyObject *__pyx_v_self, PyObject
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("seek", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+  __Pyx_RaiseArgtupleInvalid("seek", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
   __pyx_L3_error:;
   __Pyx_AddTraceback("pygrib.open.seek", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
   return NULL;
   __pyx_L4_argument_unpacking_done:;
   __pyx_r = __pyx_pf_6pygrib_4open_18seek(((struct __pyx_obj_6pygrib_open *)__pyx_v_self), __pyx_v_msg, __pyx_v_from_what);
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "pygrib.pyx":473
- *         is positioned at beginning of file)."""
- *         return self.messagenumber
- *     def seek(self, msg, from_what=0):             # <<<<<<<<<<<<<<
- *         """
- *         seek(N,from_what=0)
- */
-
 static PyObject *__pyx_pf_6pygrib_4open_18seek(struct __pyx_obj_6pygrib_open *__pyx_v_self, PyObject *__pyx_v_msg, PyObject *__pyx_v_from_what) {
   PyObject *__pyx_r = NULL;
   __Pyx_RefNannyDeclarations
   PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_t_3;
+  int __pyx_t_2;
+  PyObject *__pyx_t_3 = NULL;
   int __pyx_t_4;
-  int __pyx_t_5;
+  PyObject *__pyx_t_5 = NULL;
   PyObject *__pyx_t_6 = NULL;
+  PyObject *__pyx_t_7 = NULL;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("seek", 0);
 
-  /* "pygrib.pyx":480
+  /* "pygrib.pyx":474
  *         (if C{from_what=0}), from current position (if C{from_what=1})
  *         or from the end of file (if C{from_what=2})."""
  *         if from_what not in [0,1,2]:             # <<<<<<<<<<<<<<
@@ -4116,98 +4375,113 @@ static PyObject *__pyx_pf_6pygrib_4open_18seek(struct __pyx_obj_6pygrib_open *__
  */
   __Pyx_INCREF(__pyx_v_from_what);
   __pyx_t_1 = __pyx_v_from_what;
-  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_0, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (((int)__pyx_t_3)) {
-    __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_1, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_5 = ((int)__pyx_t_4);
+  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_int_0, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (__pyx_t_4) {
   } else {
-    __pyx_t_5 = ((int)__pyx_t_3);
+    __pyx_t_2 = __pyx_t_4;
+    goto __pyx_L4_bool_binop_done;
   }
-  if (__pyx_t_5) {
-    __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_2, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_4 = ((int)__pyx_t_3);
+  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_int_1, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (__pyx_t_4) {
   } else {
-    __pyx_t_4 = __pyx_t_5;
+    __pyx_t_2 = __pyx_t_4;
+    goto __pyx_L4_bool_binop_done;
   }
+  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_int_2, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_t_2 = __pyx_t_4;
+  __pyx_L4_bool_binop_done:;
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_5 = (__pyx_t_4 != 0);
-  if (__pyx_t_5) {
+  __pyx_t_4 = (__pyx_t_2 != 0);
+  if (__pyx_t_4) {
 
-    /* "pygrib.pyx":481
+    /* "pygrib.pyx":475
  *         or from the end of file (if C{from_what=2})."""
  *         if from_what not in [0,1,2]:
  *             raise ValueError('from_what keyword arg to seek must be 0,1 or 2')             # <<<<<<<<<<<<<<
  *         if msg == 0:
  *             if from_what == 0:
  */
-    __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_9), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_Raise(__pyx_t_1, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L3;
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
-  __pyx_L3:;
 
-  /* "pygrib.pyx":482
+  /* "pygrib.pyx":476
  *         if from_what not in [0,1,2]:
  *             raise ValueError('from_what keyword arg to seek must be 0,1 or 2')
  *         if msg == 0:             # <<<<<<<<<<<<<<
  *             if from_what == 0:
  *                 self.rewind()
  */
-  __pyx_t_1 = PyObject_RichCompare(__pyx_v_msg, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyObject_RichCompare(__pyx_v_msg, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  if (__pyx_t_5) {
+  if (__pyx_t_4) {
 
-    /* "pygrib.pyx":483
+    /* "pygrib.pyx":477
  *             raise ValueError('from_what keyword arg to seek must be 0,1 or 2')
  *         if msg == 0:
  *             if from_what == 0:             # <<<<<<<<<<<<<<
  *                 self.rewind()
  *             elif from_what == 1:
  */
-    __pyx_t_1 = PyObject_RichCompare(__pyx_v_from_what, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = PyObject_RichCompare(__pyx_v_from_what, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    if (__pyx_t_5) {
+    if (__pyx_t_4) {
 
-      /* "pygrib.pyx":484
+      /* "pygrib.pyx":478
  *         if msg == 0:
  *             if from_what == 0:
  *                 self.rewind()             # <<<<<<<<<<<<<<
  *             elif from_what == 1:
  *                 return
  */
-      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__rewind); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_rewind); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_5 = NULL;
+      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
+        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
+        if (likely(__pyx_t_5)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+          __Pyx_INCREF(__pyx_t_5);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_3, function);
+        }
+      }
+      if (__pyx_t_5) {
+        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      } else {
+        __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      }
       __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      goto __pyx_L5;
+      goto __pyx_L8;
     }
 
-    /* "pygrib.pyx":485
+    /* "pygrib.pyx":479
  *             if from_what == 0:
  *                 self.rewind()
  *             elif from_what == 1:             # <<<<<<<<<<<<<<
  *                 return
  *             elif from_what == 2:
  */
-    __pyx_t_2 = PyObject_RichCompare(__pyx_v_from_what, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    if (__pyx_t_5) {
+    __pyx_t_1 = PyObject_RichCompare(__pyx_v_from_what, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    if (__pyx_t_4) {
 
-      /* "pygrib.pyx":486
+      /* "pygrib.pyx":480
  *                 self.rewind()
  *             elif from_what == 1:
  *                 return             # <<<<<<<<<<<<<<
@@ -4217,162 +4491,238 @@ static PyObject *__pyx_pf_6pygrib_4open_18seek(struct __pyx_obj_6pygrib_open *__
       __Pyx_XDECREF(__pyx_r);
       __pyx_r = Py_None; __Pyx_INCREF(Py_None);
       goto __pyx_L0;
-      goto __pyx_L5;
     }
 
-    /* "pygrib.pyx":487
+    /* "pygrib.pyx":481
  *             elif from_what == 1:
  *                 return
  *             elif from_what == 2:             # <<<<<<<<<<<<<<
  *                 self.message(self.messages)
  *         else:
  */
-    __pyx_t_2 = PyObject_RichCompare(__pyx_v_from_what, __pyx_int_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    if (__pyx_t_5) {
+    __pyx_t_1 = PyObject_RichCompare(__pyx_v_from_what, __pyx_int_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    if (__pyx_t_4) {
 
-      /* "pygrib.pyx":488
+      /* "pygrib.pyx":482
  *                 return
  *             elif from_what == 2:
  *                 self.message(self.messages)             # <<<<<<<<<<<<<<
  *         else:
  *             if from_what == 0:
  */
-      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__message); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __Pyx_INCREF(__pyx_v_self->messages);
-      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->messages);
-      __Pyx_GIVEREF(__pyx_v_self->messages);
-      __pyx_t_6 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_6);
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
-      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-      goto __pyx_L5;
+      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_message); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_5 = NULL;
+      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
+        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
+        if (likely(__pyx_t_5)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+          __Pyx_INCREF(__pyx_t_5);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_3, function);
+        }
+      }
+      if (!__pyx_t_5) {
+        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_self->messages); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_1);
+      } else {
+        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_6);
+        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
+        __Pyx_INCREF(__pyx_v_self->messages);
+        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_self->messages);
+        __Pyx_GIVEREF(__pyx_v_self->messages);
+        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_1);
+        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+      }
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      goto __pyx_L8;
     }
-    __pyx_L5:;
-    goto __pyx_L4;
+    __pyx_L8:;
+    goto __pyx_L7;
   }
   /*else*/ {
 
-    /* "pygrib.pyx":490
+    /* "pygrib.pyx":484
  *                 self.message(self.messages)
  *         else:
  *             if from_what == 0:             # <<<<<<<<<<<<<<
  *                 self.message(msg)
  *             elif from_what == 1:
  */
-    __pyx_t_6 = PyObject_RichCompare(__pyx_v_from_what, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    if (__pyx_t_5) {
+    __pyx_t_1 = PyObject_RichCompare(__pyx_v_from_what, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    if (__pyx_t_4) {
 
-      /* "pygrib.pyx":491
+      /* "pygrib.pyx":485
  *         else:
  *             if from_what == 0:
  *                 self.message(msg)             # <<<<<<<<<<<<<<
  *             elif from_what == 1:
  *                 self.message(self.messagenumber+msg)
  */
-      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__message); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_6);
-      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __Pyx_INCREF(__pyx_v_msg);
-      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_msg);
-      __Pyx_GIVEREF(__pyx_v_msg);
-      __pyx_t_2 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      goto __pyx_L6;
+      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_message); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_6 = NULL;
+      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
+        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
+        if (likely(__pyx_t_6)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+          __Pyx_INCREF(__pyx_t_6);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_3, function);
+        }
+      }
+      if (!__pyx_t_6) {
+        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_msg); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_1);
+      } else {
+        __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_5);
+        PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
+        __Pyx_INCREF(__pyx_v_msg);
+        PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_msg);
+        __Pyx_GIVEREF(__pyx_v_msg);
+        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_1);
+        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      }
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      goto __pyx_L9;
     }
 
-    /* "pygrib.pyx":492
+    /* "pygrib.pyx":486
  *             if from_what == 0:
  *                 self.message(msg)
  *             elif from_what == 1:             # <<<<<<<<<<<<<<
  *                 self.message(self.messagenumber+msg)
  *             elif from_what == 2:
  */
-    __pyx_t_2 = PyObject_RichCompare(__pyx_v_from_what, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    if (__pyx_t_5) {
+    __pyx_t_1 = PyObject_RichCompare(__pyx_v_from_what, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    if (__pyx_t_4) {
 
-      /* "pygrib.pyx":493
+      /* "pygrib.pyx":487
  *                 self.message(msg)
  *             elif from_what == 1:
  *                 self.message(self.messagenumber+msg)             # <<<<<<<<<<<<<<
  *             elif from_what == 2:
  *                 self.message(self.messages+msg)
  */
-      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__message); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __pyx_t_1 = PyNumber_Add(__pyx_v_self->messagenumber, __pyx_v_msg); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_6);
-      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
-      __Pyx_GIVEREF(__pyx_t_1);
-      __pyx_t_1 = 0;
-      __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
+      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_message); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_5 = PyNumber_Add(__pyx_v_self->messagenumber, __pyx_v_msg); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_5);
+      __pyx_t_6 = NULL;
+      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
+        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
+        if (likely(__pyx_t_6)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+          __Pyx_INCREF(__pyx_t_6);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_3, function);
+        }
+      }
+      if (!__pyx_t_6) {
+        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+        __Pyx_GOTREF(__pyx_t_1);
+      } else {
+        __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_7);
+        PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
+        PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5);
+        __Pyx_GIVEREF(__pyx_t_5);
+        __pyx_t_5 = 0;
+        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_1);
+        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+      }
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      goto __pyx_L6;
+      goto __pyx_L9;
     }
 
-    /* "pygrib.pyx":494
+    /* "pygrib.pyx":488
  *             elif from_what == 1:
  *                 self.message(self.messagenumber+msg)
  *             elif from_what == 2:             # <<<<<<<<<<<<<<
  *                 self.message(self.messages+msg)
  *     def readline(self):
  */
-    __pyx_t_1 = PyObject_RichCompare(__pyx_v_from_what, __pyx_int_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = PyObject_RichCompare(__pyx_v_from_what, __pyx_int_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    if (__pyx_t_5) {
+    if (__pyx_t_4) {
 
-      /* "pygrib.pyx":495
+      /* "pygrib.pyx":489
  *                 self.message(self.messagenumber+msg)
  *             elif from_what == 2:
  *                 self.message(self.messages+msg)             # <<<<<<<<<<<<<<
  *     def readline(self):
  *         """
  */
-      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__message); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_6 = PyNumber_Add(__pyx_v_self->messages, __pyx_v_msg); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_6);
-      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6);
-      __Pyx_GIVEREF(__pyx_t_6);
-      __pyx_t_6 = 0;
-      __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_6);
+      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_message); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_7 = PyNumber_Add(__pyx_v_self->messages, __pyx_v_msg); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_7);
+      __pyx_t_5 = NULL;
+      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
+        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
+        if (likely(__pyx_t_5)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+          __Pyx_INCREF(__pyx_t_5);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_3, function);
+        }
+      }
+      if (!__pyx_t_5) {
+        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+        __Pyx_GOTREF(__pyx_t_1);
+      } else {
+        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_6);
+        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
+        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_7);
+        __Pyx_GIVEREF(__pyx_t_7);
+        __pyx_t_7 = 0;
+        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_1);
+        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+      }
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
-      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-      goto __pyx_L6;
+      goto __pyx_L9;
     }
-    __pyx_L6:;
+    __pyx_L9:;
   }
-  __pyx_L4:;
+  __pyx_L7:;
+
+  /* "pygrib.pyx":467
+ *         is positioned at beginning of file)."""
+ *         return self.messagenumber
+ *     def seek(self, msg, from_what=0):             # <<<<<<<<<<<<<<
+ *         """
+ *         seek(N,from_what=0)
+ */
 
+  /* function exit code */
   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
   goto __pyx_L0;
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_5);
   __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_7);
   __Pyx_AddTraceback("pygrib.open.seek", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_r = NULL;
   __pyx_L0:;
@@ -4381,26 +4731,28 @@ static PyObject *__pyx_pf_6pygrib_4open_18seek(struct __pyx_obj_6pygrib_open *__
   return __pyx_r;
 }
 
-/* Python wrapper */
-static PyObject *__pyx_pw_6pygrib_4open_21readline(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static char __pyx_doc_6pygrib_4open_20readline[] = "\n        readline()\n\n        read one entire grib message from the file.\n        Returns a L{gribmessage} instance, or None if an EOF is encountered.";
+/* "pygrib.pyx":490
+ *             elif from_what == 2:
+ *                 self.message(self.messages+msg)
+ *     def readline(self):             # <<<<<<<<<<<<<<
+ *         """
+ *         readline()
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6pygrib_4open_21readline(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6pygrib_4open_20readline[] = "\n        readline()\n\n        read one entire grib message from the file.\n        Returns a L{gribmessage} instance, or None if an EOF is encountered.";
 static PyObject *__pyx_pw_6pygrib_4open_21readline(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("readline (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_4open_20readline(((struct __pyx_obj_6pygrib_open *)__pyx_v_self));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "pygrib.pyx":496
- *             elif from_what == 2:
- *                 self.message(self.messages+msg)
- *     def readline(self):             # <<<<<<<<<<<<<<
- *         """
- *         readline()
- */
-
 static PyObject *__pyx_pf_6pygrib_4open_20readline(struct __pyx_obj_6pygrib_open *__pyx_v_self) {
   PyObject *__pyx_v_grb = NULL;
   PyObject *__pyx_r = NULL;
@@ -4412,14 +4764,14 @@ static PyObject *__pyx_pf_6pygrib_4open_20readline(struct __pyx_obj_6pygrib_open
   int __pyx_t_5;
   PyObject *__pyx_t_6 = NULL;
   PyObject *__pyx_t_7 = NULL;
-  int __pyx_t_8;
-  PyObject *__pyx_t_9 = NULL;
+  PyObject *__pyx_t_8 = NULL;
+  int __pyx_t_9;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("readline", 0);
 
-  /* "pygrib.pyx":502
+  /* "pygrib.pyx":496
  *         read one entire grib message from the file.
  *         Returns a L{gribmessage} instance, or None if an EOF is encountered."""
  *         try:             # <<<<<<<<<<<<<<
@@ -4433,46 +4785,61 @@ static PyObject *__pyx_pf_6pygrib_4open_20readline(struct __pyx_obj_6pygrib_open
     __Pyx_XGOTREF(__pyx_t_3);
     /*try:*/ {
 
-      /* "pygrib.pyx":503
+      /* "pygrib.pyx":497
  *         Returns a L{gribmessage} instance, or None if an EOF is encountered."""
  *         try:
  *             if hasattr(self,'next'):             # <<<<<<<<<<<<<<
  *                 grb = self.next()
  *             else:
  */
-      __pyx_t_4 = PyObject_HasAttr(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__next)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+      __pyx_t_4 = PyObject_HasAttr(((PyObject *)__pyx_v_self), __pyx_n_s_next); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       __pyx_t_5 = (__pyx_t_4 != 0);
       if (__pyx_t_5) {
 
-        /* "pygrib.pyx":504
+        /* "pygrib.pyx":498
  *         try:
  *             if hasattr(self,'next'):
  *                 grb = self.next()             # <<<<<<<<<<<<<<
  *             else:
  *                 grb = next(self)
  */
-        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__next); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        __Pyx_GOTREF(__pyx_t_6);
-        __pyx_t_7 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_next); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         __Pyx_GOTREF(__pyx_t_7);
-        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-        __pyx_v_grb = __pyx_t_7;
-        __pyx_t_7 = 0;
+        __pyx_t_8 = NULL;
+        if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) {
+          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
+          if (likely(__pyx_t_8)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
+            __Pyx_INCREF(__pyx_t_8);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_7, function);
+          }
+        }
+        if (__pyx_t_8) {
+          __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+        } else {
+          __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        }
+        __Pyx_GOTREF(__pyx_t_6);
+        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+        __pyx_v_grb = __pyx_t_6;
+        __pyx_t_6 = 0;
         goto __pyx_L11;
       }
       /*else*/ {
 
-        /* "pygrib.pyx":506
+        /* "pygrib.pyx":500
  *                 grb = self.next()
  *             else:
  *                 grb = next(self)             # <<<<<<<<<<<<<<
  *         except StopIteration:
  *             grb = None
  */
-        __pyx_t_7 = __Pyx_PyIter_Next(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        __Pyx_GOTREF(__pyx_t_7);
-        __pyx_v_grb = __pyx_t_7;
-        __pyx_t_7 = 0;
+        __pyx_t_6 = __Pyx_PyIter_Next(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __Pyx_GOTREF(__pyx_t_6);
+        __pyx_v_grb = __pyx_t_6;
+        __pyx_t_6 = 0;
       }
       __pyx_L11:;
     }
@@ -4481,25 +4848,26 @@ static PyObject *__pyx_pf_6pygrib_4open_20readline(struct __pyx_obj_6pygrib_open
     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
     goto __pyx_L10_try_end;
     __pyx_L3_error:;
-    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
 
-    /* "pygrib.pyx":507
+    /* "pygrib.pyx":501
  *             else:
  *                 grb = next(self)
  *         except StopIteration:             # <<<<<<<<<<<<<<
  *             grb = None
  *         return grb
  */
-    __pyx_t_8 = PyErr_ExceptionMatches(__pyx_builtin_StopIteration);
-    if (__pyx_t_8) {
+    __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_StopIteration);
+    if (__pyx_t_9) {
       __Pyx_AddTraceback("pygrib.open.readline", __pyx_clineno, __pyx_lineno, __pyx_filename);
-      if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_6, &__pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
-      __Pyx_GOTREF(__pyx_t_7);
+      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
       __Pyx_GOTREF(__pyx_t_6);
-      __Pyx_GOTREF(__pyx_t_9);
+      __Pyx_GOTREF(__pyx_t_7);
+      __Pyx_GOTREF(__pyx_t_8);
 
-      /* "pygrib.pyx":508
+      /* "pygrib.pyx":502
  *                 grb = next(self)
  *         except StopIteration:
  *             grb = None             # <<<<<<<<<<<<<<
@@ -4508,11 +4876,12 @@ static PyObject *__pyx_pf_6pygrib_4open_20readline(struct __pyx_obj_6pygrib_open
  */
       __Pyx_INCREF(Py_None);
       __Pyx_XDECREF_SET(__pyx_v_grb, Py_None);
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
       goto __pyx_L4_exception_handled;
     }
+    goto __pyx_L5_except_error;
     __pyx_L5_except_error:;
     __Pyx_XGIVEREF(__pyx_t_1);
     __Pyx_XGIVEREF(__pyx_t_2);
@@ -4527,7 +4896,7 @@ static PyObject *__pyx_pf_6pygrib_4open_20readline(struct __pyx_obj_6pygrib_open
     __pyx_L10_try_end:;
   }
 
-  /* "pygrib.pyx":509
+  /* "pygrib.pyx":503
  *         except StopIteration:
  *             grb = None
  *         return grb             # <<<<<<<<<<<<<<
@@ -4539,12 +4908,19 @@ static PyObject *__pyx_pf_6pygrib_4open_20readline(struct __pyx_obj_6pygrib_open
   __pyx_r = __pyx_v_grb;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "pygrib.pyx":490
+ *             elif from_what == 2:
+ *                 self.message(self.messages+msg)
+ *     def readline(self):             # <<<<<<<<<<<<<<
+ *         """
+ *         readline()
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_6);
   __Pyx_XDECREF(__pyx_t_7);
-  __Pyx_XDECREF(__pyx_t_9);
+  __Pyx_XDECREF(__pyx_t_8);
   __Pyx_AddTraceback("pygrib.open.readline", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_r = NULL;
   __pyx_L0:;
@@ -4554,6 +4930,14 @@ static PyObject *__pyx_pf_6pygrib_4open_20readline(struct __pyx_obj_6pygrib_open
   return __pyx_r;
 }
 
+/* "pygrib.pyx":504
+ *             grb = None
+ *         return grb
+ *     def read(self,msgs=None):             # <<<<<<<<<<<<<<
+ *         """
+ *         read(N=None)
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_6pygrib_4open_23read(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static char __pyx_doc_6pygrib_4open_22read[] = "\n        read(N=None)\n        \n        read N messages from current position, returning grib messages instances in a\n        list.  If N=None, all the messages to the end of the file are read.\n        C{pygrib.open(f).read()} is equivalent to C{list(pygrib.open(f))},\n        both return a list containing L{gribmessage} instances for all the\n        grib messages in the file C{f}.\n        ";
@@ -4566,16 +4950,8 @@ static PyObject *__pyx_pw_6pygrib_4open_23read(PyObject *__pyx_v_self, PyObject
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("read (wrapper)", 0);
   {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__msgs,0};
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_msgs,0};
     PyObject* values[1] = {0};
-
-    /* "pygrib.pyx":510
- *             grb = None
- *         return grb
- *     def read(self,msgs=None):             # <<<<<<<<<<<<<<
- *         """
- *         read(N=None)
- */
     values[0] = ((PyObject *)Py_None);
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
@@ -4589,12 +4965,12 @@ static PyObject *__pyx_pw_6pygrib_4open_23read(PyObject *__pyx_v_self, PyObject
       switch (pos_args) {
         case  0:
         if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__msgs);
+          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_msgs);
           if (value) { values[0] = value; kw_args--; }
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -4607,13 +4983,15 @@ static PyObject *__pyx_pw_6pygrib_4open_23read(PyObject *__pyx_v_self, PyObject
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("read", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+  __Pyx_RaiseArgtupleInvalid("read", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
   __pyx_L3_error:;
   __Pyx_AddTraceback("pygrib.open.read", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
   return NULL;
   __pyx_L4_argument_unpacking_done:;
   __pyx_r = __pyx_pf_6pygrib_4open_22read(((struct __pyx_obj_6pygrib_open *)__pyx_v_self), __pyx_v_msgs);
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
@@ -4633,7 +5011,7 @@ static PyObject *__pyx_pf_6pygrib_4open_22read(struct __pyx_obj_6pygrib_open *__
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("read", 0);
 
-  /* "pygrib.pyx":520
+  /* "pygrib.pyx":514
  *         grib messages in the file C{f}.
  *         """
  *         if msgs is None:             # <<<<<<<<<<<<<<
@@ -4644,70 +5022,64 @@ static PyObject *__pyx_pf_6pygrib_4open_22read(struct __pyx_obj_6pygrib_open *__
   __pyx_t_2 = (__pyx_t_1 != 0);
   if (__pyx_t_2) {
 
-    /* "pygrib.pyx":521
+    /* "pygrib.pyx":515
  *         """
  *         if msgs is None:
  *             grbs = self._advance(self.messages-self.messagenumber,return_msgs=True)             # <<<<<<<<<<<<<<
  *         else:
  *             grbs = self._advance(msgs,return_msgs=True)
  */
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s___advance); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_advance); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_4 = PyNumber_Subtract(__pyx_v_self->messages, __pyx_v_self->messagenumber); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = PyNumber_Subtract(__pyx_v_self->messages, __pyx_v_self->messagenumber); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_5);
     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
     __Pyx_GIVEREF(__pyx_t_4);
     __pyx_t_4 = 0;
-    __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
-    __pyx_t_6 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__return_msgs), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    __pyx_t_6 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return_msgs, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_6);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __pyx_v_grbs = __pyx_t_6;
     __pyx_t_6 = 0;
     goto __pyx_L3;
   }
   /*else*/ {
 
-    /* "pygrib.pyx":523
+    /* "pygrib.pyx":517
  *             grbs = self._advance(self.messages-self.messagenumber,return_msgs=True)
  *         else:
  *             grbs = self._advance(msgs,return_msgs=True)             # <<<<<<<<<<<<<<
  *         return grbs
  *     def close(self):
  */
-    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s___advance); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_advance); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_6);
-    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_INCREF(__pyx_v_msgs);
     PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_msgs);
     __Pyx_GIVEREF(__pyx_v_msgs);
-    __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
-    __pyx_t_3 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__return_msgs), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_3 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_return_msgs, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     __pyx_v_grbs = __pyx_t_3;
     __pyx_t_3 = 0;
   }
   __pyx_L3:;
 
-  /* "pygrib.pyx":524
+  /* "pygrib.pyx":518
  *         else:
  *             grbs = self._advance(msgs,return_msgs=True)
  *         return grbs             # <<<<<<<<<<<<<<
@@ -4719,8 +5091,15 @@ static PyObject *__pyx_pf_6pygrib_4open_22read(struct __pyx_obj_6pygrib_open *__
   __pyx_r = __pyx_v_grbs;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "pygrib.pyx":504
+ *             grb = None
+ *         return grb
+ *     def read(self,msgs=None):             # <<<<<<<<<<<<<<
+ *         """
+ *         read(N=None)
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_3);
   __Pyx_XDECREF(__pyx_t_4);
@@ -4735,6 +5114,14 @@ static PyObject *__pyx_pf_6pygrib_4open_22read(struct __pyx_obj_6pygrib_open *__
   return __pyx_r;
 }
 
+/* "pygrib.pyx":519
+ *             grbs = self._advance(msgs,return_msgs=True)
+ *         return grbs
+ *     def close(self):             # <<<<<<<<<<<<<<
+ *         """
+ *         close()
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_6pygrib_4open_25close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
 static char __pyx_doc_6pygrib_4open_24close[] = "\n        close()\n\n        close GRIB file, deallocate C structures associated with class instance";
@@ -4743,18 +5130,12 @@ static PyObject *__pyx_pw_6pygrib_4open_25close(PyObject *__pyx_v_self, CYTHON_U
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("close (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_4open_24close(((struct __pyx_obj_6pygrib_open *)__pyx_v_self));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "pygrib.pyx":525
- *             grbs = self._advance(msgs,return_msgs=True)
- *         return grbs
- *     def close(self):             # <<<<<<<<<<<<<<
- *         """
- *         close()
- */
-
 static PyObject *__pyx_pf_6pygrib_4open_24close(struct __pyx_obj_6pygrib_open *__pyx_v_self) {
   int __pyx_v_err;
   PyObject *__pyx_r = NULL;
@@ -4767,7 +5148,7 @@ static PyObject *__pyx_pf_6pygrib_4open_24close(struct __pyx_obj_6pygrib_open *_
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("close", 0);
 
-  /* "pygrib.pyx":531
+  /* "pygrib.pyx":525
  *         close GRIB file, deallocate C structures associated with class instance"""
  *         cdef int err
  *         fclose(self._fd)             # <<<<<<<<<<<<<<
@@ -4776,7 +5157,7 @@ static PyObject *__pyx_pf_6pygrib_4open_24close(struct __pyx_obj_6pygrib_open *_
  */
   fclose(__pyx_v_self->_fd);
 
-  /* "pygrib.pyx":532
+  /* "pygrib.pyx":526
  *         cdef int err
  *         fclose(self._fd)
  *         if self._gh != NULL:             # <<<<<<<<<<<<<<
@@ -4786,7 +5167,7 @@ static PyObject *__pyx_pf_6pygrib_4open_24close(struct __pyx_obj_6pygrib_open *_
   __pyx_t_1 = ((__pyx_v_self->_gh != NULL) != 0);
   if (__pyx_t_1) {
 
-    /* "pygrib.pyx":533
+    /* "pygrib.pyx":527
  *         fclose(self._fd)
  *         if self._gh != NULL:
  *             err = grib_handle_delete(self._gh)             # <<<<<<<<<<<<<<
@@ -4795,7 +5176,7 @@ static PyObject *__pyx_pf_6pygrib_4open_24close(struct __pyx_obj_6pygrib_open *_
  */
     __pyx_v_err = grib_handle_delete(__pyx_v_self->_gh);
 
-    /* "pygrib.pyx":534
+    /* "pygrib.pyx":528
  *         if self._gh != NULL:
  *             err = grib_handle_delete(self._gh)
  *             if err:             # <<<<<<<<<<<<<<
@@ -4805,49 +5186,45 @@ static PyObject *__pyx_pf_6pygrib_4open_24close(struct __pyx_obj_6pygrib_open *_
     __pyx_t_1 = (__pyx_v_err != 0);
     if (__pyx_t_1) {
 
-      /* "pygrib.pyx":535
+      /* "pygrib.pyx":529
  *             err = grib_handle_delete(self._gh)
  *             if err:
  *                 raise RuntimeError(grib_get_error_message(err))             # <<<<<<<<<<<<<<
  *         self.closed = True
  *         self._fd = NULL
  */
-      __pyx_t_2 = __Pyx_PyBytes_FromString(grib_get_error_message(__pyx_v_err)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
-      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_2 = __Pyx_PyBytes_FromString(grib_get_error_message(__pyx_v_err)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_3);
-      PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_2));
-      __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
+      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
+      __Pyx_GIVEREF(__pyx_t_2);
       __pyx_t_2 = 0;
-      __pyx_t_2 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_2);
-      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
       __Pyx_Raise(__pyx_t_2, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      goto __pyx_L4;
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     }
-    __pyx_L4:;
     goto __pyx_L3;
   }
   __pyx_L3:;
 
-  /* "pygrib.pyx":536
+  /* "pygrib.pyx":530
  *             if err:
  *                 raise RuntimeError(grib_get_error_message(err))
  *         self.closed = True             # <<<<<<<<<<<<<<
  *         self._fd = NULL
  * 
  */
-  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_GIVEREF(__pyx_t_2);
+  __Pyx_INCREF(Py_True);
+  __Pyx_GIVEREF(Py_True);
   __Pyx_GOTREF(__pyx_v_self->closed);
   __Pyx_DECREF(__pyx_v_self->closed);
-  __pyx_v_self->closed = __pyx_t_2;
-  __pyx_t_2 = 0;
+  __pyx_v_self->closed = Py_True;
 
-  /* "pygrib.pyx":537
+  /* "pygrib.pyx":531
  *                 raise RuntimeError(grib_get_error_message(err))
  *         self.closed = True
  *         self._fd = NULL             # <<<<<<<<<<<<<<
@@ -4856,6 +5233,15 @@ static PyObject *__pyx_pf_6pygrib_4open_24close(struct __pyx_obj_6pygrib_open *_
  */
   __pyx_v_self->_fd = NULL;
 
+  /* "pygrib.pyx":519
+ *             grbs = self._advance(msgs,return_msgs=True)
+ *         return grbs
+ *     def close(self):             # <<<<<<<<<<<<<<
+ *         """
+ *         close()
+ */
+
+  /* function exit code */
   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
   goto __pyx_L0;
   __pyx_L1_error:;
@@ -4869,29 +5255,31 @@ static PyObject *__pyx_pf_6pygrib_4open_24close(struct __pyx_obj_6pygrib_open *_
   return __pyx_r;
 }
 
+/* "pygrib.pyx":533
+ *         self._fd = NULL
+ * 
+ *     def __dealloc__(self):             # <<<<<<<<<<<<<<
+ *         # close file handle if there are no more references
+ *         # to the object.
+ */
+
 /* Python wrapper */
 static void __pyx_pw_6pygrib_4open_27__dealloc__(PyObject *__pyx_v_self); /*proto*/
 static void __pyx_pw_6pygrib_4open_27__dealloc__(PyObject *__pyx_v_self) {
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
   __pyx_pf_6pygrib_4open_26__dealloc__(((struct __pyx_obj_6pygrib_open *)__pyx_v_self));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
 }
 
-/* "pygrib.pyx":539
- *         self._fd = NULL
- * 
- *     def __dealloc__(self):             # <<<<<<<<<<<<<<
- *         # close file handle if there are no more references
- *         # to the object.
- */
-
 static void __pyx_pf_6pygrib_4open_26__dealloc__(struct __pyx_obj_6pygrib_open *__pyx_v_self) {
   __Pyx_RefNannyDeclarations
   int __pyx_t_1;
   __Pyx_RefNannySetupContext("__dealloc__", 0);
 
-  /* "pygrib.pyx":543
+  /* "pygrib.pyx":537
  *         # to the object.
  *         cdef int err
  *         if self._fd:             # <<<<<<<<<<<<<<
@@ -4901,7 +5289,7 @@ static void __pyx_pf_6pygrib_4open_26__dealloc__(struct __pyx_obj_6pygrib_open *
   __pyx_t_1 = (__pyx_v_self->_fd != 0);
   if (__pyx_t_1) {
 
-    /* "pygrib.pyx":544
+    /* "pygrib.pyx":538
  *         cdef int err
  *         if self._fd:
  *             fclose(self._fd)             # <<<<<<<<<<<<<<
@@ -4913,9 +5301,26 @@ static void __pyx_pf_6pygrib_4open_26__dealloc__(struct __pyx_obj_6pygrib_open *
   }
   __pyx_L3:;
 
+  /* "pygrib.pyx":533
+ *         self._fd = NULL
+ * 
+ *     def __dealloc__(self):             # <<<<<<<<<<<<<<
+ *         # close file handle if there are no more references
+ *         # to the object.
+ */
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
 }
 
+/* "pygrib.pyx":540
+ *             fclose(self._fd)
+ * 
+ *     def rewind(self):             # <<<<<<<<<<<<<<
+ *         """rewind iterator (same as seek(0))"""
+ *         # before rewinding, move iterator to end of file
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_6pygrib_4open_29rewind(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
 static char __pyx_doc_6pygrib_4open_28rewind[] = "rewind iterator (same as seek(0))";
@@ -4924,18 +5329,12 @@ static PyObject *__pyx_pw_6pygrib_4open_29rewind(PyObject *__pyx_v_self, CYTHON_
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("rewind (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_4open_28rewind(((struct __pyx_obj_6pygrib_open *)__pyx_v_self));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "pygrib.pyx":546
- *             fclose(self._fd)
- * 
- *     def rewind(self):             # <<<<<<<<<<<<<<
- *         """rewind iterator (same as seek(0))"""
- *         # before rewinding, move iterator to end of file
- */
-
 static PyObject *__pyx_pf_6pygrib_4open_28rewind(struct __pyx_obj_6pygrib_open *__pyx_v_self) {
   grib_handle *__pyx_v_gh;
   int __pyx_v_err;
@@ -4944,7 +5343,7 @@ static PyObject *__pyx_pf_6pygrib_4open_28rewind(struct __pyx_obj_6pygrib_open *
   int __pyx_t_1;
   __Pyx_RefNannySetupContext("rewind", 0);
 
-  /* "pygrib.pyx":551
+  /* "pygrib.pyx":545
  *         # to make sure it is not left in a funky state
  *         # (such as in the middle of a multi-part message, issue 54)
  *         while 1:             # <<<<<<<<<<<<<<
@@ -4952,9 +5351,8 @@ static PyObject *__pyx_pf_6pygrib_4open_28rewind(struct __pyx_obj_6pygrib_open *
  *             err = grib_handle_delete(gh)
  */
   while (1) {
-    if (!1) break;
 
-    /* "pygrib.pyx":552
+    /* "pygrib.pyx":546
  *         # (such as in the middle of a multi-part message, issue 54)
  *         while 1:
  *             gh = grib_handle_new_from_file(NULL, self._fd, &err)             # <<<<<<<<<<<<<<
@@ -4963,7 +5361,7 @@ static PyObject *__pyx_pf_6pygrib_4open_28rewind(struct __pyx_obj_6pygrib_open *
  */
     __pyx_v_gh = grib_handle_new_from_file(NULL, __pyx_v_self->_fd, (&__pyx_v_err));
 
-    /* "pygrib.pyx":553
+    /* "pygrib.pyx":547
  *         while 1:
  *             gh = grib_handle_new_from_file(NULL, self._fd, &err)
  *             err = grib_handle_delete(gh)             # <<<<<<<<<<<<<<
@@ -4972,7 +5370,7 @@ static PyObject *__pyx_pf_6pygrib_4open_28rewind(struct __pyx_obj_6pygrib_open *
  */
     __pyx_v_err = grib_handle_delete(__pyx_v_gh);
 
-    /* "pygrib.pyx":554
+    /* "pygrib.pyx":548
  *             gh = grib_handle_new_from_file(NULL, self._fd, &err)
  *             err = grib_handle_delete(gh)
  *             if gh == NULL: break             # <<<<<<<<<<<<<<
@@ -4982,13 +5380,11 @@ static PyObject *__pyx_pf_6pygrib_4open_28rewind(struct __pyx_obj_6pygrib_open *
     __pyx_t_1 = ((__pyx_v_gh == NULL) != 0);
     if (__pyx_t_1) {
       goto __pyx_L4_break;
-      goto __pyx_L5;
     }
-    __pyx_L5:;
   }
   __pyx_L4_break:;
 
-  /* "pygrib.pyx":555
+  /* "pygrib.pyx":549
  *             err = grib_handle_delete(gh)
  *             if gh == NULL: break
  *         rewind(self._fd)             # <<<<<<<<<<<<<<
@@ -4997,7 +5393,7 @@ static PyObject *__pyx_pf_6pygrib_4open_28rewind(struct __pyx_obj_6pygrib_open *
  */
   rewind(__pyx_v_self->_fd);
 
-  /* "pygrib.pyx":556
+  /* "pygrib.pyx":550
  *             if gh == NULL: break
  *         rewind(self._fd)
  *         self.messagenumber = 0             # <<<<<<<<<<<<<<
@@ -5010,12 +5406,29 @@ static PyObject *__pyx_pf_6pygrib_4open_28rewind(struct __pyx_obj_6pygrib_open *
   __Pyx_DECREF(__pyx_v_self->messagenumber);
   __pyx_v_self->messagenumber = __pyx_int_0;
 
+  /* "pygrib.pyx":540
+ *             fclose(self._fd)
+ * 
+ *     def rewind(self):             # <<<<<<<<<<<<<<
+ *         """rewind iterator (same as seek(0))"""
+ *         # before rewinding, move iterator to end of file
+ */
+
+  /* function exit code */
   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
   __Pyx_XGIVEREF(__pyx_r);
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
+/* "pygrib.pyx":551
+ *         rewind(self._fd)
+ *         self.messagenumber = 0
+ *     def message(self, N):             # <<<<<<<<<<<<<<
+ *         """
+ *         message(N)
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_6pygrib_4open_31message(PyObject *__pyx_v_self, PyObject *__pyx_v_N); /*proto*/
 static char __pyx_doc_6pygrib_4open_30message[] = "\n        message(N)\n        \n        retrieve N'th message in iterator.\n        same as seek(N-1) followed by readline().";
@@ -5024,18 +5437,12 @@ static PyObject *__pyx_pw_6pygrib_4open_31message(PyObject *__pyx_v_self, PyObje
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("message (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_4open_30message(((struct __pyx_obj_6pygrib_open *)__pyx_v_self), ((PyObject *)__pyx_v_N));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "pygrib.pyx":557
- *         rewind(self._fd)
- *         self.messagenumber = 0
- *     def message(self, N):             # <<<<<<<<<<<<<<
- *         """
- *         message(N)
- */
-
 static PyObject *__pyx_pf_6pygrib_4open_30message(struct __pyx_obj_6pygrib_open *__pyx_v_self, PyObject *__pyx_v_N) {
   PyObject *__pyx_r = NULL;
   __Pyx_RefNannyDeclarations
@@ -5043,91 +5450,123 @@ static PyObject *__pyx_pf_6pygrib_4open_30message(struct __pyx_obj_6pygrib_open
   int __pyx_t_2;
   PyObject *__pyx_t_3 = NULL;
   PyObject *__pyx_t_4 = NULL;
+  PyObject *__pyx_t_5 = NULL;
+  PyObject *__pyx_t_6 = NULL;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("message", 0);
 
-  /* "pygrib.pyx":563
+  /* "pygrib.pyx":557
  *         retrieve N'th message in iterator.
  *         same as seek(N-1) followed by readline()."""
  *         if N < 1:             # <<<<<<<<<<<<<<
  *             raise IOError('grb message numbers start at 1')
  *         # if iterator positioned past message N, reposition at beginning.
  */
-  __pyx_t_1 = PyObject_RichCompare(__pyx_v_N, __pyx_int_1, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyObject_RichCompare(__pyx_v_N, __pyx_int_1, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (__pyx_t_2) {
 
-    /* "pygrib.pyx":564
+    /* "pygrib.pyx":558
  *         same as seek(N-1) followed by readline()."""
  *         if N < 1:
  *             raise IOError('grb message numbers start at 1')             # <<<<<<<<<<<<<<
  *         # if iterator positioned past message N, reposition at beginning.
  *         if self.messagenumber >= N:
  */
-    __pyx_t_1 = PyObject_Call(__pyx_builtin_IOError, ((PyObject *)__pyx_k_tuple_11), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_Raise(__pyx_t_1, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L3;
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
-  __pyx_L3:;
 
-  /* "pygrib.pyx":566
+  /* "pygrib.pyx":560
  *             raise IOError('grb message numbers start at 1')
  *         # if iterator positioned past message N, reposition at beginning.
  *         if self.messagenumber >= N:             # <<<<<<<<<<<<<<
  *             self.rewind()
  *         # move iterator forward to message N.
  */
-  __pyx_t_1 = PyObject_RichCompare(__pyx_v_self->messagenumber, __pyx_v_N, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyObject_RichCompare(__pyx_v_self->messagenumber, __pyx_v_N, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (__pyx_t_2) {
 
-    /* "pygrib.pyx":567
+    /* "pygrib.pyx":561
  *         # if iterator positioned past message N, reposition at beginning.
  *         if self.messagenumber >= N:
  *             self.rewind()             # <<<<<<<<<<<<<<
  *         # move iterator forward to message N.
  *         self._advance(N-self.messagenumber)
  */
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__rewind); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_rewind); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_t_4 = NULL;
+    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
+      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+      if (likely(__pyx_t_4)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+        __Pyx_INCREF(__pyx_t_4);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_3, function);
+      }
+    }
+    if (__pyx_t_4) {
+      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    } else {
+      __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    }
+    __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     goto __pyx_L4;
   }
   __pyx_L4:;
 
-  /* "pygrib.pyx":569
+  /* "pygrib.pyx":563
  *             self.rewind()
  *         # move iterator forward to message N.
  *         self._advance(N-self.messagenumber)             # <<<<<<<<<<<<<<
  *         return _create_gribmessage(self._gh, self.messagenumber)
  *     def select(self, **kwargs):
  */
-  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s___advance); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_advance); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_1 = PyNumber_Subtract(__pyx_v_N, __pyx_v_self->messagenumber); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = PyNumber_Subtract(__pyx_v_N, __pyx_v_self->messagenumber); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
-  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
-  __Pyx_GIVEREF(__pyx_t_1);
-  __pyx_t_1 = 0;
-  __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_5 = NULL;
+  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
+    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
+    if (likely(__pyx_t_5)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+      __Pyx_INCREF(__pyx_t_5);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_3, function);
+    }
+  }
+  if (!__pyx_t_5) {
+    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+  } else {
+    __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_6);
+    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
+    PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4);
+    __Pyx_GIVEREF(__pyx_t_4);
+    __pyx_t_4 = 0;
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  }
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "pygrib.pyx":570
+  /* "pygrib.pyx":564
  *         # move iterator forward to message N.
  *         self._advance(N-self.messagenumber)
  *         return _create_gribmessage(self._gh, self.messagenumber)             # <<<<<<<<<<<<<<
@@ -5137,19 +5576,28 @@ static PyObject *__pyx_pf_6pygrib_4open_30message(struct __pyx_obj_6pygrib_open
   __Pyx_XDECREF(__pyx_r);
   __pyx_t_1 = __pyx_v_self->messagenumber;
   __Pyx_INCREF(__pyx_t_1);
-  __pyx_t_4 = __pyx_f_6pygrib__create_gribmessage(__pyx_v_self->_gh, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_3 = __pyx_f_6pygrib__create_gribmessage(__pyx_v_self->_gh, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_r = __pyx_t_4;
-  __pyx_t_4 = 0;
+  __pyx_r = __pyx_t_3;
+  __pyx_t_3 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "pygrib.pyx":551
+ *         rewind(self._fd)
+ *         self.messagenumber = 0
+ *     def message(self, N):             # <<<<<<<<<<<<<<
+ *         """
+ *         message(N)
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_XDECREF(__pyx_t_3);
   __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
   __Pyx_AddTraceback("pygrib.open.message", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_r = NULL;
   __pyx_L0:;
@@ -5158,6 +5606,14 @@ static PyObject *__pyx_pf_6pygrib_4open_30message(struct __pyx_obj_6pygrib_open
   return __pyx_r;
 }
 
+/* "pygrib.pyx":565
+ *         self._advance(N-self.messagenumber)
+ *         return _create_gribmessage(self._gh, self.messagenumber)
+ *     def select(self, **kwargs):             # <<<<<<<<<<<<<<
+ *         """
+ * select(**kwargs)
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_6pygrib_4open_33select(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static char __pyx_doc_6pygrib_4open_32select[] = "\nselect(**kwargs)\n\nreturn a list of L{gribmessage} instances from iterator filtered by kwargs.\nIf keyword is a container object, each grib message\nin the iterator is searched for membership in the container.\nIf keyword is a callable (has a _call__ method), each grib\nmessage in the iterator is tested using the callable (which should\nreturn a boolean).\nIf keyword is not a container object or a callable, each \ngrib message in the i [...]
@@ -5173,19 +5629,13 @@ static PyObject *__pyx_pw_6pygrib_4open_33select(PyObject *__pyx_v_self, PyObjec
   if (unlikely(!__pyx_v_kwargs)) return NULL;
   __Pyx_GOTREF(__pyx_v_kwargs);
   __pyx_r = __pyx_pf_6pygrib_4open_32select(((struct __pyx_obj_6pygrib_open *)__pyx_v_self), __pyx_v_kwargs);
+
+  /* function exit code */
   __Pyx_XDECREF(__pyx_v_kwargs);
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "pygrib.pyx":571
- *         self._advance(N-self.messagenumber)
- *         return _create_gribmessage(self._gh, self.messagenumber)
- *     def select(self, **kwargs):             # <<<<<<<<<<<<<<
- *         """
- * select(**kwargs)
- */
-
 static PyObject *__pyx_pf_6pygrib_4open_32select(struct __pyx_obj_6pygrib_open *__pyx_v_self, PyObject *__pyx_v_kwargs) {
   PyObject *__pyx_v_msgnum = NULL;
   PyObject *__pyx_v_grbs = NULL;
@@ -5194,9 +5644,9 @@ static PyObject *__pyx_pf_6pygrib_4open_32select(struct __pyx_obj_6pygrib_open *
   __Pyx_RefNannyDeclarations
   PyObject *__pyx_t_1 = NULL;
   PyObject *__pyx_t_2 = NULL;
-  Py_ssize_t __pyx_t_3;
-  PyObject *(*__pyx_t_4)(PyObject *);
-  PyObject *__pyx_t_5 = NULL;
+  PyObject *__pyx_t_3 = NULL;
+  Py_ssize_t __pyx_t_4;
+  PyObject *(*__pyx_t_5)(PyObject *);
   PyObject *__pyx_t_6 = NULL;
   PyObject *__pyx_t_7 = NULL;
   PyObject *__pyx_t_8 = NULL;
@@ -5207,98 +5657,131 @@ static PyObject *__pyx_pf_6pygrib_4open_32select(struct __pyx_obj_6pygrib_open *
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("select", 0);
 
-  /* "pygrib.pyx":610
+  /* "pygrib.pyx":604
  * 17:Geopotential height:gpm (instant):regular_ll:isobaricInhPa:level 30000 Pa:fcst time 72 hrs:from 200412091200:lo res cntl fcst
  * """
  *         msgnum = self.tell()             # <<<<<<<<<<<<<<
  *         self.rewind() # always search from beginning
  *         grbs = [grb for grb in self if _find(grb, **kwargs)]
  */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__tell); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_tell); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_v_msgnum = __pyx_t_2;
-  __pyx_t_2 = 0;
+  __pyx_t_3 = NULL;
+  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  if (__pyx_t_3) {
+    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  } else {
+    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  }
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_v_msgnum = __pyx_t_1;
+  __pyx_t_1 = 0;
 
-  /* "pygrib.pyx":611
+  /* "pygrib.pyx":605
  * """
  *         msgnum = self.tell()
  *         self.rewind() # always search from beginning             # <<<<<<<<<<<<<<
  *         grbs = [grb for grb in self if _find(grb, **kwargs)]
  *         self.seek(msgnum) # leave iterator in original position.
  */
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__rewind); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 611; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_rewind); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 611; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = NULL;
+  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  if (__pyx_t_3) {
+    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  } else {
+    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  }
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "pygrib.pyx":612
+  /* "pygrib.pyx":606
  *         msgnum = self.tell()
  *         self.rewind() # always search from beginning
  *         grbs = [grb for grb in self if _find(grb, **kwargs)]             # <<<<<<<<<<<<<<
  *         self.seek(msgnum) # leave iterator in original position.
  *         if not grbs:
  */
-  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  if (PyList_CheckExact(((PyObject *)__pyx_v_self)) || PyTuple_CheckExact(((PyObject *)__pyx_v_self))) {
-    __pyx_t_2 = ((PyObject *)__pyx_v_self); __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
-    __pyx_t_4 = NULL;
+  if (likely(PyList_CheckExact(((PyObject *)__pyx_v_self))) || PyTuple_CheckExact(((PyObject *)__pyx_v_self))) {
+    __pyx_t_2 = ((PyObject *)__pyx_v_self); __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
+    __pyx_t_5 = NULL;
   } else {
-    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
+    __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
   for (;;) {
-    if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_2)) {
-      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #else
-      __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #endif
-    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) {
-      if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #else
-      __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #endif
+    if (likely(!__pyx_t_5)) {
+      if (likely(PyList_CheckExact(__pyx_t_2))) {
+        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
+        #if CYTHON_COMPILING_IN_CPYTHON
+        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        #else
+        __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        #endif
+      } else {
+        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
+        #if CYTHON_COMPILING_IN_CPYTHON
+        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        #else
+        __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        #endif
+      }
     } else {
-      __pyx_t_5 = __pyx_t_4(__pyx_t_2);
-      if (unlikely(!__pyx_t_5)) {
-        if (PyErr_Occurred()) {
-          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
-          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = __pyx_t_5(__pyx_t_2);
+      if (unlikely(!__pyx_t_3)) {
+        PyObject* exc_type = PyErr_Occurred();
+        if (exc_type) {
+          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         }
         break;
       }
-      __Pyx_GOTREF(__pyx_t_5);
+      __Pyx_GOTREF(__pyx_t_3);
     }
-    __Pyx_XDECREF_SET(__pyx_v_grb, __pyx_t_5);
-    __pyx_t_5 = 0;
-    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s___find); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_XDECREF_SET(__pyx_v_grb, __pyx_t_3);
+    __pyx_t_3 = 0;
+    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_find); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_6);
     __Pyx_INCREF(__pyx_v_grb);
     PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_grb);
     __Pyx_GIVEREF(__pyx_v_grb);
-    __pyx_t_7 = ((PyObject *)__pyx_v_kwargs);
+    __pyx_t_7 = __pyx_v_kwargs;
     __Pyx_INCREF(__pyx_t_7);
-    __pyx_t_8 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_6), ((PyObject *)__pyx_t_7)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_8);
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
-    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
     if (__pyx_t_9) {
-      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_v_grb))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_v_grb))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       goto __pyx_L5;
     }
     __pyx_L5:;
@@ -5307,54 +5790,68 @@ static PyObject *__pyx_pf_6pygrib_4open_32select(struct __pyx_obj_6pygrib_open *
   __pyx_v_grbs = ((PyObject*)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "pygrib.pyx":613
+  /* "pygrib.pyx":607
  *         self.rewind() # always search from beginning
  *         grbs = [grb for grb in self if _find(grb, **kwargs)]
  *         self.seek(msgnum) # leave iterator in original position.             # <<<<<<<<<<<<<<
  *         if not grbs:
  *             raise ValueError('no matches found')
  */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__seek); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_seek); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_INCREF(__pyx_v_msgnum);
-  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_msgnum);
-  __Pyx_GIVEREF(__pyx_v_msgnum);
-  __pyx_t_8 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_8);
+  __pyx_t_8 = NULL;
+  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_8)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_8);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  if (!__pyx_t_8) {
+    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_msgnum); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+  } else {
+    __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_7);
+    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_8 = NULL;
+    __Pyx_INCREF(__pyx_v_msgnum);
+    PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_msgnum);
+    __Pyx_GIVEREF(__pyx_v_msgnum);
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  }
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
-  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
 
-  /* "pygrib.pyx":614
+  /* "pygrib.pyx":608
  *         grbs = [grb for grb in self if _find(grb, **kwargs)]
  *         self.seek(msgnum) # leave iterator in original position.
  *         if not grbs:             # <<<<<<<<<<<<<<
  *             raise ValueError('no matches found')
  *         return grbs
  */
-  __pyx_t_9 = (((PyObject *)__pyx_v_grbs) != Py_None) && (PyList_GET_SIZE(((PyObject *)__pyx_v_grbs)) != 0);
+  __pyx_t_9 = (__pyx_v_grbs != Py_None) && (PyList_GET_SIZE(__pyx_v_grbs) != 0);
   __pyx_t_10 = ((!__pyx_t_9) != 0);
   if (__pyx_t_10) {
 
-    /* "pygrib.pyx":615
+    /* "pygrib.pyx":609
  *         self.seek(msgnum) # leave iterator in original position.
  *         if not grbs:
  *             raise ValueError('no matches found')             # <<<<<<<<<<<<<<
  *         return grbs
  *     def _advance(self,nmsgs,return_msgs=False):
  */
-    __pyx_t_8 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_13), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __Pyx_Raise(__pyx_t_8, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L6;
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
-  __pyx_L6:;
 
-  /* "pygrib.pyx":616
+  /* "pygrib.pyx":610
  *         if not grbs:
  *             raise ValueError('no matches found')
  *         return grbs             # <<<<<<<<<<<<<<
@@ -5362,16 +5859,23 @@ static PyObject *__pyx_pf_6pygrib_4open_32select(struct __pyx_obj_6pygrib_open *
  *         """advance iterator n messages from current position.
  */
   __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(((PyObject *)__pyx_v_grbs));
-  __pyx_r = ((PyObject *)__pyx_v_grbs);
+  __Pyx_INCREF(__pyx_v_grbs);
+  __pyx_r = __pyx_v_grbs;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "pygrib.pyx":565
+ *         self._advance(N-self.messagenumber)
+ *         return _create_gribmessage(self._gh, self.messagenumber)
+ *     def select(self, **kwargs):             # <<<<<<<<<<<<<<
+ *         """
+ * select(**kwargs)
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_3);
   __Pyx_XDECREF(__pyx_t_6);
   __Pyx_XDECREF(__pyx_t_7);
   __Pyx_XDECREF(__pyx_t_8);
@@ -5386,6 +5890,14 @@ static PyObject *__pyx_pf_6pygrib_4open_32select(struct __pyx_obj_6pygrib_open *
   return __pyx_r;
 }
 
+/* "pygrib.pyx":611
+ *             raise ValueError('no matches found')
+ *         return grbs
+ *     def _advance(self,nmsgs,return_msgs=False):             # <<<<<<<<<<<<<<
+ *         """advance iterator n messages from current position.
+ *         if return_msgs==True, grib message instances are returned
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_6pygrib_4open_35_advance(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static char __pyx_doc_6pygrib_4open_34_advance[] = "advance iterator n messages from current position.\n        if return_msgs==True, grib message instances are returned\n        in a list";
@@ -5399,9 +5911,9 @@ static PyObject *__pyx_pw_6pygrib_4open_35_advance(PyObject *__pyx_v_self, PyObj
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("_advance (wrapper)", 0);
   {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__nmsgs,&__pyx_n_s__return_msgs,0};
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nmsgs,&__pyx_n_s_return_msgs,0};
     PyObject* values[2] = {0,0};
-    values[1] = __pyx_k_14;
+    values[1] = ((PyObject *)Py_False);
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
@@ -5414,16 +5926,16 @@ static PyObject *__pyx_pw_6pygrib_4open_35_advance(PyObject *__pyx_v_self, PyObj
       kw_args = PyDict_Size(__pyx_kwds);
       switch (pos_args) {
         case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__nmsgs)) != 0)) kw_args--;
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nmsgs)) != 0)) kw_args--;
         else goto __pyx_L5_argtuple_error;
         case  1:
         if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__return_msgs);
+          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_return_msgs);
           if (value) { values[1] = value; kw_args--; }
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_advance") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_advance") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 611; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -5438,25 +5950,19 @@ static PyObject *__pyx_pw_6pygrib_4open_35_advance(PyObject *__pyx_v_self, PyObj
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("_advance", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+  __Pyx_RaiseArgtupleInvalid("_advance", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 611; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
   __pyx_L3_error:;
   __Pyx_AddTraceback("pygrib.open._advance", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
   return NULL;
   __pyx_L4_argument_unpacking_done:;
   __pyx_r = __pyx_pf_6pygrib_4open_34_advance(((struct __pyx_obj_6pygrib_open *)__pyx_v_self), __pyx_v_nmsgs, __pyx_v_return_msgs);
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "pygrib.pyx":617
- *             raise ValueError('no matches found')
- *         return grbs
- *     def _advance(self,nmsgs,return_msgs=False):             # <<<<<<<<<<<<<<
- *         """advance iterator n messages from current position.
- *         if return_msgs==True, grib message instances are returned
- */
-
 static PyObject *__pyx_pf_6pygrib_4open_34_advance(struct __pyx_obj_6pygrib_open *__pyx_v_self, PyObject *__pyx_v_nmsgs, PyObject *__pyx_v_return_msgs) {
   int __pyx_v_err;
   PyObject *__pyx_v_grbs = NULL;
@@ -5475,44 +5981,42 @@ static PyObject *__pyx_pf_6pygrib_4open_34_advance(struct __pyx_obj_6pygrib_open
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("_advance", 0);
 
-  /* "pygrib.pyx":622
+  /* "pygrib.pyx":616
  *         in a list"""
  *         cdef int err
  *         if nmsgs < 0:             # <<<<<<<<<<<<<<
  *             raise ValueError('nmsgs must be >= 0 in _advance')
  *         if return_msgs: grbs=[]
  */
-  __pyx_t_1 = PyObject_RichCompare(__pyx_v_nmsgs, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyObject_RichCompare(__pyx_v_nmsgs, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (__pyx_t_2) {
 
-    /* "pygrib.pyx":623
+    /* "pygrib.pyx":617
  *         cdef int err
  *         if nmsgs < 0:
  *             raise ValueError('nmsgs must be >= 0 in _advance')             # <<<<<<<<<<<<<<
  *         if return_msgs: grbs=[]
  *         for n in range(self.messagenumber,self.messagenumber+nmsgs):
  */
-    __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_16), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_Raise(__pyx_t_1, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L3;
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
-  __pyx_L3:;
 
-  /* "pygrib.pyx":624
+  /* "pygrib.pyx":618
  *         if nmsgs < 0:
  *             raise ValueError('nmsgs must be >= 0 in _advance')
  *         if return_msgs: grbs=[]             # <<<<<<<<<<<<<<
  *         for n in range(self.messagenumber,self.messagenumber+nmsgs):
  *             err = grib_handle_delete(self._gh)
  */
-  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_return_msgs); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_return_msgs); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   if (__pyx_t_2) {
-    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_1);
     __pyx_v_grbs = ((PyObject*)__pyx_t_1);
     __pyx_t_1 = 0;
@@ -5520,16 +6024,16 @@ static PyObject *__pyx_pf_6pygrib_4open_34_advance(struct __pyx_obj_6pygrib_open
   }
   __pyx_L4:;
 
-  /* "pygrib.pyx":625
+  /* "pygrib.pyx":619
  *             raise ValueError('nmsgs must be >= 0 in _advance')
  *         if return_msgs: grbs=[]
  *         for n in range(self.messagenumber,self.messagenumber+nmsgs):             # <<<<<<<<<<<<<<
  *             err = grib_handle_delete(self._gh)
  *             if err:
  */
-  __pyx_t_1 = PyNumber_Add(__pyx_v_self->messagenumber, __pyx_v_nmsgs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyNumber_Add(__pyx_v_self->messagenumber, __pyx_v_nmsgs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_INCREF(__pyx_v_self->messagenumber);
   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self->messagenumber);
@@ -5537,39 +6041,42 @@ static PyObject *__pyx_pf_6pygrib_4open_34_advance(struct __pyx_obj_6pygrib_open
   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
   __Pyx_GIVEREF(__pyx_t_1);
   __pyx_t_1 = 0;
-  __pyx_t_1 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-  if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
     __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
     __pyx_t_5 = NULL;
   } else {
-    __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext;
+    __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   for (;;) {
-    if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) {
-      if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #else
-      __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #endif
-    } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) {
-      if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #else
-      __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #endif
+    if (likely(!__pyx_t_5)) {
+      if (likely(PyList_CheckExact(__pyx_t_3))) {
+        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
+        #if CYTHON_COMPILING_IN_CPYTHON
+        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        #else
+        __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        #endif
+      } else {
+        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
+        #if CYTHON_COMPILING_IN_CPYTHON
+        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        #else
+        __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        #endif
+      }
     } else {
       __pyx_t_1 = __pyx_t_5(__pyx_t_3);
       if (unlikely(!__pyx_t_1)) {
-        if (PyErr_Occurred()) {
-          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
-          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        PyObject* exc_type = PyErr_Occurred();
+        if (exc_type) {
+          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         }
         break;
       }
@@ -5578,7 +6085,7 @@ static PyObject *__pyx_pf_6pygrib_4open_34_advance(struct __pyx_obj_6pygrib_open
     __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_1);
     __pyx_t_1 = 0;
 
-    /* "pygrib.pyx":626
+    /* "pygrib.pyx":620
  *         if return_msgs: grbs=[]
  *         for n in range(self.messagenumber,self.messagenumber+nmsgs):
  *             err = grib_handle_delete(self._gh)             # <<<<<<<<<<<<<<
@@ -5587,7 +6094,7 @@ static PyObject *__pyx_pf_6pygrib_4open_34_advance(struct __pyx_obj_6pygrib_open
  */
     __pyx_v_err = grib_handle_delete(__pyx_v_self->_gh);
 
-    /* "pygrib.pyx":627
+    /* "pygrib.pyx":621
  *         for n in range(self.messagenumber,self.messagenumber+nmsgs):
  *             err = grib_handle_delete(self._gh)
  *             if err:             # <<<<<<<<<<<<<<
@@ -5597,31 +6104,29 @@ static PyObject *__pyx_pf_6pygrib_4open_34_advance(struct __pyx_obj_6pygrib_open
     __pyx_t_2 = (__pyx_v_err != 0);
     if (__pyx_t_2) {
 
-      /* "pygrib.pyx":628
+      /* "pygrib.pyx":622
  *             err = grib_handle_delete(self._gh)
  *             if err:
  *                 raise RuntimeError(grib_get_error_message(err))             # <<<<<<<<<<<<<<
  *             self._gh = grib_handle_new_from_file(NULL, self._fd, &err)
  *             if err:
  */
-      __pyx_t_1 = __Pyx_PyBytes_FromString(grib_get_error_message(__pyx_v_err)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(((PyObject *)__pyx_t_1));
-      __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_1 = __Pyx_PyBytes_FromString(grib_get_error_message(__pyx_v_err)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_1);
+      __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_6);
-      PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_1));
-      __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
+      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
+      __Pyx_GIVEREF(__pyx_t_1);
       __pyx_t_1 = 0;
-      __pyx_t_1 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_1);
-      __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
       __Pyx_Raise(__pyx_t_1, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      goto __pyx_L7;
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     }
-    __pyx_L7:;
 
-    /* "pygrib.pyx":629
+    /* "pygrib.pyx":623
  *             if err:
  *                 raise RuntimeError(grib_get_error_message(err))
  *             self._gh = grib_handle_new_from_file(NULL, self._fd, &err)             # <<<<<<<<<<<<<<
@@ -5630,7 +6135,7 @@ static PyObject *__pyx_pf_6pygrib_4open_34_advance(struct __pyx_obj_6pygrib_open
  */
     __pyx_v_self->_gh = grib_handle_new_from_file(NULL, __pyx_v_self->_fd, (&__pyx_v_err));
 
-    /* "pygrib.pyx":630
+    /* "pygrib.pyx":624
  *                 raise RuntimeError(grib_get_error_message(err))
  *             self._gh = grib_handle_new_from_file(NULL, self._fd, &err)
  *             if err:             # <<<<<<<<<<<<<<
@@ -5640,31 +6145,29 @@ static PyObject *__pyx_pf_6pygrib_4open_34_advance(struct __pyx_obj_6pygrib_open
     __pyx_t_2 = (__pyx_v_err != 0);
     if (__pyx_t_2) {
 
-      /* "pygrib.pyx":631
+      /* "pygrib.pyx":625
  *             self._gh = grib_handle_new_from_file(NULL, self._fd, &err)
  *             if err:
  *                 raise RuntimeError(grib_get_error_message(err))             # <<<<<<<<<<<<<<
  *             if self._gh == NULL:
  *                 raise IOError('not that many messages in file')
  */
-      __pyx_t_1 = __Pyx_PyBytes_FromString(grib_get_error_message(__pyx_v_err)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(((PyObject *)__pyx_t_1));
-      __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_1 = __Pyx_PyBytes_FromString(grib_get_error_message(__pyx_v_err)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_1);
+      __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_6);
-      PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_1));
-      __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
+      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
+      __Pyx_GIVEREF(__pyx_t_1);
       __pyx_t_1 = 0;
-      __pyx_t_1 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_1);
-      __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
       __Pyx_Raise(__pyx_t_1, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      goto __pyx_L8;
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     }
-    __pyx_L8:;
 
-    /* "pygrib.pyx":632
+    /* "pygrib.pyx":626
  *             if err:
  *                 raise RuntimeError(grib_get_error_message(err))
  *             if self._gh == NULL:             # <<<<<<<<<<<<<<
@@ -5674,30 +6177,28 @@ static PyObject *__pyx_pf_6pygrib_4open_34_advance(struct __pyx_obj_6pygrib_open
     __pyx_t_2 = ((__pyx_v_self->_gh == NULL) != 0);
     if (__pyx_t_2) {
 
-      /* "pygrib.pyx":633
+      /* "pygrib.pyx":627
  *                 raise RuntimeError(grib_get_error_message(err))
  *             if self._gh == NULL:
  *                 raise IOError('not that many messages in file')             # <<<<<<<<<<<<<<
  *             self.messagenumber = self.messagenumber + 1
  *             if return_msgs: grbs.append(_create_gribmessage(self._gh, self.messagenumber))
  */
-      __pyx_t_1 = PyObject_Call(__pyx_builtin_IOError, ((PyObject *)__pyx_k_tuple_18), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_Raise(__pyx_t_1, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      goto __pyx_L9;
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     }
-    __pyx_L9:;
 
-    /* "pygrib.pyx":634
+    /* "pygrib.pyx":628
  *             if self._gh == NULL:
  *                 raise IOError('not that many messages in file')
  *             self.messagenumber = self.messagenumber + 1             # <<<<<<<<<<<<<<
  *             if return_msgs: grbs.append(_create_gribmessage(self._gh, self.messagenumber))
  *         if return_msgs: return grbs
  */
-    __pyx_t_1 = PyNumber_Add(__pyx_v_self->messagenumber, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = PyNumber_Add(__pyx_v_self->messagenumber, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_GIVEREF(__pyx_t_1);
     __Pyx_GOTREF(__pyx_v_self->messagenumber);
@@ -5705,47 +6206,62 @@ static PyObject *__pyx_pf_6pygrib_4open_34_advance(struct __pyx_obj_6pygrib_open
     __pyx_v_self->messagenumber = __pyx_t_1;
     __pyx_t_1 = 0;
 
-    /* "pygrib.pyx":635
+    /* "pygrib.pyx":629
  *                 raise IOError('not that many messages in file')
  *             self.messagenumber = self.messagenumber + 1
  *             if return_msgs: grbs.append(_create_gribmessage(self._gh, self.messagenumber))             # <<<<<<<<<<<<<<
  *         if return_msgs: return grbs
  * 
  */
-    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_return_msgs); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_return_msgs); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     if (__pyx_t_2) {
-      if (unlikely(!__pyx_v_grbs)) { __Pyx_RaiseUnboundLocalError("grbs"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+      if (unlikely(!__pyx_v_grbs)) { __Pyx_RaiseUnboundLocalError("grbs"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
       __pyx_t_1 = __pyx_v_self->messagenumber;
       __Pyx_INCREF(__pyx_t_1);
-      __pyx_t_6 = __pyx_f_6pygrib__create_gribmessage(__pyx_v_self->_gh, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_6 = __pyx_f_6pygrib__create_gribmessage(__pyx_v_self->_gh, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_6);
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_grbs, __pyx_t_6); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_grbs, __pyx_t_6); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
       goto __pyx_L10;
     }
     __pyx_L10:;
+
+    /* "pygrib.pyx":619
+ *             raise ValueError('nmsgs must be >= 0 in _advance')
+ *         if return_msgs: grbs=[]
+ *         for n in range(self.messagenumber,self.messagenumber+nmsgs):             # <<<<<<<<<<<<<<
+ *             err = grib_handle_delete(self._gh)
+ *             if err:
+ */
   }
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
-  /* "pygrib.pyx":636
+  /* "pygrib.pyx":630
  *             self.messagenumber = self.messagenumber + 1
  *             if return_msgs: grbs.append(_create_gribmessage(self._gh, self.messagenumber))
  *         if return_msgs: return grbs             # <<<<<<<<<<<<<<
  * 
  * # keep track of python gribmessage attributes so they can be
  */
-  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_return_msgs); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_return_msgs); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   if (__pyx_t_2) {
     __Pyx_XDECREF(__pyx_r);
-    if (unlikely(!__pyx_v_grbs)) { __Pyx_RaiseUnboundLocalError("grbs"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
-    __Pyx_INCREF(((PyObject *)__pyx_v_grbs));
-    __pyx_r = ((PyObject *)__pyx_v_grbs);
+    if (unlikely(!__pyx_v_grbs)) { __Pyx_RaiseUnboundLocalError("grbs"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+    __Pyx_INCREF(__pyx_v_grbs);
+    __pyx_r = __pyx_v_grbs;
     goto __pyx_L0;
-    goto __pyx_L11;
   }
-  __pyx_L11:;
 
+  /* "pygrib.pyx":611
+ *             raise ValueError('no matches found')
+ *         return grbs
+ *     def _advance(self,nmsgs,return_msgs=False):             # <<<<<<<<<<<<<<
+ *         """advance iterator n messages from current position.
+ *         if return_msgs==True, grib message instances are returned
+ */
+
+  /* function exit code */
   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
   goto __pyx_L0;
   __pyx_L1_error:;
@@ -5762,6 +6278,14 @@ static PyObject *__pyx_pf_6pygrib_4open_34_advance(struct __pyx_obj_6pygrib_open
   return __pyx_r;
 }
 
+/* "pygrib.pyx":385
+ *     cdef FILE *_fd
+ *     cdef grib_handle *_gh
+ *     cdef public object name, messagenumber, messages, closed,\             # <<<<<<<<<<<<<<
+ *                        has_multi_field_msgs
+ *     def __cinit__(self, filename):
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_6pygrib_4open_4name_1__get__(PyObject *__pyx_v_self); /*proto*/
 static PyObject *__pyx_pw_6pygrib_4open_4name_1__get__(PyObject *__pyx_v_self) {
@@ -5769,18 +6293,12 @@ static PyObject *__pyx_pw_6pygrib_4open_4name_1__get__(PyObject *__pyx_v_self) {
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_4open_4name___get__(((struct __pyx_obj_6pygrib_open *)__pyx_v_self));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "pygrib.pyx":391
- *     cdef FILE *_fd
- *     cdef grib_handle *_gh
- *     cdef public object name, messagenumber, messages, closed,\             # <<<<<<<<<<<<<<
- *                        has_multi_field_msgs
- *     def __cinit__(self, filename):
- */
-
 static PyObject *__pyx_pf_6pygrib_4open_4name___get__(struct __pyx_obj_6pygrib_open *__pyx_v_self) {
   PyObject *__pyx_r = NULL;
   __Pyx_RefNannyDeclarations
@@ -5790,7 +6308,7 @@ static PyObject *__pyx_pf_6pygrib_4open_4name___get__(struct __pyx_obj_6pygrib_o
   __pyx_r = __pyx_v_self->name;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  /* function exit code */
   __pyx_L0:;
   __Pyx_XGIVEREF(__pyx_r);
   __Pyx_RefNannyFinishContext();
@@ -5804,6 +6322,8 @@ static int __pyx_pw_6pygrib_4open_4name_3__set__(PyObject *__pyx_v_self, PyObjec
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_4open_4name_2__set__(((struct __pyx_obj_6pygrib_open *)__pyx_v_self), ((PyObject *)__pyx_v_value));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
@@ -5818,6 +6338,7 @@ static int __pyx_pf_6pygrib_4open_4name_2__set__(struct __pyx_obj_6pygrib_open *
   __Pyx_DECREF(__pyx_v_self->name);
   __pyx_v_self->name = __pyx_v_value;
 
+  /* function exit code */
   __pyx_r = 0;
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
@@ -5830,6 +6351,8 @@ static int __pyx_pw_6pygrib_4open_4name_5__del__(PyObject *__pyx_v_self) {
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_4open_4name_4__del__(((struct __pyx_obj_6pygrib_open *)__pyx_v_self));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
@@ -5844,6 +6367,7 @@ static int __pyx_pf_6pygrib_4open_4name_4__del__(struct __pyx_obj_6pygrib_open *
   __Pyx_DECREF(__pyx_v_self->name);
   __pyx_v_self->name = Py_None;
 
+  /* function exit code */
   __pyx_r = 0;
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
@@ -5856,6 +6380,8 @@ static PyObject *__pyx_pw_6pygrib_4open_13messagenumber_1__get__(PyObject *__pyx
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_4open_13messagenumber___get__(((struct __pyx_obj_6pygrib_open *)__pyx_v_self));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
@@ -5869,7 +6395,7 @@ static PyObject *__pyx_pf_6pygrib_4open_13messagenumber___get__(struct __pyx_obj
   __pyx_r = __pyx_v_self->messagenumber;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  /* function exit code */
   __pyx_L0:;
   __Pyx_XGIVEREF(__pyx_r);
   __Pyx_RefNannyFinishContext();
@@ -5883,6 +6409,8 @@ static int __pyx_pw_6pygrib_4open_13messagenumber_3__set__(PyObject *__pyx_v_sel
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_4open_13messagenumber_2__set__(((struct __pyx_obj_6pygrib_open *)__pyx_v_self), ((PyObject *)__pyx_v_value));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
@@ -5897,6 +6425,7 @@ static int __pyx_pf_6pygrib_4open_13messagenumber_2__set__(struct __pyx_obj_6pyg
   __Pyx_DECREF(__pyx_v_self->messagenumber);
   __pyx_v_self->messagenumber = __pyx_v_value;
 
+  /* function exit code */
   __pyx_r = 0;
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
@@ -5909,6 +6438,8 @@ static int __pyx_pw_6pygrib_4open_13messagenumber_5__del__(PyObject *__pyx_v_sel
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_4open_13messagenumber_4__del__(((struct __pyx_obj_6pygrib_open *)__pyx_v_self));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
@@ -5923,6 +6454,7 @@ static int __pyx_pf_6pygrib_4open_13messagenumber_4__del__(struct __pyx_obj_6pyg
   __Pyx_DECREF(__pyx_v_self->messagenumber);
   __pyx_v_self->messagenumber = Py_None;
 
+  /* function exit code */
   __pyx_r = 0;
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
@@ -5935,6 +6467,8 @@ static PyObject *__pyx_pw_6pygrib_4open_8messages_1__get__(PyObject *__pyx_v_sel
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_4open_8messages___get__(((struct __pyx_obj_6pygrib_open *)__pyx_v_self));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
@@ -5948,7 +6482,7 @@ static PyObject *__pyx_pf_6pygrib_4open_8messages___get__(struct __pyx_obj_6pygr
   __pyx_r = __pyx_v_self->messages;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  /* function exit code */
   __pyx_L0:;
   __Pyx_XGIVEREF(__pyx_r);
   __Pyx_RefNannyFinishContext();
@@ -5962,6 +6496,8 @@ static int __pyx_pw_6pygrib_4open_8messages_3__set__(PyObject *__pyx_v_self, PyO
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_4open_8messages_2__set__(((struct __pyx_obj_6pygrib_open *)__pyx_v_self), ((PyObject *)__pyx_v_value));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
@@ -5976,6 +6512,7 @@ static int __pyx_pf_6pygrib_4open_8messages_2__set__(struct __pyx_obj_6pygrib_op
   __Pyx_DECREF(__pyx_v_self->messages);
   __pyx_v_self->messages = __pyx_v_value;
 
+  /* function exit code */
   __pyx_r = 0;
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
@@ -5988,6 +6525,8 @@ static int __pyx_pw_6pygrib_4open_8messages_5__del__(PyObject *__pyx_v_self) {
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_4open_8messages_4__del__(((struct __pyx_obj_6pygrib_open *)__pyx_v_self));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
@@ -6002,6 +6541,7 @@ static int __pyx_pf_6pygrib_4open_8messages_4__del__(struct __pyx_obj_6pygrib_op
   __Pyx_DECREF(__pyx_v_self->messages);
   __pyx_v_self->messages = Py_None;
 
+  /* function exit code */
   __pyx_r = 0;
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
@@ -6014,6 +6554,8 @@ static PyObject *__pyx_pw_6pygrib_4open_6closed_1__get__(PyObject *__pyx_v_self)
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_4open_6closed___get__(((struct __pyx_obj_6pygrib_open *)__pyx_v_self));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
@@ -6027,7 +6569,7 @@ static PyObject *__pyx_pf_6pygrib_4open_6closed___get__(struct __pyx_obj_6pygrib
   __pyx_r = __pyx_v_self->closed;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  /* function exit code */
   __pyx_L0:;
   __Pyx_XGIVEREF(__pyx_r);
   __Pyx_RefNannyFinishContext();
@@ -6041,6 +6583,8 @@ static int __pyx_pw_6pygrib_4open_6closed_3__set__(PyObject *__pyx_v_self, PyObj
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_4open_6closed_2__set__(((struct __pyx_obj_6pygrib_open *)__pyx_v_self), ((PyObject *)__pyx_v_value));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
@@ -6055,6 +6599,7 @@ static int __pyx_pf_6pygrib_4open_6closed_2__set__(struct __pyx_obj_6pygrib_open
   __Pyx_DECREF(__pyx_v_self->closed);
   __pyx_v_self->closed = __pyx_v_value;
 
+  /* function exit code */
   __pyx_r = 0;
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
@@ -6067,6 +6612,8 @@ static int __pyx_pw_6pygrib_4open_6closed_5__del__(PyObject *__pyx_v_self) {
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_4open_6closed_4__del__(((struct __pyx_obj_6pygrib_open *)__pyx_v_self));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
@@ -6081,11 +6628,20 @@ static int __pyx_pf_6pygrib_4open_6closed_4__del__(struct __pyx_obj_6pygrib_open
   __Pyx_DECREF(__pyx_v_self->closed);
   __pyx_v_self->closed = Py_None;
 
+  /* function exit code */
   __pyx_r = 0;
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
+/* "pygrib.pyx":386
+ *     cdef grib_handle *_gh
+ *     cdef public object name, messagenumber, messages, closed,\
+ *                        has_multi_field_msgs             # <<<<<<<<<<<<<<
+ *     def __cinit__(self, filename):
+ *         # initialize C level objects.
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_6pygrib_4open_20has_multi_field_msgs_1__get__(PyObject *__pyx_v_self); /*proto*/
 static PyObject *__pyx_pw_6pygrib_4open_20has_multi_field_msgs_1__get__(PyObject *__pyx_v_self) {
@@ -6093,18 +6649,12 @@ static PyObject *__pyx_pw_6pygrib_4open_20has_multi_field_msgs_1__get__(PyObject
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_4open_20has_multi_field_msgs___get__(((struct __pyx_obj_6pygrib_open *)__pyx_v_self));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "pygrib.pyx":392
- *     cdef grib_handle *_gh
- *     cdef public object name, messagenumber, messages, closed,\
- *                        has_multi_field_msgs             # <<<<<<<<<<<<<<
- *     def __cinit__(self, filename):
- *         # initialize C level objects.
- */
-
 static PyObject *__pyx_pf_6pygrib_4open_20has_multi_field_msgs___get__(struct __pyx_obj_6pygrib_open *__pyx_v_self) {
   PyObject *__pyx_r = NULL;
   __Pyx_RefNannyDeclarations
@@ -6114,7 +6664,7 @@ static PyObject *__pyx_pf_6pygrib_4open_20has_multi_field_msgs___get__(struct __
   __pyx_r = __pyx_v_self->has_multi_field_msgs;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  /* function exit code */
   __pyx_L0:;
   __Pyx_XGIVEREF(__pyx_r);
   __Pyx_RefNannyFinishContext();
@@ -6128,6 +6678,8 @@ static int __pyx_pw_6pygrib_4open_20has_multi_field_msgs_3__set__(PyObject *__py
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_4open_20has_multi_field_msgs_2__set__(((struct __pyx_obj_6pygrib_open *)__pyx_v_self), ((PyObject *)__pyx_v_value));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
@@ -6142,6 +6694,7 @@ static int __pyx_pf_6pygrib_4open_20has_multi_field_msgs_2__set__(struct __pyx_o
   __Pyx_DECREF(__pyx_v_self->has_multi_field_msgs);
   __pyx_v_self->has_multi_field_msgs = __pyx_v_value;
 
+  /* function exit code */
   __pyx_r = 0;
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
@@ -6154,6 +6707,8 @@ static int __pyx_pw_6pygrib_4open_20has_multi_field_msgs_5__del__(PyObject *__py
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_4open_20has_multi_field_msgs_4__del__(((struct __pyx_obj_6pygrib_open *)__pyx_v_self));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
@@ -6168,32 +6723,35 @@ static int __pyx_pf_6pygrib_4open_20has_multi_field_msgs_4__del__(struct __pyx_o
   __Pyx_DECREF(__pyx_v_self->has_multi_field_msgs);
   __pyx_v_self->has_multi_field_msgs = Py_None;
 
+  /* function exit code */
   __pyx_r = 0;
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
+/* "pygrib.pyx":637
+ * ['_gh','fcstimeunits','expand_reduced','projparams','messagenumber','_all_keys','_ro_keys']
+ * 
+ * def julian_to_datetime(object jd):             # <<<<<<<<<<<<<<
+ *     """
+ *     julian_to_datetime(julday)
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_6pygrib_13julian_to_datetime(PyObject *__pyx_self, PyObject *__pyx_v_jd); /*proto*/
 static char __pyx_doc_6pygrib_12julian_to_datetime[] = "\n    julian_to_datetime(julday)\n    \n    convert Julian day number to python datetime instance.\n\n    Used to create validDate and analDate attributes from\n    julianDay and forecastTime keys.";
-static PyMethodDef __pyx_mdef_6pygrib_13julian_to_datetime = {__Pyx_NAMESTR("julian_to_datetime"), (PyCFunction)__pyx_pw_6pygrib_13julian_to_datetime, METH_O, __Pyx_DOCSTR(__pyx_doc_6pygrib_12julian_to_datetime)};
+static PyMethodDef __pyx_mdef_6pygrib_13julian_to_datetime = {"julian_to_datetime", (PyCFunction)__pyx_pw_6pygrib_13julian_to_datetime, METH_O, __pyx_doc_6pygrib_12julian_to_datetime};
 static PyObject *__pyx_pw_6pygrib_13julian_to_datetime(PyObject *__pyx_self, PyObject *__pyx_v_jd) {
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("julian_to_datetime (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_12julian_to_datetime(__pyx_self, ((PyObject *)__pyx_v_jd));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "pygrib.pyx":643
- * ['_gh','fcstimeunits','expand_reduced','projparams','messagenumber','_all_keys','_ro_keys']
- * 
- * def julian_to_datetime(object jd):             # <<<<<<<<<<<<<<
- *     """
- *     julian_to_datetime(julday)
- */
-
 static PyObject *__pyx_pf_6pygrib_12julian_to_datetime(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_jd) {
   double __pyx_v_julday;
   long __pyx_v_year;
@@ -6215,22 +6773,25 @@ static PyObject *__pyx_pf_6pygrib_12julian_to_datetime(CYTHON_UNUSED PyObject *_
   PyObject *__pyx_t_8 = NULL;
   PyObject *__pyx_t_9 = NULL;
   PyObject *__pyx_t_10 = NULL;
+  PyObject *__pyx_t_11 = NULL;
+  Py_ssize_t __pyx_t_12;
+  PyObject *__pyx_t_13 = NULL;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("julian_to_datetime", 0);
 
-  /* "pygrib.pyx":654
+  /* "pygrib.pyx":648
  *     cdef long year, month, day, hour, minute, second
  *     cdef int err
  *     julday = jd             # <<<<<<<<<<<<<<
  *     err = grib_julian_to_datetime(julday, &year, &month, &day, &hour, &minute, &second)
  *     if err:
  */
-  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_jd); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_jd); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_v_julday = __pyx_t_1;
 
-  /* "pygrib.pyx":655
+  /* "pygrib.pyx":649
  *     cdef int err
  *     julday = jd
  *     err = grib_julian_to_datetime(julday, &year, &month, &day, &hour, &minute, &second)             # <<<<<<<<<<<<<<
@@ -6239,7 +6800,7 @@ static PyObject *__pyx_pf_6pygrib_12julian_to_datetime(CYTHON_UNUSED PyObject *_
  */
   __pyx_v_err = grib_julian_to_datetime(__pyx_v_julday, (&__pyx_v_year), (&__pyx_v_month), (&__pyx_v_day), (&__pyx_v_hour), (&__pyx_v_minute), (&__pyx_v_second));
 
-  /* "pygrib.pyx":656
+  /* "pygrib.pyx":650
  *     julday = jd
  *     err = grib_julian_to_datetime(julday, &year, &month, &day, &hour, &minute, &second)
  *     if err:             # <<<<<<<<<<<<<<
@@ -6249,31 +6810,29 @@ static PyObject *__pyx_pf_6pygrib_12julian_to_datetime(CYTHON_UNUSED PyObject *_
   __pyx_t_2 = (__pyx_v_err != 0);
   if (__pyx_t_2) {
 
-    /* "pygrib.pyx":657
+    /* "pygrib.pyx":651
  *     err = grib_julian_to_datetime(julday, &year, &month, &day, &hour, &minute, &second)
  *     if err:
  *         raise RuntimeError(grib_get_error_message(err))             # <<<<<<<<<<<<<<
  *     return datetime(year, month, day, hour, minute, second)
  * 
  */
-    __pyx_t_3 = __Pyx_PyBytes_FromString(grib_get_error_message(__pyx_v_err)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
-    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = __Pyx_PyBytes_FromString(grib_get_error_message(__pyx_v_err)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
-    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_3));
-    __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
+    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
+    __Pyx_GIVEREF(__pyx_t_3);
     __pyx_t_3 = 0;
-    __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L3;
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
-  __pyx_L3:;
 
-  /* "pygrib.pyx":658
+  /* "pygrib.pyx":652
  *     if err:
  *         raise RuntimeError(grib_get_error_message(err))
  *     return datetime(year, month, day, hour, minute, second)             # <<<<<<<<<<<<<<
@@ -6281,50 +6840,72 @@ static PyObject *__pyx_pf_6pygrib_12julian_to_datetime(CYTHON_UNUSED PyObject *_
  * def datetime_to_julian(object d):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__datetime); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_4 = PyInt_FromLong(__pyx_v_year); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_datetime); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_5 = PyInt_FromLong(__pyx_v_month); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_v_year); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_6 = PyInt_FromLong(__pyx_v_day); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = __Pyx_PyInt_From_long(__pyx_v_month); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_7 = PyInt_FromLong(__pyx_v_hour); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_7 = __Pyx_PyInt_From_long(__pyx_v_day); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_8 = PyInt_FromLong(__pyx_v_minute); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_hour); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_8);
-  __pyx_t_9 = PyInt_FromLong(__pyx_v_second); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_9 = __Pyx_PyInt_From_long(__pyx_v_minute); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_9);
-  __pyx_t_10 = PyTuple_New(6); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_10 = __Pyx_PyInt_From_long(__pyx_v_second); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_10);
-  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_4);
-  __Pyx_GIVEREF(__pyx_t_4);
-  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_5);
+  __pyx_t_11 = NULL;
+  __pyx_t_12 = 0;
+  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
+    __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_4);
+    if (likely(__pyx_t_11)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+      __Pyx_INCREF(__pyx_t_11);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_4, function);
+      __pyx_t_12 = 1;
+    }
+  }
+  __pyx_t_13 = PyTuple_New(6+__pyx_t_12); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_13);
+  if (__pyx_t_11) {
+    PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __Pyx_GIVEREF(__pyx_t_11); __pyx_t_11 = NULL;
+  }
+  PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_12, __pyx_t_5);
   __Pyx_GIVEREF(__pyx_t_5);
-  PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_6);
+  PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_12, __pyx_t_6);
   __Pyx_GIVEREF(__pyx_t_6);
-  PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_7);
+  PyTuple_SET_ITEM(__pyx_t_13, 2+__pyx_t_12, __pyx_t_7);
   __Pyx_GIVEREF(__pyx_t_7);
-  PyTuple_SET_ITEM(__pyx_t_10, 4, __pyx_t_8);
+  PyTuple_SET_ITEM(__pyx_t_13, 3+__pyx_t_12, __pyx_t_8);
   __Pyx_GIVEREF(__pyx_t_8);
-  PyTuple_SET_ITEM(__pyx_t_10, 5, __pyx_t_9);
+  PyTuple_SET_ITEM(__pyx_t_13, 4+__pyx_t_12, __pyx_t_9);
   __Pyx_GIVEREF(__pyx_t_9);
-  __pyx_t_4 = 0;
+  PyTuple_SET_ITEM(__pyx_t_13, 5+__pyx_t_12, __pyx_t_10);
+  __Pyx_GIVEREF(__pyx_t_10);
   __pyx_t_5 = 0;
   __pyx_t_6 = 0;
   __pyx_t_7 = 0;
   __pyx_t_8 = 0;
   __pyx_t_9 = 0;
-  __pyx_t_9 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_9);
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
-  __pyx_r = __pyx_t_9;
-  __pyx_t_9 = 0;
+  __pyx_t_10 = 0;
+  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_13, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_r = __pyx_t_3;
+  __pyx_t_3 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "pygrib.pyx":637
+ * ['_gh','fcstimeunits','expand_reduced','projparams','messagenumber','_all_keys','_ro_keys']
+ * 
+ * def julian_to_datetime(object jd):             # <<<<<<<<<<<<<<
+ *     """
+ *     julian_to_datetime(julday)
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_3);
   __Pyx_XDECREF(__pyx_t_4);
@@ -6334,6 +6915,8 @@ static PyObject *__pyx_pf_6pygrib_12julian_to_datetime(CYTHON_UNUSED PyObject *_
   __Pyx_XDECREF(__pyx_t_8);
   __Pyx_XDECREF(__pyx_t_9);
   __Pyx_XDECREF(__pyx_t_10);
+  __Pyx_XDECREF(__pyx_t_11);
+  __Pyx_XDECREF(__pyx_t_13);
   __Pyx_AddTraceback("pygrib.julian_to_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_r = NULL;
   __pyx_L0:;
@@ -6342,27 +6925,29 @@ static PyObject *__pyx_pf_6pygrib_12julian_to_datetime(CYTHON_UNUSED PyObject *_
   return __pyx_r;
 }
 
+/* "pygrib.pyx":654
+ *     return datetime(year, month, day, hour, minute, second)
+ * 
+ * def datetime_to_julian(object d):             # <<<<<<<<<<<<<<
+ *     """
+ *     datetime_to_julian(date)
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_6pygrib_15datetime_to_julian(PyObject *__pyx_self, PyObject *__pyx_v_d); /*proto*/
 static char __pyx_doc_6pygrib_14datetime_to_julian[] = "\n    datetime_to_julian(date)\n    \n    convert python datetime instance to Julian day number.";
-static PyMethodDef __pyx_mdef_6pygrib_15datetime_to_julian = {__Pyx_NAMESTR("datetime_to_julian"), (PyCFunction)__pyx_pw_6pygrib_15datetime_to_julian, METH_O, __Pyx_DOCSTR(__pyx_doc_6pygrib_14datetime_to_julian)};
+static PyMethodDef __pyx_mdef_6pygrib_15datetime_to_julian = {"datetime_to_julian", (PyCFunction)__pyx_pw_6pygrib_15datetime_to_julian, METH_O, __pyx_doc_6pygrib_14datetime_to_julian};
 static PyObject *__pyx_pw_6pygrib_15datetime_to_julian(PyObject *__pyx_self, PyObject *__pyx_v_d) {
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("datetime_to_julian (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_14datetime_to_julian(__pyx_self, ((PyObject *)__pyx_v_d));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "pygrib.pyx":660
- *     return datetime(year, month, day, hour, minute, second)
- * 
- * def datetime_to_julian(object d):             # <<<<<<<<<<<<<<
- *     """
- *     datetime_to_julian(date)
- */
-
 static PyObject *__pyx_pf_6pygrib_14datetime_to_julian(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_d) {
   double __pyx_v_julday;
   int __pyx_v_err;
@@ -6383,53 +6968,53 @@ static PyObject *__pyx_pf_6pygrib_14datetime_to_julian(CYTHON_UNUSED PyObject *_
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("datetime_to_julian", 0);
 
-  /* "pygrib.pyx":668
+  /* "pygrib.pyx":662
  *     cdef int err
  *     cdef long year, month, day, hour, minute, second
  *     year = d.year; month = d.month; day = d.day; hour = d.hour             # <<<<<<<<<<<<<<
  *     minute = d.minute; second = d.second
  *     err = grib_datetime_to_julian(year,month,day,hour,minute,second,&julday)
  */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_d, __pyx_n_s__year); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_d, __pyx_n_s_year); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyInt_AsLong(__pyx_t_1); if (unlikely((__pyx_t_2 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_2 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_v_year = __pyx_t_2;
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_d, __pyx_n_s__month); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_d, __pyx_n_s_month); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyInt_AsLong(__pyx_t_1); if (unlikely((__pyx_t_2 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_2 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_v_month = __pyx_t_2;
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_d, __pyx_n_s__day); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_d, __pyx_n_s_day); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyInt_AsLong(__pyx_t_1); if (unlikely((__pyx_t_2 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_2 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_v_day = __pyx_t_2;
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_d, __pyx_n_s__hour); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_d, __pyx_n_s_hour); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyInt_AsLong(__pyx_t_1); if (unlikely((__pyx_t_2 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_2 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_v_hour = __pyx_t_2;
 
-  /* "pygrib.pyx":669
+  /* "pygrib.pyx":663
  *     cdef long year, month, day, hour, minute, second
  *     year = d.year; month = d.month; day = d.day; hour = d.hour
  *     minute = d.minute; second = d.second             # <<<<<<<<<<<<<<
  *     err = grib_datetime_to_julian(year,month,day,hour,minute,second,&julday)
  *     if err:
  */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_d, __pyx_n_s__minute); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 669; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_d, __pyx_n_s_minute); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyInt_AsLong(__pyx_t_1); if (unlikely((__pyx_t_2 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 669; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_2 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_v_minute = __pyx_t_2;
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_d, __pyx_n_s__second); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 669; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_d, __pyx_n_s_second); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyInt_AsLong(__pyx_t_1); if (unlikely((__pyx_t_2 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 669; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_2 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_v_second = __pyx_t_2;
 
-  /* "pygrib.pyx":670
+  /* "pygrib.pyx":664
  *     year = d.year; month = d.month; day = d.day; hour = d.hour
  *     minute = d.minute; second = d.second
  *     err = grib_datetime_to_julian(year,month,day,hour,minute,second,&julday)             # <<<<<<<<<<<<<<
@@ -6438,7 +7023,7 @@ static PyObject *__pyx_pf_6pygrib_14datetime_to_julian(CYTHON_UNUSED PyObject *_
  */
   __pyx_v_err = grib_datetime_to_julian(__pyx_v_year, __pyx_v_month, __pyx_v_day, __pyx_v_hour, __pyx_v_minute, __pyx_v_second, (&__pyx_v_julday));
 
-  /* "pygrib.pyx":671
+  /* "pygrib.pyx":665
  *     minute = d.minute; second = d.second
  *     err = grib_datetime_to_julian(year,month,day,hour,minute,second,&julday)
  *     if err:             # <<<<<<<<<<<<<<
@@ -6448,31 +7033,29 @@ static PyObject *__pyx_pf_6pygrib_14datetime_to_julian(CYTHON_UNUSED PyObject *_
   __pyx_t_3 = (__pyx_v_err != 0);
   if (__pyx_t_3) {
 
-    /* "pygrib.pyx":672
+    /* "pygrib.pyx":666
  *     err = grib_datetime_to_julian(year,month,day,hour,minute,second,&julday)
  *     if err:
  *         raise RuntimeError(grib_get_error_message(err))             # <<<<<<<<<<<<<<
  *     return julday
  * 
  */
-    __pyx_t_1 = __Pyx_PyBytes_FromString(grib_get_error_message(__pyx_v_err)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
-    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = __Pyx_PyBytes_FromString(grib_get_error_message(__pyx_v_err)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
-    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_1));
-    __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
+    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
+    __Pyx_GIVEREF(__pyx_t_1);
     __pyx_t_1 = 0;
-    __pyx_t_1 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_Raise(__pyx_t_1, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L3;
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
-  __pyx_L3:;
 
-  /* "pygrib.pyx":673
+  /* "pygrib.pyx":667
  *     if err:
  *         raise RuntimeError(grib_get_error_message(err))
  *     return julday             # <<<<<<<<<<<<<<
@@ -6480,14 +7063,21 @@ static PyObject *__pyx_pf_6pygrib_14datetime_to_julian(CYTHON_UNUSED PyObject *_
  * cdef _create_gribmessage(grib_handle *gh, object messagenumber):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_julday); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_julday); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "pygrib.pyx":654
+ *     return datetime(year, month, day, hour, minute, second)
+ * 
+ * def datetime_to_julian(object d):             # <<<<<<<<<<<<<<
+ *     """
+ *     datetime_to_julian(date)
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_XDECREF(__pyx_t_4);
@@ -6499,7 +7089,7 @@ static PyObject *__pyx_pf_6pygrib_14datetime_to_julian(CYTHON_UNUSED PyObject *_
   return __pyx_r;
 }
 
-/* "pygrib.pyx":675
+/* "pygrib.pyx":669
  *     return julday
  * 
  * cdef _create_gribmessage(grib_handle *gh, object messagenumber):             # <<<<<<<<<<<<<<
@@ -6514,25 +7104,26 @@ static PyObject *__pyx_f_6pygrib__create_gribmessage(grib_handle *__pyx_v_gh, Py
   PyObject *__pyx_t_1 = NULL;
   PyObject *__pyx_t_2 = NULL;
   PyObject *__pyx_t_3 = NULL;
+  PyObject *__pyx_t_4 = NULL;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("_create_gribmessage", 0);
 
-  /* "pygrib.pyx":677
+  /* "pygrib.pyx":671
  * cdef _create_gribmessage(grib_handle *gh, object messagenumber):
  *     """factory function for creating gribmessage instances"""
  *     cdef gribmessage grb  = gribmessage.__new__(gribmessage)             # <<<<<<<<<<<<<<
  *     grb.messagenumber = messagenumber
  *     grb.expand_reduced = True
  */
-  __pyx_t_1 = __pyx_tp_new_6pygrib_gribmessage(((PyTypeObject *)((PyObject*)__pyx_ptype_6pygrib_gribmessage)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __pyx_tp_new_6pygrib_gribmessage(((PyTypeObject *)((PyObject*)__pyx_ptype_6pygrib_gribmessage)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6pygrib_gribmessage)))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6pygrib_gribmessage)))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_v_grb = ((struct __pyx_obj_6pygrib_gribmessage *)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "pygrib.pyx":678
+  /* "pygrib.pyx":672
  *     """factory function for creating gribmessage instances"""
  *     cdef gribmessage grb  = gribmessage.__new__(gribmessage)
  *     grb.messagenumber = messagenumber             # <<<<<<<<<<<<<<
@@ -6545,22 +7136,20 @@ static PyObject *__pyx_f_6pygrib__create_gribmessage(grib_handle *__pyx_v_gh, Py
   __Pyx_DECREF(__pyx_v_grb->messagenumber);
   __pyx_v_grb->messagenumber = __pyx_v_messagenumber;
 
-  /* "pygrib.pyx":679
+  /* "pygrib.pyx":673
  *     cdef gribmessage grb  = gribmessage.__new__(gribmessage)
  *     grb.messagenumber = messagenumber
  *     grb.expand_reduced = True             # <<<<<<<<<<<<<<
  *     grb._gh = grib_handle_clone(gh)
  *     grb._all_keys = grb.keys()
  */
-  __pyx_t_1 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_INCREF(Py_True);
+  __Pyx_GIVEREF(Py_True);
   __Pyx_GOTREF(__pyx_v_grb->expand_reduced);
   __Pyx_DECREF(__pyx_v_grb->expand_reduced);
-  __pyx_v_grb->expand_reduced = __pyx_t_1;
-  __pyx_t_1 = 0;
+  __pyx_v_grb->expand_reduced = Py_True;
 
-  /* "pygrib.pyx":680
+  /* "pygrib.pyx":674
  *     grb.messagenumber = messagenumber
  *     grb.expand_reduced = True
  *     grb._gh = grib_handle_clone(gh)             # <<<<<<<<<<<<<<
@@ -6569,34 +7158,64 @@ static PyObject *__pyx_f_6pygrib__create_gribmessage(grib_handle *__pyx_v_gh, Py
  */
   __pyx_v_grb->_gh = grib_handle_clone(__pyx_v_gh);
 
-  /* "pygrib.pyx":681
+  /* "pygrib.pyx":675
  *     grb.expand_reduced = True
  *     grb._gh = grib_handle_clone(gh)
  *     grb._all_keys = grb.keys()             # <<<<<<<<<<<<<<
  *     grb._ro_keys  = grb._read_only_keys()
  *     grb._set_projparams() # set projection parameter dict.
  */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_grb), __pyx_n_s__keys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_grb), __pyx_n_s_keys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 675; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_GIVEREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  if (__pyx_t_3) {
+    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 675; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  } else {
+    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 675; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  }
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_GIVEREF(__pyx_t_1);
   __Pyx_GOTREF(__pyx_v_grb->_all_keys);
   __Pyx_DECREF(__pyx_v_grb->_all_keys);
-  __pyx_v_grb->_all_keys = __pyx_t_2;
-  __pyx_t_2 = 0;
+  __pyx_v_grb->_all_keys = __pyx_t_1;
+  __pyx_t_1 = 0;
 
-  /* "pygrib.pyx":682
+  /* "pygrib.pyx":676
  *     grb._gh = grib_handle_clone(gh)
  *     grb._all_keys = grb.keys()
  *     grb._ro_keys  = grb._read_only_keys()             # <<<<<<<<<<<<<<
  *     grb._set_projparams() # set projection parameter dict.
  *     return setdates(grb)
  */
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_grb), __pyx_n_s___read_only_keys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_grb), __pyx_n_s_read_only_keys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = NULL;
+  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  if (__pyx_t_3) {
+    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  } else {
+    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  }
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __Pyx_GIVEREF(__pyx_t_1);
@@ -6605,21 +7224,36 @@ static PyObject *__pyx_f_6pygrib__create_gribmessage(grib_handle *__pyx_v_gh, Py
   __pyx_v_grb->_ro_keys = __pyx_t_1;
   __pyx_t_1 = 0;
 
-  /* "pygrib.pyx":683
+  /* "pygrib.pyx":677
  *     grb._all_keys = grb.keys()
  *     grb._ro_keys  = grb._read_only_keys()
  *     grb._set_projparams() # set projection parameter dict.             # <<<<<<<<<<<<<<
  *     return setdates(grb)
  * 
  */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_grb), __pyx_n_s___set_projparams); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 683; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 683; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_grb), __pyx_n_s_set_projparams); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_3 = NULL;
+  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  if (__pyx_t_3) {
+    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  } else {
+    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  }
+  __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "pygrib.pyx":684
+  /* "pygrib.pyx":678
  *     grb._ro_keys  = grb._read_only_keys()
  *     grb._set_projparams() # set projection parameter dict.
  *     return setdates(grb)             # <<<<<<<<<<<<<<
@@ -6627,27 +7261,51 @@ static PyObject *__pyx_f_6pygrib__create_gribmessage(grib_handle *__pyx_v_gh, Py
  * def fromstring(gribstring):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__setdates); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 684; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_setdates); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 684; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_INCREF(((PyObject *)__pyx_v_grb));
-  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_grb));
-  __Pyx_GIVEREF(((PyObject *)__pyx_v_grb));
-  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 684; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_3 = NULL;
+  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  if (!__pyx_t_3) {
+    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_grb)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+  } else {
+    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
+    __Pyx_INCREF(((PyObject *)__pyx_v_grb));
+    PyTuple_SET_ITEM(__pyx_t_4, 0+1, ((PyObject *)__pyx_v_grb));
+    __Pyx_GIVEREF(((PyObject *)__pyx_v_grb));
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  }
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
-  __pyx_r = __pyx_t_3;
-  __pyx_t_3 = 0;
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "pygrib.pyx":669
+ *     return julday
+ * 
+ * cdef _create_gribmessage(grib_handle *gh, object messagenumber):             # <<<<<<<<<<<<<<
+ *     """factory function for creating gribmessage instances"""
+ *     cdef gribmessage grb  = gribmessage.__new__(gribmessage)
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_XDECREF(__pyx_t_2);
   __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
   __Pyx_AddTraceback("pygrib._create_gribmessage", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_r = 0;
   __pyx_L0:;
@@ -6657,27 +7315,29 @@ static PyObject *__pyx_f_6pygrib__create_gribmessage(grib_handle *__pyx_v_gh, Py
   return __pyx_r;
 }
 
+/* "pygrib.pyx":680
+ *     return setdates(grb)
+ * 
+ * def fromstring(gribstring):             # <<<<<<<<<<<<<<
+ *     """
+ *     fromstring(string)
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_6pygrib_17fromstring(PyObject *__pyx_self, PyObject *__pyx_v_gribstring); /*proto*/
 static char __pyx_doc_6pygrib_16fromstring[] = "\n    fromstring(string)\n\n    Create a gribmessage instance from a python bytes object\n    representing a binary grib message (the reverse of L{gribmessage.tostring}).\n    ";
-static PyMethodDef __pyx_mdef_6pygrib_17fromstring = {__Pyx_NAMESTR("fromstring"), (PyCFunction)__pyx_pw_6pygrib_17fromstring, METH_O, __Pyx_DOCSTR(__pyx_doc_6pygrib_16fromstring)};
+static PyMethodDef __pyx_mdef_6pygrib_17fromstring = {"fromstring", (PyCFunction)__pyx_pw_6pygrib_17fromstring, METH_O, __pyx_doc_6pygrib_16fromstring};
 static PyObject *__pyx_pw_6pygrib_17fromstring(PyObject *__pyx_self, PyObject *__pyx_v_gribstring) {
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("fromstring (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_16fromstring(__pyx_self, ((PyObject *)__pyx_v_gribstring));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "pygrib.pyx":686
- *     return setdates(grb)
- * 
- * def fromstring(gribstring):             # <<<<<<<<<<<<<<
- *     """
- *     fromstring(string)
- */
-
 static PyObject *__pyx_pf_6pygrib_16fromstring(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_gribstring) {
   char *__pyx_v_gribstr;
   grib_handle *__pyx_v_gh;
@@ -6689,45 +7349,46 @@ static PyObject *__pyx_pf_6pygrib_16fromstring(CYTHON_UNUSED PyObject *__pyx_sel
   PyObject *__pyx_t_3 = NULL;
   PyObject *__pyx_t_4 = NULL;
   PyObject *__pyx_t_5 = NULL;
+  PyObject *__pyx_t_6 = NULL;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("fromstring", 0);
 
-  /* "pygrib.pyx":696
+  /* "pygrib.pyx":690
  *     cdef grib_handle * gh
  *     cdef gribmessage grb
  *     gribstr = gribstring             # <<<<<<<<<<<<<<
  *     gh = grib_handle_new_from_message_copy(NULL, <void *>gribstr, len(gribstring))
  *     grb  = gribmessage.__new__(gribmessage)
  */
-  __pyx_t_1 = __Pyx_PyObject_AsString(__pyx_v_gribstring); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_PyObject_AsString(__pyx_v_gribstring); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 690; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_v_gribstr = __pyx_t_1;
 
-  /* "pygrib.pyx":697
+  /* "pygrib.pyx":691
  *     cdef gribmessage grb
  *     gribstr = gribstring
  *     gh = grib_handle_new_from_message_copy(NULL, <void *>gribstr, len(gribstring))             # <<<<<<<<<<<<<<
  *     grb  = gribmessage.__new__(gribmessage)
  *     grb.messagenumber = 1
  */
-  __pyx_t_2 = PyObject_Length(__pyx_v_gribstring); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyObject_Length(__pyx_v_gribstring); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_v_gh = grib_handle_new_from_message_copy(NULL, ((void *)__pyx_v_gribstr), __pyx_t_2);
 
-  /* "pygrib.pyx":698
+  /* "pygrib.pyx":692
  *     gribstr = gribstring
  *     gh = grib_handle_new_from_message_copy(NULL, <void *>gribstr, len(gribstring))
  *     grb  = gribmessage.__new__(gribmessage)             # <<<<<<<<<<<<<<
  *     grb.messagenumber = 1
  *     grb.expand_reduced = True
  */
-  __pyx_t_3 = __pyx_tp_new_6pygrib_gribmessage(((PyTypeObject *)((PyObject*)__pyx_ptype_6pygrib_gribmessage)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __pyx_tp_new_6pygrib_gribmessage(((PyTypeObject *)((PyObject*)__pyx_ptype_6pygrib_gribmessage)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 692; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
-  if (!(likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6pygrib_gribmessage)))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (!(likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6pygrib_gribmessage)))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 692; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_v_grb = ((struct __pyx_obj_6pygrib_gribmessage *)__pyx_t_3);
   __pyx_t_3 = 0;
 
-  /* "pygrib.pyx":699
+  /* "pygrib.pyx":693
  *     gh = grib_handle_new_from_message_copy(NULL, <void *>gribstr, len(gribstring))
  *     grb  = gribmessage.__new__(gribmessage)
  *     grb.messagenumber = 1             # <<<<<<<<<<<<<<
@@ -6740,22 +7401,20 @@ static PyObject *__pyx_pf_6pygrib_16fromstring(CYTHON_UNUSED PyObject *__pyx_sel
   __Pyx_DECREF(__pyx_v_grb->messagenumber);
   __pyx_v_grb->messagenumber = __pyx_int_1;
 
-  /* "pygrib.pyx":700
+  /* "pygrib.pyx":694
  *     grb  = gribmessage.__new__(gribmessage)
  *     grb.messagenumber = 1
  *     grb.expand_reduced = True             # <<<<<<<<<<<<<<
  *     grb._gh = gh
  *     grb._all_keys = grb.keys()
  */
-  __pyx_t_3 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_GIVEREF(__pyx_t_3);
+  __Pyx_INCREF(Py_True);
+  __Pyx_GIVEREF(Py_True);
   __Pyx_GOTREF(__pyx_v_grb->expand_reduced);
   __Pyx_DECREF(__pyx_v_grb->expand_reduced);
-  __pyx_v_grb->expand_reduced = __pyx_t_3;
-  __pyx_t_3 = 0;
+  __pyx_v_grb->expand_reduced = Py_True;
 
-  /* "pygrib.pyx":701
+  /* "pygrib.pyx":695
  *     grb.messagenumber = 1
  *     grb.expand_reduced = True
  *     grb._gh = gh             # <<<<<<<<<<<<<<
@@ -6764,34 +7423,64 @@ static PyObject *__pyx_pf_6pygrib_16fromstring(CYTHON_UNUSED PyObject *__pyx_sel
  */
   __pyx_v_grb->_gh = __pyx_v_gh;
 
-  /* "pygrib.pyx":702
+  /* "pygrib.pyx":696
  *     grb.expand_reduced = True
  *     grb._gh = gh
  *     grb._all_keys = grb.keys()             # <<<<<<<<<<<<<<
  *     grb._ro_keys  = grb._read_only_keys()
  *     grb._set_projparams() # set projection parameter dict.
  */
-  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_grb), __pyx_n_s__keys); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_grb), __pyx_n_s_keys); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_GIVEREF(__pyx_t_4);
+  __pyx_t_5 = NULL;
+  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
+    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
+    if (likely(__pyx_t_5)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+      __Pyx_INCREF(__pyx_t_5);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_4, function);
+    }
+  }
+  if (__pyx_t_5) {
+    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  } else {
+    __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  }
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __Pyx_GIVEREF(__pyx_t_3);
   __Pyx_GOTREF(__pyx_v_grb->_all_keys);
   __Pyx_DECREF(__pyx_v_grb->_all_keys);
-  __pyx_v_grb->_all_keys = __pyx_t_4;
-  __pyx_t_4 = 0;
+  __pyx_v_grb->_all_keys = __pyx_t_3;
+  __pyx_t_3 = 0;
 
-  /* "pygrib.pyx":703
+  /* "pygrib.pyx":697
  *     grb._gh = gh
  *     grb._all_keys = grb.keys()
  *     grb._ro_keys  = grb._read_only_keys()             # <<<<<<<<<<<<<<
  *     grb._set_projparams() # set projection parameter dict.
  *     return setdates(grb)
  */
-  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_grb), __pyx_n_s___read_only_keys); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_grb), __pyx_n_s_read_only_keys); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = NULL;
+  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
+    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
+    if (likely(__pyx_t_5)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+      __Pyx_INCREF(__pyx_t_5);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_4, function);
+    }
+  }
+  if (__pyx_t_5) {
+    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  } else {
+    __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  }
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   __Pyx_GIVEREF(__pyx_t_3);
@@ -6800,21 +7489,36 @@ static PyObject *__pyx_pf_6pygrib_16fromstring(CYTHON_UNUSED PyObject *__pyx_sel
   __pyx_v_grb->_ro_keys = __pyx_t_3;
   __pyx_t_3 = 0;
 
-  /* "pygrib.pyx":704
+  /* "pygrib.pyx":698
  *     grb._all_keys = grb.keys()
  *     grb._ro_keys  = grb._read_only_keys()
  *     grb._set_projparams() # set projection parameter dict.             # <<<<<<<<<<<<<<
  *     return setdates(grb)
  * 
  */
-  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_grb), __pyx_n_s___set_projparams); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_grb), __pyx_n_s_set_projparams); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_t_5 = NULL;
+  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
+    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
+    if (likely(__pyx_t_5)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+      __Pyx_INCREF(__pyx_t_5);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_4, function);
+    }
+  }
+  if (__pyx_t_5) {
+    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  } else {
+    __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  }
+  __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
-  /* "pygrib.pyx":705
+  /* "pygrib.pyx":699
  *     grb._ro_keys  = grb._read_only_keys()
  *     grb._set_projparams() # set projection parameter dict.
  *     return setdates(grb)             # <<<<<<<<<<<<<<
@@ -6822,27 +7526,51 @@ static PyObject *__pyx_pf_6pygrib_16fromstring(CYTHON_UNUSED PyObject *__pyx_sel
  * def setdates(gribmessage grb):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__setdates); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_setdates); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_INCREF(((PyObject *)__pyx_v_grb));
-  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_grb));
-  __Pyx_GIVEREF(((PyObject *)__pyx_v_grb));
-  __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_5 = NULL;
+  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
+    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
+    if (likely(__pyx_t_5)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+      __Pyx_INCREF(__pyx_t_5);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_4, function);
+    }
+  }
+  if (!__pyx_t_5) {
+    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_v_grb)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+  } else {
+    __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_6);
+    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
+    __Pyx_INCREF(((PyObject *)__pyx_v_grb));
+    PyTuple_SET_ITEM(__pyx_t_6, 0+1, ((PyObject *)__pyx_v_grb));
+    __Pyx_GIVEREF(((PyObject *)__pyx_v_grb));
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  }
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-  __pyx_r = __pyx_t_5;
-  __pyx_t_5 = 0;
+  __pyx_r = __pyx_t_3;
+  __pyx_t_3 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "pygrib.pyx":680
+ *     return setdates(grb)
+ * 
+ * def fromstring(gribstring):             # <<<<<<<<<<<<<<
+ *     """
+ *     fromstring(string)
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_3);
   __Pyx_XDECREF(__pyx_t_4);
   __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
   __Pyx_AddTraceback("pygrib.fromstring", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_r = NULL;
   __pyx_L0:;
@@ -6852,10 +7580,18 @@ static PyObject *__pyx_pf_6pygrib_16fromstring(CYTHON_UNUSED PyObject *__pyx_sel
   return __pyx_r;
 }
 
+/* "pygrib.pyx":701
+ *     return setdates(grb)
+ * 
+ * def setdates(gribmessage grb):             # <<<<<<<<<<<<<<
+ *     """
+ *     setdates(grb)
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_6pygrib_19setdates(PyObject *__pyx_self, PyObject *__pyx_v_grb); /*proto*/
 static char __pyx_doc_6pygrib_18setdates[] = "\n    setdates(grb)\n    \n    set fcstimeunits, analDate and validDate attributes using\n    julianDay, forecastTime and indicatorOfUnitOfTimeRange.\n    Called automatically when gribmessage instance created,\n    but can be called manually to update keys if one of \n    them is modified after instance creation.\n    ";
-static PyMethodDef __pyx_mdef_6pygrib_19setdates = {__Pyx_NAMESTR("setdates"), (PyCFunction)__pyx_pw_6pygrib_19setdates, METH_O, __Pyx_DOCSTR(__pyx_doc_6pygrib_18setdates)};
+static PyMethodDef __pyx_mdef_6pygrib_19setdates = {"setdates", (PyCFunction)__pyx_pw_6pygrib_19setdates, METH_O, __pyx_doc_6pygrib_18setdates};
 static PyObject *__pyx_pw_6pygrib_19setdates(PyObject *__pyx_self, PyObject *__pyx_v_grb) {
   CYTHON_UNUSED int __pyx_lineno = 0;
   CYTHON_UNUSED const char *__pyx_filename = NULL;
@@ -6863,8 +7599,10 @@ static PyObject *__pyx_pw_6pygrib_19setdates(PyObject *__pyx_self, PyObject *__p
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("setdates (wrapper)", 0);
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_grb), __pyx_ptype_6pygrib_gribmessage, 1, "grb", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_grb), __pyx_ptype_6pygrib_gribmessage, 1, "grb", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_r = __pyx_pf_6pygrib_18setdates(__pyx_self, ((struct __pyx_obj_6pygrib_gribmessage *)__pyx_v_grb));
+
+  /* function exit code */
   goto __pyx_L0;
   __pyx_L1_error:;
   __pyx_r = NULL;
@@ -6873,21 +7611,13 @@ static PyObject *__pyx_pw_6pygrib_19setdates(PyObject *__pyx_self, PyObject *__p
   return __pyx_r;
 }
 
-/* "pygrib.pyx":707
- *     return setdates(grb)
- * 
- * def setdates(gribmessage grb):             # <<<<<<<<<<<<<<
- *     """
- *     setdates(grb)
- */
-
 static PyObject *__pyx_pf_6pygrib_18setdates(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6pygrib_gribmessage *__pyx_v_grb) {
   PyObject *__pyx_v_ftime = NULL;
   PyObject *__pyx_r = NULL;
   __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
+  int __pyx_t_1;
   PyObject *__pyx_t_2 = NULL;
-  int __pyx_t_3;
+  PyObject *__pyx_t_3 = NULL;
   int __pyx_t_4;
   int __pyx_t_5;
   PyObject *__pyx_t_6 = NULL;
@@ -6896,76 +7626,80 @@ static PyObject *__pyx_pf_6pygrib_18setdates(CYTHON_UNUSED PyObject *__pyx_self,
   PyObject *__pyx_t_9 = NULL;
   double __pyx_t_10;
   PyObject *__pyx_t_11 = NULL;
-  int __pyx_t_12;
+  PyObject *__pyx_t_12 = NULL;
+  int __pyx_t_13;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("setdates", 0);
 
-  /* "pygrib.pyx":717
+  /* "pygrib.pyx":711
  *     them is modified after instance creation.
  *     """
  *     grb.fcstimeunits = ""             # <<<<<<<<<<<<<<
  *     if grb.has_key('indicatorOfUnitOfTimeRange') and\
  *        grb.indicatorOfUnitOfTimeRange in _ftimedict:
  */
-  __Pyx_INCREF(((PyObject *)__pyx_kp_s_19));
-  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_19));
+  __Pyx_INCREF(__pyx_kp_s__8);
+  __Pyx_GIVEREF(__pyx_kp_s__8);
   __Pyx_GOTREF(__pyx_v_grb->fcstimeunits);
   __Pyx_DECREF(__pyx_v_grb->fcstimeunits);
-  __pyx_v_grb->fcstimeunits = ((PyObject *)__pyx_kp_s_19);
+  __pyx_v_grb->fcstimeunits = __pyx_kp_s__8;
 
-  /* "pygrib.pyx":718
+  /* "pygrib.pyx":712
  *     """
  *     grb.fcstimeunits = ""
  *     if grb.has_key('indicatorOfUnitOfTimeRange') and\             # <<<<<<<<<<<<<<
  *        grb.indicatorOfUnitOfTimeRange in _ftimedict:
  *         grb.fcstimeunits = _ftimedict[grb.indicatorOfUnitOfTimeRange]
  */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_grb), __pyx_n_s__has_key); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_21), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_grb), __pyx_n_s_has_key); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (__pyx_t_3) {
+  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (__pyx_t_4) {
+  } else {
+    __pyx_t_1 = __pyx_t_4;
+    goto __pyx_L4_bool_binop_done;
+  }
 
-    /* "pygrib.pyx":719
+  /* "pygrib.pyx":713
  *     grb.fcstimeunits = ""
  *     if grb.has_key('indicatorOfUnitOfTimeRange') and\
  *        grb.indicatorOfUnitOfTimeRange in _ftimedict:             # <<<<<<<<<<<<<<
  *         grb.fcstimeunits = _ftimedict[grb.indicatorOfUnitOfTimeRange]
  *     if grb.has_key('forecastTime'):
  */
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_grb), __pyx_n_s_20); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s___ftimedict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_4 = (__Pyx_PySequence_Contains(__pyx_t_2, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_5 = __pyx_t_4;
-  } else {
-    __pyx_t_5 = __pyx_t_3;
-  }
-  if (__pyx_t_5) {
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_grb), __pyx_n_s_indicatorOfUnitOfTimeRange); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ftimedict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_4 = (__Pyx_PySequence_Contains(__pyx_t_3, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_5 = (__pyx_t_4 != 0);
+  __pyx_t_1 = __pyx_t_5;
+  __pyx_L4_bool_binop_done:;
+  if (__pyx_t_1) {
 
-    /* "pygrib.pyx":720
+    /* "pygrib.pyx":714
  *     if grb.has_key('indicatorOfUnitOfTimeRange') and\
  *        grb.indicatorOfUnitOfTimeRange in _ftimedict:
  *         grb.fcstimeunits = _ftimedict[grb.indicatorOfUnitOfTimeRange]             # <<<<<<<<<<<<<<
  *     if grb.has_key('forecastTime'):
  *         if grb.has_key('stepRange'):
  */
-    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s___ftimedict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_grb), __pyx_n_s_20); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ftimedict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_6 = PyObject_GetItem(__pyx_t_1, __pyx_t_2); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_grb), __pyx_n_s_indicatorOfUnitOfTimeRange); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_6 = PyObject_GetItem(__pyx_t_2, __pyx_t_3); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
     __Pyx_GOTREF(__pyx_t_6);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_GIVEREF(__pyx_t_6);
     __Pyx_GOTREF(__pyx_v_grb->fcstimeunits);
     __Pyx_DECREF(__pyx_v_grb->fcstimeunits);
@@ -6975,63 +7709,63 @@ static PyObject *__pyx_pf_6pygrib_18setdates(CYTHON_UNUSED PyObject *__pyx_self,
   }
   __pyx_L3:;
 
-  /* "pygrib.pyx":721
+  /* "pygrib.pyx":715
  *        grb.indicatorOfUnitOfTimeRange in _ftimedict:
  *         grb.fcstimeunits = _ftimedict[grb.indicatorOfUnitOfTimeRange]
  *     if grb.has_key('forecastTime'):             # <<<<<<<<<<<<<<
  *         if grb.has_key('stepRange'):
  *             # this is a hack to work around grib_api bug
  */
-  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_grb), __pyx_n_s__has_key); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_grb), __pyx_n_s_has_key); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_2 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_k_tuple_22), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (__pyx_t_5) {
+  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (__pyx_t_1) {
 
-    /* "pygrib.pyx":722
+    /* "pygrib.pyx":716
  *         grb.fcstimeunits = _ftimedict[grb.indicatorOfUnitOfTimeRange]
  *     if grb.has_key('forecastTime'):
  *         if grb.has_key('stepRange'):             # <<<<<<<<<<<<<<
  *             # this is a hack to work around grib_api bug
  *             # sometimes stepUnits and indicatorOfUnitOfTimeRange
  */
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_grb), __pyx_n_s__has_key); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_6 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_23), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_grb), __pyx_n_s_has_key); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_6);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    if (__pyx_t_5) {
+    if (__pyx_t_1) {
 
-      /* "pygrib.pyx":726
+      /* "pygrib.pyx":720
  *             # sometimes stepUnits and indicatorOfUnitOfTimeRange
  *             # are inconsistent.
  *             grb.stepUnits = grb.indicatorOfUnitOfTimeRange             # <<<<<<<<<<<<<<
  *             ftime = grb['stepRange'] # computed key, uses stepUnits
  *             # if it's a range, use the end of the range to define validDate
  */
-      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_grb), __pyx_n_s_20); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 726; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_grb), __pyx_n_s_indicatorOfUnitOfTimeRange); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_6);
-      if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_grb), __pyx_n_s__stepUnits, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 726; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_grb), __pyx_n_s_stepUnits, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
-      /* "pygrib.pyx":727
+      /* "pygrib.pyx":721
  *             # are inconsistent.
  *             grb.stepUnits = grb.indicatorOfUnitOfTimeRange
  *             ftime = grb['stepRange'] # computed key, uses stepUnits             # <<<<<<<<<<<<<<
  *             # if it's a range, use the end of the range to define validDate
  *             try:
  */
-      __pyx_t_6 = PyObject_GetItem(((PyObject *)__pyx_v_grb), ((PyObject *)__pyx_n_s__stepRange)); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_6 = PyObject_GetItem(((PyObject *)__pyx_v_grb), __pyx_n_s_stepRange); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
       __Pyx_GOTREF(__pyx_t_6);
       __pyx_v_ftime = __pyx_t_6;
       __pyx_t_6 = 0;
 
-      /* "pygrib.pyx":729
+      /* "pygrib.pyx":723
  *             ftime = grb['stepRange'] # computed key, uses stepUnits
  *             # if it's a range, use the end of the range to define validDate
  *             try:             # <<<<<<<<<<<<<<
@@ -7045,24 +7779,24 @@ static PyObject *__pyx_pf_6pygrib_18setdates(CYTHON_UNUSED PyObject *__pyx_self,
         __Pyx_XGOTREF(__pyx_t_9);
         /*try:*/ {
 
-          /* "pygrib.pyx":730
+          /* "pygrib.pyx":724
  *             # if it's a range, use the end of the range to define validDate
  *             try:
  *                 ftime = float(ftime.split('-')[1])             # <<<<<<<<<<<<<<
  *             except:
  *                 ftime = grb.forecastTime
  */
-          __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_ftime, __pyx_n_s__split); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 730; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
+          __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_ftime, __pyx_n_s_split); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
           __Pyx_GOTREF(__pyx_t_6);
-          __pyx_t_2 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_k_tuple_25), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 730; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
-          __Pyx_GOTREF(__pyx_t_2);
+          __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
+          __Pyx_GOTREF(__pyx_t_3);
           __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-          __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_2, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 730; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
+          __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_3, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L8_error;};
           __Pyx_GOTREF(__pyx_t_6);
-          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-          __pyx_t_10 = __Pyx_PyObject_AsDouble(__pyx_t_6); if (unlikely(__pyx_t_10 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 730; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
+          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+          __pyx_t_10 = __Pyx_PyObject_AsDouble(__pyx_t_6); if (unlikely(__pyx_t_10 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
           __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-          __pyx_t_6 = PyFloat_FromDouble(__pyx_t_10); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 730; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
+          __pyx_t_6 = PyFloat_FromDouble(__pyx_t_10); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
           __Pyx_GOTREF(__pyx_t_6);
           __Pyx_DECREF_SET(__pyx_v_ftime, __pyx_t_6);
           __pyx_t_6 = 0;
@@ -7070,13 +7804,13 @@ static PyObject *__pyx_pf_6pygrib_18setdates(CYTHON_UNUSED PyObject *__pyx_self,
         __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
         __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
         __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
-        goto __pyx_L13_try_end;
-        __pyx_L6_error:;
-        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
-        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+        goto __pyx_L15_try_end;
+        __pyx_L8_error:;
+        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
         __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
 
-        /* "pygrib.pyx":731
+        /* "pygrib.pyx":725
  *             try:
  *                 ftime = float(ftime.split('-')[1])
  *             except:             # <<<<<<<<<<<<<<
@@ -7085,62 +7819,62 @@ static PyObject *__pyx_pf_6pygrib_18setdates(CYTHON_UNUSED PyObject *__pyx_self,
  */
         /*except:*/ {
           __Pyx_AddTraceback("pygrib.setdates", __pyx_clineno, __pyx_lineno, __pyx_filename);
-          if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_2, &__pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
+          if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_3, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
           __Pyx_GOTREF(__pyx_t_6);
+          __Pyx_GOTREF(__pyx_t_3);
           __Pyx_GOTREF(__pyx_t_2);
-          __Pyx_GOTREF(__pyx_t_1);
 
-          /* "pygrib.pyx":732
+          /* "pygrib.pyx":726
  *                 ftime = float(ftime.split('-')[1])
  *             except:
  *                 ftime = grb.forecastTime             # <<<<<<<<<<<<<<
  *         else:
  *             ftime = grb.forecastTime
  */
-          __pyx_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_grb), __pyx_n_s__forecastTime); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
+          __pyx_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_grb), __pyx_n_s_forecastTime); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 726; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
           __Pyx_GOTREF(__pyx_t_11);
           __Pyx_DECREF_SET(__pyx_v_ftime, __pyx_t_11);
           __pyx_t_11 = 0;
           __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
           __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-          goto __pyx_L7_exception_handled;
+          goto __pyx_L9_exception_handled;
         }
-        __pyx_L8_except_error:;
+        __pyx_L10_except_error:;
         __Pyx_XGIVEREF(__pyx_t_7);
         __Pyx_XGIVEREF(__pyx_t_8);
         __Pyx_XGIVEREF(__pyx_t_9);
         __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
         goto __pyx_L1_error;
-        __pyx_L7_exception_handled:;
+        __pyx_L9_exception_handled:;
         __Pyx_XGIVEREF(__pyx_t_7);
         __Pyx_XGIVEREF(__pyx_t_8);
         __Pyx_XGIVEREF(__pyx_t_9);
         __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
-        __pyx_L13_try_end:;
+        __pyx_L15_try_end:;
       }
-      goto __pyx_L5;
+      goto __pyx_L7;
     }
     /*else*/ {
 
-      /* "pygrib.pyx":734
+      /* "pygrib.pyx":728
  *                 ftime = grb.forecastTime
  *         else:
  *             ftime = grb.forecastTime             # <<<<<<<<<<<<<<
  *     else:
  *         ftime = 0
  */
-      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_grb), __pyx_n_s__forecastTime); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __pyx_v_ftime = __pyx_t_1;
-      __pyx_t_1 = 0;
+      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_grb), __pyx_n_s_forecastTime); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_v_ftime = __pyx_t_2;
+      __pyx_t_2 = 0;
     }
-    __pyx_L5:;
-    goto __pyx_L4;
+    __pyx_L7:;
+    goto __pyx_L6;
   }
   /*else*/ {
 
-    /* "pygrib.pyx":736
+    /* "pygrib.pyx":730
  *             ftime = grb.forecastTime
  *     else:
  *         ftime = 0             # <<<<<<<<<<<<<<
@@ -7150,25 +7884,25 @@ static PyObject *__pyx_pf_6pygrib_18setdates(CYTHON_UNUSED PyObject *__pyx_self,
     __Pyx_INCREF(__pyx_int_0);
     __pyx_v_ftime = __pyx_int_0;
   }
-  __pyx_L4:;
+  __pyx_L6:;
 
-  /* "pygrib.pyx":737
+  /* "pygrib.pyx":731
  *     else:
  *         ftime = 0
  *     if grb.has_key('julianDay'):             # <<<<<<<<<<<<<<
  *         # don't do anything if datetime fails (because of a miscoded julianDay)
  *         try:
  */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_grb), __pyx_n_s__has_key); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_26), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_grb), __pyx_n_s_has_key); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (__pyx_t_5) {
+  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (__pyx_t_1) {
 
-    /* "pygrib.pyx":739
+    /* "pygrib.pyx":733
  *     if grb.has_key('julianDay'):
  *         # don't do anything if datetime fails (because of a miscoded julianDay)
  *         try:             # <<<<<<<<<<<<<<
@@ -7182,66 +7916,84 @@ static PyObject *__pyx_pf_6pygrib_18setdates(CYTHON_UNUSED PyObject *__pyx_self,
       __Pyx_XGOTREF(__pyx_t_7);
       /*try:*/ {
 
-        /* "pygrib.pyx":741
+        /* "pygrib.pyx":735
  *         try:
  *             grb.analDate =\
  *             julian_to_datetime(grb.julianDay)             # <<<<<<<<<<<<<<
  *         except ValueError:
  *             return grb
  */
-        __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__julian_to_datetime); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
+        __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_julian_to_datetime); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
         __Pyx_GOTREF(__pyx_t_2);
-        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_grb), __pyx_n_s__julianDay); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
-        __Pyx_GOTREF(__pyx_t_1);
-        __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
+        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_grb), __pyx_n_s_julianDay); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
         __Pyx_GOTREF(__pyx_t_6);
-        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
-        __Pyx_GIVEREF(__pyx_t_1);
-        __pyx_t_1 = 0;
-        __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
-        __Pyx_GOTREF(__pyx_t_1);
+        __pyx_t_11 = NULL;
+        if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
+          __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_2);
+          if (likely(__pyx_t_11)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+            __Pyx_INCREF(__pyx_t_11);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_2, function);
+          }
+        }
+        if (!__pyx_t_11) {
+          __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
+          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+          __Pyx_GOTREF(__pyx_t_3);
+        } else {
+          __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
+          __Pyx_GOTREF(__pyx_t_12);
+          PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __Pyx_GIVEREF(__pyx_t_11); __pyx_t_11 = NULL;
+          PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_6);
+          __Pyx_GIVEREF(__pyx_t_6);
+          __pyx_t_6 = 0;
+          __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_12, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
+          __Pyx_GOTREF(__pyx_t_3);
+          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+        }
         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-        __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
 
-        /* "pygrib.pyx":740
+        /* "pygrib.pyx":734
  *         # don't do anything if datetime fails (because of a miscoded julianDay)
  *         try:
  *             grb.analDate =\             # <<<<<<<<<<<<<<
  *             julian_to_datetime(grb.julianDay)
  *         except ValueError:
  */
-        __Pyx_GIVEREF(__pyx_t_1);
+        __Pyx_GIVEREF(__pyx_t_3);
         __Pyx_GOTREF(__pyx_v_grb->analDate);
         __Pyx_DECREF(__pyx_v_grb->analDate);
-        __pyx_v_grb->analDate = __pyx_t_1;
-        __pyx_t_1 = 0;
+        __pyx_v_grb->analDate = __pyx_t_3;
+        __pyx_t_3 = 0;
       }
       __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
       __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
       __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
-      goto __pyx_L24_try_end;
-      __pyx_L17_error:;
+      goto __pyx_L26_try_end;
+      __pyx_L19_error:;
       __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
-      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
       __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
-      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
+      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
 
-      /* "pygrib.pyx":742
+      /* "pygrib.pyx":736
  *             grb.analDate =\
  *             julian_to_datetime(grb.julianDay)
  *         except ValueError:             # <<<<<<<<<<<<<<
  *             return grb
  *         if grb.fcstimeunits == 'hrs':
  */
-      __pyx_t_12 = PyErr_ExceptionMatches(__pyx_builtin_ValueError);
-      if (__pyx_t_12) {
+      __pyx_t_13 = PyErr_ExceptionMatches(__pyx_builtin_ValueError);
+      if (__pyx_t_13) {
         __Pyx_AddTraceback("pygrib.setdates", __pyx_clineno, __pyx_lineno, __pyx_filename);
-        if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_6, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 742; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;}
-        __Pyx_GOTREF(__pyx_t_1);
-        __Pyx_GOTREF(__pyx_t_6);
+        if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L21_except_error;}
+        __Pyx_GOTREF(__pyx_t_3);
         __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_GOTREF(__pyx_t_12);
 
-        /* "pygrib.pyx":743
+        /* "pygrib.pyx":737
  *             julian_to_datetime(grb.julianDay)
  *         except ValueError:
  *             return grb             # <<<<<<<<<<<<<<
@@ -7251,48 +8003,38 @@ static PyObject *__pyx_pf_6pygrib_18setdates(CYTHON_UNUSED PyObject *__pyx_self,
         __Pyx_XDECREF(__pyx_r);
         __Pyx_INCREF(((PyObject *)__pyx_v_grb));
         __pyx_r = ((PyObject *)__pyx_v_grb);
-        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-        goto __pyx_L20_except_return;
-        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-        goto __pyx_L18_exception_handled;
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+        goto __pyx_L22_except_return;
       }
-      __pyx_L19_except_error:;
+      goto __pyx_L21_except_error;
+      __pyx_L21_except_error:;
       __Pyx_XGIVEREF(__pyx_t_9);
       __Pyx_XGIVEREF(__pyx_t_8);
       __Pyx_XGIVEREF(__pyx_t_7);
       __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_8, __pyx_t_7);
       goto __pyx_L1_error;
-      __pyx_L20_except_return:;
+      __pyx_L22_except_return:;
       __Pyx_XGIVEREF(__pyx_t_9);
       __Pyx_XGIVEREF(__pyx_t_8);
       __Pyx_XGIVEREF(__pyx_t_7);
       __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_8, __pyx_t_7);
       goto __pyx_L0;
-      __pyx_L18_exception_handled:;
-      __Pyx_XGIVEREF(__pyx_t_9);
-      __Pyx_XGIVEREF(__pyx_t_8);
-      __Pyx_XGIVEREF(__pyx_t_7);
-      __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_8, __pyx_t_7);
-      __pyx_L24_try_end:;
+      __pyx_L26_try_end:;
     }
 
-    /* "pygrib.pyx":744
+    /* "pygrib.pyx":738
  *         except ValueError:
  *             return grb
  *         if grb.fcstimeunits == 'hrs':             # <<<<<<<<<<<<<<
  *             try:
  *                 grb.validDate =\
  */
-    __pyx_t_2 = PyObject_RichCompare(__pyx_v_grb->fcstimeunits, ((PyObject *)__pyx_n_s__hrs), Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    if (__pyx_t_5) {
+    __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_grb->fcstimeunits, __pyx_n_s_hrs, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (__pyx_t_1) {
 
-      /* "pygrib.pyx":745
+      /* "pygrib.pyx":739
  *             return grb
  *         if grb.fcstimeunits == 'hrs':
  *             try:             # <<<<<<<<<<<<<<
@@ -7306,75 +8048,90 @@ static PyObject *__pyx_pf_6pygrib_18setdates(CYTHON_UNUSED PyObject *__pyx_self,
         __Pyx_XGOTREF(__pyx_t_9);
         /*try:*/ {
 
-          /* "pygrib.pyx":747
+          /* "pygrib.pyx":741
  *             try:
  *                 grb.validDate =\
  *                 julian_to_datetime(grb.julianDay+ftime/24.)             # <<<<<<<<<<<<<<
  *             except ValueError:
  *                 return grb
  */
-          __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__julian_to_datetime); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L28_error;}
+          __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_julian_to_datetime); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L30_error;}
           __Pyx_GOTREF(__pyx_t_2);
-          __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_grb), __pyx_n_s__julianDay); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L28_error;}
+          __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_grb), __pyx_n_s_julianDay); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L30_error;}
+          __Pyx_GOTREF(__pyx_t_3);
+          __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_v_ftime, __pyx_float_24_); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L30_error;}
           __Pyx_GOTREF(__pyx_t_6);
-          __pyx_t_1 = PyFloat_FromDouble(24.); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L28_error;}
-          __Pyx_GOTREF(__pyx_t_1);
-          __pyx_t_11 = __Pyx_PyNumber_Divide(__pyx_v_ftime, __pyx_t_1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L28_error;}
+          __pyx_t_11 = PyNumber_Add(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L30_error;}
           __Pyx_GOTREF(__pyx_t_11);
-          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-          __pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_11); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L28_error;}
-          __Pyx_GOTREF(__pyx_t_1);
+          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
           __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-          __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L28_error;}
-          __Pyx_GOTREF(__pyx_t_11);
-          PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_1);
-          __Pyx_GIVEREF(__pyx_t_1);
-          __pyx_t_1 = 0;
-          __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L28_error;}
-          __Pyx_GOTREF(__pyx_t_1);
+          __pyx_t_6 = NULL;
+          if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
+            __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
+            if (likely(__pyx_t_6)) {
+              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+              __Pyx_INCREF(__pyx_t_6);
+              __Pyx_INCREF(function);
+              __Pyx_DECREF_SET(__pyx_t_2, function);
+            }
+          }
+          if (!__pyx_t_6) {
+            __pyx_t_12 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_11); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L30_error;}
+            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+            __Pyx_GOTREF(__pyx_t_12);
+          } else {
+            __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L30_error;}
+            __Pyx_GOTREF(__pyx_t_3);
+            PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
+            PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_11);
+            __Pyx_GIVEREF(__pyx_t_11);
+            __pyx_t_11 = 0;
+            __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L30_error;}
+            __Pyx_GOTREF(__pyx_t_12);
+            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+          }
           __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-          __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
 
-          /* "pygrib.pyx":746
+          /* "pygrib.pyx":740
  *         if grb.fcstimeunits == 'hrs':
  *             try:
  *                 grb.validDate =\             # <<<<<<<<<<<<<<
  *                 julian_to_datetime(grb.julianDay+ftime/24.)
  *             except ValueError:
  */
-          __Pyx_GIVEREF(__pyx_t_1);
+          __Pyx_GIVEREF(__pyx_t_12);
           __Pyx_GOTREF(__pyx_v_grb->validDate);
           __Pyx_DECREF(__pyx_v_grb->validDate);
-          __pyx_v_grb->validDate = __pyx_t_1;
-          __pyx_t_1 = 0;
+          __pyx_v_grb->validDate = __pyx_t_12;
+          __pyx_t_12 = 0;
         }
         __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
         __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
         __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
-        goto __pyx_L35_try_end;
-        __pyx_L28_error:;
+        goto __pyx_L37_try_end;
+        __pyx_L30_error:;
         __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
-        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
         __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
-        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
 
-        /* "pygrib.pyx":748
+        /* "pygrib.pyx":742
  *                 grb.validDate =\
  *                 julian_to_datetime(grb.julianDay+ftime/24.)
  *             except ValueError:             # <<<<<<<<<<<<<<
  *                 return grb
  *         elif grb.fcstimeunits == 'mins':
  */
-        __pyx_t_12 = PyErr_ExceptionMatches(__pyx_builtin_ValueError);
-        if (__pyx_t_12) {
+        __pyx_t_13 = PyErr_ExceptionMatches(__pyx_builtin_ValueError);
+        if (__pyx_t_13) {
           __Pyx_AddTraceback("pygrib.setdates", __pyx_clineno, __pyx_lineno, __pyx_filename);
-          if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_11, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L30_except_error;}
-          __Pyx_GOTREF(__pyx_t_1);
-          __Pyx_GOTREF(__pyx_t_11);
+          if (__Pyx_GetException(&__pyx_t_12, &__pyx_t_2, &__pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 742; __pyx_clineno = __LINE__; goto __pyx_L32_except_error;}
+          __Pyx_GOTREF(__pyx_t_12);
           __Pyx_GOTREF(__pyx_t_2);
+          __Pyx_GOTREF(__pyx_t_3);
 
-          /* "pygrib.pyx":749
+          /* "pygrib.pyx":743
  *                 julian_to_datetime(grb.julianDay+ftime/24.)
  *             except ValueError:
  *                 return grb             # <<<<<<<<<<<<<<
@@ -7384,50 +8141,40 @@ static PyObject *__pyx_pf_6pygrib_18setdates(CYTHON_UNUSED PyObject *__pyx_self,
           __Pyx_XDECREF(__pyx_r);
           __Pyx_INCREF(((PyObject *)__pyx_v_grb));
           __pyx_r = ((PyObject *)__pyx_v_grb);
-          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
           __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-          goto __pyx_L31_except_return;
-          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-          goto __pyx_L29_exception_handled;
+          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+          goto __pyx_L33_except_return;
         }
-        __pyx_L30_except_error:;
+        goto __pyx_L32_except_error;
+        __pyx_L32_except_error:;
         __Pyx_XGIVEREF(__pyx_t_7);
         __Pyx_XGIVEREF(__pyx_t_8);
         __Pyx_XGIVEREF(__pyx_t_9);
         __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
         goto __pyx_L1_error;
-        __pyx_L31_except_return:;
+        __pyx_L33_except_return:;
         __Pyx_XGIVEREF(__pyx_t_7);
         __Pyx_XGIVEREF(__pyx_t_8);
         __Pyx_XGIVEREF(__pyx_t_9);
         __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
         goto __pyx_L0;
-        __pyx_L29_exception_handled:;
-        __Pyx_XGIVEREF(__pyx_t_7);
-        __Pyx_XGIVEREF(__pyx_t_8);
-        __Pyx_XGIVEREF(__pyx_t_9);
-        __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
-        __pyx_L35_try_end:;
+        __pyx_L37_try_end:;
       }
-      goto __pyx_L27;
+      goto __pyx_L29;
     }
 
-    /* "pygrib.pyx":750
+    /* "pygrib.pyx":744
  *             except ValueError:
  *                 return grb
  *         elif grb.fcstimeunits == 'mins':             # <<<<<<<<<<<<<<
  *             try:
  *                 grb.validDate =\
  */
-    __pyx_t_2 = PyObject_RichCompare(__pyx_v_grb->fcstimeunits, ((PyObject *)__pyx_n_s__mins), Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    if (__pyx_t_5) {
+    __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_grb->fcstimeunits, __pyx_n_s_mins, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (__pyx_t_1) {
 
-      /* "pygrib.pyx":751
+      /* "pygrib.pyx":745
  *                 return grb
  *         elif grb.fcstimeunits == 'mins':
  *             try:             # <<<<<<<<<<<<<<
@@ -7441,75 +8188,90 @@ static PyObject *__pyx_pf_6pygrib_18setdates(CYTHON_UNUSED PyObject *__pyx_self,
         __Pyx_XGOTREF(__pyx_t_7);
         /*try:*/ {
 
-          /* "pygrib.pyx":753
+          /* "pygrib.pyx":747
  *             try:
  *                 grb.validDate =\
  *                 julian_to_datetime(grb.julianDay+ftime/1440.)             # <<<<<<<<<<<<<<
  *             except ValueError:
  *                 return grb
  */
-          __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__julian_to_datetime); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L38_error;}
+          __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_julian_to_datetime); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L40_error;}
           __Pyx_GOTREF(__pyx_t_2);
-          __pyx_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_grb), __pyx_n_s__julianDay); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L38_error;}
+          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_grb), __pyx_n_s_julianDay); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L40_error;}
+          __Pyx_GOTREF(__pyx_t_12);
+          __pyx_t_11 = __Pyx_PyNumber_Divide(__pyx_v_ftime, __pyx_float_1440_); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L40_error;}
           __Pyx_GOTREF(__pyx_t_11);
-          __pyx_t_1 = PyFloat_FromDouble(1440.); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L38_error;}
-          __Pyx_GOTREF(__pyx_t_1);
-          __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_v_ftime, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L38_error;}
+          __pyx_t_6 = PyNumber_Add(__pyx_t_12, __pyx_t_11); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L40_error;}
           __Pyx_GOTREF(__pyx_t_6);
-          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-          __pyx_t_1 = PyNumber_Add(__pyx_t_11, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L38_error;}
-          __Pyx_GOTREF(__pyx_t_1);
+          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
           __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-          __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L38_error;}
-          __Pyx_GOTREF(__pyx_t_6);
-          PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
-          __Pyx_GIVEREF(__pyx_t_1);
-          __pyx_t_1 = 0;
-          __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L38_error;}
-          __Pyx_GOTREF(__pyx_t_1);
+          __pyx_t_11 = NULL;
+          if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
+            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_2);
+            if (likely(__pyx_t_11)) {
+              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+              __Pyx_INCREF(__pyx_t_11);
+              __Pyx_INCREF(function);
+              __Pyx_DECREF_SET(__pyx_t_2, function);
+            }
+          }
+          if (!__pyx_t_11) {
+            __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L40_error;}
+            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+            __Pyx_GOTREF(__pyx_t_3);
+          } else {
+            __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L40_error;}
+            __Pyx_GOTREF(__pyx_t_12);
+            PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __Pyx_GIVEREF(__pyx_t_11); __pyx_t_11 = NULL;
+            PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_6);
+            __Pyx_GIVEREF(__pyx_t_6);
+            __pyx_t_6 = 0;
+            __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_12, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L40_error;}
+            __Pyx_GOTREF(__pyx_t_3);
+            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+          }
           __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-          __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
 
-          /* "pygrib.pyx":752
+          /* "pygrib.pyx":746
  *         elif grb.fcstimeunits == 'mins':
  *             try:
  *                 grb.validDate =\             # <<<<<<<<<<<<<<
  *                 julian_to_datetime(grb.julianDay+ftime/1440.)
  *             except ValueError:
  */
-          __Pyx_GIVEREF(__pyx_t_1);
+          __Pyx_GIVEREF(__pyx_t_3);
           __Pyx_GOTREF(__pyx_v_grb->validDate);
           __Pyx_DECREF(__pyx_v_grb->validDate);
-          __pyx_v_grb->validDate = __pyx_t_1;
-          __pyx_t_1 = 0;
+          __pyx_v_grb->validDate = __pyx_t_3;
+          __pyx_t_3 = 0;
         }
         __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
         __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
         __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
-        goto __pyx_L45_try_end;
-        __pyx_L38_error:;
+        goto __pyx_L47_try_end;
+        __pyx_L40_error:;
         __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
-        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
         __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
-        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
+        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
 
-        /* "pygrib.pyx":754
+        /* "pygrib.pyx":748
  *                 grb.validDate =\
  *                 julian_to_datetime(grb.julianDay+ftime/1440.)
  *             except ValueError:             # <<<<<<<<<<<<<<
  *                 return grb
  *         elif grb.fcstimeunits == 'days':
  */
-        __pyx_t_12 = PyErr_ExceptionMatches(__pyx_builtin_ValueError);
-        if (__pyx_t_12) {
+        __pyx_t_13 = PyErr_ExceptionMatches(__pyx_builtin_ValueError);
+        if (__pyx_t_13) {
           __Pyx_AddTraceback("pygrib.setdates", __pyx_clineno, __pyx_lineno, __pyx_filename);
-          if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_6, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L40_except_error;}
-          __Pyx_GOTREF(__pyx_t_1);
-          __Pyx_GOTREF(__pyx_t_6);
+          if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L42_except_error;}
+          __Pyx_GOTREF(__pyx_t_3);
           __Pyx_GOTREF(__pyx_t_2);
+          __Pyx_GOTREF(__pyx_t_12);
 
-          /* "pygrib.pyx":755
+          /* "pygrib.pyx":749
  *                 julian_to_datetime(grb.julianDay+ftime/1440.)
  *             except ValueError:
  *                 return grb             # <<<<<<<<<<<<<<
@@ -7519,50 +8281,40 @@ static PyObject *__pyx_pf_6pygrib_18setdates(CYTHON_UNUSED PyObject *__pyx_self,
           __Pyx_XDECREF(__pyx_r);
           __Pyx_INCREF(((PyObject *)__pyx_v_grb));
           __pyx_r = ((PyObject *)__pyx_v_grb);
-          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-          goto __pyx_L41_except_return;
-          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
           __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-          goto __pyx_L39_exception_handled;
+          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+          goto __pyx_L43_except_return;
         }
-        __pyx_L40_except_error:;
+        goto __pyx_L42_except_error;
+        __pyx_L42_except_error:;
         __Pyx_XGIVEREF(__pyx_t_9);
         __Pyx_XGIVEREF(__pyx_t_8);
         __Pyx_XGIVEREF(__pyx_t_7);
         __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_8, __pyx_t_7);
         goto __pyx_L1_error;
-        __pyx_L41_except_return:;
+        __pyx_L43_except_return:;
         __Pyx_XGIVEREF(__pyx_t_9);
         __Pyx_XGIVEREF(__pyx_t_8);
         __Pyx_XGIVEREF(__pyx_t_7);
         __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_8, __pyx_t_7);
         goto __pyx_L0;
-        __pyx_L39_exception_handled:;
-        __Pyx_XGIVEREF(__pyx_t_9);
-        __Pyx_XGIVEREF(__pyx_t_8);
-        __Pyx_XGIVEREF(__pyx_t_7);
-        __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_8, __pyx_t_7);
-        __pyx_L45_try_end:;
+        __pyx_L47_try_end:;
       }
-      goto __pyx_L27;
+      goto __pyx_L29;
     }
 
-    /* "pygrib.pyx":756
+    /* "pygrib.pyx":750
  *             except ValueError:
  *                 return grb
  *         elif grb.fcstimeunits == 'days':             # <<<<<<<<<<<<<<
  *             try:
  *                 grb.validDate =\
  */
-    __pyx_t_2 = PyObject_RichCompare(__pyx_v_grb->fcstimeunits, ((PyObject *)__pyx_n_s__days), Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    if (__pyx_t_5) {
+    __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_grb->fcstimeunits, __pyx_n_s_days, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (__pyx_t_1) {
 
-      /* "pygrib.pyx":757
+      /* "pygrib.pyx":751
  *                 return grb
  *         elif grb.fcstimeunits == 'days':
  *             try:             # <<<<<<<<<<<<<<
@@ -7576,69 +8328,87 @@ static PyObject *__pyx_pf_6pygrib_18setdates(CYTHON_UNUSED PyObject *__pyx_self,
         __Pyx_XGOTREF(__pyx_t_9);
         /*try:*/ {
 
-          /* "pygrib.pyx":759
+          /* "pygrib.pyx":753
  *             try:
  *                 grb.validDate =\
  *                 julian_to_datetime(grb.julianDay+ftime)             # <<<<<<<<<<<<<<
  *             except ValueError:
  *                 return grb
  */
-          __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__julian_to_datetime); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L48_error;}
+          __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_julian_to_datetime); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L50_error;}
           __Pyx_GOTREF(__pyx_t_2);
-          __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_grb), __pyx_n_s__julianDay); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L48_error;}
-          __Pyx_GOTREF(__pyx_t_6);
-          __pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_v_ftime); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L48_error;}
-          __Pyx_GOTREF(__pyx_t_1);
-          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-          __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L48_error;}
+          __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_grb), __pyx_n_s_julianDay); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L50_error;}
+          __Pyx_GOTREF(__pyx_t_3);
+          __pyx_t_6 = PyNumber_Add(__pyx_t_3, __pyx_v_ftime); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L50_error;}
           __Pyx_GOTREF(__pyx_t_6);
-          PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
-          __Pyx_GIVEREF(__pyx_t_1);
-          __pyx_t_1 = 0;
-          __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L48_error;}
-          __Pyx_GOTREF(__pyx_t_1);
+          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+          __pyx_t_3 = NULL;
+          if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
+            __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+            if (likely(__pyx_t_3)) {
+              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+              __Pyx_INCREF(__pyx_t_3);
+              __Pyx_INCREF(function);
+              __Pyx_DECREF_SET(__pyx_t_2, function);
+            }
+          }
+          if (!__pyx_t_3) {
+            __pyx_t_12 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L50_error;}
+            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+            __Pyx_GOTREF(__pyx_t_12);
+          } else {
+            __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L50_error;}
+            __Pyx_GOTREF(__pyx_t_11);
+            PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
+            PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_6);
+            __Pyx_GIVEREF(__pyx_t_6);
+            __pyx_t_6 = 0;
+            __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_11, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L50_error;}
+            __Pyx_GOTREF(__pyx_t_12);
+            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+          }
           __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-          __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
 
-          /* "pygrib.pyx":758
+          /* "pygrib.pyx":752
  *         elif grb.fcstimeunits == 'days':
  *             try:
  *                 grb.validDate =\             # <<<<<<<<<<<<<<
  *                 julian_to_datetime(grb.julianDay+ftime)
  *             except ValueError:
  */
-          __Pyx_GIVEREF(__pyx_t_1);
+          __Pyx_GIVEREF(__pyx_t_12);
           __Pyx_GOTREF(__pyx_v_grb->validDate);
           __Pyx_DECREF(__pyx_v_grb->validDate);
-          __pyx_v_grb->validDate = __pyx_t_1;
-          __pyx_t_1 = 0;
+          __pyx_v_grb->validDate = __pyx_t_12;
+          __pyx_t_12 = 0;
         }
         __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
         __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
         __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
-        goto __pyx_L55_try_end;
-        __pyx_L48_error:;
+        goto __pyx_L57_try_end;
+        __pyx_L50_error:;
+        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
         __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
         __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
-        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
-        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
 
-        /* "pygrib.pyx":760
+        /* "pygrib.pyx":754
  *                 grb.validDate =\
  *                 julian_to_datetime(grb.julianDay+ftime)
  *             except ValueError:             # <<<<<<<<<<<<<<
  *                 return grb
  *         elif grb.fcstimeunits == 'secs':
  */
-        __pyx_t_12 = PyErr_ExceptionMatches(__pyx_builtin_ValueError);
-        if (__pyx_t_12) {
+        __pyx_t_13 = PyErr_ExceptionMatches(__pyx_builtin_ValueError);
+        if (__pyx_t_13) {
           __Pyx_AddTraceback("pygrib.setdates", __pyx_clineno, __pyx_lineno, __pyx_filename);
-          if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_6, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; __pyx_clineno = __LINE__; goto __pyx_L50_except_error;}
-          __Pyx_GOTREF(__pyx_t_1);
-          __Pyx_GOTREF(__pyx_t_6);
+          if (__Pyx_GetException(&__pyx_t_12, &__pyx_t_2, &__pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L52_except_error;}
+          __Pyx_GOTREF(__pyx_t_12);
           __Pyx_GOTREF(__pyx_t_2);
+          __Pyx_GOTREF(__pyx_t_11);
 
-          /* "pygrib.pyx":761
+          /* "pygrib.pyx":755
  *                 julian_to_datetime(grb.julianDay+ftime)
  *             except ValueError:
  *                 return grb             # <<<<<<<<<<<<<<
@@ -7648,50 +8418,40 @@ static PyObject *__pyx_pf_6pygrib_18setdates(CYTHON_UNUSED PyObject *__pyx_self,
           __Pyx_XDECREF(__pyx_r);
           __Pyx_INCREF(((PyObject *)__pyx_v_grb));
           __pyx_r = ((PyObject *)__pyx_v_grb);
-          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-          goto __pyx_L51_except_return;
-          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
           __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-          goto __pyx_L49_exception_handled;
+          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+          goto __pyx_L53_except_return;
         }
-        __pyx_L50_except_error:;
+        goto __pyx_L52_except_error;
+        __pyx_L52_except_error:;
         __Pyx_XGIVEREF(__pyx_t_7);
         __Pyx_XGIVEREF(__pyx_t_8);
         __Pyx_XGIVEREF(__pyx_t_9);
         __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
         goto __pyx_L1_error;
-        __pyx_L51_except_return:;
+        __pyx_L53_except_return:;
         __Pyx_XGIVEREF(__pyx_t_7);
         __Pyx_XGIVEREF(__pyx_t_8);
         __Pyx_XGIVEREF(__pyx_t_9);
         __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
         goto __pyx_L0;
-        __pyx_L49_exception_handled:;
-        __Pyx_XGIVEREF(__pyx_t_7);
-        __Pyx_XGIVEREF(__pyx_t_8);
-        __Pyx_XGIVEREF(__pyx_t_9);
-        __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
-        __pyx_L55_try_end:;
+        __pyx_L57_try_end:;
       }
-      goto __pyx_L27;
+      goto __pyx_L29;
     }
 
-    /* "pygrib.pyx":762
+    /* "pygrib.pyx":756
  *             except ValueError:
  *                 return grb
  *         elif grb.fcstimeunits == 'secs':             # <<<<<<<<<<<<<<
  *             try:
  *                 grb.validDate =\
  */
-    __pyx_t_2 = PyObject_RichCompare(__pyx_v_grb->fcstimeunits, ((PyObject *)__pyx_n_s__secs), Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    if (__pyx_t_5) {
+    __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_grb->fcstimeunits, __pyx_n_s_secs, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (__pyx_t_1) {
 
-      /* "pygrib.pyx":763
+      /* "pygrib.pyx":757
  *                 return grb
  *         elif grb.fcstimeunits == 'secs':
  *             try:             # <<<<<<<<<<<<<<
@@ -7705,75 +8465,90 @@ static PyObject *__pyx_pf_6pygrib_18setdates(CYTHON_UNUSED PyObject *__pyx_self,
         __Pyx_XGOTREF(__pyx_t_7);
         /*try:*/ {
 
-          /* "pygrib.pyx":765
+          /* "pygrib.pyx":759
  *             try:
  *                 grb.validDate =\
  *                 julian_to_datetime(grb.julianDay+ftime/86400.)             # <<<<<<<<<<<<<<
  *             except ValueError:
  *                 return grb
  */
-          __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__julian_to_datetime); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
+          __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_julian_to_datetime); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L60_error;}
           __Pyx_GOTREF(__pyx_t_2);
-          __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_grb), __pyx_n_s__julianDay); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
+          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_grb), __pyx_n_s_julianDay); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L60_error;}
+          __Pyx_GOTREF(__pyx_t_12);
+          __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_v_ftime, __pyx_float_86400_); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L60_error;}
           __Pyx_GOTREF(__pyx_t_6);
-          __pyx_t_1 = PyFloat_FromDouble(86400.); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
-          __Pyx_GOTREF(__pyx_t_1);
-          __pyx_t_11 = __Pyx_PyNumber_Divide(__pyx_v_ftime, __pyx_t_1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
-          __Pyx_GOTREF(__pyx_t_11);
-          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-          __pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_11); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
-          __Pyx_GOTREF(__pyx_t_1);
+          __pyx_t_3 = PyNumber_Add(__pyx_t_12, __pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L60_error;}
+          __Pyx_GOTREF(__pyx_t_3);
+          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
           __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-          __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
-          __Pyx_GOTREF(__pyx_t_11);
-          PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_1);
-          __Pyx_GIVEREF(__pyx_t_1);
-          __pyx_t_1 = 0;
-          __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
-          __Pyx_GOTREF(__pyx_t_1);
+          __pyx_t_6 = NULL;
+          if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
+            __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
+            if (likely(__pyx_t_6)) {
+              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+              __Pyx_INCREF(__pyx_t_6);
+              __Pyx_INCREF(function);
+              __Pyx_DECREF_SET(__pyx_t_2, function);
+            }
+          }
+          if (!__pyx_t_6) {
+            __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L60_error;}
+            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+            __Pyx_GOTREF(__pyx_t_11);
+          } else {
+            __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L60_error;}
+            __Pyx_GOTREF(__pyx_t_12);
+            PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
+            PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_3);
+            __Pyx_GIVEREF(__pyx_t_3);
+            __pyx_t_3 = 0;
+            __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_12, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L60_error;}
+            __Pyx_GOTREF(__pyx_t_11);
+            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+          }
           __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-          __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
 
-          /* "pygrib.pyx":764
+          /* "pygrib.pyx":758
  *         elif grb.fcstimeunits == 'secs':
  *             try:
  *                 grb.validDate =\             # <<<<<<<<<<<<<<
  *                 julian_to_datetime(grb.julianDay+ftime/86400.)
  *             except ValueError:
  */
-          __Pyx_GIVEREF(__pyx_t_1);
+          __Pyx_GIVEREF(__pyx_t_11);
           __Pyx_GOTREF(__pyx_v_grb->validDate);
           __Pyx_DECREF(__pyx_v_grb->validDate);
-          __pyx_v_grb->validDate = __pyx_t_1;
-          __pyx_t_1 = 0;
+          __pyx_v_grb->validDate = __pyx_t_11;
+          __pyx_t_11 = 0;
         }
         __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
         __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
         __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
-        goto __pyx_L65_try_end;
-        __pyx_L58_error:;
+        goto __pyx_L67_try_end;
+        __pyx_L60_error:;
         __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
         __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
         __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
-        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-        /* "pygrib.pyx":766
+        /* "pygrib.pyx":760
  *                 grb.validDate =\
  *                 julian_to_datetime(grb.julianDay+ftime/86400.)
  *             except ValueError:             # <<<<<<<<<<<<<<
  *                 return grb
  *         elif grb.fcstimeunits == '3 hr periods':
  */
-        __pyx_t_12 = PyErr_ExceptionMatches(__pyx_builtin_ValueError);
-        if (__pyx_t_12) {
+        __pyx_t_13 = PyErr_ExceptionMatches(__pyx_builtin_ValueError);
+        if (__pyx_t_13) {
           __Pyx_AddTraceback("pygrib.setdates", __pyx_clineno, __pyx_lineno, __pyx_filename);
-          if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_11, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L60_except_error;}
-          __Pyx_GOTREF(__pyx_t_1);
+          if (__Pyx_GetException(&__pyx_t_11, &__pyx_t_2, &__pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; __pyx_clineno = __LINE__; goto __pyx_L62_except_error;}
           __Pyx_GOTREF(__pyx_t_11);
           __Pyx_GOTREF(__pyx_t_2);
+          __Pyx_GOTREF(__pyx_t_12);
 
-          /* "pygrib.pyx":767
+          /* "pygrib.pyx":761
  *                 julian_to_datetime(grb.julianDay+ftime/86400.)
  *             except ValueError:
  *                 return grb             # <<<<<<<<<<<<<<
@@ -7783,50 +8558,40 @@ static PyObject *__pyx_pf_6pygrib_18setdates(CYTHON_UNUSED PyObject *__pyx_self,
           __Pyx_XDECREF(__pyx_r);
           __Pyx_INCREF(((PyObject *)__pyx_v_grb));
           __pyx_r = ((PyObject *)__pyx_v_grb);
-          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
           __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
           __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-          goto __pyx_L61_except_return;
-          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-          goto __pyx_L59_exception_handled;
+          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+          goto __pyx_L63_except_return;
         }
-        __pyx_L60_except_error:;
+        goto __pyx_L62_except_error;
+        __pyx_L62_except_error:;
         __Pyx_XGIVEREF(__pyx_t_9);
         __Pyx_XGIVEREF(__pyx_t_8);
         __Pyx_XGIVEREF(__pyx_t_7);
         __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_8, __pyx_t_7);
         goto __pyx_L1_error;
-        __pyx_L61_except_return:;
+        __pyx_L63_except_return:;
         __Pyx_XGIVEREF(__pyx_t_9);
         __Pyx_XGIVEREF(__pyx_t_8);
         __Pyx_XGIVEREF(__pyx_t_7);
         __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_8, __pyx_t_7);
         goto __pyx_L0;
-        __pyx_L59_exception_handled:;
-        __Pyx_XGIVEREF(__pyx_t_9);
-        __Pyx_XGIVEREF(__pyx_t_8);
-        __Pyx_XGIVEREF(__pyx_t_7);
-        __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_8, __pyx_t_7);
-        __pyx_L65_try_end:;
+        __pyx_L67_try_end:;
       }
-      goto __pyx_L27;
+      goto __pyx_L29;
     }
 
-    /* "pygrib.pyx":768
+    /* "pygrib.pyx":762
  *             except ValueError:
  *                 return grb
  *         elif grb.fcstimeunits == '3 hr periods':             # <<<<<<<<<<<<<<
  *             try:
  *                 grb.validDate =\
  */
-    __pyx_t_2 = PyObject_RichCompare(__pyx_v_grb->fcstimeunits, ((PyObject *)__pyx_kp_s_27), Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    if (__pyx_t_5) {
+    __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_grb->fcstimeunits, __pyx_kp_s_3_hr_periods, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (__pyx_t_1) {
 
-      /* "pygrib.pyx":769
+      /* "pygrib.pyx":763
  *                 return grb
  *         elif grb.fcstimeunits == '3 hr periods':
  *             try:             # <<<<<<<<<<<<<<
@@ -7840,75 +8605,90 @@ static PyObject *__pyx_pf_6pygrib_18setdates(CYTHON_UNUSED PyObject *__pyx_self,
         __Pyx_XGOTREF(__pyx_t_9);
         /*try:*/ {
 
-          /* "pygrib.pyx":771
+          /* "pygrib.pyx":765
  *             try:
  *                 grb.validDate =\
  *                 julian_to_datetime(grb.julianDay+ftime/8.)             # <<<<<<<<<<<<<<
  *             except ValueError:
  *                 return grb
  */
-          __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__julian_to_datetime); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L68_error;}
+          __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_julian_to_datetime); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L70_error;}
           __Pyx_GOTREF(__pyx_t_2);
-          __pyx_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_grb), __pyx_n_s__julianDay); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L68_error;}
+          __pyx_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_grb), __pyx_n_s_julianDay); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L70_error;}
           __Pyx_GOTREF(__pyx_t_11);
-          __pyx_t_1 = PyFloat_FromDouble(8.); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L68_error;}
-          __Pyx_GOTREF(__pyx_t_1);
-          __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_v_ftime, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L68_error;}
+          __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_v_ftime, __pyx_float_8_); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L70_error;}
+          __Pyx_GOTREF(__pyx_t_3);
+          __pyx_t_6 = PyNumber_Add(__pyx_t_11, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L70_error;}
           __Pyx_GOTREF(__pyx_t_6);
-          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-          __pyx_t_1 = PyNumber_Add(__pyx_t_11, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L68_error;}
-          __Pyx_GOTREF(__pyx_t_1);
           __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-          __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L68_error;}
-          __Pyx_GOTREF(__pyx_t_6);
-          PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
-          __Pyx_GIVEREF(__pyx_t_1);
-          __pyx_t_1 = 0;
-          __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L68_error;}
-          __Pyx_GOTREF(__pyx_t_1);
+          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+          __pyx_t_3 = NULL;
+          if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
+            __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+            if (likely(__pyx_t_3)) {
+              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+              __Pyx_INCREF(__pyx_t_3);
+              __Pyx_INCREF(function);
+              __Pyx_DECREF_SET(__pyx_t_2, function);
+            }
+          }
+          if (!__pyx_t_3) {
+            __pyx_t_12 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L70_error;}
+            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+            __Pyx_GOTREF(__pyx_t_12);
+          } else {
+            __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L70_error;}
+            __Pyx_GOTREF(__pyx_t_11);
+            PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
+            PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_6);
+            __Pyx_GIVEREF(__pyx_t_6);
+            __pyx_t_6 = 0;
+            __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_11, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L70_error;}
+            __Pyx_GOTREF(__pyx_t_12);
+            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+          }
           __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-          __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
 
-          /* "pygrib.pyx":770
+          /* "pygrib.pyx":764
  *         elif grb.fcstimeunits == '3 hr periods':
  *             try:
  *                 grb.validDate =\             # <<<<<<<<<<<<<<
  *                 julian_to_datetime(grb.julianDay+ftime/8.)
  *             except ValueError:
  */
-          __Pyx_GIVEREF(__pyx_t_1);
+          __Pyx_GIVEREF(__pyx_t_12);
           __Pyx_GOTREF(__pyx_v_grb->validDate);
           __Pyx_DECREF(__pyx_v_grb->validDate);
-          __pyx_v_grb->validDate = __pyx_t_1;
-          __pyx_t_1 = 0;
+          __pyx_v_grb->validDate = __pyx_t_12;
+          __pyx_t_12 = 0;
         }
         __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
         __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
         __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
-        goto __pyx_L75_try_end;
-        __pyx_L68_error:;
+        goto __pyx_L77_try_end;
+        __pyx_L70_error:;
+        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
         __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
         __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
-        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
-        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
 
-        /* "pygrib.pyx":772
+        /* "pygrib.pyx":766
  *                 grb.validDate =\
  *                 julian_to_datetime(grb.julianDay+ftime/8.)
  *             except ValueError:             # <<<<<<<<<<<<<<
  *                 return grb
  *         elif grb.fcstimeunits == '6 hr periods':
  */
-        __pyx_t_12 = PyErr_ExceptionMatches(__pyx_builtin_ValueError);
-        if (__pyx_t_12) {
+        __pyx_t_13 = PyErr_ExceptionMatches(__pyx_builtin_ValueError);
+        if (__pyx_t_13) {
           __Pyx_AddTraceback("pygrib.setdates", __pyx_clineno, __pyx_lineno, __pyx_filename);
-          if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_6, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L70_except_error;}
-          __Pyx_GOTREF(__pyx_t_1);
-          __Pyx_GOTREF(__pyx_t_6);
+          if (__Pyx_GetException(&__pyx_t_12, &__pyx_t_2, &__pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L72_except_error;}
+          __Pyx_GOTREF(__pyx_t_12);
           __Pyx_GOTREF(__pyx_t_2);
+          __Pyx_GOTREF(__pyx_t_11);
 
-          /* "pygrib.pyx":773
+          /* "pygrib.pyx":767
  *                 julian_to_datetime(grb.julianDay+ftime/8.)
  *             except ValueError:
  *                 return grb             # <<<<<<<<<<<<<<
@@ -7918,50 +8698,40 @@ static PyObject *__pyx_pf_6pygrib_18setdates(CYTHON_UNUSED PyObject *__pyx_self,
           __Pyx_XDECREF(__pyx_r);
           __Pyx_INCREF(((PyObject *)__pyx_v_grb));
           __pyx_r = ((PyObject *)__pyx_v_grb);
-          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-          goto __pyx_L71_except_return;
-          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
           __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-          goto __pyx_L69_exception_handled;
+          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+          goto __pyx_L73_except_return;
         }
-        __pyx_L70_except_error:;
+        goto __pyx_L72_except_error;
+        __pyx_L72_except_error:;
         __Pyx_XGIVEREF(__pyx_t_7);
         __Pyx_XGIVEREF(__pyx_t_8);
         __Pyx_XGIVEREF(__pyx_t_9);
         __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
         goto __pyx_L1_error;
-        __pyx_L71_except_return:;
+        __pyx_L73_except_return:;
         __Pyx_XGIVEREF(__pyx_t_7);
         __Pyx_XGIVEREF(__pyx_t_8);
         __Pyx_XGIVEREF(__pyx_t_9);
         __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
         goto __pyx_L0;
-        __pyx_L69_exception_handled:;
-        __Pyx_XGIVEREF(__pyx_t_7);
-        __Pyx_XGIVEREF(__pyx_t_8);
-        __Pyx_XGIVEREF(__pyx_t_9);
-        __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
-        __pyx_L75_try_end:;
+        __pyx_L77_try_end:;
       }
-      goto __pyx_L27;
+      goto __pyx_L29;
     }
 
-    /* "pygrib.pyx":774
+    /* "pygrib.pyx":768
  *             except ValueError:
  *                 return grb
  *         elif grb.fcstimeunits == '6 hr periods':             # <<<<<<<<<<<<<<
  *             try:
  *                 grb.validDate =\
  */
-    __pyx_t_2 = PyObject_RichCompare(__pyx_v_grb->fcstimeunits, ((PyObject *)__pyx_kp_s_28), Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    if (__pyx_t_5) {
+    __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_grb->fcstimeunits, __pyx_kp_s_6_hr_periods, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (__pyx_t_1) {
 
-      /* "pygrib.pyx":775
+      /* "pygrib.pyx":769
  *                 return grb
  *         elif grb.fcstimeunits == '6 hr periods':
  *             try:             # <<<<<<<<<<<<<<
@@ -7975,75 +8745,90 @@ static PyObject *__pyx_pf_6pygrib_18setdates(CYTHON_UNUSED PyObject *__pyx_self,
         __Pyx_XGOTREF(__pyx_t_7);
         /*try:*/ {
 
-          /* "pygrib.pyx":777
+          /* "pygrib.pyx":771
  *             try:
  *                 grb.validDate =\
  *                 julian_to_datetime(grb.julianDay+ftime/4.)             # <<<<<<<<<<<<<<
  *             except ValueError:
  *                 return grb
  */
-          __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__julian_to_datetime); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L78_error;}
+          __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_julian_to_datetime); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L80_error;}
           __Pyx_GOTREF(__pyx_t_2);
-          __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_grb), __pyx_n_s__julianDay); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L78_error;}
+          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_grb), __pyx_n_s_julianDay); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L80_error;}
+          __Pyx_GOTREF(__pyx_t_12);
+          __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_v_ftime, __pyx_float_4_); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L80_error;}
           __Pyx_GOTREF(__pyx_t_6);
-          __pyx_t_1 = PyFloat_FromDouble(4.); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L78_error;}
-          __Pyx_GOTREF(__pyx_t_1);
-          __pyx_t_11 = __Pyx_PyNumber_Divide(__pyx_v_ftime, __pyx_t_1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L78_error;}
-          __Pyx_GOTREF(__pyx_t_11);
-          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-          __pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_11); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L78_error;}
-          __Pyx_GOTREF(__pyx_t_1);
+          __pyx_t_3 = PyNumber_Add(__pyx_t_12, __pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L80_error;}
+          __Pyx_GOTREF(__pyx_t_3);
+          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
           __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-          __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L78_error;}
-          __Pyx_GOTREF(__pyx_t_11);
-          PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_1);
-          __Pyx_GIVEREF(__pyx_t_1);
-          __pyx_t_1 = 0;
-          __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L78_error;}
-          __Pyx_GOTREF(__pyx_t_1);
+          __pyx_t_6 = NULL;
+          if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
+            __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
+            if (likely(__pyx_t_6)) {
+              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+              __Pyx_INCREF(__pyx_t_6);
+              __Pyx_INCREF(function);
+              __Pyx_DECREF_SET(__pyx_t_2, function);
+            }
+          }
+          if (!__pyx_t_6) {
+            __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L80_error;}
+            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+            __Pyx_GOTREF(__pyx_t_11);
+          } else {
+            __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L80_error;}
+            __Pyx_GOTREF(__pyx_t_12);
+            PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
+            PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_3);
+            __Pyx_GIVEREF(__pyx_t_3);
+            __pyx_t_3 = 0;
+            __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_12, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L80_error;}
+            __Pyx_GOTREF(__pyx_t_11);
+            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+          }
           __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-          __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
 
-          /* "pygrib.pyx":776
+          /* "pygrib.pyx":770
  *         elif grb.fcstimeunits == '6 hr periods':
  *             try:
  *                 grb.validDate =\             # <<<<<<<<<<<<<<
  *                 julian_to_datetime(grb.julianDay+ftime/4.)
  *             except ValueError:
  */
-          __Pyx_GIVEREF(__pyx_t_1);
+          __Pyx_GIVEREF(__pyx_t_11);
           __Pyx_GOTREF(__pyx_v_grb->validDate);
           __Pyx_DECREF(__pyx_v_grb->validDate);
-          __pyx_v_grb->validDate = __pyx_t_1;
-          __pyx_t_1 = 0;
+          __pyx_v_grb->validDate = __pyx_t_11;
+          __pyx_t_11 = 0;
         }
         __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
         __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
         __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
-        goto __pyx_L85_try_end;
-        __pyx_L78_error:;
+        goto __pyx_L87_try_end;
+        __pyx_L80_error:;
         __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
         __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
         __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
-        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-        /* "pygrib.pyx":778
+        /* "pygrib.pyx":772
  *                 grb.validDate =\
  *                 julian_to_datetime(grb.julianDay+ftime/4.)
  *             except ValueError:             # <<<<<<<<<<<<<<
  *                 return grb
  *         elif grb.fcstimeunits == '12 hr periods':
  */
-        __pyx_t_12 = PyErr_ExceptionMatches(__pyx_builtin_ValueError);
-        if (__pyx_t_12) {
+        __pyx_t_13 = PyErr_ExceptionMatches(__pyx_builtin_ValueError);
+        if (__pyx_t_13) {
           __Pyx_AddTraceback("pygrib.setdates", __pyx_clineno, __pyx_lineno, __pyx_filename);
-          if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_11, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L80_except_error;}
-          __Pyx_GOTREF(__pyx_t_1);
+          if (__Pyx_GetException(&__pyx_t_11, &__pyx_t_2, &__pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L82_except_error;}
           __Pyx_GOTREF(__pyx_t_11);
           __Pyx_GOTREF(__pyx_t_2);
+          __Pyx_GOTREF(__pyx_t_12);
 
-          /* "pygrib.pyx":779
+          /* "pygrib.pyx":773
  *                 julian_to_datetime(grb.julianDay+ftime/4.)
  *             except ValueError:
  *                 return grb             # <<<<<<<<<<<<<<
@@ -8053,50 +8838,40 @@ static PyObject *__pyx_pf_6pygrib_18setdates(CYTHON_UNUSED PyObject *__pyx_self,
           __Pyx_XDECREF(__pyx_r);
           __Pyx_INCREF(((PyObject *)__pyx_v_grb));
           __pyx_r = ((PyObject *)__pyx_v_grb);
-          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
           __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
           __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-          goto __pyx_L81_except_return;
-          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-          goto __pyx_L79_exception_handled;
+          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+          goto __pyx_L83_except_return;
         }
-        __pyx_L80_except_error:;
+        goto __pyx_L82_except_error;
+        __pyx_L82_except_error:;
         __Pyx_XGIVEREF(__pyx_t_9);
         __Pyx_XGIVEREF(__pyx_t_8);
         __Pyx_XGIVEREF(__pyx_t_7);
         __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_8, __pyx_t_7);
         goto __pyx_L1_error;
-        __pyx_L81_except_return:;
+        __pyx_L83_except_return:;
         __Pyx_XGIVEREF(__pyx_t_9);
         __Pyx_XGIVEREF(__pyx_t_8);
         __Pyx_XGIVEREF(__pyx_t_7);
         __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_8, __pyx_t_7);
         goto __pyx_L0;
-        __pyx_L79_exception_handled:;
-        __Pyx_XGIVEREF(__pyx_t_9);
-        __Pyx_XGIVEREF(__pyx_t_8);
-        __Pyx_XGIVEREF(__pyx_t_7);
-        __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_8, __pyx_t_7);
-        __pyx_L85_try_end:;
+        __pyx_L87_try_end:;
       }
-      goto __pyx_L27;
+      goto __pyx_L29;
     }
 
-    /* "pygrib.pyx":780
+    /* "pygrib.pyx":774
  *             except ValueError:
  *                 return grb
  *         elif grb.fcstimeunits == '12 hr periods':             # <<<<<<<<<<<<<<
  *             try:
  *                 grb.validDate =\
  */
-    __pyx_t_2 = PyObject_RichCompare(__pyx_v_grb->fcstimeunits, ((PyObject *)__pyx_kp_s_29), Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    if (__pyx_t_5) {
+    __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_grb->fcstimeunits, __pyx_kp_s_12_hr_periods, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (__pyx_t_1) {
 
-      /* "pygrib.pyx":781
+      /* "pygrib.pyx":775
  *                 return grb
  *         elif grb.fcstimeunits == '12 hr periods':
  *             try:             # <<<<<<<<<<<<<<
@@ -8110,75 +8885,90 @@ static PyObject *__pyx_pf_6pygrib_18setdates(CYTHON_UNUSED PyObject *__pyx_self,
         __Pyx_XGOTREF(__pyx_t_9);
         /*try:*/ {
 
-          /* "pygrib.pyx":783
+          /* "pygrib.pyx":777
  *             try:
  *                 grb.validDate =\
  *                 julian_to_datetime(grb.julianDay+ftime/2.)             # <<<<<<<<<<<<<<
  *             except ValueError:
  *                 return grb
  */
-          __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__julian_to_datetime); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L88_error;}
+          __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_julian_to_datetime); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L90_error;}
           __Pyx_GOTREF(__pyx_t_2);
-          __pyx_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_grb), __pyx_n_s__julianDay); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L88_error;}
+          __pyx_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_grb), __pyx_n_s_julianDay); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L90_error;}
           __Pyx_GOTREF(__pyx_t_11);
-          __pyx_t_1 = PyFloat_FromDouble(2.); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L88_error;}
-          __Pyx_GOTREF(__pyx_t_1);
-          __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_v_ftime, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L88_error;}
+          __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_v_ftime, __pyx_float_2_); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L90_error;}
+          __Pyx_GOTREF(__pyx_t_3);
+          __pyx_t_6 = PyNumber_Add(__pyx_t_11, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L90_error;}
           __Pyx_GOTREF(__pyx_t_6);
-          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-          __pyx_t_1 = PyNumber_Add(__pyx_t_11, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L88_error;}
-          __Pyx_GOTREF(__pyx_t_1);
           __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-          __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L88_error;}
-          __Pyx_GOTREF(__pyx_t_6);
-          PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
-          __Pyx_GIVEREF(__pyx_t_1);
-          __pyx_t_1 = 0;
-          __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L88_error;}
-          __Pyx_GOTREF(__pyx_t_1);
+          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+          __pyx_t_3 = NULL;
+          if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
+            __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+            if (likely(__pyx_t_3)) {
+              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+              __Pyx_INCREF(__pyx_t_3);
+              __Pyx_INCREF(function);
+              __Pyx_DECREF_SET(__pyx_t_2, function);
+            }
+          }
+          if (!__pyx_t_3) {
+            __pyx_t_12 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L90_error;}
+            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+            __Pyx_GOTREF(__pyx_t_12);
+          } else {
+            __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L90_error;}
+            __Pyx_GOTREF(__pyx_t_11);
+            PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
+            PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_6);
+            __Pyx_GIVEREF(__pyx_t_6);
+            __pyx_t_6 = 0;
+            __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_11, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L90_error;}
+            __Pyx_GOTREF(__pyx_t_12);
+            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+          }
           __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-          __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
 
-          /* "pygrib.pyx":782
+          /* "pygrib.pyx":776
  *         elif grb.fcstimeunits == '12 hr periods':
  *             try:
  *                 grb.validDate =\             # <<<<<<<<<<<<<<
  *                 julian_to_datetime(grb.julianDay+ftime/2.)
  *             except ValueError:
  */
-          __Pyx_GIVEREF(__pyx_t_1);
+          __Pyx_GIVEREF(__pyx_t_12);
           __Pyx_GOTREF(__pyx_v_grb->validDate);
           __Pyx_DECREF(__pyx_v_grb->validDate);
-          __pyx_v_grb->validDate = __pyx_t_1;
-          __pyx_t_1 = 0;
+          __pyx_v_grb->validDate = __pyx_t_12;
+          __pyx_t_12 = 0;
         }
         __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
         __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
         __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
-        goto __pyx_L95_try_end;
-        __pyx_L88_error:;
+        goto __pyx_L97_try_end;
+        __pyx_L90_error:;
+        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
         __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
         __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
-        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
-        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
 
-        /* "pygrib.pyx":784
+        /* "pygrib.pyx":778
  *                 grb.validDate =\
  *                 julian_to_datetime(grb.julianDay+ftime/2.)
  *             except ValueError:             # <<<<<<<<<<<<<<
  *                 return grb
  *     return grb
  */
-        __pyx_t_12 = PyErr_ExceptionMatches(__pyx_builtin_ValueError);
-        if (__pyx_t_12) {
+        __pyx_t_13 = PyErr_ExceptionMatches(__pyx_builtin_ValueError);
+        if (__pyx_t_13) {
           __Pyx_AddTraceback("pygrib.setdates", __pyx_clineno, __pyx_lineno, __pyx_filename);
-          if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_6, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 784; __pyx_clineno = __LINE__; goto __pyx_L90_except_error;}
-          __Pyx_GOTREF(__pyx_t_1);
-          __Pyx_GOTREF(__pyx_t_6);
+          if (__Pyx_GetException(&__pyx_t_12, &__pyx_t_2, &__pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L92_except_error;}
+          __Pyx_GOTREF(__pyx_t_12);
           __Pyx_GOTREF(__pyx_t_2);
+          __Pyx_GOTREF(__pyx_t_11);
 
-          /* "pygrib.pyx":785
+          /* "pygrib.pyx":779
  *                 julian_to_datetime(grb.julianDay+ftime/2.)
  *             except ValueError:
  *                 return grb             # <<<<<<<<<<<<<<
@@ -8188,42 +8978,34 @@ static PyObject *__pyx_pf_6pygrib_18setdates(CYTHON_UNUSED PyObject *__pyx_self,
           __Pyx_XDECREF(__pyx_r);
           __Pyx_INCREF(((PyObject *)__pyx_v_grb));
           __pyx_r = ((PyObject *)__pyx_v_grb);
-          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-          goto __pyx_L91_except_return;
-          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
           __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-          goto __pyx_L89_exception_handled;
+          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+          goto __pyx_L93_except_return;
         }
-        __pyx_L90_except_error:;
+        goto __pyx_L92_except_error;
+        __pyx_L92_except_error:;
         __Pyx_XGIVEREF(__pyx_t_7);
         __Pyx_XGIVEREF(__pyx_t_8);
         __Pyx_XGIVEREF(__pyx_t_9);
         __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
         goto __pyx_L1_error;
-        __pyx_L91_except_return:;
+        __pyx_L93_except_return:;
         __Pyx_XGIVEREF(__pyx_t_7);
         __Pyx_XGIVEREF(__pyx_t_8);
         __Pyx_XGIVEREF(__pyx_t_9);
         __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
         goto __pyx_L0;
-        __pyx_L89_exception_handled:;
-        __Pyx_XGIVEREF(__pyx_t_7);
-        __Pyx_XGIVEREF(__pyx_t_8);
-        __Pyx_XGIVEREF(__pyx_t_9);
-        __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
-        __pyx_L95_try_end:;
+        __pyx_L97_try_end:;
       }
-      goto __pyx_L27;
+      goto __pyx_L29;
     }
-    __pyx_L27:;
-    goto __pyx_L16;
+    __pyx_L29:;
+    goto __pyx_L18;
   }
-  __pyx_L16:;
+  __pyx_L18:;
 
-  /* "pygrib.pyx":786
+  /* "pygrib.pyx":780
  *             except ValueError:
  *                 return grb
  *     return grb             # <<<<<<<<<<<<<<
@@ -8235,13 +9017,21 @@ static PyObject *__pyx_pf_6pygrib_18setdates(CYTHON_UNUSED PyObject *__pyx_self,
   __pyx_r = ((PyObject *)__pyx_v_grb);
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "pygrib.pyx":701
+ *     return setdates(grb)
+ * 
+ * def setdates(gribmessage grb):             # <<<<<<<<<<<<<<
+ *     """
+ *     setdates(grb)
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
   __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
   __Pyx_XDECREF(__pyx_t_6);
   __Pyx_XDECREF(__pyx_t_11);
+  __Pyx_XDECREF(__pyx_t_12);
   __Pyx_AddTraceback("pygrib.setdates", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_r = NULL;
   __pyx_L0:;
@@ -8251,10 +9041,18 @@ static PyObject *__pyx_pf_6pygrib_18setdates(CYTHON_UNUSED PyObject *__pyx_self,
   return __pyx_r;
 }
 
+/* "pygrib.pyx":782
+ *     return grb
+ * 
+ * def reload(gribmessage grb):             # <<<<<<<<<<<<<<
+ *     """
+ *     reload(grb)
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_6pygrib_21reload(PyObject *__pyx_self, PyObject *__pyx_v_grb); /*proto*/
 static char __pyx_doc_6pygrib_20reload[] = "\n    reload(grb)\n\n    Recreate gribmessage object, updating all the keys to be consistent\n    with each other.  For example, if the forecastTime key is changed,\n    recreating the gribmessage object with this function will cause\n    the analDate and verifDate keys to be updated accordingly.\n\n    Equivalent to fromstring(grb.tostring())";
-static PyMethodDef __pyx_mdef_6pygrib_21reload = {__Pyx_NAMESTR("reload"), (PyCFunction)__pyx_pw_6pygrib_21reload, METH_O, __Pyx_DOCSTR(__pyx_doc_6pygrib_20reload)};
+static PyMethodDef __pyx_mdef_6pygrib_21reload = {"reload", (PyCFunction)__pyx_pw_6pygrib_21reload, METH_O, __pyx_doc_6pygrib_20reload};
 static PyObject *__pyx_pw_6pygrib_21reload(PyObject *__pyx_self, PyObject *__pyx_v_grb) {
   CYTHON_UNUSED int __pyx_lineno = 0;
   CYTHON_UNUSED const char *__pyx_filename = NULL;
@@ -8262,8 +9060,10 @@ static PyObject *__pyx_pw_6pygrib_21reload(PyObject *__pyx_self, PyObject *__pyx
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("reload (wrapper)", 0);
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_grb), __pyx_ptype_6pygrib_gribmessage, 1, "grb", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_grb), __pyx_ptype_6pygrib_gribmessage, 1, "grb", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_r = __pyx_pf_6pygrib_20reload(__pyx_self, ((struct __pyx_obj_6pygrib_gribmessage *)__pyx_v_grb));
+
+  /* function exit code */
   goto __pyx_L0;
   __pyx_L1_error:;
   __pyx_r = NULL;
@@ -8272,26 +9072,20 @@ static PyObject *__pyx_pw_6pygrib_21reload(PyObject *__pyx_self, PyObject *__pyx
   return __pyx_r;
 }
 
-/* "pygrib.pyx":788
- *     return grb
- * 
- * def reload(gribmessage grb):             # <<<<<<<<<<<<<<
- *     """
- *     reload(grb)
- */
-
 static PyObject *__pyx_pf_6pygrib_20reload(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6pygrib_gribmessage *__pyx_v_grb) {
   PyObject *__pyx_r = NULL;
   __Pyx_RefNannyDeclarations
   PyObject *__pyx_t_1 = NULL;
   PyObject *__pyx_t_2 = NULL;
   PyObject *__pyx_t_3 = NULL;
+  PyObject *__pyx_t_4 = NULL;
+  PyObject *__pyx_t_5 = NULL;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("reload", 0);
 
-  /* "pygrib.pyx":798
+  /* "pygrib.pyx":792
  * 
  *     Equivalent to fromstring(grb.tostring())"""
  *     return fromstring(grb.tostring())             # <<<<<<<<<<<<<<
@@ -8299,32 +9093,73 @@ static PyObject *__pyx_pf_6pygrib_20reload(CYTHON_UNUSED PyObject *__pyx_self, s
  * cdef class gribmessage(object):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__fromstring); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_grb), __pyx_n_s__tostring); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_fromstring); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_grb), __pyx_n_s_tostring); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_5 = NULL;
+  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
+    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
+    if (likely(__pyx_t_5)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+      __Pyx_INCREF(__pyx_t_5);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_4, function);
+    }
+  }
+  if (__pyx_t_5) {
+    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  } else {
+    __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  }
   __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_t_4 = NULL;
+  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_4)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_4);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  if (!__pyx_t_4) {
+    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+  } else {
+    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
+    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3);
+    __Pyx_GIVEREF(__pyx_t_3);
+    __pyx_t_3 = 0;
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  }
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
-  __Pyx_GIVEREF(__pyx_t_3);
-  __pyx_t_3 = 0;
-  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
-  __pyx_r = __pyx_t_3;
-  __pyx_t_3 = 0;
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "pygrib.pyx":782
+ *     return grb
+ * 
+ * def reload(gribmessage grb):             # <<<<<<<<<<<<<<
+ *     """
+ *     reload(grb)
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_XDECREF(__pyx_t_2);
   __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
   __Pyx_AddTraceback("pygrib.reload", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_r = NULL;
   __pyx_L0:;
@@ -8333,6 +9168,14 @@ static PyObject *__pyx_pf_6pygrib_20reload(CYTHON_UNUSED PyObject *__pyx_self, s
   return __pyx_r;
 }
 
+/* "pygrib.pyx":833
+ *     cdef public messagenumber, projparams, validDate, analDate,\
+ *     expand_reduced, _ro_keys, _all_keys, fcstimeunits
+ *     def __init__(self):             # <<<<<<<<<<<<<<
+ *         # calling "__new__()" will not call "__init__()" !
+ *         raise TypeError("This class cannot be instantiated from Python")
+ */
+
 /* Python wrapper */
 static int __pyx_pw_6pygrib_11gribmessage_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static int __pyx_pw_6pygrib_11gribmessage_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
@@ -8343,18 +9186,12 @@ static int __pyx_pw_6pygrib_11gribmessage_1__init__(PyObject *__pyx_v_self, PyOb
     __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
   if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
   __pyx_r = __pyx_pf_6pygrib_11gribmessage___init__(((struct __pyx_obj_6pygrib_gribmessage *)__pyx_v_self));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "pygrib.pyx":839
- *     cdef public messagenumber, projparams, validDate, analDate,\
- *     expand_reduced, _ro_keys, _all_keys, fcstimeunits
- *     def __init__(self):             # <<<<<<<<<<<<<<
- *         # calling "__new__()" will not call "__init__()" !
- *         raise TypeError("This class cannot be instantiated from Python")
- */
-
 static int __pyx_pf_6pygrib_11gribmessage___init__(CYTHON_UNUSED struct __pyx_obj_6pygrib_gribmessage *__pyx_v_self) {
   int __pyx_r;
   __Pyx_RefNannyDeclarations
@@ -8364,40 +9201,37 @@ static int __pyx_pf_6pygrib_11gribmessage___init__(CYTHON_UNUSED struct __pyx_ob
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("__init__", 0);
 
-  /* "pygrib.pyx":841
+  /* "pygrib.pyx":835
  *     def __init__(self):
  *         # calling "__new__()" will not call "__init__()" !
  *         raise TypeError("This class cannot be instantiated from Python")             # <<<<<<<<<<<<<<
  *     def __dealloc__(self):
  *         # finalization (inverse of __cinit__): needed to allow garbage collector to free memory.
  */
-  __pyx_t_1 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_31), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
-  __pyx_r = 0;
-  goto __pyx_L0;
+  /* "pygrib.pyx":833
+ *     cdef public messagenumber, projparams, validDate, analDate,\
+ *     expand_reduced, _ro_keys, _all_keys, fcstimeunits
+ *     def __init__(self):             # <<<<<<<<<<<<<<
+ *         # calling "__new__()" will not call "__init__()" !
+ *         raise TypeError("This class cannot be instantiated from Python")
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_AddTraceback("pygrib.gribmessage.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_r = -1;
-  __pyx_L0:;
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* Python wrapper */
-static void __pyx_pw_6pygrib_11gribmessage_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
-static void __pyx_pw_6pygrib_11gribmessage_3__dealloc__(PyObject *__pyx_v_self) {
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
-  __pyx_pf_6pygrib_11gribmessage_2__dealloc__(((struct __pyx_obj_6pygrib_gribmessage *)__pyx_v_self));
-  __Pyx_RefNannyFinishContext();
-}
-
-/* "pygrib.pyx":842
+/* "pygrib.pyx":836
  *         # calling "__new__()" will not call "__init__()" !
  *         raise TypeError("This class cannot be instantiated from Python")
  *     def __dealloc__(self):             # <<<<<<<<<<<<<<
@@ -8405,12 +9239,23 @@ static void __pyx_pw_6pygrib_11gribmessage_3__dealloc__(PyObject *__pyx_v_self)
  *         cdef int err
  */
 
+/* Python wrapper */
+static void __pyx_pw_6pygrib_11gribmessage_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
+static void __pyx_pw_6pygrib_11gribmessage_3__dealloc__(PyObject *__pyx_v_self) {
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
+  __pyx_pf_6pygrib_11gribmessage_2__dealloc__(((struct __pyx_obj_6pygrib_gribmessage *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+}
+
 static void __pyx_pf_6pygrib_11gribmessage_2__dealloc__(struct __pyx_obj_6pygrib_gribmessage *__pyx_v_self) {
   CYTHON_UNUSED int __pyx_v_err;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__dealloc__", 0);
 
-  /* "pygrib.pyx":845
+  /* "pygrib.pyx":839
  *         # finalization (inverse of __cinit__): needed to allow garbage collector to free memory.
  *         cdef int err
  *         err = grib_handle_delete(self._gh)             # <<<<<<<<<<<<<<
@@ -8419,9 +9264,26 @@ static void __pyx_pf_6pygrib_11gribmessage_2__dealloc__(struct __pyx_obj_6pygrib
  */
   __pyx_v_err = grib_handle_delete(__pyx_v_self->_gh);
 
+  /* "pygrib.pyx":836
+ *         # calling "__new__()" will not call "__init__()" !
+ *         raise TypeError("This class cannot be instantiated from Python")
+ *     def __dealloc__(self):             # <<<<<<<<<<<<<<
+ *         # finalization (inverse of __cinit__): needed to allow garbage collector to free memory.
+ *         cdef int err
+ */
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
 }
 
+/* "pygrib.pyx":840
+ *         cdef int err
+ *         err = grib_handle_delete(self._gh)
+ *     def __getattr__(self, item):             # <<<<<<<<<<<<<<
+ *         # allow gribmessage keys to accessed like attributes.
+ *         # this is tried after looking for item in self.__dict__.keys().
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_6pygrib_11gribmessage_5__getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
 static PyObject *__pyx_pw_6pygrib_11gribmessage_5__getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
@@ -8429,18 +9291,12 @@ static PyObject *__pyx_pw_6pygrib_11gribmessage_5__getattr__(PyObject *__pyx_v_s
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_11gribmessage_4__getattr__(((struct __pyx_obj_6pygrib_gribmessage *)__pyx_v_self), ((PyObject *)__pyx_v_item));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "pygrib.pyx":846
- *         cdef int err
- *         err = grib_handle_delete(self._gh)
- *     def __getattr__(self, item):             # <<<<<<<<<<<<<<
- *         # allow gribmessage keys to accessed like attributes.
- *         # this is tried after looking for item in self.__dict__.keys().
- */
-
 static PyObject *__pyx_pf_6pygrib_11gribmessage_4__getattr__(struct __pyx_obj_6pygrib_gribmessage *__pyx_v_self, PyObject *__pyx_v_item) {
   PyObject *__pyx_r = NULL;
   __Pyx_RefNannyDeclarations
@@ -8450,15 +9306,15 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_4__getattr__(struct __pyx_obj_6p
   PyObject *__pyx_t_4 = NULL;
   PyObject *__pyx_t_5 = NULL;
   PyObject *__pyx_t_6 = NULL;
-  int __pyx_t_7;
-  PyObject *__pyx_t_8 = NULL;
+  PyObject *__pyx_t_7 = NULL;
+  int __pyx_t_8;
   PyObject *__pyx_t_9 = NULL;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("__getattr__", 0);
 
-  /* "pygrib.pyx":849
+  /* "pygrib.pyx":843
  *         # allow gribmessage keys to accessed like attributes.
  *         # this is tried after looking for item in self.__dict__.keys().
  *         try:             # <<<<<<<<<<<<<<
@@ -8472,7 +9328,7 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_4__getattr__(struct __pyx_obj_6p
     __Pyx_XGOTREF(__pyx_t_3);
     /*try:*/ {
 
-      /* "pygrib.pyx":850
+      /* "pygrib.pyx":844
  *         # this is tried after looking for item in self.__dict__.keys().
  *         try:
  *             return self.__getitem__(item)             # <<<<<<<<<<<<<<
@@ -8480,95 +9336,106 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_4__getattr__(struct __pyx_obj_6p
  *             raise AttributeError(item)
  */
       __Pyx_XDECREF(__pyx_r);
-      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s____getitem__); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 850; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 850; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getitem); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       __Pyx_GOTREF(__pyx_t_5);
-      __Pyx_INCREF(__pyx_v_item);
-      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_item);
-      __Pyx_GIVEREF(__pyx_v_item);
-      __pyx_t_6 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 850; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-      __Pyx_GOTREF(__pyx_t_6);
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
-      __pyx_r = __pyx_t_6;
-      __pyx_t_6 = 0;
+      __pyx_t_6 = NULL;
+      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
+        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
+        if (likely(__pyx_t_6)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+          __Pyx_INCREF(__pyx_t_6);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_5, function);
+        }
+      }
+      if (!__pyx_t_6) {
+        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_item); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __Pyx_GOTREF(__pyx_t_4);
+      } else {
+        __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __Pyx_GOTREF(__pyx_t_7);
+        PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
+        __Pyx_INCREF(__pyx_v_item);
+        PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_item);
+        __Pyx_GIVEREF(__pyx_v_item);
+        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __Pyx_GOTREF(__pyx_t_4);
+        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+      }
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __pyx_r = __pyx_t_4;
+      __pyx_t_4 = 0;
       goto __pyx_L7_try_return;
     }
-    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
-    goto __pyx_L10_try_end;
-    __pyx_L7_try_return:;
-    __Pyx_XGIVEREF(__pyx_t_1);
-    __Pyx_XGIVEREF(__pyx_t_2);
-    __Pyx_XGIVEREF(__pyx_t_3);
-    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
-    goto __pyx_L0;
     __pyx_L3_error:;
-    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
 
-    /* "pygrib.pyx":851
+    /* "pygrib.pyx":845
  *         try:
  *             return self.__getitem__(item)
  *         except KeyError:             # <<<<<<<<<<<<<<
  *             raise AttributeError(item)
  *     def __setattr__(self, name, value):
  */
-    __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_KeyError);
-    if (__pyx_t_7) {
+    __pyx_t_8 = PyErr_ExceptionMatches(__pyx_builtin_KeyError);
+    if (__pyx_t_8) {
       __Pyx_AddTraceback("pygrib.gribmessage.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
-      __Pyx_GOTREF(__pyx_t_6);
-      __Pyx_GOTREF(__pyx_t_5);
+      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
       __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_GOTREF(__pyx_t_5);
+      __Pyx_GOTREF(__pyx_t_7);
 
-      /* "pygrib.pyx":852
+      /* "pygrib.pyx":846
  *             return self.__getitem__(item)
  *         except KeyError:
  *             raise AttributeError(item)             # <<<<<<<<<<<<<<
  *     def __setattr__(self, name, value):
  *         # allow gribmessage keys to be set like attributes.
  */
-      __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
-      __Pyx_GOTREF(__pyx_t_8);
+      __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
+      __Pyx_GOTREF(__pyx_t_6);
       __Pyx_INCREF(__pyx_v_item);
-      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_item);
+      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_item);
       __Pyx_GIVEREF(__pyx_v_item);
-      __pyx_t_9 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
+      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
       __Pyx_GOTREF(__pyx_t_9);
-      __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
       __Pyx_Raise(__pyx_t_9, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
-      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      goto __pyx_L4_exception_handled;
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
     }
+    goto __pyx_L5_except_error;
     __pyx_L5_except_error:;
     __Pyx_XGIVEREF(__pyx_t_1);
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
     goto __pyx_L1_error;
-    __pyx_L4_exception_handled:;
+    __pyx_L7_try_return:;
     __Pyx_XGIVEREF(__pyx_t_1);
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
-    __pyx_L10_try_end:;
+    goto __pyx_L0;
   }
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "pygrib.pyx":840
+ *         cdef int err
+ *         err = grib_handle_delete(self._gh)
+ *     def __getattr__(self, item):             # <<<<<<<<<<<<<<
+ *         # allow gribmessage keys to accessed like attributes.
+ *         # this is tried after looking for item in self.__dict__.keys().
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_4);
   __Pyx_XDECREF(__pyx_t_5);
   __Pyx_XDECREF(__pyx_t_6);
-  __Pyx_XDECREF(__pyx_t_8);
+  __Pyx_XDECREF(__pyx_t_7);
   __Pyx_XDECREF(__pyx_t_9);
   __Pyx_AddTraceback("pygrib.gribmessage.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_r = NULL;
@@ -8578,6 +9445,14 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_4__getattr__(struct __pyx_obj_6p
   return __pyx_r;
 }
 
+/* "pygrib.pyx":847
+ *         except KeyError:
+ *             raise AttributeError(item)
+ *     def __setattr__(self, name, value):             # <<<<<<<<<<<<<<
+ *         # allow gribmessage keys to be set like attributes.
+ *         if name not in _private_atts:
+ */
+
 /* Python wrapper */
 static int __pyx_pw_6pygrib_11gribmessage_7__setattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value); /*proto*/
 static int __pyx_pw_6pygrib_11gribmessage_7__setattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value) {
@@ -8585,18 +9460,12 @@ static int __pyx_pw_6pygrib_11gribmessage_7__setattr__(PyObject *__pyx_v_self, P
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__setattr__ (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_11gribmessage_6__setattr__(((struct __pyx_obj_6pygrib_gribmessage *)__pyx_v_self), ((PyObject *)__pyx_v_name), ((PyObject *)__pyx_v_value));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "pygrib.pyx":853
- *         except KeyError:
- *             raise AttributeError(item)
- *     def __setattr__(self, name, value):             # <<<<<<<<<<<<<<
- *         # allow gribmessage keys to be set like attributes.
- *         if name not in _private_atts:
- */
-
 static int __pyx_pf_6pygrib_11gribmessage_6__setattr__(struct __pyx_obj_6pygrib_gribmessage *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value) {
   int __pyx_r;
   __Pyx_RefNannyDeclarations
@@ -8608,46 +9477,55 @@ static int __pyx_pf_6pygrib_11gribmessage_6__setattr__(struct __pyx_obj_6pygrib_
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("__setattr__", 0);
 
-  /* "pygrib.pyx":855
+  /* "pygrib.pyx":849
  *     def __setattr__(self, name, value):
  *         # allow gribmessage keys to be set like attributes.
  *         if name not in _private_atts:             # <<<<<<<<<<<<<<
  *             # these are grib message keys
  *             self[name] = value
  */
-  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s___private_atts); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_private_atts); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = (__Pyx_PySequence_Contains(__pyx_v_name, __pyx_t_1, Py_NE)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = (__Pyx_PySequence_Contains(__pyx_v_name, __pyx_t_1, Py_NE)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_t_3 = (__pyx_t_2 != 0);
   if (__pyx_t_3) {
 
-    /* "pygrib.pyx":857
+    /* "pygrib.pyx":851
  *         if name not in _private_atts:
  *             # these are grib message keys
  *             self[name] = value             # <<<<<<<<<<<<<<
  *         else:
  *             # these are python attributes.
  */
-    if (PyObject_SetItem(((PyObject *)__pyx_v_self), __pyx_v_name, __pyx_v_value) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_self), __pyx_v_name, __pyx_v_value) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     goto __pyx_L3;
   }
   /*else*/ {
 
-    /* "pygrib.pyx":860
+    /* "pygrib.pyx":854
  *         else:
  *             # these are python attributes.
  *             self.__dict__[name]=value             # <<<<<<<<<<<<<<
  *     def __repr__(self):
  *         """prints a short inventory of the grib message"""
  */
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s____dict__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 854; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_1);
-    if (PyObject_SetItem(__pyx_t_1, __pyx_v_name, __pyx_v_value) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_name, __pyx_v_value) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 854; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   }
   __pyx_L3:;
 
+  /* "pygrib.pyx":847
+ *         except KeyError:
+ *             raise AttributeError(item)
+ *     def __setattr__(self, name, value):             # <<<<<<<<<<<<<<
+ *         # allow gribmessage keys to be set like attributes.
+ *         if name not in _private_atts:
+ */
+
+  /* function exit code */
   __pyx_r = 0;
   goto __pyx_L0;
   __pyx_L1_error:;
@@ -8659,6 +9537,14 @@ static int __pyx_pf_6pygrib_11gribmessage_6__setattr__(struct __pyx_obj_6pygrib_
   return __pyx_r;
 }
 
+/* "pygrib.pyx":855
+ *             # these are python attributes.
+ *             self.__dict__[name]=value
+ *     def __repr__(self):             # <<<<<<<<<<<<<<
+ *         """prints a short inventory of the grib message"""
+ *         inventory = []
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_6pygrib_11gribmessage_9__repr__(PyObject *__pyx_v_self); /*proto*/
 static char __pyx_doc_6pygrib_11gribmessage_8__repr__[] = "prints a short inventory of the grib message";
@@ -8670,18 +9556,12 @@ static PyObject *__pyx_pw_6pygrib_11gribmessage_9__repr__(PyObject *__pyx_v_self
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_11gribmessage_8__repr__(((struct __pyx_obj_6pygrib_gribmessage *)__pyx_v_self));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "pygrib.pyx":861
- *             # these are python attributes.
- *             self.__dict__[name]=value
- *     def __repr__(self):             # <<<<<<<<<<<<<<
- *         """prints a short inventory of the grib message"""
- *         inventory = []
- */
-
 static PyObject *__pyx_pf_6pygrib_11gribmessage_8__repr__(struct __pyx_obj_6pygrib_gribmessage *__pyx_v_self) {
   PyObject *__pyx_v_inventory = NULL;
   PyObject *__pyx_v_toplev = NULL;
@@ -8701,122 +9581,122 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_8__repr__(struct __pyx_obj_6pygr
   PyObject *__pyx_t_4 = NULL;
   int __pyx_t_5;
   int __pyx_t_6;
-  int __pyx_t_7;
+  PyObject *__pyx_t_7 = NULL;
   PyObject *__pyx_t_8 = NULL;
-  PyObject *__pyx_t_9 = NULL;
+  Py_ssize_t __pyx_t_9;
+  PyObject *__pyx_t_10 = NULL;
+  int __pyx_t_11;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("__repr__", 0);
 
-  /* "pygrib.pyx":863
+  /* "pygrib.pyx":857
  *     def __repr__(self):
  *         """prints a short inventory of the grib message"""
  *         inventory = []             # <<<<<<<<<<<<<<
  *         if self.valid_key('name'):
  *             if self['name'] != 'unknown':
  */
-  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_v_inventory = ((PyObject*)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "pygrib.pyx":864
+  /* "pygrib.pyx":858
  *         """prints a short inventory of the grib message"""
  *         inventory = []
  *         if self.valid_key('name'):             # <<<<<<<<<<<<<<
  *             if self['name'] != 'unknown':
  *                 inventory.append(repr(self.messagenumber)+':'+self['name'])
  */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__valid_key); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_valid_key); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_32), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   if (__pyx_t_3) {
 
-    /* "pygrib.pyx":865
+    /* "pygrib.pyx":859
  *         inventory = []
  *         if self.valid_key('name'):
  *             if self['name'] != 'unknown':             # <<<<<<<<<<<<<<
  *                 inventory.append(repr(self.messagenumber)+':'+self['name'])
  *             elif self.valid_key('parameterName'):
  */
-    __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__name)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_name); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, ((PyObject *)__pyx_n_s__unknown), Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_unknown, Py_NE)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     if (__pyx_t_3) {
 
-      /* "pygrib.pyx":866
+      /* "pygrib.pyx":860
  *         if self.valid_key('name'):
  *             if self['name'] != 'unknown':
  *                 inventory.append(repr(self.messagenumber)+':'+self['name'])             # <<<<<<<<<<<<<<
  *             elif self.valid_key('parameterName'):
  *                 inventory.append(repr(self.messagenumber)+':'+self['parameterName'])
  */
-      __pyx_t_1 = __pyx_v_self->messagenumber;
-      __Pyx_INCREF(__pyx_t_1);
-      __pyx_t_2 = PyObject_Repr(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __pyx_t_1 = PyNumber_Add(__pyx_t_2, ((PyObject *)__pyx_kp_s_33)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_2 = __pyx_v_self->messagenumber;
+      __Pyx_INCREF(__pyx_t_2);
+      __pyx_t_1 = PyObject_Repr(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__name)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_kp_s__17); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_2);
-      __pyx_t_4 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_name); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+      __Pyx_GOTREF(__pyx_t_1);
+      __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_inventory, __pyx_t_4); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_inventory, __pyx_t_4); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       goto __pyx_L4;
     }
 
-    /* "pygrib.pyx":867
+    /* "pygrib.pyx":861
  *             if self['name'] != 'unknown':
  *                 inventory.append(repr(self.messagenumber)+':'+self['name'])
  *             elif self.valid_key('parameterName'):             # <<<<<<<<<<<<<<
  *                 inventory.append(repr(self.messagenumber)+':'+self['parameterName'])
  *         if self.valid_key('units'):
  */
-    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__valid_key); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_valid_key); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_34), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     if (__pyx_t_3) {
 
-      /* "pygrib.pyx":868
+      /* "pygrib.pyx":862
  *                 inventory.append(repr(self.messagenumber)+':'+self['name'])
  *             elif self.valid_key('parameterName'):
  *                 inventory.append(repr(self.messagenumber)+':'+self['parameterName'])             # <<<<<<<<<<<<<<
  *         if self.valid_key('units'):
  *             if self['units'] != 'unknown':
  */
-      __pyx_t_2 = __pyx_v_self->messagenumber;
-      __Pyx_INCREF(__pyx_t_2);
-      __pyx_t_4 = PyObject_Repr(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __pyx_t_2 = PyNumber_Add(__pyx_t_4, ((PyObject *)__pyx_kp_s_33)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__parameterName)); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_1 = __pyx_v_self->messagenumber;
+      __Pyx_INCREF(__pyx_t_1);
+      __pyx_t_4 = PyObject_Repr(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_4);
-      __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_kp_s__17); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_1);
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_inventory, __pyx_t_1); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_parameterName); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_2);
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_inventory, __pyx_t_2); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
       goto __pyx_L4;
     }
     __pyx_L4:;
@@ -8824,84 +9704,82 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_8__repr__(struct __pyx_obj_6pygr
   }
   __pyx_L3:;
 
-  /* "pygrib.pyx":869
+  /* "pygrib.pyx":863
  *             elif self.valid_key('parameterName'):
  *                 inventory.append(repr(self.messagenumber)+':'+self['parameterName'])
  *         if self.valid_key('units'):             # <<<<<<<<<<<<<<
  *             if self['units'] != 'unknown':
  *                 inventory.append(':'+self['units'])
  */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__valid_key); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_35), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_valid_key); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   if (__pyx_t_3) {
 
-    /* "pygrib.pyx":870
+    /* "pygrib.pyx":864
  *                 inventory.append(repr(self.messagenumber)+':'+self['parameterName'])
  *         if self.valid_key('units'):
  *             if self['units'] != 'unknown':             # <<<<<<<<<<<<<<
  *                 inventory.append(':'+self['units'])
  *             elif self.valid_key('parameterUnits'):
  */
-    __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__units)); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_units); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
     __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, ((PyObject *)__pyx_n_s__unknown), Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_n_s_unknown, Py_NE)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     if (__pyx_t_3) {
 
-      /* "pygrib.pyx":871
+      /* "pygrib.pyx":865
  *         if self.valid_key('units'):
  *             if self['units'] != 'unknown':
  *                 inventory.append(':'+self['units'])             # <<<<<<<<<<<<<<
  *             elif self.valid_key('parameterUnits'):
  *                 inventory.append(':'+self['parameterUnits'])
  */
-      __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__units)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_kp_s_33), __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_units); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
       __Pyx_GOTREF(__pyx_t_4);
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_inventory, __pyx_t_4); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_2 = PyNumber_Add(__pyx_kp_s__17, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_2);
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_inventory, __pyx_t_2); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
       goto __pyx_L6;
     }
 
-    /* "pygrib.pyx":872
+    /* "pygrib.pyx":866
  *             if self['units'] != 'unknown':
  *                 inventory.append(':'+self['units'])
  *             elif self.valid_key('parameterUnits'):             # <<<<<<<<<<<<<<
  *                 inventory.append(':'+self['parameterUnits'])
  *         if self.valid_key('stepType'):
  */
-    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__valid_key); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_valid_key); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_36), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     if (__pyx_t_3) {
 
-      /* "pygrib.pyx":873
+      /* "pygrib.pyx":867
  *                 inventory.append(':'+self['units'])
  *             elif self.valid_key('parameterUnits'):
  *                 inventory.append(':'+self['parameterUnits'])             # <<<<<<<<<<<<<<
  *         if self.valid_key('stepType'):
  *             inventory.append(' ('+self['stepType']+')')
  */
-      __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__parameterUnits)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_kp_s_33), __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_parameterUnits); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
       __Pyx_GOTREF(__pyx_t_4);
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_inventory, __pyx_t_4); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_2 = PyNumber_Add(__pyx_kp_s__17, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_2);
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_inventory, __pyx_t_2); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
       goto __pyx_L6;
     }
     __pyx_L6:;
@@ -8909,188 +9787,192 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_8__repr__(struct __pyx_obj_6pygr
   }
   __pyx_L5:;
 
-  /* "pygrib.pyx":874
+  /* "pygrib.pyx":868
  *             elif self.valid_key('parameterUnits'):
  *                 inventory.append(':'+self['parameterUnits'])
  *         if self.valid_key('stepType'):             # <<<<<<<<<<<<<<
  *             inventory.append(' ('+self['stepType']+')')
  *         if self.valid_key('typeOfGrid') or self.valid_key('gridType'):
  */
-  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__valid_key); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_valid_key); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_37), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (__pyx_t_3) {
 
-    /* "pygrib.pyx":875
+    /* "pygrib.pyx":869
  *                 inventory.append(':'+self['parameterUnits'])
  *         if self.valid_key('stepType'):
  *             inventory.append(' ('+self['stepType']+')')             # <<<<<<<<<<<<<<
  *         if self.valid_key('typeOfGrid') or self.valid_key('gridType'):
  *             if self.valid_key('typeOfGrid'):
  */
-    __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__stepType)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_kp_s_38), __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_stepType); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
     __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_1 = PyNumber_Add(__pyx_t_4, ((PyObject *)__pyx_kp_s_39)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_2 = PyNumber_Add(__pyx_kp_s__22, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_kp_s__23); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_inventory, __pyx_t_4); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_inventory, __pyx_t_1); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     goto __pyx_L7;
   }
   __pyx_L7:;
 
-  /* "pygrib.pyx":876
+  /* "pygrib.pyx":870
  *         if self.valid_key('stepType'):
  *             inventory.append(' ('+self['stepType']+')')
  *         if self.valid_key('typeOfGrid') or self.valid_key('gridType'):             # <<<<<<<<<<<<<<
  *             if self.valid_key('typeOfGrid'):
  *                inventory.append(':'+self['typeOfGrid'])
  */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__valid_key); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_40), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_valid_key); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  if (!__pyx_t_3) {
-    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__valid_key); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_41), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_7 = __pyx_t_6;
+  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  if (!__pyx_t_6) {
   } else {
-    __pyx_t_7 = __pyx_t_3;
+    __pyx_t_3 = __pyx_t_6;
+    goto __pyx_L9_bool_binop_done;
   }
-  if (__pyx_t_7) {
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_valid_key); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_t_3 = __pyx_t_6;
+  __pyx_L9_bool_binop_done:;
+  if (__pyx_t_3) {
 
-    /* "pygrib.pyx":877
+    /* "pygrib.pyx":871
  *             inventory.append(' ('+self['stepType']+')')
  *         if self.valid_key('typeOfGrid') or self.valid_key('gridType'):
  *             if self.valid_key('typeOfGrid'):             # <<<<<<<<<<<<<<
  *                inventory.append(':'+self['typeOfGrid'])
  *             else:
  */
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__valid_key); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_42), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_valid_key); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    if (__pyx_t_7) {
+    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    if (__pyx_t_3) {
 
-      /* "pygrib.pyx":878
+      /* "pygrib.pyx":872
  *         if self.valid_key('typeOfGrid') or self.valid_key('gridType'):
  *             if self.valid_key('typeOfGrid'):
  *                inventory.append(':'+self['typeOfGrid'])             # <<<<<<<<<<<<<<
  *             else:
  *                inventory.append(':'+self['gridType'])
  */
-      __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__typeOfGrid)); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_typeOfGrid); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_t_4 = PyNumber_Add(__pyx_kp_s__17, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_4);
-      __pyx_t_1 = PyNumber_Add(((PyObject *)__pyx_kp_s_33), __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_inventory, __pyx_t_4); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_inventory, __pyx_t_1); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      goto __pyx_L9;
+      goto __pyx_L11;
     }
     /*else*/ {
 
-      /* "pygrib.pyx":880
+      /* "pygrib.pyx":874
  *                inventory.append(':'+self['typeOfGrid'])
  *             else:
  *                inventory.append(':'+self['gridType'])             # <<<<<<<<<<<<<<
  *         if self.valid_key('typeOfLevel'):
  *             inventory.append(':'+self['typeOfLevel'])
  */
-      __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__gridType)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_kp_s_33), __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_gridType); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
       __Pyx_GOTREF(__pyx_t_4);
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_inventory, __pyx_t_4); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_2 = PyNumber_Add(__pyx_kp_s__17, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_2);
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_inventory, __pyx_t_2); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     }
-    __pyx_L9:;
+    __pyx_L11:;
     goto __pyx_L8;
   }
   __pyx_L8:;
 
-  /* "pygrib.pyx":881
+  /* "pygrib.pyx":875
  *             else:
  *                inventory.append(':'+self['gridType'])
  *         if self.valid_key('typeOfLevel'):             # <<<<<<<<<<<<<<
  *             inventory.append(':'+self['typeOfLevel'])
  *         if self.valid_key('topLevel') and self.valid_key('bottomLevel'):
  */
-  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__valid_key); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_valid_key); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_43), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  if (__pyx_t_7) {
+  if (__pyx_t_3) {
 
-    /* "pygrib.pyx":882
+    /* "pygrib.pyx":876
  *                inventory.append(':'+self['gridType'])
  *         if self.valid_key('typeOfLevel'):
  *             inventory.append(':'+self['typeOfLevel'])             # <<<<<<<<<<<<<<
  *         if self.valid_key('topLevel') and self.valid_key('bottomLevel'):
  *             toplev = None; botlev = None
  */
-    __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__typeOfLevel)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_kp_s_33), __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_typeOfLevel); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
     __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_inventory, __pyx_t_4); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = PyNumber_Add(__pyx_kp_s__17, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    goto __pyx_L10;
+    __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_inventory, __pyx_t_2); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    goto __pyx_L12;
   }
-  __pyx_L10:;
+  __pyx_L12:;
 
-  /* "pygrib.pyx":883
+  /* "pygrib.pyx":877
  *         if self.valid_key('typeOfLevel'):
  *             inventory.append(':'+self['typeOfLevel'])
  *         if self.valid_key('topLevel') and self.valid_key('bottomLevel'):             # <<<<<<<<<<<<<<
  *             toplev = None; botlev = None
  *             levunits = 'unknown'
  */
-  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__valid_key); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_valid_key); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_44), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  if (__pyx_t_7) {
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__valid_key); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_45), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_t_6 = __pyx_t_3;
+  if (__pyx_t_6) {
   } else {
-    __pyx_t_6 = __pyx_t_7;
+    __pyx_t_3 = __pyx_t_6;
+    goto __pyx_L14_bool_binop_done;
   }
-  if (__pyx_t_6) {
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_valid_key); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_3 = __pyx_t_6;
+  __pyx_L14_bool_binop_done:;
+  if (__pyx_t_3) {
 
-    /* "pygrib.pyx":884
+    /* "pygrib.pyx":878
  *             inventory.append(':'+self['typeOfLevel'])
  *         if self.valid_key('topLevel') and self.valid_key('bottomLevel'):
  *             toplev = None; botlev = None             # <<<<<<<<<<<<<<
@@ -9102,360 +9984,410 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_8__repr__(struct __pyx_obj_6pygr
     __Pyx_INCREF(Py_None);
     __pyx_v_botlev = Py_None;
 
-    /* "pygrib.pyx":885
+    /* "pygrib.pyx":879
  *         if self.valid_key('topLevel') and self.valid_key('bottomLevel'):
  *             toplev = None; botlev = None
  *             levunits = 'unknown'             # <<<<<<<<<<<<<<
  *             if self.valid_key('unitsOfFirstFixedSurface'):
  *                 levunits = self['unitsOfFirstFixedSurface']
  */
-    __Pyx_INCREF(((PyObject *)__pyx_n_s__unknown));
-    __pyx_v_levunits = ((PyObject *)__pyx_n_s__unknown);
+    __Pyx_INCREF(__pyx_n_s_unknown);
+    __pyx_v_levunits = __pyx_n_s_unknown;
 
-    /* "pygrib.pyx":886
+    /* "pygrib.pyx":880
  *             toplev = None; botlev = None
  *             levunits = 'unknown'
  *             if self.valid_key('unitsOfFirstFixedSurface'):             # <<<<<<<<<<<<<<
  *                 levunits = self['unitsOfFirstFixedSurface']
  *             if self.valid_key('typeOfFirstFixedSurface') and self['typeOfFirstFixedSurface'] != 255:
  */
-    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__valid_key); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_valid_key); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_47), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    if (__pyx_t_6) {
+    if (__pyx_t_3) {
 
-      /* "pygrib.pyx":887
+      /* "pygrib.pyx":881
  *             levunits = 'unknown'
  *             if self.valid_key('unitsOfFirstFixedSurface'):
  *                 levunits = self['unitsOfFirstFixedSurface']             # <<<<<<<<<<<<<<
  *             if self.valid_key('typeOfFirstFixedSurface') and self['typeOfFirstFixedSurface'] != 255:
  *                 toplev = self['topLevel']
  */
-      __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s_46)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __Pyx_DECREF_SET(__pyx_v_levunits, __pyx_t_1);
-      __pyx_t_1 = 0;
-      goto __pyx_L12;
+      __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_unitsOfFirstFixedSurface); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_DECREF_SET(__pyx_v_levunits, __pyx_t_4);
+      __pyx_t_4 = 0;
+      goto __pyx_L16;
     }
-    __pyx_L12:;
+    __pyx_L16:;
 
-    /* "pygrib.pyx":888
+    /* "pygrib.pyx":882
  *             if self.valid_key('unitsOfFirstFixedSurface'):
  *                 levunits = self['unitsOfFirstFixedSurface']
  *             if self.valid_key('typeOfFirstFixedSurface') and self['typeOfFirstFixedSurface'] != 255:             # <<<<<<<<<<<<<<
  *                 toplev = self['topLevel']
  *                 if self.valid_key('scaledValueOfFirstFixedSurface') and\
  */
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__valid_key); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_49), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_valid_key); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     if (__pyx_t_6) {
-      __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s_48)); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_int_255, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __pyx_t_3 = __pyx_t_7;
     } else {
       __pyx_t_3 = __pyx_t_6;
+      goto __pyx_L18_bool_binop_done;
     }
+    __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_typeOfFirstFixedSurface); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_int_255, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_3 = __pyx_t_6;
+    __pyx_L18_bool_binop_done:;
     if (__pyx_t_3) {
 
-      /* "pygrib.pyx":889
+      /* "pygrib.pyx":883
  *                 levunits = self['unitsOfFirstFixedSurface']
  *             if self.valid_key('typeOfFirstFixedSurface') and self['typeOfFirstFixedSurface'] != 255:
  *                 toplev = self['topLevel']             # <<<<<<<<<<<<<<
  *                 if self.valid_key('scaledValueOfFirstFixedSurface') and\
  *                    self.valid_key('scaleFactorOfFirstFixedSurface'):
  */
-      __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__topLevel)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __Pyx_DECREF_SET(__pyx_v_toplev, __pyx_t_1);
-      __pyx_t_1 = 0;
+      __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_topLevel); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_DECREF_SET(__pyx_v_toplev, __pyx_t_4);
+      __pyx_t_4 = 0;
 
-      /* "pygrib.pyx":890
+      /* "pygrib.pyx":884
  *             if self.valid_key('typeOfFirstFixedSurface') and self['typeOfFirstFixedSurface'] != 255:
  *                 toplev = self['topLevel']
  *                 if self.valid_key('scaledValueOfFirstFixedSurface') and\             # <<<<<<<<<<<<<<
  *                    self.valid_key('scaleFactorOfFirstFixedSurface'):
  *                    if self['scaleFactorOfFirstFixedSurface']:
  */
-      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__valid_key); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_51), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_valid_key); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_4);
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_2);
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      if (__pyx_t_3) {
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      if (__pyx_t_6) {
+      } else {
+        __pyx_t_3 = __pyx_t_6;
+        goto __pyx_L21_bool_binop_done;
+      }
 
-        /* "pygrib.pyx":891
+      /* "pygrib.pyx":885
  *                 toplev = self['topLevel']
  *                 if self.valid_key('scaledValueOfFirstFixedSurface') and\
  *                    self.valid_key('scaleFactorOfFirstFixedSurface'):             # <<<<<<<<<<<<<<
  *                    if self['scaleFactorOfFirstFixedSurface']:
  *                        toplev = self['scaledValueOfFirstFixedSurface']/\
  */
-        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__valid_key); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_4);
-        __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_53), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_1);
-        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-        __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-        __pyx_t_7 = __pyx_t_6;
-      } else {
-        __pyx_t_7 = __pyx_t_3;
-      }
-      if (__pyx_t_7) {
+      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_valid_key); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_3 = __pyx_t_6;
+      __pyx_L21_bool_binop_done:;
+      if (__pyx_t_3) {
 
-        /* "pygrib.pyx":892
+        /* "pygrib.pyx":886
  *                 if self.valid_key('scaledValueOfFirstFixedSurface') and\
  *                    self.valid_key('scaleFactorOfFirstFixedSurface'):
  *                    if self['scaleFactorOfFirstFixedSurface']:             # <<<<<<<<<<<<<<
  *                        toplev = self['scaledValueOfFirstFixedSurface']/\
  *                                 np.power(10.0,self['scaleFactorOfFirstFixedSurface'])
  */
-        __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s_52)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_1);
-        __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-        if (__pyx_t_7) {
+        __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_scaleFactorOfFirstFixedSurface); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+        __Pyx_GOTREF(__pyx_t_4);
+        __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (__pyx_t_3) {
 
-          /* "pygrib.pyx":893
+          /* "pygrib.pyx":887
  *                    self.valid_key('scaleFactorOfFirstFixedSurface'):
  *                    if self['scaleFactorOfFirstFixedSurface']:
  *                        toplev = self['scaledValueOfFirstFixedSurface']/\             # <<<<<<<<<<<<<<
  *                                 np.power(10.0,self['scaleFactorOfFirstFixedSurface'])
  *                    else:
  */
-          __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s_50)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_1);
+          __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_scaledValueOfFirstFixedSurface); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+          __Pyx_GOTREF(__pyx_t_4);
 
-          /* "pygrib.pyx":894
+          /* "pygrib.pyx":888
  *                    if self['scaleFactorOfFirstFixedSurface']:
  *                        toplev = self['scaledValueOfFirstFixedSurface']/\
  *                                 np.power(10.0,self['scaleFactorOfFirstFixedSurface'])             # <<<<<<<<<<<<<<
  *                    else:
  *                        toplev = self['scaledValueOfFirstFixedSurface']
  */
-          __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_4);
-          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__power); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __Pyx_GOTREF(__pyx_t_1);
+          __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_power); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __Pyx_GOTREF(__pyx_t_7);
+          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+          __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_scaleFactorOfFirstFixedSurface); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+          __Pyx_GOTREF(__pyx_t_1);
+          __pyx_t_8 = NULL;
+          __pyx_t_9 = 0;
+          if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
+            __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
+            if (likely(__pyx_t_8)) {
+              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
+              __Pyx_INCREF(__pyx_t_8);
+              __Pyx_INCREF(function);
+              __Pyx_DECREF_SET(__pyx_t_7, function);
+              __pyx_t_9 = 1;
+            }
+          }
+          __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __Pyx_GOTREF(__pyx_t_10);
+          if (__pyx_t_8) {
+            PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_8 = NULL;
+          }
+          __Pyx_INCREF(__pyx_float_10_0);
+          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_float_10_0);
+          __Pyx_GIVEREF(__pyx_float_10_0);
+          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_1);
+          __Pyx_GIVEREF(__pyx_t_1);
+          __pyx_t_1 = 0;
+          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
           __Pyx_GOTREF(__pyx_t_2);
+          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+
+          /* "pygrib.pyx":887
+ *                    self.valid_key('scaleFactorOfFirstFixedSurface'):
+ *                    if self['scaleFactorOfFirstFixedSurface']:
+ *                        toplev = self['scaledValueOfFirstFixedSurface']/\             # <<<<<<<<<<<<<<
+ *                                 np.power(10.0,self['scaleFactorOfFirstFixedSurface'])
+ *                    else:
+ */
+          __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __Pyx_GOTREF(__pyx_t_7);
           __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-          __pyx_t_4 = PyFloat_FromDouble(10.0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_4);
-          __pyx_t_8 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s_52)); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_8);
-          __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_9);
-          PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4);
-          __Pyx_GIVEREF(__pyx_t_4);
-          PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_8);
-          __Pyx_GIVEREF(__pyx_t_8);
-          __pyx_t_4 = 0;
-          __pyx_t_8 = 0;
-          __pyx_t_8 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_8);
           __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-          __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
-          __pyx_t_9 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_9);
-          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-          __Pyx_DECREF_SET(__pyx_v_toplev, __pyx_t_9);
-          __pyx_t_9 = 0;
-          goto __pyx_L15;
+          __Pyx_DECREF_SET(__pyx_v_toplev, __pyx_t_7);
+          __pyx_t_7 = 0;
+          goto __pyx_L23;
         }
         /*else*/ {
 
-          /* "pygrib.pyx":896
+          /* "pygrib.pyx":890
  *                                 np.power(10.0,self['scaleFactorOfFirstFixedSurface'])
  *                    else:
  *                        toplev = self['scaledValueOfFirstFixedSurface']             # <<<<<<<<<<<<<<
  *             if self.valid_key('typeOfSecondFixedSurface') and self['typeOfSecondFixedSurface'] != 255:
  *                 botlev = self['bottomLevel']
  */
-          __pyx_t_9 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s_50)); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_9);
-          __Pyx_DECREF_SET(__pyx_v_toplev, __pyx_t_9);
-          __pyx_t_9 = 0;
+          __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_scaledValueOfFirstFixedSurface); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+          __Pyx_GOTREF(__pyx_t_7);
+          __Pyx_DECREF_SET(__pyx_v_toplev, __pyx_t_7);
+          __pyx_t_7 = 0;
         }
-        __pyx_L15:;
-        goto __pyx_L14;
+        __pyx_L23:;
+        goto __pyx_L20;
       }
-      __pyx_L14:;
-      goto __pyx_L13;
+      __pyx_L20:;
+      goto __pyx_L17;
     }
-    __pyx_L13:;
+    __pyx_L17:;
 
-    /* "pygrib.pyx":897
+    /* "pygrib.pyx":891
  *                    else:
  *                        toplev = self['scaledValueOfFirstFixedSurface']
  *             if self.valid_key('typeOfSecondFixedSurface') and self['typeOfSecondFixedSurface'] != 255:             # <<<<<<<<<<<<<<
  *                 botlev = self['bottomLevel']
  *                 if self.valid_key('scaledValueOfSecondFixedSurface') and\
  */
-    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__valid_key); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_9);
-    __pyx_t_8 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_k_tuple_55), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-    if (__pyx_t_7) {
-      __pyx_t_8 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s_54)); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-      __pyx_t_9 = PyObject_RichCompare(__pyx_t_8, __pyx_int_255, Py_NE); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-      __pyx_t_6 = __pyx_t_3;
+    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_valid_key); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_7);
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    if (__pyx_t_6) {
     } else {
-      __pyx_t_6 = __pyx_t_7;
+      __pyx_t_3 = __pyx_t_6;
+      goto __pyx_L25_bool_binop_done;
     }
-    if (__pyx_t_6) {
+    __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_typeOfSecondFixedSurface); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_7 = PyObject_RichCompare(__pyx_t_2, __pyx_int_255, Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __pyx_t_3 = __pyx_t_6;
+    __pyx_L25_bool_binop_done:;
+    if (__pyx_t_3) {
 
-      /* "pygrib.pyx":898
+      /* "pygrib.pyx":892
  *                        toplev = self['scaledValueOfFirstFixedSurface']
  *             if self.valid_key('typeOfSecondFixedSurface') and self['typeOfSecondFixedSurface'] != 255:
  *                 botlev = self['bottomLevel']             # <<<<<<<<<<<<<<
  *                 if self.valid_key('scaledValueOfSecondFixedSurface') and\
  *                    self.valid_key('scaleFactorOfSecondFixedSurface'):
  */
-      __pyx_t_9 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__bottomLevel)); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_9);
-      __Pyx_DECREF_SET(__pyx_v_botlev, __pyx_t_9);
-      __pyx_t_9 = 0;
+      __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_bottomLevel); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+      __Pyx_GOTREF(__pyx_t_7);
+      __Pyx_DECREF_SET(__pyx_v_botlev, __pyx_t_7);
+      __pyx_t_7 = 0;
 
-      /* "pygrib.pyx":899
+      /* "pygrib.pyx":893
  *             if self.valid_key('typeOfSecondFixedSurface') and self['typeOfSecondFixedSurface'] != 255:
  *                 botlev = self['bottomLevel']
  *                 if self.valid_key('scaledValueOfSecondFixedSurface') and\             # <<<<<<<<<<<<<<
  *                    self.valid_key('scaleFactorOfSecondFixedSurface'):
  *                    if self['scaleFactorOfSecondFixedSurface']:
  */
-      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__valid_key); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_9);
-      __pyx_t_8 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_k_tuple_57), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_valid_key); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_7);
+      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
       if (__pyx_t_6) {
+      } else {
+        __pyx_t_3 = __pyx_t_6;
+        goto __pyx_L28_bool_binop_done;
+      }
 
-        /* "pygrib.pyx":900
+      /* "pygrib.pyx":894
  *                 botlev = self['bottomLevel']
  *                 if self.valid_key('scaledValueOfSecondFixedSurface') and\
  *                    self.valid_key('scaleFactorOfSecondFixedSurface'):             # <<<<<<<<<<<<<<
  *                    if self['scaleFactorOfSecondFixedSurface']:
  *                        botlev = self['scaledValueOfSecondFixedSurface']/\
  */
-        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__valid_key); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_8);
-        __pyx_t_9 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_k_tuple_59), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_9);
-        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-        __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-        __pyx_t_3 = __pyx_t_7;
-      } else {
-        __pyx_t_3 = __pyx_t_6;
-      }
+      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_valid_key); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_7);
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+      __pyx_t_3 = __pyx_t_6;
+      __pyx_L28_bool_binop_done:;
       if (__pyx_t_3) {
 
-        /* "pygrib.pyx":901
+        /* "pygrib.pyx":895
  *                 if self.valid_key('scaledValueOfSecondFixedSurface') and\
  *                    self.valid_key('scaleFactorOfSecondFixedSurface'):
  *                    if self['scaleFactorOfSecondFixedSurface']:             # <<<<<<<<<<<<<<
  *                        botlev = self['scaledValueOfSecondFixedSurface']/\
  *                                 np.power(10.0,self['scaleFactorOfSecondFixedSurface'])
  */
-        __pyx_t_9 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s_58)); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 901; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_9);
-        __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 901; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+        __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_scaleFactorOfSecondFixedSurface); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+        __Pyx_GOTREF(__pyx_t_7);
+        __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
         if (__pyx_t_3) {
 
-          /* "pygrib.pyx":902
+          /* "pygrib.pyx":896
  *                    self.valid_key('scaleFactorOfSecondFixedSurface'):
  *                    if self['scaleFactorOfSecondFixedSurface']:
  *                        botlev = self['scaledValueOfSecondFixedSurface']/\             # <<<<<<<<<<<<<<
  *                                 np.power(10.0,self['scaleFactorOfSecondFixedSurface'])
  *                    else:
  */
-          __pyx_t_9 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s_56)); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_9);
+          __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_scaledValueOfSecondFixedSurface); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+          __Pyx_GOTREF(__pyx_t_7);
 
-          /* "pygrib.pyx":903
+          /* "pygrib.pyx":897
  *                    if self['scaleFactorOfSecondFixedSurface']:
  *                        botlev = self['scaledValueOfSecondFixedSurface']/\
  *                                 np.power(10.0,self['scaleFactorOfSecondFixedSurface'])             # <<<<<<<<<<<<<<
  *                    else:
  *                        botlev = self['scaledValueOfSecondFixedSurface']
  */
-          __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_8);
-          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s__power); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_1);
-          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-          __pyx_t_8 = PyFloat_FromDouble(10.0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_8);
-          __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s_58)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_2);
-          __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
           __Pyx_GOTREF(__pyx_t_4);
-          PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8);
-          __Pyx_GIVEREF(__pyx_t_8);
-          PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
-          __Pyx_GIVEREF(__pyx_t_2);
-          __pyx_t_8 = 0;
-          __pyx_t_2 = 0;
-          __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_2);
-          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-          __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-          __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_t_9, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_power); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __Pyx_GOTREF(__pyx_t_10);
+          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_scaleFactorOfSecondFixedSurface); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
           __Pyx_GOTREF(__pyx_t_4);
-          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-          __Pyx_DECREF_SET(__pyx_v_botlev, __pyx_t_4);
+          __pyx_t_1 = NULL;
+          __pyx_t_9 = 0;
+          if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_10))) {
+            __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_10);
+            if (likely(__pyx_t_1)) {
+              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
+              __Pyx_INCREF(__pyx_t_1);
+              __Pyx_INCREF(function);
+              __Pyx_DECREF_SET(__pyx_t_10, function);
+              __pyx_t_9 = 1;
+            }
+          }
+          __pyx_t_8 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __Pyx_GOTREF(__pyx_t_8);
+          if (__pyx_t_1) {
+            PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = NULL;
+          }
+          __Pyx_INCREF(__pyx_float_10_0);
+          PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_9, __pyx_float_10_0);
+          __Pyx_GIVEREF(__pyx_float_10_0);
+          PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_9, __pyx_t_4);
+          __Pyx_GIVEREF(__pyx_t_4);
           __pyx_t_4 = 0;
-          goto __pyx_L18;
+          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __Pyx_GOTREF(__pyx_t_2);
+          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+
+          /* "pygrib.pyx":896
+ *                    self.valid_key('scaleFactorOfSecondFixedSurface'):
+ *                    if self['scaleFactorOfSecondFixedSurface']:
+ *                        botlev = self['scaledValueOfSecondFixedSurface']/\             # <<<<<<<<<<<<<<
+ *                                 np.power(10.0,self['scaleFactorOfSecondFixedSurface'])
+ *                    else:
+ */
+          __pyx_t_10 = __Pyx_PyNumber_Divide(__pyx_t_7, __pyx_t_2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __Pyx_GOTREF(__pyx_t_10);
+          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+          __Pyx_DECREF_SET(__pyx_v_botlev, __pyx_t_10);
+          __pyx_t_10 = 0;
+          goto __pyx_L30;
         }
         /*else*/ {
 
-          /* "pygrib.pyx":905
+          /* "pygrib.pyx":899
  *                                 np.power(10.0,self['scaleFactorOfSecondFixedSurface'])
  *                    else:
  *                        botlev = self['scaledValueOfSecondFixedSurface']             # <<<<<<<<<<<<<<
  *             levstring = None
  *             if botlev is None or toplev == botlev:
  */
-          __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s_56)); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_4);
-          __Pyx_DECREF_SET(__pyx_v_botlev, __pyx_t_4);
-          __pyx_t_4 = 0;
+          __pyx_t_10 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_scaledValueOfSecondFixedSurface); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+          __Pyx_GOTREF(__pyx_t_10);
+          __Pyx_DECREF_SET(__pyx_v_botlev, __pyx_t_10);
+          __pyx_t_10 = 0;
         }
-        __pyx_L18:;
-        goto __pyx_L17;
+        __pyx_L30:;
+        goto __pyx_L27;
       }
-      __pyx_L17:;
-      goto __pyx_L16;
+      __pyx_L27:;
+      goto __pyx_L24;
     }
-    __pyx_L16:;
+    __pyx_L24:;
 
-    /* "pygrib.pyx":906
+    /* "pygrib.pyx":900
  *                    else:
  *                        botlev = self['scaledValueOfSecondFixedSurface']
  *             levstring = None             # <<<<<<<<<<<<<<
@@ -9465,770 +10397,791 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_8__repr__(struct __pyx_obj_6pygr
     __Pyx_INCREF(Py_None);
     __pyx_v_levstring = Py_None;
 
-    /* "pygrib.pyx":907
+    /* "pygrib.pyx":901
  *                        botlev = self['scaledValueOfSecondFixedSurface']
  *             levstring = None
  *             if botlev is None or toplev == botlev:             # <<<<<<<<<<<<<<
  *                 levstring = ':level %s' % toplev
  *             else:
  */
-    __pyx_t_3 = (__pyx_v_botlev == Py_None);
-    if (!__pyx_t_3) {
-      __pyx_t_4 = PyObject_RichCompare(__pyx_v_toplev, __pyx_v_botlev, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __pyx_t_7 = __pyx_t_6;
+    __pyx_t_6 = (__pyx_v_botlev == Py_None);
+    __pyx_t_11 = (__pyx_t_6 != 0);
+    if (!__pyx_t_11) {
     } else {
-      __pyx_t_7 = __pyx_t_3;
-    }
-    if (__pyx_t_7) {
+      __pyx_t_3 = __pyx_t_11;
+      goto __pyx_L32_bool_binop_done;
+    }
+    __pyx_t_10 = PyObject_RichCompare(__pyx_v_toplev, __pyx_v_botlev, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 901; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 901; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+    __pyx_t_3 = __pyx_t_11;
+    __pyx_L32_bool_binop_done:;
+    if (__pyx_t_3) {
 
-      /* "pygrib.pyx":908
+      /* "pygrib.pyx":902
  *             levstring = None
  *             if botlev is None or toplev == botlev:
  *                 levstring = ':level %s' % toplev             # <<<<<<<<<<<<<<
  *             else:
  *                 levstring = ':levels %s-%s' % (toplev,botlev)
  */
-      __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_60), __pyx_v_toplev); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(((PyObject *)__pyx_t_4));
-      __Pyx_DECREF_SET(__pyx_v_levstring, ((PyObject *)__pyx_t_4));
-      __pyx_t_4 = 0;
-      goto __pyx_L19;
+      __pyx_t_10 = __Pyx_PyString_Format(__pyx_kp_s_level_s, __pyx_v_toplev); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_10);
+      __Pyx_DECREF_SET(__pyx_v_levstring, __pyx_t_10);
+      __pyx_t_10 = 0;
+      goto __pyx_L31;
     }
     /*else*/ {
 
-      /* "pygrib.pyx":910
+      /* "pygrib.pyx":904
  *                 levstring = ':level %s' % toplev
  *             else:
  *                 levstring = ':levels %s-%s' % (toplev,botlev)             # <<<<<<<<<<<<<<
  *             if levunits != 'unknown':
  *                 levstring = levstring+' %s' % levunits
  */
-      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_10);
       __Pyx_INCREF(__pyx_v_toplev);
-      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_toplev);
+      PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_toplev);
       __Pyx_GIVEREF(__pyx_v_toplev);
       __Pyx_INCREF(__pyx_v_botlev);
-      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_botlev);
+      PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_v_botlev);
       __Pyx_GIVEREF(__pyx_v_botlev);
-      __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_61), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
-      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-      __Pyx_DECREF_SET(__pyx_v_levstring, ((PyObject *)__pyx_t_2));
+      __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_levels_s_s, __pyx_t_10); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+      __Pyx_DECREF_SET(__pyx_v_levstring, __pyx_t_2);
       __pyx_t_2 = 0;
     }
-    __pyx_L19:;
+    __pyx_L31:;
 
-    /* "pygrib.pyx":911
+    /* "pygrib.pyx":905
  *             else:
  *                 levstring = ':levels %s-%s' % (toplev,botlev)
  *             if levunits != 'unknown':             # <<<<<<<<<<<<<<
  *                 levstring = levstring+' %s' % levunits
  *             if levstring is not None:
  */
-    __pyx_t_2 = PyObject_RichCompare(__pyx_v_levunits, ((PyObject *)__pyx_n_s__unknown), Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    if (__pyx_t_7) {
+    __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_levunits, __pyx_n_s_unknown, Py_NE)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (__pyx_t_3) {
 
-      /* "pygrib.pyx":912
+      /* "pygrib.pyx":906
  *                 levstring = ':levels %s-%s' % (toplev,botlev)
  *             if levunits != 'unknown':
  *                 levstring = levstring+' %s' % levunits             # <<<<<<<<<<<<<<
  *             if levstring is not None:
  *                 inventory.append(levstring)
  */
-      __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_62), __pyx_v_levunits); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
-      __pyx_t_4 = PyNumber_Add(__pyx_v_levstring, ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
-      __Pyx_DECREF_SET(__pyx_v_levstring, __pyx_t_4);
-      __pyx_t_4 = 0;
-      goto __pyx_L20;
+      __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_s, __pyx_v_levunits); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_t_10 = PyNumber_Add(__pyx_v_levstring, __pyx_t_2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_10);
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_DECREF_SET(__pyx_v_levstring, __pyx_t_10);
+      __pyx_t_10 = 0;
+      goto __pyx_L34;
     }
-    __pyx_L20:;
+    __pyx_L34:;
 
-    /* "pygrib.pyx":913
+    /* "pygrib.pyx":907
  *             if levunits != 'unknown':
  *                 levstring = levstring+' %s' % levunits
  *             if levstring is not None:             # <<<<<<<<<<<<<<
  *                 inventory.append(levstring)
  *         elif self.valid_key('level'):
  */
-    __pyx_t_7 = (__pyx_v_levstring != Py_None);
-    __pyx_t_3 = (__pyx_t_7 != 0);
-    if (__pyx_t_3) {
+    __pyx_t_3 = (__pyx_v_levstring != Py_None);
+    __pyx_t_11 = (__pyx_t_3 != 0);
+    if (__pyx_t_11) {
 
-      /* "pygrib.pyx":914
+      /* "pygrib.pyx":908
  *                 levstring = levstring+' %s' % levunits
  *             if levstring is not None:
  *                 inventory.append(levstring)             # <<<<<<<<<<<<<<
  *         elif self.valid_key('level'):
  *             inventory.append(':level %s' % self['level'])
  */
-      __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_inventory, __pyx_v_levstring); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      goto __pyx_L21;
+      __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_inventory, __pyx_v_levstring); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      goto __pyx_L35;
     }
-    __pyx_L21:;
-    goto __pyx_L11;
+    __pyx_L35:;
+    goto __pyx_L13;
   }
 
-  /* "pygrib.pyx":915
+  /* "pygrib.pyx":909
  *             if levstring is not None:
  *                 inventory.append(levstring)
  *         elif self.valid_key('level'):             # <<<<<<<<<<<<<<
  *             inventory.append(':level %s' % self['level'])
  *         if self.has_key('stepRange'):
  */
-  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__valid_key); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_63), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_valid_key); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_10);
+  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (__pyx_t_3) {
+  if (__pyx_t_11) {
 
-    /* "pygrib.pyx":916
+    /* "pygrib.pyx":910
  *                 inventory.append(levstring)
  *         elif self.valid_key('level'):
  *             inventory.append(':level %s' % self['level'])             # <<<<<<<<<<<<<<
  *         if self.has_key('stepRange'):
  *             ftime = self['stepRange'] # computed key, uses stepUnits
  */
-    __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__level)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_level); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_60), __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
+    __pyx_t_10 = __Pyx_PyString_Format(__pyx_kp_s_level_s, __pyx_t_2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_10);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_inventory, ((PyObject *)__pyx_t_4)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-    goto __pyx_L11;
+    __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_inventory, __pyx_t_10); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+    goto __pyx_L13;
   }
-  __pyx_L11:;
+  __pyx_L13:;
 
-  /* "pygrib.pyx":917
+  /* "pygrib.pyx":911
  *         elif self.valid_key('level'):
  *             inventory.append(':level %s' % self['level'])
  *         if self.has_key('stepRange'):             # <<<<<<<<<<<<<<
  *             ftime = self['stepRange'] # computed key, uses stepUnits
  *             if self.valid_key('stepType') and self['stepType'] != 'instant':
  */
-  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__has_key); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_64), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_has_key); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_10);
+  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (__pyx_t_3) {
+  if (__pyx_t_11) {
 
-    /* "pygrib.pyx":918
+    /* "pygrib.pyx":912
  *             inventory.append(':level %s' % self['level'])
  *         if self.has_key('stepRange'):
  *             ftime = self['stepRange'] # computed key, uses stepUnits             # <<<<<<<<<<<<<<
  *             if self.valid_key('stepType') and self['stepType'] != 'instant':
  *                 inventory.append(':fcst time %s %s (%s)'%\
  */
-    __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__stepRange)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_stepRange); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
     __Pyx_GOTREF(__pyx_t_2);
     __pyx_v_ftime = __pyx_t_2;
     __pyx_t_2 = 0;
 
-    /* "pygrib.pyx":919
+    /* "pygrib.pyx":913
  *         if self.has_key('stepRange'):
  *             ftime = self['stepRange'] # computed key, uses stepUnits
  *             if self.valid_key('stepType') and self['stepType'] != 'instant':             # <<<<<<<<<<<<<<
  *                 inventory.append(':fcst time %s %s (%s)'%\
  *                     (ftime,self.fcstimeunits,self.stepType))
  */
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__valid_key); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_valid_key); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_65), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_10);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
     if (__pyx_t_3) {
-      __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__stepType)); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __pyx_t_2 = PyObject_RichCompare(__pyx_t_4, ((PyObject *)__pyx_n_s__instant), Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __pyx_t_6 = __pyx_t_7;
     } else {
-      __pyx_t_6 = __pyx_t_3;
+      __pyx_t_11 = __pyx_t_3;
+      goto __pyx_L38_bool_binop_done;
     }
-    if (__pyx_t_6) {
+    __pyx_t_10 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_stepType); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_10);
+    __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_10, __pyx_n_s_instant, Py_NE)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+    __pyx_t_11 = __pyx_t_3;
+    __pyx_L38_bool_binop_done:;
+    if (__pyx_t_11) {
 
-      /* "pygrib.pyx":921
+      /* "pygrib.pyx":915
  *             if self.valid_key('stepType') and self['stepType'] != 'instant':
  *                 inventory.append(':fcst time %s %s (%s)'%\
  *                     (ftime,self.fcstimeunits,self.stepType))             # <<<<<<<<<<<<<<
  *             else:
  *                 inventory.append(':fcst time %s %s'% (ftime,self.fcstimeunits))
  */
-      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__stepType); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_stepType); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_10);
+      __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_2);
-      __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
       __Pyx_INCREF(__pyx_v_ftime);
-      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_ftime);
+      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_ftime);
       __Pyx_GIVEREF(__pyx_v_ftime);
       __Pyx_INCREF(__pyx_v_self->fcstimeunits);
-      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_self->fcstimeunits);
+      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_self->fcstimeunits);
       __Pyx_GIVEREF(__pyx_v_self->fcstimeunits);
-      PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_2);
-      __Pyx_GIVEREF(__pyx_t_2);
-      __pyx_t_2 = 0;
-      __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_66), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
-      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-      __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_inventory, ((PyObject *)__pyx_t_2)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
-      goto __pyx_L23;
+      PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_10);
+      __Pyx_GIVEREF(__pyx_t_10);
+      __pyx_t_10 = 0;
+
+      /* "pygrib.pyx":914
+ *             ftime = self['stepRange'] # computed key, uses stepUnits
+ *             if self.valid_key('stepType') and self['stepType'] != 'instant':
+ *                 inventory.append(':fcst time %s %s (%s)'%\             # <<<<<<<<<<<<<<
+ *                     (ftime,self.fcstimeunits,self.stepType))
+ *             else:
+ */
+      __pyx_t_10 = __Pyx_PyString_Format(__pyx_kp_s_fcst_time_s_s_s, __pyx_t_2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_10);
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_inventory, __pyx_t_10); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+      goto __pyx_L37;
     }
     /*else*/ {
 
-      /* "pygrib.pyx":923
+      /* "pygrib.pyx":917
  *                     (ftime,self.fcstimeunits,self.stepType))
  *             else:
  *                 inventory.append(':fcst time %s %s'% (ftime,self.fcstimeunits))             # <<<<<<<<<<<<<<
  *         elif self.valid_key('forecastTime'):
  *             ftime = repr(self['forecastTime'])
  */
-      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_10);
       __Pyx_INCREF(__pyx_v_ftime);
-      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_ftime);
+      PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_ftime);
       __Pyx_GIVEREF(__pyx_v_ftime);
       __Pyx_INCREF(__pyx_v_self->fcstimeunits);
-      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_self->fcstimeunits);
+      PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_v_self->fcstimeunits);
       __Pyx_GIVEREF(__pyx_v_self->fcstimeunits);
-      __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_67), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(((PyObject *)__pyx_t_4));
-      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
-      __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_inventory, ((PyObject *)__pyx_t_4)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
+      __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_fcst_time_s_s, __pyx_t_10); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+      __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_inventory, __pyx_t_2); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     }
-    __pyx_L23:;
-    goto __pyx_L22;
+    __pyx_L37:;
+    goto __pyx_L36;
   }
 
-  /* "pygrib.pyx":924
+  /* "pygrib.pyx":918
  *             else:
  *                 inventory.append(':fcst time %s %s'% (ftime,self.fcstimeunits))
  *         elif self.valid_key('forecastTime'):             # <<<<<<<<<<<<<<
  *             ftime = repr(self['forecastTime'])
  *             inventory.append(':fcst time %s %s'% (ftime,self.fcstimeunits))
  */
-  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__valid_key); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_68), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_valid_key); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__40, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_10);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (__pyx_t_6) {
+  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+  if (__pyx_t_11) {
 
-    /* "pygrib.pyx":925
+    /* "pygrib.pyx":919
  *                 inventory.append(':fcst time %s %s'% (ftime,self.fcstimeunits))
  *         elif self.valid_key('forecastTime'):
  *             ftime = repr(self['forecastTime'])             # <<<<<<<<<<<<<<
  *             inventory.append(':fcst time %s %s'% (ftime,self.fcstimeunits))
  *         if self.valid_key('dataDate') and self.valid_key('dataTime'):
  */
-    __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__forecastTime)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_10 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_forecastTime); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_10);
+    __pyx_t_2 = PyObject_Repr(__pyx_t_10); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_4 = PyObject_Repr(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_v_ftime = __pyx_t_4;
-    __pyx_t_4 = 0;
+    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+    __pyx_v_ftime = __pyx_t_2;
+    __pyx_t_2 = 0;
 
-    /* "pygrib.pyx":926
+    /* "pygrib.pyx":920
  *         elif self.valid_key('forecastTime'):
  *             ftime = repr(self['forecastTime'])
  *             inventory.append(':fcst time %s %s'% (ftime,self.fcstimeunits))             # <<<<<<<<<<<<<<
  *         if self.valid_key('dataDate') and self.valid_key('dataTime'):
  *             inventory.append(
  */
-    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
     __Pyx_INCREF(__pyx_v_ftime);
-    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_ftime);
+    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_ftime);
     __Pyx_GIVEREF(__pyx_v_ftime);
     __Pyx_INCREF(__pyx_v_self->fcstimeunits);
-    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_self->fcstimeunits);
+    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_self->fcstimeunits);
     __Pyx_GIVEREF(__pyx_v_self->fcstimeunits);
-    __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_67), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
-    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-    __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_inventory, ((PyObject *)__pyx_t_2)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
-    goto __pyx_L22;
+    __pyx_t_10 = __Pyx_PyString_Format(__pyx_kp_s_fcst_time_s_s, __pyx_t_2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_10);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_inventory, __pyx_t_10); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+    goto __pyx_L36;
   }
-  __pyx_L22:;
+  __pyx_L36:;
 
-  /* "pygrib.pyx":927
+  /* "pygrib.pyx":921
  *             ftime = repr(self['forecastTime'])
  *             inventory.append(':fcst time %s %s'% (ftime,self.fcstimeunits))
  *         if self.valid_key('dataDate') and self.valid_key('dataTime'):             # <<<<<<<<<<<<<<
  *             inventory.append(
  *             ':from '+repr(self['dataDate'])+'%04i' % self['dataTime'])
  */
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__valid_key); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_valid_key); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_10);
+  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_69), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  if (__pyx_t_6) {
-    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__valid_key); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_70), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_7 = __pyx_t_3;
+  if (__pyx_t_3) {
   } else {
-    __pyx_t_7 = __pyx_t_6;
+    __pyx_t_11 = __pyx_t_3;
+    goto __pyx_L41_bool_binop_done;
   }
-  if (__pyx_t_7) {
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_valid_key); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_10);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+  __pyx_t_11 = __pyx_t_3;
+  __pyx_L41_bool_binop_done:;
+  if (__pyx_t_11) {
 
-    /* "pygrib.pyx":929
+    /* "pygrib.pyx":923
  *         if self.valid_key('dataDate') and self.valid_key('dataTime'):
  *             inventory.append(
  *             ':from '+repr(self['dataDate'])+'%04i' % self['dataTime'])             # <<<<<<<<<<<<<<
  *         #if self.valid_key('validityDate') and self.valid_key('validityTime'):
  *         #    inventory.append(
  */
-    __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__dataDate)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_10 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_dataDate); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_10);
+    __pyx_t_2 = PyObject_Repr(__pyx_t_10); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_4 = PyObject_Repr(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+    __pyx_t_10 = PyNumber_Add(__pyx_kp_s_from, __pyx_t_2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_10);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_2 = PyNumber_Add(((PyObject *)__pyx_kp_s_71), __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_dataTime); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
     __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__dataTime)); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_9 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_72), __pyx_t_4); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_9));
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_t_4 = PyNumber_Add(__pyx_t_2, ((PyObject *)__pyx_t_9)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_04i, __pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_7);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
-    __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_inventory, __pyx_t_4); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    goto __pyx_L24;
+    __pyx_t_2 = PyNumber_Add(__pyx_t_10, __pyx_t_7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+
+    /* "pygrib.pyx":922
+ *             inventory.append(':fcst time %s %s'% (ftime,self.fcstimeunits))
+ *         if self.valid_key('dataDate') and self.valid_key('dataTime'):
+ *             inventory.append(             # <<<<<<<<<<<<<<
+ *             ':from '+repr(self['dataDate'])+'%04i' % self['dataTime'])
+ *         #if self.valid_key('validityDate') and self.valid_key('validityTime'):
+ */
+    __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_inventory, __pyx_t_2); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    goto __pyx_L40;
   }
-  __pyx_L24:;
+  __pyx_L40:;
 
-  /* "pygrib.pyx":933
+  /* "pygrib.pyx":927
  *         #    inventory.append(
  *         #    ':valid '+repr(self['validityDate'])+repr(self['validityTime']))
  *         if self.valid_key('perturbationNumber') and\             # <<<<<<<<<<<<<<
  *            self.valid_key('typeOfEnsembleForecast'):
  *             ens_type = self['typeOfEnsembleForecast']
  */
-  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__valid_key); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_9 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_73), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_9);
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-  if (__pyx_t_7) {
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_valid_key); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_7);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  if (__pyx_t_3) {
+  } else {
+    __pyx_t_11 = __pyx_t_3;
+    goto __pyx_L44_bool_binop_done;
+  }
 
-    /* "pygrib.pyx":934
+  /* "pygrib.pyx":928
  *         #    ':valid '+repr(self['validityDate'])+repr(self['validityTime']))
  *         if self.valid_key('perturbationNumber') and\
  *            self.valid_key('typeOfEnsembleForecast'):             # <<<<<<<<<<<<<<
  *             ens_type = self['typeOfEnsembleForecast']
  *             pert_num = self['perturbationNumber']
  */
-    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__valid_key); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_9);
-    __pyx_t_4 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_k_tuple_75), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_t_3 = __pyx_t_6;
-  } else {
-    __pyx_t_3 = __pyx_t_7;
-  }
-  if (__pyx_t_3) {
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_valid_key); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_7);
+  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_11 = __pyx_t_3;
+  __pyx_L44_bool_binop_done:;
+  if (__pyx_t_11) {
 
-    /* "pygrib.pyx":935
+    /* "pygrib.pyx":929
  *         if self.valid_key('perturbationNumber') and\
  *            self.valid_key('typeOfEnsembleForecast'):
  *             ens_type = self['typeOfEnsembleForecast']             # <<<<<<<<<<<<<<
  *             pert_num = self['perturbationNumber']
  *             if ens_type == 0:
  */
-    __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s_74)); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __pyx_v_ens_type = __pyx_t_4;
-    __pyx_t_4 = 0;
+    __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_typeOfEnsembleForecast); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_v_ens_type = __pyx_t_2;
+    __pyx_t_2 = 0;
 
-    /* "pygrib.pyx":936
+    /* "pygrib.pyx":930
  *            self.valid_key('typeOfEnsembleForecast'):
  *             ens_type = self['typeOfEnsembleForecast']
  *             pert_num = self['perturbationNumber']             # <<<<<<<<<<<<<<
  *             if ens_type == 0:
  *                inventory.append(":lo res cntl fcst")
  */
-    __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__perturbationNumber)); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __pyx_v_pert_num = __pyx_t_4;
-    __pyx_t_4 = 0;
+    __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_perturbationNumber); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_v_pert_num = __pyx_t_2;
+    __pyx_t_2 = 0;
 
-    /* "pygrib.pyx":937
+    /* "pygrib.pyx":931
  *             ens_type = self['typeOfEnsembleForecast']
  *             pert_num = self['perturbationNumber']
  *             if ens_type == 0:             # <<<<<<<<<<<<<<
  *                inventory.append(":lo res cntl fcst")
  *             elif ens_type == 1:
  */
-    __pyx_t_4 = PyObject_RichCompare(__pyx_v_ens_type, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    if (__pyx_t_3) {
+    __pyx_t_2 = PyObject_RichCompare(__pyx_v_ens_type, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    if (__pyx_t_11) {
 
-      /* "pygrib.pyx":938
+      /* "pygrib.pyx":932
  *             pert_num = self['perturbationNumber']
  *             if ens_type == 0:
  *                inventory.append(":lo res cntl fcst")             # <<<<<<<<<<<<<<
  *             elif ens_type == 1:
  *                inventory.append(":hi res cntl fcst")
  */
-      __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_inventory, ((PyObject *)__pyx_kp_s_76)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      goto __pyx_L26;
+      __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_inventory, __pyx_kp_s_lo_res_cntl_fcst); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      goto __pyx_L46;
     }
 
-    /* "pygrib.pyx":939
+    /* "pygrib.pyx":933
  *             if ens_type == 0:
  *                inventory.append(":lo res cntl fcst")
  *             elif ens_type == 1:             # <<<<<<<<<<<<<<
  *                inventory.append(":hi res cntl fcst")
  *             elif ens_type == 2:
  */
-    __pyx_t_4 = PyObject_RichCompare(__pyx_v_ens_type, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    if (__pyx_t_3) {
+    __pyx_t_2 = PyObject_RichCompare(__pyx_v_ens_type, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    if (__pyx_t_11) {
 
-      /* "pygrib.pyx":940
+      /* "pygrib.pyx":934
  *                inventory.append(":lo res cntl fcst")
  *             elif ens_type == 1:
  *                inventory.append(":hi res cntl fcst")             # <<<<<<<<<<<<<<
  *             elif ens_type == 2:
  *                inventory.append(":neg ens pert %d" % pert_num)
  */
-      __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_inventory, ((PyObject *)__pyx_kp_s_77)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      goto __pyx_L26;
+      __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_inventory, __pyx_kp_s_hi_res_cntl_fcst); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      goto __pyx_L46;
     }
 
-    /* "pygrib.pyx":941
+    /* "pygrib.pyx":935
  *             elif ens_type == 1:
  *                inventory.append(":hi res cntl fcst")
  *             elif ens_type == 2:             # <<<<<<<<<<<<<<
  *                inventory.append(":neg ens pert %d" % pert_num)
  *             elif ens_type == 3:
  */
-    __pyx_t_4 = PyObject_RichCompare(__pyx_v_ens_type, __pyx_int_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 941; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 941; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    if (__pyx_t_3) {
+    __pyx_t_2 = PyObject_RichCompare(__pyx_v_ens_type, __pyx_int_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    if (__pyx_t_11) {
 
-      /* "pygrib.pyx":942
+      /* "pygrib.pyx":936
  *                inventory.append(":hi res cntl fcst")
  *             elif ens_type == 2:
  *                inventory.append(":neg ens pert %d" % pert_num)             # <<<<<<<<<<<<<<
  *             elif ens_type == 3:
  *                inventory.append(":pos ens pert %d" % pert_num)
  */
-      __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_78), __pyx_v_pert_num); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(((PyObject *)__pyx_t_4));
-      __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_inventory, ((PyObject *)__pyx_t_4)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-      goto __pyx_L26;
+      __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_neg_ens_pert_d, __pyx_v_pert_num); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_inventory, __pyx_t_2); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      goto __pyx_L46;
     }
 
-    /* "pygrib.pyx":943
+    /* "pygrib.pyx":937
  *             elif ens_type == 2:
  *                inventory.append(":neg ens pert %d" % pert_num)
  *             elif ens_type == 3:             # <<<<<<<<<<<<<<
  *                inventory.append(":pos ens pert %d" % pert_num)
  *         if self.valid_key('derivedForecast'):
  */
-    __pyx_t_4 = PyObject_RichCompare(__pyx_v_ens_type, __pyx_int_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    if (__pyx_t_3) {
+    __pyx_t_2 = PyObject_RichCompare(__pyx_v_ens_type, __pyx_int_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    if (__pyx_t_11) {
 
-      /* "pygrib.pyx":944
+      /* "pygrib.pyx":938
  *                inventory.append(":neg ens pert %d" % pert_num)
  *             elif ens_type == 3:
  *                inventory.append(":pos ens pert %d" % pert_num)             # <<<<<<<<<<<<<<
  *         if self.valid_key('derivedForecast'):
  *             if self['derivedForecast'] == 0:
  */
-      __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_79), __pyx_v_pert_num); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(((PyObject *)__pyx_t_4));
-      __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_inventory, ((PyObject *)__pyx_t_4)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-      goto __pyx_L26;
+      __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_pos_ens_pert_d, __pyx_v_pert_num); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_inventory, __pyx_t_2); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      goto __pyx_L46;
     }
-    __pyx_L26:;
-    goto __pyx_L25;
+    __pyx_L46:;
+    goto __pyx_L43;
   }
-  __pyx_L25:;
+  __pyx_L43:;
 
-  /* "pygrib.pyx":945
+  /* "pygrib.pyx":939
  *             elif ens_type == 3:
  *                inventory.append(":pos ens pert %d" % pert_num)
  *         if self.valid_key('derivedForecast'):             # <<<<<<<<<<<<<<
  *             if self['derivedForecast'] == 0:
  *                 inventory.append(":ens mean")
  */
-  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__valid_key); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_9 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_80), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_9);
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-  if (__pyx_t_3) {
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_valid_key); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_7);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  if (__pyx_t_11) {
 
-    /* "pygrib.pyx":946
+    /* "pygrib.pyx":940
  *                inventory.append(":pos ens pert %d" % pert_num)
  *         if self.valid_key('derivedForecast'):
  *             if self['derivedForecast'] == 0:             # <<<<<<<<<<<<<<
  *                 inventory.append(":ens mean")
  *             elif self['derivedForecast'] == 1:
  */
-    __pyx_t_9 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__derivedForecast)); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_9);
-    __pyx_t_4 = PyObject_RichCompare(__pyx_t_9, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    if (__pyx_t_3) {
+    __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_derivedForecast); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_7);
+    __pyx_t_2 = PyObject_RichCompare(__pyx_t_7, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    if (__pyx_t_11) {
 
-      /* "pygrib.pyx":947
+      /* "pygrib.pyx":941
  *         if self.valid_key('derivedForecast'):
  *             if self['derivedForecast'] == 0:
  *                 inventory.append(":ens mean")             # <<<<<<<<<<<<<<
  *             elif self['derivedForecast'] == 1:
  *                 inventory.append(":weighted ens mean")
  */
-      __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_inventory, ((PyObject *)__pyx_kp_s_81)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      goto __pyx_L28;
+      __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_inventory, __pyx_kp_s_ens_mean); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 941; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      goto __pyx_L48;
     }
 
-    /* "pygrib.pyx":948
+    /* "pygrib.pyx":942
  *             if self['derivedForecast'] == 0:
  *                 inventory.append(":ens mean")
  *             elif self['derivedForecast'] == 1:             # <<<<<<<<<<<<<<
  *                 inventory.append(":weighted ens mean")
  *             elif self['derivedForecast'] == 2:
  */
-    __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__derivedForecast)); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_9 = PyObject_RichCompare(__pyx_t_4, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-    if (__pyx_t_3) {
+    __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_derivedForecast); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_7 = PyObject_RichCompare(__pyx_t_2, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    if (__pyx_t_11) {
 
-      /* "pygrib.pyx":949
+      /* "pygrib.pyx":943
  *                 inventory.append(":ens mean")
  *             elif self['derivedForecast'] == 1:
  *                 inventory.append(":weighted ens mean")             # <<<<<<<<<<<<<<
  *             elif self['derivedForecast'] == 2:
  *                 inventory.append(":ens std dev")
  */
-      __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_inventory, ((PyObject *)__pyx_kp_s_82)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      goto __pyx_L28;
+      __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_inventory, __pyx_kp_s_weighted_ens_mean); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      goto __pyx_L48;
     }
 
-    /* "pygrib.pyx":950
+    /* "pygrib.pyx":944
  *             elif self['derivedForecast'] == 1:
  *                 inventory.append(":weighted ens mean")
  *             elif self['derivedForecast'] == 2:             # <<<<<<<<<<<<<<
  *                 inventory.append(":ens std dev")
  *             elif self['derivedForecast'] == 3:
  */
-    __pyx_t_9 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__derivedForecast)); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_9);
-    __pyx_t_4 = PyObject_RichCompare(__pyx_t_9, __pyx_int_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    if (__pyx_t_3) {
+    __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_derivedForecast); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_7);
+    __pyx_t_2 = PyObject_RichCompare(__pyx_t_7, __pyx_int_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    if (__pyx_t_11) {
 
-      /* "pygrib.pyx":951
+      /* "pygrib.pyx":945
  *                 inventory.append(":weighted ens mean")
  *             elif self['derivedForecast'] == 2:
  *                 inventory.append(":ens std dev")             # <<<<<<<<<<<<<<
  *             elif self['derivedForecast'] == 3:
  *                 inventory.append(":normalized ens std dev")
  */
-      __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_inventory, ((PyObject *)__pyx_kp_s_83)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      goto __pyx_L28;
+      __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_inventory, __pyx_kp_s_ens_std_dev); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      goto __pyx_L48;
     }
 
-    /* "pygrib.pyx":952
+    /* "pygrib.pyx":946
  *             elif self['derivedForecast'] == 2:
  *                 inventory.append(":ens std dev")
  *             elif self['derivedForecast'] == 3:             # <<<<<<<<<<<<<<
  *                 inventory.append(":normalized ens std dev")
  *             elif self['derivedForecast'] == 4:
  */
-    __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__derivedForecast)); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_9 = PyObject_RichCompare(__pyx_t_4, __pyx_int_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-    if (__pyx_t_3) {
+    __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_derivedForecast); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_7 = PyObject_RichCompare(__pyx_t_2, __pyx_int_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    if (__pyx_t_11) {
 
-      /* "pygrib.pyx":953
+      /* "pygrib.pyx":947
  *                 inventory.append(":ens std dev")
  *             elif self['derivedForecast'] == 3:
  *                 inventory.append(":normalized ens std dev")             # <<<<<<<<<<<<<<
  *             elif self['derivedForecast'] == 4:
  *                 inventory.append(":ens spread")
  */
-      __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_inventory, ((PyObject *)__pyx_kp_s_84)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      goto __pyx_L28;
+      __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_inventory, __pyx_kp_s_normalized_ens_std_dev); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      goto __pyx_L48;
     }
 
-    /* "pygrib.pyx":954
+    /* "pygrib.pyx":948
  *             elif self['derivedForecast'] == 3:
  *                 inventory.append(":normalized ens std dev")
  *             elif self['derivedForecast'] == 4:             # <<<<<<<<<<<<<<
  *                 inventory.append(":ens spread")
  *             elif self['derivedForecast'] == 5:
  */
-    __pyx_t_9 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__derivedForecast)); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_9);
-    __pyx_t_4 = PyObject_RichCompare(__pyx_t_9, __pyx_int_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    if (__pyx_t_3) {
+    __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_derivedForecast); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_7);
+    __pyx_t_2 = PyObject_RichCompare(__pyx_t_7, __pyx_int_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    if (__pyx_t_11) {
 
-      /* "pygrib.pyx":955
+      /* "pygrib.pyx":949
  *                 inventory.append(":normalized ens std dev")
  *             elif self['derivedForecast'] == 4:
  *                 inventory.append(":ens spread")             # <<<<<<<<<<<<<<
  *             elif self['derivedForecast'] == 5:
  *                 inventory.append(":ens large anomaly index")
  */
-      __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_inventory, ((PyObject *)__pyx_kp_s_85)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      goto __pyx_L28;
+      __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_inventory, __pyx_kp_s_ens_spread); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      goto __pyx_L48;
     }
 
-    /* "pygrib.pyx":956
+    /* "pygrib.pyx":950
  *             elif self['derivedForecast'] == 4:
  *                 inventory.append(":ens spread")
  *             elif self['derivedForecast'] == 5:             # <<<<<<<<<<<<<<
  *                 inventory.append(":ens large anomaly index")
  *             elif self['derivedForecast'] == 6:
  */
-    __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__derivedForecast)); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_9 = PyObject_RichCompare(__pyx_t_4, __pyx_int_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-    if (__pyx_t_3) {
+    __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_derivedForecast); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 950; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_7 = PyObject_RichCompare(__pyx_t_2, __pyx_int_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    if (__pyx_t_11) {
 
-      /* "pygrib.pyx":957
+      /* "pygrib.pyx":951
  *                 inventory.append(":ens spread")
  *             elif self['derivedForecast'] == 5:
  *                 inventory.append(":ens large anomaly index")             # <<<<<<<<<<<<<<
  *             elif self['derivedForecast'] == 6:
  *                 inventory.append(":ens mean of cluster")
  */
-      __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_inventory, ((PyObject *)__pyx_kp_s_86)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      goto __pyx_L28;
+      __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_inventory, __pyx_kp_s_ens_large_anomaly_index); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      goto __pyx_L48;
     }
 
-    /* "pygrib.pyx":958
+    /* "pygrib.pyx":952
  *             elif self['derivedForecast'] == 5:
  *                 inventory.append(":ens large anomaly index")
  *             elif self['derivedForecast'] == 6:             # <<<<<<<<<<<<<<
  *                 inventory.append(":ens mean of cluster")
  *         if self.valid_key('probabilityTypeName'):
  */
-    __pyx_t_9 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__derivedForecast)); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_9);
-    __pyx_t_4 = PyObject_RichCompare(__pyx_t_9, __pyx_int_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    if (__pyx_t_3) {
+    __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_derivedForecast); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_7);
+    __pyx_t_2 = PyObject_RichCompare(__pyx_t_7, __pyx_int_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    if (__pyx_t_11) {
 
-      /* "pygrib.pyx":959
+      /* "pygrib.pyx":953
  *                 inventory.append(":ens large anomaly index")
  *             elif self['derivedForecast'] == 6:
  *                 inventory.append(":ens mean of cluster")             # <<<<<<<<<<<<<<
  *         if self.valid_key('probabilityTypeName'):
  *             inventory.append(":"+self['probabilityTypeName'])
  */
-      __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_inventory, ((PyObject *)__pyx_kp_s_87)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      goto __pyx_L28;
+      __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_inventory, __pyx_kp_s_ens_mean_of_cluster); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      goto __pyx_L48;
     }
-    __pyx_L28:;
-    goto __pyx_L27;
+    __pyx_L48:;
+    goto __pyx_L47;
   }
-  __pyx_L27:;
+  __pyx_L47:;
 
-  /* "pygrib.pyx":960
+  /* "pygrib.pyx":954
  *             elif self['derivedForecast'] == 6:
  *                 inventory.append(":ens mean of cluster")
  *         if self.valid_key('probabilityTypeName'):             # <<<<<<<<<<<<<<
  *             inventory.append(":"+self['probabilityTypeName'])
  *             lowerlim = None
  */
-  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__valid_key); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_9 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_88), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_9);
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-  if (__pyx_t_3) {
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_valid_key); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_7);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  if (__pyx_t_11) {
 
-    /* "pygrib.pyx":961
+    /* "pygrib.pyx":955
  *                 inventory.append(":ens mean of cluster")
  *         if self.valid_key('probabilityTypeName'):
  *             inventory.append(":"+self['probabilityTypeName'])             # <<<<<<<<<<<<<<
  *             lowerlim = None
  *             if self.valid_key('scaledValueOfLowerLimit') and\
  */
-    __pyx_t_9 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__probabilityTypeName)); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_9);
-    __pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_kp_s_33), __pyx_t_9); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-    __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_inventory, __pyx_t_4); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
-    /* "pygrib.pyx":962
- *         if self.valid_key('probabilityTypeName'):
+    __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_probabilityTypeName); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 955; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_7);
+    __pyx_t_2 = PyNumber_Add(__pyx_kp_s__17, __pyx_t_7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_inventory, __pyx_t_2); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+    /* "pygrib.pyx":956
+ *         if self.valid_key('probabilityTypeName'):
  *             inventory.append(":"+self['probabilityTypeName'])
  *             lowerlim = None             # <<<<<<<<<<<<<<
  *             if self.valid_key('scaledValueOfLowerLimit') and\
@@ -10237,124 +11190,149 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_8__repr__(struct __pyx_obj_6pygr
     __Pyx_INCREF(Py_None);
     __pyx_v_lowerlim = Py_None;
 
-    /* "pygrib.pyx":963
+    /* "pygrib.pyx":957
  *             inventory.append(":"+self['probabilityTypeName'])
  *             lowerlim = None
  *             if self.valid_key('scaledValueOfLowerLimit') and\             # <<<<<<<<<<<<<<
  *                self.valid_key('scaleFactorOfLowerLimit'):
  *                if self['scaledValueOfLowerLimit'] and\
  */
-    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__valid_key); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_9 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_90), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_9);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_valid_key); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_7);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
     if (__pyx_t_3) {
+    } else {
+      __pyx_t_11 = __pyx_t_3;
+      goto __pyx_L51_bool_binop_done;
+    }
 
-      /* "pygrib.pyx":964
+    /* "pygrib.pyx":958
  *             lowerlim = None
  *             if self.valid_key('scaledValueOfLowerLimit') and\
  *                self.valid_key('scaleFactorOfLowerLimit'):             # <<<<<<<<<<<<<<
  *                if self['scaledValueOfLowerLimit'] and\
  *                   self['scaleFactorOfLowerLimit']:
  */
-      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__valid_key); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_9);
-      __pyx_t_4 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_k_tuple_92), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __pyx_t_6 = __pyx_t_7;
-    } else {
-      __pyx_t_6 = __pyx_t_3;
-    }
-    if (__pyx_t_6) {
+    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_valid_key); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_7);
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_11 = __pyx_t_3;
+    __pyx_L51_bool_binop_done:;
+    if (__pyx_t_11) {
 
-      /* "pygrib.pyx":965
+      /* "pygrib.pyx":959
  *             if self.valid_key('scaledValueOfLowerLimit') and\
  *                self.valid_key('scaleFactorOfLowerLimit'):
  *                if self['scaledValueOfLowerLimit'] and\             # <<<<<<<<<<<<<<
  *                   self['scaleFactorOfLowerLimit']:
  *                    lowerlim = self['scaledValueOfLowerLimit']/\
  */
-      __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s_89)); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      if (__pyx_t_6) {
+      __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_scaledValueOfLowerLimit); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      if (__pyx_t_3) {
+      } else {
+        __pyx_t_11 = __pyx_t_3;
+        goto __pyx_L54_bool_binop_done;
+      }
 
-        /* "pygrib.pyx":966
+      /* "pygrib.pyx":960
  *                self.valid_key('scaleFactorOfLowerLimit'):
  *                if self['scaledValueOfLowerLimit'] and\
  *                   self['scaleFactorOfLowerLimit']:             # <<<<<<<<<<<<<<
  *                    lowerlim = self['scaledValueOfLowerLimit']/\
  *                               np.power(10.0,self['scaleFactorOfLowerLimit'])
  */
-        __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s_91)); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_4);
-        __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-        __pyx_t_7 = __pyx_t_3;
-      } else {
-        __pyx_t_7 = __pyx_t_6;
-      }
-      if (__pyx_t_7) {
+      __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_scaleFactorOfLowerLimit); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __pyx_t_11 = __pyx_t_3;
+      __pyx_L54_bool_binop_done:;
+      if (__pyx_t_11) {
 
-        /* "pygrib.pyx":967
+        /* "pygrib.pyx":961
  *                if self['scaledValueOfLowerLimit'] and\
  *                   self['scaleFactorOfLowerLimit']:
  *                    lowerlim = self['scaledValueOfLowerLimit']/\             # <<<<<<<<<<<<<<
  *                               np.power(10.0,self['scaleFactorOfLowerLimit'])
  *             upperlim = None
  */
-        __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s_89)); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_4);
+        __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_scaledValueOfLowerLimit); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+        __Pyx_GOTREF(__pyx_t_2);
 
-        /* "pygrib.pyx":968
+        /* "pygrib.pyx":962
  *                   self['scaleFactorOfLowerLimit']:
  *                    lowerlim = self['scaledValueOfLowerLimit']/\
  *                               np.power(10.0,self['scaleFactorOfLowerLimit'])             # <<<<<<<<<<<<<<
  *             upperlim = None
  *             if self.valid_key('scaledValueOfUpperLimit') and\
  */
-        __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_9);
-        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s__power); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_2);
-        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-        __pyx_t_9 = PyFloat_FromDouble(10.0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_9);
-        __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s_91)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_1);
-        __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_10);
+        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_power); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         __Pyx_GOTREF(__pyx_t_8);
-        PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9);
-        __Pyx_GIVEREF(__pyx_t_9);
-        PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_1);
-        __Pyx_GIVEREF(__pyx_t_1);
+        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+        __pyx_t_10 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_scaleFactorOfLowerLimit); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+        __Pyx_GOTREF(__pyx_t_10);
+        __pyx_t_4 = NULL;
         __pyx_t_9 = 0;
-        __pyx_t_1 = 0;
-        __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_8))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_8);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_8, function);
+            __pyx_t_9 = 1;
+          }
+        }
+        __pyx_t_1 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         __Pyx_GOTREF(__pyx_t_1);
-        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-        __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
-        __pyx_t_8 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_8);
-        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (__pyx_t_4) {
+          PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
+        }
+        __Pyx_INCREF(__pyx_float_10_0);
+        PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_9, __pyx_float_10_0);
+        __Pyx_GIVEREF(__pyx_float_10_0);
+        PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_9, __pyx_t_10);
+        __Pyx_GIVEREF(__pyx_t_10);
+        __pyx_t_10 = 0;
+        __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_1, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_7);
         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+
+        /* "pygrib.pyx":961
+ *                if self['scaledValueOfLowerLimit'] and\
+ *                   self['scaleFactorOfLowerLimit']:
+ *                    lowerlim = self['scaledValueOfLowerLimit']/\             # <<<<<<<<<<<<<<
+ *                               np.power(10.0,self['scaleFactorOfLowerLimit'])
+ *             upperlim = None
+ */
+        __pyx_t_8 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_8);
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
         __Pyx_DECREF_SET(__pyx_v_lowerlim, __pyx_t_8);
         __pyx_t_8 = 0;
-        goto __pyx_L31;
+        goto __pyx_L53;
       }
-      __pyx_L31:;
-      goto __pyx_L30;
+      __pyx_L53:;
+      goto __pyx_L50;
     }
-    __pyx_L30:;
+    __pyx_L50:;
 
-    /* "pygrib.pyx":969
+    /* "pygrib.pyx":963
  *                    lowerlim = self['scaledValueOfLowerLimit']/\
  *                               np.power(10.0,self['scaleFactorOfLowerLimit'])
  *             upperlim = None             # <<<<<<<<<<<<<<
@@ -10364,217 +11342,246 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_8__repr__(struct __pyx_obj_6pygr
     __Pyx_INCREF(Py_None);
     __pyx_v_upperlim = Py_None;
 
-    /* "pygrib.pyx":970
+    /* "pygrib.pyx":964
  *                               np.power(10.0,self['scaleFactorOfLowerLimit'])
  *             upperlim = None
  *             if self.valid_key('scaledValueOfUpperLimit') and\             # <<<<<<<<<<<<<<
  *                self.valid_key('scaleFactorOfUpperLimit'):
  *                if self['scaledValueOfUpperLimit'] and\
  */
-    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__valid_key); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_valid_key); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_8);
-    __pyx_t_1 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_k_tuple_94), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_7);
     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    if (__pyx_t_7) {
+    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    if (__pyx_t_3) {
+    } else {
+      __pyx_t_11 = __pyx_t_3;
+      goto __pyx_L57_bool_binop_done;
+    }
 
-      /* "pygrib.pyx":971
+    /* "pygrib.pyx":965
  *             upperlim = None
  *             if self.valid_key('scaledValueOfUpperLimit') and\
  *                self.valid_key('scaleFactorOfUpperLimit'):             # <<<<<<<<<<<<<<
  *                if self['scaledValueOfUpperLimit'] and\
  *                   self['scaleFactorOfUpperLimit']:
  */
-      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__valid_key); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_8 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_96), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      __pyx_t_3 = __pyx_t_6;
-    } else {
-      __pyx_t_3 = __pyx_t_7;
-    }
-    if (__pyx_t_3) {
+    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_valid_key); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_7);
+    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_8);
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+    __pyx_t_11 = __pyx_t_3;
+    __pyx_L57_bool_binop_done:;
+    if (__pyx_t_11) {
 
-      /* "pygrib.pyx":972
+      /* "pygrib.pyx":966
  *             if self.valid_key('scaledValueOfUpperLimit') and\
  *                self.valid_key('scaleFactorOfUpperLimit'):
  *                if self['scaledValueOfUpperLimit'] and\             # <<<<<<<<<<<<<<
  *                   self['scaleFactorOfUpperLimit']:
  *                    upperlim = self['scaledValueOfUpperLimit']/\
  */
-      __pyx_t_8 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s_93)); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_8 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_scaledValueOfUpperLimit); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
       __Pyx_GOTREF(__pyx_t_8);
-      __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
       if (__pyx_t_3) {
+      } else {
+        __pyx_t_11 = __pyx_t_3;
+        goto __pyx_L60_bool_binop_done;
+      }
 
-        /* "pygrib.pyx":973
+      /* "pygrib.pyx":967
  *                self.valid_key('scaleFactorOfUpperLimit'):
  *                if self['scaledValueOfUpperLimit'] and\
  *                   self['scaleFactorOfUpperLimit']:             # <<<<<<<<<<<<<<
  *                    upperlim = self['scaledValueOfUpperLimit']/\
  *                               np.power(10.0,self['scaleFactorOfUpperLimit'])
  */
-        __pyx_t_8 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s_95)); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_8);
-        __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-        __pyx_t_6 = __pyx_t_7;
-      } else {
-        __pyx_t_6 = __pyx_t_3;
-      }
-      if (__pyx_t_6) {
+      __pyx_t_8 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_scaleFactorOfUpperLimit); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+      __Pyx_GOTREF(__pyx_t_8);
+      __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+      __pyx_t_11 = __pyx_t_3;
+      __pyx_L60_bool_binop_done:;
+      if (__pyx_t_11) {
 
-        /* "pygrib.pyx":974
+        /* "pygrib.pyx":968
  *                if self['scaledValueOfUpperLimit'] and\
  *                   self['scaleFactorOfUpperLimit']:
  *                    upperlim = self['scaledValueOfUpperLimit']/\             # <<<<<<<<<<<<<<
  *                               np.power(10.0,self['scaleFactorOfUpperLimit'])
  *             if upperlim is not None and lowerlim is not None:
  */
-        __pyx_t_8 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s_93)); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_t_8 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_scaledValueOfUpperLimit); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
         __Pyx_GOTREF(__pyx_t_8);
 
-        /* "pygrib.pyx":975
+        /* "pygrib.pyx":969
  *                   self['scaleFactorOfUpperLimit']:
  *                    upperlim = self['scaledValueOfUpperLimit']/\
  *                               np.power(10.0,self['scaleFactorOfUpperLimit'])             # <<<<<<<<<<<<<<
  *             if upperlim is not None and lowerlim is not None:
  *                 inventory.append(" (%s-%s)" % (upperlim,lowerlim))
  */
-        __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_1);
-        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__power); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_4);
-        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-        __pyx_t_1 = PyFloat_FromDouble(10.0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_2);
+        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_power); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         __Pyx_GOTREF(__pyx_t_1);
-        __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s_95)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_scaleFactorOfUpperLimit); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
         __Pyx_GOTREF(__pyx_t_2);
-        __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_9);
-        PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1);
-        __Pyx_GIVEREF(__pyx_t_1);
-        PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_2);
+        __pyx_t_10 = NULL;
+        __pyx_t_9 = 0;
+        if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
+          __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_1);
+          if (likely(__pyx_t_10)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
+            __Pyx_INCREF(__pyx_t_10);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_1, function);
+            __pyx_t_9 = 1;
+          }
+        }
+        __pyx_t_4 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_4);
+        if (__pyx_t_10) {
+          PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); __pyx_t_10 = NULL;
+        }
+        __Pyx_INCREF(__pyx_float_10_0);
+        PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_9, __pyx_float_10_0);
+        __Pyx_GIVEREF(__pyx_float_10_0);
+        PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_9, __pyx_t_2);
         __Pyx_GIVEREF(__pyx_t_2);
-        __pyx_t_1 = 0;
         __pyx_t_2 = 0;
-        __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_2);
+        __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_7);
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-        __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
-        __pyx_t_9 = __Pyx_PyNumber_Divide(__pyx_t_8, __pyx_t_2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_9);
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+        /* "pygrib.pyx":968
+ *                if self['scaledValueOfUpperLimit'] and\
+ *                   self['scaleFactorOfUpperLimit']:
+ *                    upperlim = self['scaledValueOfUpperLimit']/\             # <<<<<<<<<<<<<<
+ *                               np.power(10.0,self['scaleFactorOfUpperLimit'])
+ *             if upperlim is not None and lowerlim is not None:
+ */
+        __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_1);
         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-        __Pyx_DECREF_SET(__pyx_v_upperlim, __pyx_t_9);
-        __pyx_t_9 = 0;
-        goto __pyx_L33;
+        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+        __Pyx_DECREF_SET(__pyx_v_upperlim, __pyx_t_1);
+        __pyx_t_1 = 0;
+        goto __pyx_L59;
       }
-      __pyx_L33:;
-      goto __pyx_L32;
+      __pyx_L59:;
+      goto __pyx_L56;
     }
-    __pyx_L32:;
+    __pyx_L56:;
 
-    /* "pygrib.pyx":976
+    /* "pygrib.pyx":970
  *                    upperlim = self['scaledValueOfUpperLimit']/\
  *                               np.power(10.0,self['scaleFactorOfUpperLimit'])
  *             if upperlim is not None and lowerlim is not None:             # <<<<<<<<<<<<<<
  *                 inventory.append(" (%s-%s)" % (upperlim,lowerlim))
  *             elif upperlim is not None:
  */
-    __pyx_t_6 = (__pyx_v_upperlim != Py_None);
-    if ((__pyx_t_6 != 0)) {
-      __pyx_t_3 = (__pyx_v_lowerlim != Py_None);
-      __pyx_t_7 = (__pyx_t_3 != 0);
+    __pyx_t_3 = (__pyx_v_upperlim != Py_None);
+    __pyx_t_6 = (__pyx_t_3 != 0);
+    if (__pyx_t_6) {
     } else {
-      __pyx_t_7 = (__pyx_t_6 != 0);
+      __pyx_t_11 = __pyx_t_6;
+      goto __pyx_L63_bool_binop_done;
     }
-    if (__pyx_t_7) {
+    __pyx_t_6 = (__pyx_v_lowerlim != Py_None);
+    __pyx_t_3 = (__pyx_t_6 != 0);
+    __pyx_t_11 = __pyx_t_3;
+    __pyx_L63_bool_binop_done:;
+    if (__pyx_t_11) {
 
-      /* "pygrib.pyx":977
+      /* "pygrib.pyx":971
  *                               np.power(10.0,self['scaleFactorOfUpperLimit'])
  *             if upperlim is not None and lowerlim is not None:
  *                 inventory.append(" (%s-%s)" % (upperlim,lowerlim))             # <<<<<<<<<<<<<<
  *             elif upperlim is not None:
  *                 inventory.append(" (> %s)" % upperlim)
  */
-      __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_9);
+      __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_1);
       __Pyx_INCREF(__pyx_v_upperlim);
-      PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_upperlim);
+      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_upperlim);
       __Pyx_GIVEREF(__pyx_v_upperlim);
       __Pyx_INCREF(__pyx_v_lowerlim);
-      PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_lowerlim);
+      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_lowerlim);
       __Pyx_GIVEREF(__pyx_v_lowerlim);
-      __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_97), ((PyObject *)__pyx_t_9)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
-      __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
-      __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_inventory, ((PyObject *)__pyx_t_2)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
-      goto __pyx_L34;
+      __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_s_s, __pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_7);
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_inventory, __pyx_t_7); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+      goto __pyx_L62;
     }
 
-    /* "pygrib.pyx":978
+    /* "pygrib.pyx":972
  *             if upperlim is not None and lowerlim is not None:
  *                 inventory.append(" (%s-%s)" % (upperlim,lowerlim))
  *             elif upperlim is not None:             # <<<<<<<<<<<<<<
  *                 inventory.append(" (> %s)" % upperlim)
  *             elif lowerlim is not None:
  */
-    __pyx_t_7 = (__pyx_v_upperlim != Py_None);
-    __pyx_t_6 = (__pyx_t_7 != 0);
-    if (__pyx_t_6) {
+    __pyx_t_11 = (__pyx_v_upperlim != Py_None);
+    __pyx_t_3 = (__pyx_t_11 != 0);
+    if (__pyx_t_3) {
 
-      /* "pygrib.pyx":979
+      /* "pygrib.pyx":973
  *                 inventory.append(" (%s-%s)" % (upperlim,lowerlim))
  *             elif upperlim is not None:
  *                 inventory.append(" (> %s)" % upperlim)             # <<<<<<<<<<<<<<
  *             elif lowerlim is not None:
  *                 inventory.append(" (< %s)" % lowerlim)
  */
-      __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_98), __pyx_v_upperlim); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
-      __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_inventory, ((PyObject *)__pyx_t_2)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
-      goto __pyx_L34;
+      __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_s_2, __pyx_v_upperlim); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_7);
+      __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_inventory, __pyx_t_7); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+      goto __pyx_L62;
     }
 
-    /* "pygrib.pyx":980
+    /* "pygrib.pyx":974
  *             elif upperlim is not None:
  *                 inventory.append(" (> %s)" % upperlim)
  *             elif lowerlim is not None:             # <<<<<<<<<<<<<<
  *                 inventory.append(" (< %s)" % lowerlim)
  *         return ''.join(inventory)
  */
-    __pyx_t_6 = (__pyx_v_lowerlim != Py_None);
-    __pyx_t_7 = (__pyx_t_6 != 0);
-    if (__pyx_t_7) {
+    __pyx_t_3 = (__pyx_v_lowerlim != Py_None);
+    __pyx_t_11 = (__pyx_t_3 != 0);
+    if (__pyx_t_11) {
 
-      /* "pygrib.pyx":981
+      /* "pygrib.pyx":975
  *                 inventory.append(" (> %s)" % upperlim)
  *             elif lowerlim is not None:
  *                 inventory.append(" (< %s)" % lowerlim)             # <<<<<<<<<<<<<<
  *         return ''.join(inventory)
  * 
  */
-      __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_99), __pyx_v_lowerlim); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
-      __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_inventory, ((PyObject *)__pyx_t_2)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
-      goto __pyx_L34;
+      __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_s_3, __pyx_v_lowerlim); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_7);
+      __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_inventory, __pyx_t_7); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+      goto __pyx_L62;
     }
-    __pyx_L34:;
-    goto __pyx_L29;
+    __pyx_L62:;
+    goto __pyx_L49;
   }
-  __pyx_L29:;
+  __pyx_L49:;
 
-  /* "pygrib.pyx":982
+  /* "pygrib.pyx":976
  *             elif lowerlim is not None:
  *                 inventory.append(" (< %s)" % lowerlim)
  *         return ''.join(inventory)             # <<<<<<<<<<<<<<
@@ -10582,29 +11589,28 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_8__repr__(struct __pyx_obj_6pygr
  *     def _get_key(self, key, default=None):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_kp_s_19), __pyx_n_s__join); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_9);
-  __Pyx_INCREF(((PyObject *)__pyx_v_inventory));
-  PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_v_inventory));
-  __Pyx_GIVEREF(((PyObject *)__pyx_v_inventory));
-  __pyx_t_8 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_8);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
-  __pyx_r = __pyx_t_8;
-  __pyx_t_8 = 0;
+  __pyx_t_7 = __Pyx_PyString_Join(__pyx_kp_s__8, __pyx_v_inventory); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_7);
+  __pyx_r = __pyx_t_7;
+  __pyx_t_7 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "pygrib.pyx":855
+ *             # these are python attributes.
+ *             self.__dict__[name]=value
+ *     def __repr__(self):             # <<<<<<<<<<<<<<
+ *         """prints a short inventory of the grib message"""
+ *         inventory = []
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_XDECREF(__pyx_t_2);
   __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_7);
   __Pyx_XDECREF(__pyx_t_8);
-  __Pyx_XDECREF(__pyx_t_9);
+  __Pyx_XDECREF(__pyx_t_10);
   __Pyx_AddTraceback("pygrib.gribmessage.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_r = NULL;
   __pyx_L0:;
@@ -10623,6 +11629,14 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_8__repr__(struct __pyx_obj_6pygr
   return __pyx_r;
 }
 
+/* "pygrib.pyx":978
+ *         return ''.join(inventory)
+ * 
+ *     def _get_key(self, key, default=None):             # <<<<<<<<<<<<<<
+ *         """get key if it exists, otherwise return default value (default None)"""
+ *         if self.has_key(key):
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_6pygrib_11gribmessage_11_get_key(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static char __pyx_doc_6pygrib_11gribmessage_10_get_key[] = "get key if it exists, otherwise return default value (default None)";
@@ -10636,16 +11650,8 @@ static PyObject *__pyx_pw_6pygrib_11gribmessage_11_get_key(PyObject *__pyx_v_sel
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("_get_key (wrapper)", 0);
   {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__key,&__pyx_n_s__default,0};
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_default,0};
     PyObject* values[2] = {0,0};
-
-    /* "pygrib.pyx":984
- *         return ''.join(inventory)
- * 
- *     def _get_key(self, key, default=None):             # <<<<<<<<<<<<<<
- *         """get key if it exists, otherwise return default value (default None)"""
- *         if self.has_key(key):
- */
     values[1] = ((PyObject *)Py_None);
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
@@ -10659,16 +11665,16 @@ static PyObject *__pyx_pw_6pygrib_11gribmessage_11_get_key(PyObject *__pyx_v_sel
       kw_args = PyDict_Size(__pyx_kwds);
       switch (pos_args) {
         case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--;
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
         else goto __pyx_L5_argtuple_error;
         case  1:
         if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__default);
+          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_default);
           if (value) { values[1] = value; kw_args--; }
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_get_key") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 984; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_get_key") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -10683,13 +11689,15 @@ static PyObject *__pyx_pw_6pygrib_11gribmessage_11_get_key(PyObject *__pyx_v_sel
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("_get_key", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 984; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+  __Pyx_RaiseArgtupleInvalid("_get_key", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
   __pyx_L3_error:;
   __Pyx_AddTraceback("pygrib.gribmessage._get_key", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
   return NULL;
   __pyx_L4_argument_unpacking_done:;
   __pyx_r = __pyx_pf_6pygrib_11gribmessage_10_get_key(((struct __pyx_obj_6pygrib_gribmessage *)__pyx_v_self), __pyx_v_key, __pyx_v_default);
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
@@ -10700,35 +11708,52 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_10_get_key(struct __pyx_obj_6pyg
   PyObject *__pyx_t_1 = NULL;
   PyObject *__pyx_t_2 = NULL;
   PyObject *__pyx_t_3 = NULL;
-  int __pyx_t_4;
+  PyObject *__pyx_t_4 = NULL;
+  int __pyx_t_5;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("_get_key", 0);
 
-  /* "pygrib.pyx":986
+  /* "pygrib.pyx":980
  *     def _get_key(self, key, default=None):
  *         """get key if it exists, otherwise return default value (default None)"""
  *         if self.has_key(key):             # <<<<<<<<<<<<<<
  *             return self[key]
  *         else:
  */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__has_key); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_has_key); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_INCREF(__pyx_v_key);
-  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_key);
-  __Pyx_GIVEREF(__pyx_v_key);
-  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_3 = NULL;
+  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  if (!__pyx_t_3) {
+    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_key); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+  } else {
+    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
+    __Pyx_INCREF(__pyx_v_key);
+    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_key);
+    __Pyx_GIVEREF(__pyx_v_key);
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  }
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
-  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  if (__pyx_t_4) {
+  if (__pyx_t_5) {
 
-    /* "pygrib.pyx":987
+    /* "pygrib.pyx":981
  *         """get key if it exists, otherwise return default value (default None)"""
  *         if self.has_key(key):
  *             return self[key]             # <<<<<<<<<<<<<<
@@ -10736,16 +11761,15 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_10_get_key(struct __pyx_obj_6pyg
  *             return default
  */
     __Pyx_XDECREF(__pyx_r);
-    __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_key); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_r = __pyx_t_3;
-    __pyx_t_3 = 0;
+    __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_key); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_r = __pyx_t_1;
+    __pyx_t_1 = 0;
     goto __pyx_L0;
-    goto __pyx_L3;
   }
   /*else*/ {
 
-    /* "pygrib.pyx":989
+    /* "pygrib.pyx":983
  *             return self[key]
  *         else:
  *             return default             # <<<<<<<<<<<<<<
@@ -10757,14 +11781,21 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_10_get_key(struct __pyx_obj_6pyg
     __pyx_r = __pyx_v_default;
     goto __pyx_L0;
   }
-  __pyx_L3:;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "pygrib.pyx":978
+ *         return ''.join(inventory)
+ * 
+ *     def _get_key(self, key, default=None):             # <<<<<<<<<<<<<<
+ *         """get key if it exists, otherwise return default value (default None)"""
+ *         if self.has_key(key):
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_XDECREF(__pyx_t_2);
   __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
   __Pyx_AddTraceback("pygrib.gribmessage._get_key", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_r = NULL;
   __pyx_L0:;
@@ -10773,32 +11804,34 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_10_get_key(struct __pyx_obj_6pyg
   return __pyx_r;
 }
 
-/* Python wrapper */
-static PyObject *__pyx_pw_6pygrib_11gribmessage_13expand_grid(PyObject *__pyx_v_self, PyObject *__pyx_v_expand_reduced); /*proto*/
-static char __pyx_doc_6pygrib_11gribmessage_12expand_grid[] = "toggle expansion of 1D reduced grid data to a regular (2D) grid";
+/* "pygrib.pyx":985
+ *             return default
+ * 
+ *     def expand_grid(self,expand_reduced):             # <<<<<<<<<<<<<<
+ *         """toggle expansion of 1D reduced grid data to a regular (2D) grid"""
+ *         self.expand_reduced = expand_reduced
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6pygrib_11gribmessage_13expand_grid(PyObject *__pyx_v_self, PyObject *__pyx_v_expand_reduced); /*proto*/
+static char __pyx_doc_6pygrib_11gribmessage_12expand_grid[] = "toggle expansion of 1D reduced grid data to a regular (2D) grid";
 static PyObject *__pyx_pw_6pygrib_11gribmessage_13expand_grid(PyObject *__pyx_v_self, PyObject *__pyx_v_expand_reduced) {
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("expand_grid (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_11gribmessage_12expand_grid(((struct __pyx_obj_6pygrib_gribmessage *)__pyx_v_self), ((PyObject *)__pyx_v_expand_reduced));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "pygrib.pyx":991
- *             return default
- * 
- *     def expand_grid(self,expand_reduced):             # <<<<<<<<<<<<<<
- *         """toggle expansion of 1D reduced grid data to a regular (2D) grid"""
- *         self.expand_reduced = expand_reduced
- */
-
 static PyObject *__pyx_pf_6pygrib_11gribmessage_12expand_grid(struct __pyx_obj_6pygrib_gribmessage *__pyx_v_self, PyObject *__pyx_v_expand_reduced) {
   PyObject *__pyx_r = NULL;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("expand_grid", 0);
 
-  /* "pygrib.pyx":993
+  /* "pygrib.pyx":987
  *     def expand_grid(self,expand_reduced):
  *         """toggle expansion of 1D reduced grid data to a regular (2D) grid"""
  *         self.expand_reduced = expand_reduced             # <<<<<<<<<<<<<<
@@ -10811,32 +11844,43 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_12expand_grid(struct __pyx_obj_6
   __Pyx_DECREF(__pyx_v_self->expand_reduced);
   __pyx_v_self->expand_reduced = __pyx_v_expand_reduced;
 
+  /* "pygrib.pyx":985
+ *             return default
+ * 
+ *     def expand_grid(self,expand_reduced):             # <<<<<<<<<<<<<<
+ *         """toggle expansion of 1D reduced grid data to a regular (2D) grid"""
+ *         self.expand_reduced = expand_reduced
+ */
+
+  /* function exit code */
   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
   __Pyx_XGIVEREF(__pyx_r);
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
+/* "pygrib.pyx":989
+ *         self.expand_reduced = expand_reduced
+ * 
+ *     def is_missing(self,key):             # <<<<<<<<<<<<<<
+ *         """
+ *         is_missing(key)
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_6pygrib_11gribmessage_15is_missing(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
-static char __pyx_doc_6pygrib_11gribmessage_14is_missing[] = "\n        is_missing(key)\n\n        returns True if value associated with key is equal\n        to grib missing value flag (False otherwise)";
+static char __pyx_doc_6pygrib_11gribmessage_14is_missing[] = "\n        is_missing(key)\n\n        returns True if key is invalid or value associated with key is equal\n        to grib missing value flag (False otherwise)";
 static PyObject *__pyx_pw_6pygrib_11gribmessage_15is_missing(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("is_missing (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_11gribmessage_14is_missing(((struct __pyx_obj_6pygrib_gribmessage *)__pyx_v_self), ((PyObject *)__pyx_v_key));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "pygrib.pyx":995
- *         self.expand_reduced = expand_reduced
- * 
- *     def is_missing(self,key):             # <<<<<<<<<<<<<<
- *         """
- *         is_missing(key)
- */
-
 static PyObject *__pyx_pf_6pygrib_11gribmessage_14is_missing(struct __pyx_obj_6pygrib_gribmessage *__pyx_v_self, PyObject *__pyx_v_key) {
   int __pyx_v_err;
   int __pyx_v_miss;
@@ -10847,105 +11891,76 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_14is_missing(struct __pyx_obj_6p
   PyObject *__pyx_t_1 = NULL;
   char *__pyx_t_2;
   int __pyx_t_3;
-  PyObject *__pyx_t_4 = NULL;
+  int __pyx_t_4;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("is_missing", 0);
 
-  /* "pygrib.pyx":1003
+  /* "pygrib.pyx":997
  *         cdef int err,miss
  *         cdef char *name
  *         bytestr = _strencode(key)             # <<<<<<<<<<<<<<
  *         name = bytestr
  *         miss = grib_is_missing(self._gh, name, &err)
  */
-  __pyx_t_1 = __pyx_f_6pygrib__strencode(__pyx_v_key, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __pyx_f_6pygrib__strencode(__pyx_v_key, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_v_bytestr = __pyx_t_1;
   __pyx_t_1 = 0;
 
-  /* "pygrib.pyx":1004
+  /* "pygrib.pyx":998
  *         cdef char *name
  *         bytestr = _strencode(key)
  *         name = bytestr             # <<<<<<<<<<<<<<
  *         miss = grib_is_missing(self._gh, name, &err)
- *         if err:
+ *         if miss or err:
  */
-  __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_v_bytestr); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_v_bytestr); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_v_name = __pyx_t_2;
 
-  /* "pygrib.pyx":1005
+  /* "pygrib.pyx":999
  *         bytestr = _strencode(key)
  *         name = bytestr
  *         miss = grib_is_missing(self._gh, name, &err)             # <<<<<<<<<<<<<<
- *         if err:
- *             raise RuntimeError(grib_get_error_message(err))
+ *         if miss or err:
+ *             return True
  */
   __pyx_v_miss = grib_is_missing(__pyx_v_self->_gh, __pyx_v_name, (&__pyx_v_err));
 
-  /* "pygrib.pyx":1006
+  /* "pygrib.pyx":1000
  *         name = bytestr
  *         miss = grib_is_missing(self._gh, name, &err)
- *         if err:             # <<<<<<<<<<<<<<
- *             raise RuntimeError(grib_get_error_message(err))
- *         if miss:
- */
-  __pyx_t_3 = (__pyx_v_err != 0);
-  if (__pyx_t_3) {
-
-    /* "pygrib.pyx":1007
- *         miss = grib_is_missing(self._gh, name, &err)
- *         if err:
- *             raise RuntimeError(grib_get_error_message(err))             # <<<<<<<<<<<<<<
- *         if miss:
- *             return True
- */
-    __pyx_t_1 = __Pyx_PyBytes_FromString(grib_get_error_message(__pyx_v_err)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
-    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_1));
-    __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
-    __pyx_t_1 = 0;
-    __pyx_t_1 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L3;
-  }
-  __pyx_L3:;
-
-  /* "pygrib.pyx":1008
- *         if err:
- *             raise RuntimeError(grib_get_error_message(err))
- *         if miss:             # <<<<<<<<<<<<<<
+ *         if miss or err:             # <<<<<<<<<<<<<<
  *             return True
  *         else:
  */
-  __pyx_t_3 = (__pyx_v_miss != 0);
+  __pyx_t_4 = (__pyx_v_miss != 0);
+  if (!__pyx_t_4) {
+  } else {
+    __pyx_t_3 = __pyx_t_4;
+    goto __pyx_L4_bool_binop_done;
+  }
+  __pyx_t_4 = (__pyx_v_err != 0);
+  __pyx_t_3 = __pyx_t_4;
+  __pyx_L4_bool_binop_done:;
   if (__pyx_t_3) {
 
-    /* "pygrib.pyx":1009
- *             raise RuntimeError(grib_get_error_message(err))
- *         if miss:
+    /* "pygrib.pyx":1001
+ *         miss = grib_is_missing(self._gh, name, &err)
+ *         if miss or err:
  *             return True             # <<<<<<<<<<<<<<
  *         else:
  *             return False
  */
     __Pyx_XDECREF(__pyx_r);
-    __pyx_t_1 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_r = __pyx_t_1;
-    __pyx_t_1 = 0;
+    __Pyx_INCREF(Py_True);
+    __pyx_r = Py_True;
     goto __pyx_L0;
-    goto __pyx_L4;
   }
   /*else*/ {
 
-    /* "pygrib.pyx":1011
+    /* "pygrib.pyx":1003
  *             return True
  *         else:
  *             return False             # <<<<<<<<<<<<<<
@@ -10953,19 +11968,22 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_14is_missing(struct __pyx_obj_6p
  *         """
  */
     __Pyx_XDECREF(__pyx_r);
-    __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_r = __pyx_t_1;
-    __pyx_t_1 = 0;
+    __Pyx_INCREF(Py_False);
+    __pyx_r = Py_False;
     goto __pyx_L0;
   }
-  __pyx_L4:;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "pygrib.pyx":989
+ *         self.expand_reduced = expand_reduced
+ * 
+ *     def is_missing(self,key):             # <<<<<<<<<<<<<<
+ *         """
+ *         is_missing(key)
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_4);
   __Pyx_AddTraceback("pygrib.gribmessage.is_missing", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_r = NULL;
   __pyx_L0:;
@@ -10975,6 +11993,14 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_14is_missing(struct __pyx_obj_6p
   return __pyx_r;
 }
 
+/* "pygrib.pyx":1004
+ *         else:
+ *             return False
+ *     def keys(self):             # <<<<<<<<<<<<<<
+ *         """
+ *         keys()
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_6pygrib_11gribmessage_17keys(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
 static char __pyx_doc_6pygrib_11gribmessage_16keys[] = "\n        keys()\n\n        return keys associated with a grib message (a dictionary-like object)\n        ";
@@ -10983,18 +12009,12 @@ static PyObject *__pyx_pw_6pygrib_11gribmessage_17keys(PyObject *__pyx_v_self, C
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("keys (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_11gribmessage_16keys(((struct __pyx_obj_6pygrib_gribmessage *)__pyx_v_self));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "pygrib.pyx":1012
- *         else:
- *             return False
- *     def keys(self):             # <<<<<<<<<<<<<<
- *         """
- *         keys()
- */
-
 static PyObject *__pyx_pf_6pygrib_11gribmessage_16keys(struct __pyx_obj_6pygrib_gribmessage *__pyx_v_self) {
   grib_keys_iterator *__pyx_v_gi;
   int __pyx_v_err;
@@ -11007,15 +12027,14 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_16keys(struct __pyx_obj_6pygrib_
   int __pyx_t_1;
   int __pyx_t_2;
   PyObject *__pyx_t_3 = NULL;
-  PyObject *__pyx_t_4 = NULL;
-  int __pyx_t_5;
-  int __pyx_t_6;
+  int __pyx_t_4;
+  PyObject *__pyx_t_5 = NULL;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("keys", 0);
 
-  /* "pygrib.pyx":1022
+  /* "pygrib.pyx":1014
  *         cdef char *name
  *         # use cached keys if they exist.
  *         if self._all_keys is not None: return self._all_keys             # <<<<<<<<<<<<<<
@@ -11029,32 +12048,30 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_16keys(struct __pyx_obj_6pygrib_
     __Pyx_INCREF(__pyx_v_self->_all_keys);
     __pyx_r = __pyx_v_self->_all_keys;
     goto __pyx_L0;
-    goto __pyx_L3;
   }
-  __pyx_L3:;
 
-  /* "pygrib.pyx":1025
+  /* "pygrib.pyx":1016
+ *         if self._all_keys is not None: return self._all_keys
  *         # if not, get keys from grib file.
- *         gi = grib_keys_iterator_new(self._gh,\
- *                 GRIB_KEYS_ITERATOR_ALL_KEYS, NULL)             # <<<<<<<<<<<<<<
+ *         gi = grib_keys_iterator_new(self._gh,\             # <<<<<<<<<<<<<<
+ *                 GRIB_KEYS_ITERATOR_ALL_KEYS, NULL)
  *         keys = []
- *         while grib_keys_iterator_next(gi):
  */
   __pyx_v_gi = grib_keys_iterator_new(__pyx_v_self->_gh, GRIB_KEYS_ITERATOR_ALL_KEYS, NULL);
 
-  /* "pygrib.pyx":1026
+  /* "pygrib.pyx":1018
  *         gi = grib_keys_iterator_new(self._gh,\
  *                 GRIB_KEYS_ITERATOR_ALL_KEYS, NULL)
  *         keys = []             # <<<<<<<<<<<<<<
  *         while grib_keys_iterator_next(gi):
  *             name = grib_keys_iterator_get_name(gi)
  */
-  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
   __pyx_v_keys = ((PyObject*)__pyx_t_3);
   __pyx_t_3 = 0;
 
-  /* "pygrib.pyx":1027
+  /* "pygrib.pyx":1019
  *                 GRIB_KEYS_ITERATOR_ALL_KEYS, NULL)
  *         keys = []
  *         while grib_keys_iterator_next(gi):             # <<<<<<<<<<<<<<
@@ -11065,7 +12082,7 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_16keys(struct __pyx_obj_6pygrib_
     __pyx_t_2 = (grib_keys_iterator_next(__pyx_v_gi) != 0);
     if (!__pyx_t_2) break;
 
-    /* "pygrib.pyx":1028
+    /* "pygrib.pyx":1020
  *         keys = []
  *         while grib_keys_iterator_next(gi):
  *             name = grib_keys_iterator_get_name(gi)             # <<<<<<<<<<<<<<
@@ -11074,19 +12091,19 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_16keys(struct __pyx_obj_6pygrib_
  */
     __pyx_v_name = grib_keys_iterator_get_name(__pyx_v_gi);
 
-    /* "pygrib.pyx":1029
+    /* "pygrib.pyx":1021
  *         while grib_keys_iterator_next(gi):
  *             name = grib_keys_iterator_get_name(gi)
  *             key = name.decode('ascii')             # <<<<<<<<<<<<<<
  *             # ignore these keys.
  *             if key in ["zero","one","eight","eleven","false","thousand","file",
  */
-    __pyx_t_3 = ((PyObject *)__Pyx_decode_c_string(__pyx_v_name, 0, strlen(__pyx_v_name), NULL, NULL, PyUnicode_DecodeASCII)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
-    __Pyx_XDECREF_SET(__pyx_v_key, ((PyObject *)__pyx_t_3));
+    __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_name, 0, strlen(__pyx_v_name), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_3);
     __pyx_t_3 = 0;
 
-    /* "pygrib.pyx":1031
+    /* "pygrib.pyx":1023
  *             key = name.decode('ascii')
  *             # ignore these keys.
  *             if key in ["zero","one","eight","eleven","false","thousand","file",             # <<<<<<<<<<<<<<
@@ -11095,86 +12112,68 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_16keys(struct __pyx_obj_6pygrib_
  */
     __Pyx_INCREF(__pyx_v_key);
     __pyx_t_3 = __pyx_v_key;
-    __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, ((PyObject *)__pyx_n_s__zero), Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    if (!((int)__pyx_t_2)) {
-      __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, ((PyObject *)__pyx_n_s__one), Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __pyx_t_5 = ((int)__pyx_t_1);
+    __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_zero, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (!__pyx_t_1) {
     } else {
-      __pyx_t_5 = ((int)__pyx_t_2);
+      __pyx_t_2 = __pyx_t_1;
+      goto __pyx_L7_bool_binop_done;
     }
-    if (!__pyx_t_5) {
-      __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, ((PyObject *)__pyx_n_s__eight), Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __pyx_t_1 = ((int)__pyx_t_2);
+    __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_one, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (!__pyx_t_1) {
     } else {
-      __pyx_t_1 = __pyx_t_5;
+      __pyx_t_2 = __pyx_t_1;
+      goto __pyx_L7_bool_binop_done;
     }
+    __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_eight, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     if (!__pyx_t_1) {
-      __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, ((PyObject *)__pyx_n_s__eleven), Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __pyx_t_2 = ((int)__pyx_t_5);
     } else {
       __pyx_t_2 = __pyx_t_1;
+      goto __pyx_L7_bool_binop_done;
     }
-    if (!__pyx_t_2) {
-      __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, ((PyObject *)__pyx_n_s__false), Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __pyx_t_5 = ((int)__pyx_t_1);
+    __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_eleven, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (!__pyx_t_1) {
     } else {
-      __pyx_t_5 = __pyx_t_2;
+      __pyx_t_2 = __pyx_t_1;
+      goto __pyx_L7_bool_binop_done;
     }
-    if (!__pyx_t_5) {
-      __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, ((PyObject *)__pyx_n_s__thousand), Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __pyx_t_1 = ((int)__pyx_t_2);
+    __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_false, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (!__pyx_t_1) {
     } else {
-      __pyx_t_1 = __pyx_t_5;
+      __pyx_t_2 = __pyx_t_1;
+      goto __pyx_L7_bool_binop_done;
     }
+    __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_thousand, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     if (!__pyx_t_1) {
-      __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, ((PyObject *)__pyx_n_s__file), Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __pyx_t_2 = ((int)__pyx_t_5);
     } else {
       __pyx_t_2 = __pyx_t_1;
+      goto __pyx_L7_bool_binop_done;
     }
-    if (!__pyx_t_2) {
-      __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, ((PyObject *)__pyx_n_s__localDir), Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __pyx_t_5 = ((int)__pyx_t_1);
+    __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_file, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (!__pyx_t_1) {
     } else {
-      __pyx_t_5 = __pyx_t_2;
+      __pyx_t_2 = __pyx_t_1;
+      goto __pyx_L7_bool_binop_done;
     }
-    if (!__pyx_t_5) {
-      __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, ((PyObject *)__pyx_kp_s__7777), Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __pyx_t_1 = ((int)__pyx_t_2);
+    __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_localDir, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (!__pyx_t_1) {
     } else {
-      __pyx_t_1 = __pyx_t_5;
+      __pyx_t_2 = __pyx_t_1;
+      goto __pyx_L7_bool_binop_done;
     }
+    __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_kp_s_7777, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     if (!__pyx_t_1) {
-      __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, ((PyObject *)__pyx_n_s__oneThousand), Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __pyx_t_2 = ((int)__pyx_t_5);
     } else {
       __pyx_t_2 = __pyx_t_1;
+      goto __pyx_L7_bool_binop_done;
     }
+    __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_oneThousand, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = __pyx_t_1;
+    __pyx_L7_bool_binop_done:;
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __pyx_t_1 = (__pyx_t_2 != 0);
     if (__pyx_t_1) {
 
-      /* "pygrib.pyx":1033
+      /* "pygrib.pyx":1025
  *             if key in ["zero","one","eight","eleven","false","thousand","file",
  *                        "localDir","7777","oneThousand"]:
  *                 continue             # <<<<<<<<<<<<<<
@@ -11182,11 +12181,9 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_16keys(struct __pyx_obj_6pygrib_
  *             if err: # skip unreadable keys
  */
       goto __pyx_L4_continue;
-      goto __pyx_L6;
     }
-    __pyx_L6:;
 
-    /* "pygrib.pyx":1034
+    /* "pygrib.pyx":1026
  *                        "localDir","7777","oneThousand"]:
  *                 continue
  *             err = grib_get_native_type(self._gh, name, &typ)             # <<<<<<<<<<<<<<
@@ -11195,7 +12192,7 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_16keys(struct __pyx_obj_6pygrib_
  */
     __pyx_v_err = grib_get_native_type(__pyx_v_self->_gh, __pyx_v_name, (&__pyx_v_typ));
 
-    /* "pygrib.pyx":1035
+    /* "pygrib.pyx":1027
  *                 continue
  *             err = grib_get_native_type(self._gh, name, &typ)
  *             if err: # skip unreadable keys             # <<<<<<<<<<<<<<
@@ -11205,7 +12202,7 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_16keys(struct __pyx_obj_6pygrib_
     __pyx_t_1 = (__pyx_v_err != 0);
     if (__pyx_t_1) {
 
-      /* "pygrib.pyx":1036
+      /* "pygrib.pyx":1028
  *             err = grib_get_native_type(self._gh, name, &typ)
  *             if err: # skip unreadable keys
  *                 continue             # <<<<<<<<<<<<<<
@@ -11213,11 +12210,9 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_16keys(struct __pyx_obj_6pygrib_
  *             if typ not in\
  */
       goto __pyx_L4_continue;
-      goto __pyx_L7;
     }
-    __pyx_L7:;
 
-    /* "pygrib.pyx":1038
+    /* "pygrib.pyx":1030
  *                 continue
  *             # keys with these types are ignored.
  *             if typ not in\             # <<<<<<<<<<<<<<
@@ -11226,7 +12221,7 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_16keys(struct __pyx_obj_6pygrib_
  */
     switch (__pyx_v_typ) {
 
-      /* "pygrib.pyx":1039
+      /* "pygrib.pyx":1031
  *             # keys with these types are ignored.
  *             if typ not in\
  *             [GRIB_TYPE_UNDEFINED,GRIB_TYPE_SECTION,GRIB_TYPE_BYTES,GRIB_TYPE_LABEL,GRIB_TYPE_MISSING]:             # <<<<<<<<<<<<<<
@@ -11239,7 +12234,7 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_16keys(struct __pyx_obj_6pygrib_
       case GRIB_TYPE_LABEL:
       case GRIB_TYPE_MISSING:
 
-      /* "pygrib.pyx":1038
+      /* "pygrib.pyx":1030
  *                 continue
  *             # keys with these types are ignored.
  *             if typ not in\             # <<<<<<<<<<<<<<
@@ -11255,21 +12250,21 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_16keys(struct __pyx_obj_6pygrib_
     __pyx_t_2 = (__pyx_t_1 != 0);
     if (__pyx_t_2) {
 
-      /* "pygrib.pyx":1040
+      /* "pygrib.pyx":1032
  *             if typ not in\
  *             [GRIB_TYPE_UNDEFINED,GRIB_TYPE_SECTION,GRIB_TYPE_BYTES,GRIB_TYPE_LABEL,GRIB_TYPE_MISSING]:
  *                 keys.append(key)             # <<<<<<<<<<<<<<
  *         err = grib_keys_iterator_delete(gi)
  *         if err:
  */
-      __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_keys, __pyx_v_key); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      goto __pyx_L8;
+      __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_keys, __pyx_v_key); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      goto __pyx_L18;
     }
-    __pyx_L8:;
+    __pyx_L18:;
     __pyx_L4_continue:;
   }
 
-  /* "pygrib.pyx":1041
+  /* "pygrib.pyx":1033
  *             [GRIB_TYPE_UNDEFINED,GRIB_TYPE_SECTION,GRIB_TYPE_BYTES,GRIB_TYPE_LABEL,GRIB_TYPE_MISSING]:
  *                 keys.append(key)
  *         err = grib_keys_iterator_delete(gi)             # <<<<<<<<<<<<<<
@@ -11278,7 +12273,7 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_16keys(struct __pyx_obj_6pygrib_
  */
   __pyx_v_err = grib_keys_iterator_delete(__pyx_v_gi);
 
-  /* "pygrib.pyx":1042
+  /* "pygrib.pyx":1034
  *                 keys.append(key)
  *         err = grib_keys_iterator_delete(gi)
  *         if err:             # <<<<<<<<<<<<<<
@@ -11288,61 +12283,59 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_16keys(struct __pyx_obj_6pygrib_
   __pyx_t_2 = (__pyx_v_err != 0);
   if (__pyx_t_2) {
 
-    /* "pygrib.pyx":1043
+    /* "pygrib.pyx":1035
  *         err = grib_keys_iterator_delete(gi)
  *         if err:
  *             raise RuntimeError(grib_get_error_message(err))             # <<<<<<<<<<<<<<
  *         # add extra python keys.
  *         if hasattr(self,'analDate'): keys.append('analDate')
  */
-    __pyx_t_3 = __Pyx_PyBytes_FromString(grib_get_error_message(__pyx_v_err)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
-    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_3));
-    __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
+    __pyx_t_3 = __Pyx_PyBytes_FromString(grib_get_error_message(__pyx_v_err)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
+    __Pyx_GIVEREF(__pyx_t_3);
     __pyx_t_3 = 0;
-    __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L9;
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
-  __pyx_L9:;
 
-  /* "pygrib.pyx":1045
+  /* "pygrib.pyx":1037
  *             raise RuntimeError(grib_get_error_message(err))
  *         # add extra python keys.
  *         if hasattr(self,'analDate'): keys.append('analDate')             # <<<<<<<<<<<<<<
  *         if hasattr(self,'validDate'): keys.append('validDate')
  *         return keys
  */
-  __pyx_t_2 = PyObject_HasAttr(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__analDate)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyObject_HasAttr(((PyObject *)__pyx_v_self), __pyx_n_s_analDate); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_1 = (__pyx_t_2 != 0);
   if (__pyx_t_1) {
-    __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_keys, ((PyObject *)__pyx_n_s__analDate)); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L10;
+    __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_keys, __pyx_n_s_analDate); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    goto __pyx_L20;
   }
-  __pyx_L10:;
+  __pyx_L20:;
 
-  /* "pygrib.pyx":1046
+  /* "pygrib.pyx":1038
  *         # add extra python keys.
  *         if hasattr(self,'analDate'): keys.append('analDate')
  *         if hasattr(self,'validDate'): keys.append('validDate')             # <<<<<<<<<<<<<<
  *         return keys
  *     def _read_only_keys(self):
  */
-  __pyx_t_1 = PyObject_HasAttr(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__validDate)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyObject_HasAttr(((PyObject *)__pyx_v_self), __pyx_n_s_validDate); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_2 = (__pyx_t_1 != 0);
   if (__pyx_t_2) {
-    __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_keys, ((PyObject *)__pyx_n_s__validDate)); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L11;
+    __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_keys, __pyx_n_s_validDate); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    goto __pyx_L21;
   }
-  __pyx_L11:;
+  __pyx_L21:;
 
-  /* "pygrib.pyx":1047
+  /* "pygrib.pyx":1039
  *         if hasattr(self,'analDate'): keys.append('analDate')
  *         if hasattr(self,'validDate'): keys.append('validDate')
  *         return keys             # <<<<<<<<<<<<<<
@@ -11350,15 +12343,22 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_16keys(struct __pyx_obj_6pygrib_
  *         """
  */
   __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(((PyObject *)__pyx_v_keys));
-  __pyx_r = ((PyObject *)__pyx_v_keys);
+  __Pyx_INCREF(__pyx_v_keys);
+  __pyx_r = __pyx_v_keys;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "pygrib.pyx":1004
+ *         else:
+ *             return False
+ *     def keys(self):             # <<<<<<<<<<<<<<
+ *         """
+ *         keys()
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
   __Pyx_AddTraceback("pygrib.gribmessage.keys", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_r = NULL;
   __pyx_L0:;
@@ -11369,6 +12369,14 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_16keys(struct __pyx_obj_6pygrib_
   return __pyx_r;
 }
 
+/* "pygrib.pyx":1040
+ *         if hasattr(self,'validDate'): keys.append('validDate')
+ *         return keys
+ *     def _read_only_keys(self):             # <<<<<<<<<<<<<<
+ *         """
+ *         _read_only_keys()
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_6pygrib_11gribmessage_19_read_only_keys(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
 static char __pyx_doc_6pygrib_11gribmessage_18_read_only_keys[] = "\n        _read_only_keys()\n\n        return read-only keys associated with a grib message (a dictionary-like object)\n        ";
@@ -11377,18 +12385,12 @@ static PyObject *__pyx_pw_6pygrib_11gribmessage_19_read_only_keys(PyObject *__py
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("_read_only_keys (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_11gribmessage_18_read_only_keys(((struct __pyx_obj_6pygrib_gribmessage *)__pyx_v_self));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "pygrib.pyx":1048
- *         if hasattr(self,'validDate'): keys.append('validDate')
- *         return keys
- *     def _read_only_keys(self):             # <<<<<<<<<<<<<<
- *         """
- *         _read_only_keys()
- */
-
 static PyObject *__pyx_pf_6pygrib_11gribmessage_18_read_only_keys(struct __pyx_obj_6pygrib_gribmessage *__pyx_v_self) {
   grib_keys_iterator *__pyx_v_gi;
   int __pyx_v_err;
@@ -11402,15 +12404,16 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_18_read_only_keys(struct __pyx_o
   int __pyx_t_2;
   PyObject *__pyx_t_3 = NULL;
   PyObject *__pyx_t_4 = NULL;
-  int __pyx_t_5;
-  Py_ssize_t __pyx_t_6;
-  PyObject *(*__pyx_t_7)(PyObject *);
+  PyObject *__pyx_t_5 = NULL;
+  int __pyx_t_6;
+  Py_ssize_t __pyx_t_7;
+  PyObject *(*__pyx_t_8)(PyObject *);
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("_read_only_keys", 0);
 
-  /* "pygrib.pyx":1057
+  /* "pygrib.pyx":1049
  *         cdef int err, typ
  *         cdef char *name
  *         if self._all_keys is None:             # <<<<<<<<<<<<<<
@@ -11421,49 +12424,64 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_18_read_only_keys(struct __pyx_o
   __pyx_t_2 = (__pyx_t_1 != 0);
   if (__pyx_t_2) {
 
-    /* "pygrib.pyx":1058
+    /* "pygrib.pyx":1050
  *         cdef char *name
  *         if self._all_keys is None:
  *             self._all_keys = self.keys()             # <<<<<<<<<<<<<<
  *         gi = grib_keys_iterator_new(self._gh,\
  *                 GRIB_KEYS_ITERATOR_SKIP_READ_ONLY, NULL)
  */
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__keys); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_keys); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __Pyx_GIVEREF(__pyx_t_4);
+    __pyx_t_5 = NULL;
+    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
+      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
+      if (likely(__pyx_t_5)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+        __Pyx_INCREF(__pyx_t_5);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_4, function);
+      }
+    }
+    if (__pyx_t_5) {
+      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    } else {
+      __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    }
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_GIVEREF(__pyx_t_3);
     __Pyx_GOTREF(__pyx_v_self->_all_keys);
     __Pyx_DECREF(__pyx_v_self->_all_keys);
-    __pyx_v_self->_all_keys = __pyx_t_4;
-    __pyx_t_4 = 0;
+    __pyx_v_self->_all_keys = __pyx_t_3;
+    __pyx_t_3 = 0;
     goto __pyx_L3;
   }
   __pyx_L3:;
 
-  /* "pygrib.pyx":1060
+  /* "pygrib.pyx":1051
+ *         if self._all_keys is None:
  *             self._all_keys = self.keys()
- *         gi = grib_keys_iterator_new(self._gh,\
- *                 GRIB_KEYS_ITERATOR_SKIP_READ_ONLY, NULL)             # <<<<<<<<<<<<<<
+ *         gi = grib_keys_iterator_new(self._gh,\             # <<<<<<<<<<<<<<
+ *                 GRIB_KEYS_ITERATOR_SKIP_READ_ONLY, NULL)
  *         keys_noro = []
- *         while grib_keys_iterator_next(gi):
  */
   __pyx_v_gi = grib_keys_iterator_new(__pyx_v_self->_gh, GRIB_KEYS_ITERATOR_SKIP_READ_ONLY, NULL);
 
-  /* "pygrib.pyx":1061
+  /* "pygrib.pyx":1053
  *         gi = grib_keys_iterator_new(self._gh,\
  *                 GRIB_KEYS_ITERATOR_SKIP_READ_ONLY, NULL)
  *         keys_noro = []             # <<<<<<<<<<<<<<
  *         while grib_keys_iterator_next(gi):
  *             name = grib_keys_iterator_get_name(gi)
  */
-  __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __pyx_v_keys_noro = ((PyObject*)__pyx_t_4);
-  __pyx_t_4 = 0;
+  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_v_keys_noro = ((PyObject*)__pyx_t_3);
+  __pyx_t_3 = 0;
 
-  /* "pygrib.pyx":1062
+  /* "pygrib.pyx":1054
  *                 GRIB_KEYS_ITERATOR_SKIP_READ_ONLY, NULL)
  *         keys_noro = []
  *         while grib_keys_iterator_next(gi):             # <<<<<<<<<<<<<<
@@ -11474,7 +12492,7 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_18_read_only_keys(struct __pyx_o
     __pyx_t_2 = (grib_keys_iterator_next(__pyx_v_gi) != 0);
     if (!__pyx_t_2) break;
 
-    /* "pygrib.pyx":1063
+    /* "pygrib.pyx":1055
  *         keys_noro = []
  *         while grib_keys_iterator_next(gi):
  *             name = grib_keys_iterator_get_name(gi)             # <<<<<<<<<<<<<<
@@ -11483,29 +12501,29 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_18_read_only_keys(struct __pyx_o
  */
     __pyx_v_name = grib_keys_iterator_get_name(__pyx_v_gi);
 
-    /* "pygrib.pyx":1064
+    /* "pygrib.pyx":1056
  *         while grib_keys_iterator_next(gi):
  *             name = grib_keys_iterator_get_name(gi)
  *             key = name.decode('ascii')             # <<<<<<<<<<<<<<
  *             keys_noro.append(key)
  *         err = grib_keys_iterator_delete(gi)
  */
-    __pyx_t_4 = ((PyObject *)__Pyx_decode_c_string(__pyx_v_name, 0, strlen(__pyx_v_name), NULL, NULL, PyUnicode_DecodeASCII)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
-    __Pyx_XDECREF_SET(__pyx_v_key, ((PyObject *)__pyx_t_4));
-    __pyx_t_4 = 0;
+    __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_name, 0, strlen(__pyx_v_name), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_3);
+    __pyx_t_3 = 0;
 
-    /* "pygrib.pyx":1065
+    /* "pygrib.pyx":1057
  *             name = grib_keys_iterator_get_name(gi)
  *             key = name.decode('ascii')
  *             keys_noro.append(key)             # <<<<<<<<<<<<<<
  *         err = grib_keys_iterator_delete(gi)
  *         if err:
  */
-    __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_keys_noro, __pyx_v_key); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_keys_noro, __pyx_v_key); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
 
-  /* "pygrib.pyx":1066
+  /* "pygrib.pyx":1058
  *             key = name.decode('ascii')
  *             keys_noro.append(key)
  *         err = grib_keys_iterator_delete(gi)             # <<<<<<<<<<<<<<
@@ -11514,7 +12532,7 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_18_read_only_keys(struct __pyx_o
  */
   __pyx_v_err = grib_keys_iterator_delete(__pyx_v_gi);
 
-  /* "pygrib.pyx":1067
+  /* "pygrib.pyx":1059
  *             keys_noro.append(key)
  *         err = grib_keys_iterator_delete(gi)
  *         if err:             # <<<<<<<<<<<<<<
@@ -11524,112 +12542,121 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_18_read_only_keys(struct __pyx_o
   __pyx_t_2 = (__pyx_v_err != 0);
   if (__pyx_t_2) {
 
-    /* "pygrib.pyx":1068
+    /* "pygrib.pyx":1060
  *         err = grib_keys_iterator_delete(gi)
  *         if err:
  *             raise RuntimeError(grib_get_error_message(err))             # <<<<<<<<<<<<<<
  *         keys_ro = []
  *         for key in self._all_keys:
  */
-    __pyx_t_4 = __Pyx_PyBytes_FromString(grib_get_error_message(__pyx_v_err)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
-    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = __Pyx_PyBytes_FromString(grib_get_error_message(__pyx_v_err)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
-    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_4));
-    __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
-    __pyx_t_4 = 0;
-    __pyx_t_4 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
+    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
+    __Pyx_GIVEREF(__pyx_t_3);
+    __pyx_t_3 = 0;
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L6;
+    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
-  __pyx_L6:;
 
-  /* "pygrib.pyx":1069
+  /* "pygrib.pyx":1061
  *         if err:
  *             raise RuntimeError(grib_get_error_message(err))
  *         keys_ro = []             # <<<<<<<<<<<<<<
  *         for key in self._all_keys:
  *             if key not in keys_noro:
  */
-  __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __pyx_v_keys_ro = ((PyObject*)__pyx_t_4);
-  __pyx_t_4 = 0;
+  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_v_keys_ro = ((PyObject*)__pyx_t_3);
+  __pyx_t_3 = 0;
 
-  /* "pygrib.pyx":1070
+  /* "pygrib.pyx":1062
  *             raise RuntimeError(grib_get_error_message(err))
  *         keys_ro = []
  *         for key in self._all_keys:             # <<<<<<<<<<<<<<
  *             if key not in keys_noro:
  *                 keys_ro.append(key)
  */
-  if (PyList_CheckExact(__pyx_v_self->_all_keys) || PyTuple_CheckExact(__pyx_v_self->_all_keys)) {
-    __pyx_t_4 = __pyx_v_self->_all_keys; __Pyx_INCREF(__pyx_t_4); __pyx_t_6 = 0;
-    __pyx_t_7 = NULL;
+  if (likely(PyList_CheckExact(__pyx_v_self->_all_keys)) || PyTuple_CheckExact(__pyx_v_self->_all_keys)) {
+    __pyx_t_3 = __pyx_v_self->_all_keys; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
+    __pyx_t_8 = NULL;
   } else {
-    __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_self->_all_keys); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_7 = Py_TYPE(__pyx_t_4)->tp_iternext;
+    __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_self->_all_keys); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1062; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1062; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
   for (;;) {
-    if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_4)) {
-      if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_4)) break;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #else
-      __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #endif
-    } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_4)) {
-      if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #else
-      __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #endif
-    } else {
-      __pyx_t_3 = __pyx_t_7(__pyx_t_4);
-      if (unlikely(!__pyx_t_3)) {
-        if (PyErr_Occurred()) {
-          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
-          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        }
-        break;
+    if (likely(!__pyx_t_8)) {
+      if (likely(PyList_CheckExact(__pyx_t_3))) {
+        if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
+        #if CYTHON_COMPILING_IN_CPYTHON
+        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1062; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        #else
+        __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1062; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        #endif
+      } else {
+        if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
+        #if CYTHON_COMPILING_IN_CPYTHON
+        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1062; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        #else
+        __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1062; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        #endif
       }
-      __Pyx_GOTREF(__pyx_t_3);
+    } else {
+      __pyx_t_4 = __pyx_t_8(__pyx_t_3);
+      if (unlikely(!__pyx_t_4)) {
+        PyObject* exc_type = PyErr_Occurred();
+        if (exc_type) {
+          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1062; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        }
+        break;
+      }
+      __Pyx_GOTREF(__pyx_t_4);
     }
-    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_3);
-    __pyx_t_3 = 0;
+    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_4);
+    __pyx_t_4 = 0;
 
-    /* "pygrib.pyx":1071
+    /* "pygrib.pyx":1063
  *         keys_ro = []
  *         for key in self._all_keys:
  *             if key not in keys_noro:             # <<<<<<<<<<<<<<
  *                 keys_ro.append(key)
  *         return keys_ro
  */
-    __pyx_t_2 = (__Pyx_PySequence_Contains(__pyx_v_key, ((PyObject *)__pyx_v_keys_noro), Py_NE)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = (__Pyx_PySequence_Contains(__pyx_v_key, __pyx_v_keys_noro, Py_NE)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1063; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __pyx_t_1 = (__pyx_t_2 != 0);
     if (__pyx_t_1) {
 
-      /* "pygrib.pyx":1072
+      /* "pygrib.pyx":1064
  *         for key in self._all_keys:
  *             if key not in keys_noro:
  *                 keys_ro.append(key)             # <<<<<<<<<<<<<<
  *         return keys_ro
  *     def data(self,lat1=None,lat2=None,lon1=None,lon2=None):
  */
-      __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_keys_ro, __pyx_v_key); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_keys_ro, __pyx_v_key); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       goto __pyx_L9;
     }
     __pyx_L9:;
+
+    /* "pygrib.pyx":1062
+ *             raise RuntimeError(grib_get_error_message(err))
+ *         keys_ro = []
+ *         for key in self._all_keys:             # <<<<<<<<<<<<<<
+ *             if key not in keys_noro:
+ *                 keys_ro.append(key)
+ */
   }
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
-  /* "pygrib.pyx":1073
+  /* "pygrib.pyx":1065
  *             if key not in keys_noro:
  *                 keys_ro.append(key)
  *         return keys_ro             # <<<<<<<<<<<<<<
@@ -11637,15 +12664,23 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_18_read_only_keys(struct __pyx_o
  *         """
  */
   __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(((PyObject *)__pyx_v_keys_ro));
-  __pyx_r = ((PyObject *)__pyx_v_keys_ro);
+  __Pyx_INCREF(__pyx_v_keys_ro);
+  __pyx_r = __pyx_v_keys_ro;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "pygrib.pyx":1040
+ *         if hasattr(self,'validDate'): keys.append('validDate')
+ *         return keys
+ *     def _read_only_keys(self):             # <<<<<<<<<<<<<<
+ *         """
+ *         _read_only_keys()
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_3);
   __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
   __Pyx_AddTraceback("pygrib.gribmessage._read_only_keys", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_r = NULL;
   __pyx_L0:;
@@ -11657,6 +12692,14 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_18_read_only_keys(struct __pyx_o
   return __pyx_r;
 }
 
+/* "pygrib.pyx":1066
+ *                 keys_ro.append(key)
+ *         return keys_ro
+ *     def data(self,lat1=None,lat2=None,lon1=None,lon2=None):             # <<<<<<<<<<<<<<
+ *         """
+ * 	data(lat1=None,lat2=None,lon1=None,lon2=None)
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_6pygrib_11gribmessage_21data(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static char __pyx_doc_6pygrib_11gribmessage_20data[] = "\n\tdata(lat1=None,lat2=None,lon1=None,lon2=None)\n\n\textract data, lats and lons for a subset region defined\n\tby the keywords lat1,lat2,lon1,lon2.\n\n        The default values of lat1,lat2,lon1,lon2 are None, which\n        means the entire grid is returned.\n\n        If the grid type is unprojected lat/lon and a geographic\n        subset is requested (by using the lat1,lat2,lon1,lon2 keywords),\n        then 2-d arrays are r [...]
@@ -11672,16 +12715,8 @@ static PyObject *__pyx_pw_6pygrib_11gribmessage_21data(PyObject *__pyx_v_self, P
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("data (wrapper)", 0);
   {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__lat1,&__pyx_n_s__lat2,&__pyx_n_s__lon1,&__pyx_n_s__lon2,0};
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_lat1,&__pyx_n_s_lat2,&__pyx_n_s_lon1,&__pyx_n_s_lon2,0};
     PyObject* values[4] = {0,0,0,0};
-
-    /* "pygrib.pyx":1074
- *                 keys_ro.append(key)
- *         return keys_ro
- *     def data(self,lat1=None,lat2=None,lon1=None,lon2=None):             # <<<<<<<<<<<<<<
- *         """
- * 	data(lat1=None,lat2=None,lon1=None,lon2=None)
- */
     values[0] = ((PyObject *)Py_None);
     values[1] = ((PyObject *)Py_None);
     values[2] = ((PyObject *)Py_None);
@@ -11701,27 +12736,27 @@ static PyObject *__pyx_pw_6pygrib_11gribmessage_21data(PyObject *__pyx_v_self, P
       switch (pos_args) {
         case  0:
         if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lat1);
+          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_lat1);
           if (value) { values[0] = value; kw_args--; }
         }
         case  1:
         if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lat2);
+          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_lat2);
           if (value) { values[1] = value; kw_args--; }
         }
         case  2:
         if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lon1);
+          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_lon1);
           if (value) { values[2] = value; kw_args--; }
         }
         case  3:
         if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lon2);
+          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_lon2);
           if (value) { values[3] = value; kw_args--; }
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "data") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "data") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -11740,13 +12775,15 @@ static PyObject *__pyx_pw_6pygrib_11gribmessage_21data(PyObject *__pyx_v_self, P
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("data", 0, 0, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+  __Pyx_RaiseArgtupleInvalid("data", 0, 0, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
   __pyx_L3_error:;
   __Pyx_AddTraceback("pygrib.gribmessage.data", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
   return NULL;
   __pyx_L4_argument_unpacking_done:;
   __pyx_r = __pyx_pf_6pygrib_11gribmessage_20data(((struct __pyx_obj_6pygrib_gribmessage *)__pyx_v_self), __pyx_v_lat1, __pyx_v_lat2, __pyx_v_lon1, __pyx_v_lon2);
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
@@ -11774,6 +12811,8 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_20data(struct __pyx_obj_6pygrib_
   int __pyx_t_6;
   int __pyx_t_7;
   int __pyx_t_8;
+  Py_ssize_t __pyx_t_9;
+  PyObject *__pyx_t_10 = NULL;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
@@ -11783,32 +12822,47 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_20data(struct __pyx_obj_6pygrib_
   __Pyx_INCREF(__pyx_v_lon1);
   __Pyx_INCREF(__pyx_v_lon2);
 
-  /* "pygrib.pyx":1088
+  /* "pygrib.pyx":1080
  *         then 2-d arrays are returned, otherwise 1-d arrays are returned.
  * 	"""
  *         data = self.values             # <<<<<<<<<<<<<<
  *         lats, lons = self.latlons()
  *         if lon1==lon2==lat1==lat2==None:
  */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__values); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_values); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_v_data = __pyx_t_1;
   __pyx_t_1 = 0;
 
-  /* "pygrib.pyx":1089
+  /* "pygrib.pyx":1081
  * 	"""
  *         data = self.values
  *         lats, lons = self.latlons()             # <<<<<<<<<<<<<<
  *         if lon1==lon2==lat1==lat2==None:
  *             datsubset = data; lonsubset = lons; latsubset = lats
  */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__latlons); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1089; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1089; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_latlons); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
-    PyObject* sequence = __pyx_t_2;
+  __pyx_t_3 = NULL;
+  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  if (__pyx_t_3) {
+    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  } else {
+    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  }
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
+    PyObject* sequence = __pyx_t_1;
     #if CYTHON_COMPILING_IN_CPYTHON
     Py_ssize_t size = Py_SIZE(sequence);
     #else
@@ -11817,37 +12871,36 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_20data(struct __pyx_obj_6pygrib_
     if (unlikely(size != 2)) {
       if (size > 2) __Pyx_RaiseTooManyValuesError(2);
       else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1089; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     }
     #if CYTHON_COMPILING_IN_CPYTHON
     if (likely(PyTuple_CheckExact(sequence))) {
-      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
+      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
       __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
     } else {
-      __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
+      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
       __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
     }
-    __Pyx_INCREF(__pyx_t_1);
+    __Pyx_INCREF(__pyx_t_2);
     __Pyx_INCREF(__pyx_t_3);
     #else
-    __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1089; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1089; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
     #endif
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  } else
-  {
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  } else {
     Py_ssize_t index = -1;
-    __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1089; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
-    index = 0; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
-    __Pyx_GOTREF(__pyx_t_1);
+    index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
+    __Pyx_GOTREF(__pyx_t_2);
     index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
     __Pyx_GOTREF(__pyx_t_3);
-    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1089; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __pyx_t_5 = NULL;
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     goto __pyx_L4_unpacking_done;
@@ -11855,39 +12908,39 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_20data(struct __pyx_obj_6pygrib_
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __pyx_t_5 = NULL;
     if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1089; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __pyx_L4_unpacking_done:;
   }
-  __pyx_v_lats = __pyx_t_1;
-  __pyx_t_1 = 0;
+  __pyx_v_lats = __pyx_t_2;
+  __pyx_t_2 = 0;
   __pyx_v_lons = __pyx_t_3;
   __pyx_t_3 = 0;
 
-  /* "pygrib.pyx":1090
+  /* "pygrib.pyx":1082
  *         data = self.values
  *         lats, lons = self.latlons()
  *         if lon1==lon2==lat1==lat2==None:             # <<<<<<<<<<<<<<
  *             datsubset = data; lonsubset = lons; latsubset = lats
  *         else:
  */
-  __pyx_t_2 = PyObject_RichCompare(__pyx_v_lon1, __pyx_v_lon2, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1090; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__Pyx_PyObject_IsTrue(__pyx_t_2)) {
-    __Pyx_DECREF(__pyx_t_2);
-    __pyx_t_2 = PyObject_RichCompare(__pyx_v_lon2, __pyx_v_lat1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1090; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    if (__Pyx_PyObject_IsTrue(__pyx_t_2)) {
-      __Pyx_DECREF(__pyx_t_2);
-      __pyx_t_2 = PyObject_RichCompare(__pyx_v_lat1, __pyx_v_lat2, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1090; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      if (__Pyx_PyObject_IsTrue(__pyx_t_2)) {
-        __Pyx_DECREF(__pyx_t_2);
-        __pyx_t_2 = PyObject_RichCompare(__pyx_v_lat2, Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1090; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyObject_RichCompare(__pyx_v_lon1, __pyx_v_lon2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (__Pyx_PyObject_IsTrue(__pyx_t_1)) {
+    __Pyx_DECREF(__pyx_t_1);
+    __pyx_t_1 = PyObject_RichCompare(__pyx_v_lon2, __pyx_v_lat1, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (__Pyx_PyObject_IsTrue(__pyx_t_1)) {
+      __Pyx_DECREF(__pyx_t_1);
+      __pyx_t_1 = PyObject_RichCompare(__pyx_v_lat1, __pyx_v_lat2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      if (__Pyx_PyObject_IsTrue(__pyx_t_1)) {
+        __Pyx_DECREF(__pyx_t_1);
+        __pyx_t_1 = PyObject_RichCompare(__pyx_v_lat2, Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       }
     }
   }
-  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1090; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (__pyx_t_6) {
 
-    /* "pygrib.pyx":1091
+    /* "pygrib.pyx":1083
  *         lats, lons = self.latlons()
  *         if lon1==lon2==lat1==lat2==None:
  *             datsubset = data; lonsubset = lons; latsubset = lats             # <<<<<<<<<<<<<<
@@ -11904,7 +12957,7 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_20data(struct __pyx_obj_6pygrib_
   }
   /*else*/ {
 
-    /* "pygrib.pyx":1093
+    /* "pygrib.pyx":1085
  *             datsubset = data; lonsubset = lons; latsubset = lats
  *         else:
  *             if lat1 is None: lat1 = lats.min()             # <<<<<<<<<<<<<<
@@ -11914,18 +12967,33 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_20data(struct __pyx_obj_6pygrib_
     __pyx_t_6 = (__pyx_v_lat1 == Py_None);
     __pyx_t_7 = (__pyx_t_6 != 0);
     if (__pyx_t_7) {
-      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_lats, __pyx_n_s__min); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_lats, __pyx_n_s_min); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_3);
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __Pyx_DECREF_SET(__pyx_v_lat1, __pyx_t_3);
-      __pyx_t_3 = 0;
+      __pyx_t_2 = NULL;
+      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
+        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
+        if (likely(__pyx_t_2)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+          __Pyx_INCREF(__pyx_t_2);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_3, function);
+        }
+      }
+      if (__pyx_t_2) {
+        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      } else {
+        __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      }
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_DECREF_SET(__pyx_v_lat1, __pyx_t_1);
+      __pyx_t_1 = 0;
       goto __pyx_L6;
     }
     __pyx_L6:;
 
-    /* "pygrib.pyx":1094
+    /* "pygrib.pyx":1086
  *         else:
  *             if lat1 is None: lat1 = lats.min()
  *             if lat2 is None: lat2 = lats.max()             # <<<<<<<<<<<<<<
@@ -11935,18 +13003,33 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_20data(struct __pyx_obj_6pygrib_
     __pyx_t_7 = (__pyx_v_lat2 == Py_None);
     __pyx_t_6 = (__pyx_t_7 != 0);
     if (__pyx_t_6) {
-      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_lats, __pyx_n_s__max); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_lats, __pyx_n_s_max); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_t_2 = NULL;
+      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
+        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
+        if (likely(__pyx_t_2)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+          __Pyx_INCREF(__pyx_t_2);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_3, function);
+        }
+      }
+      if (__pyx_t_2) {
+        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      } else {
+        __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      }
+      __Pyx_GOTREF(__pyx_t_1);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __Pyx_DECREF_SET(__pyx_v_lat2, __pyx_t_2);
-      __pyx_t_2 = 0;
+      __Pyx_DECREF_SET(__pyx_v_lat2, __pyx_t_1);
+      __pyx_t_1 = 0;
       goto __pyx_L7;
     }
     __pyx_L7:;
 
-    /* "pygrib.pyx":1095
+    /* "pygrib.pyx":1087
  *             if lat1 is None: lat1 = lats.min()
  *             if lat2 is None: lat2 = lats.max()
  *             if lon1 is None: lon1 = lons.min()             # <<<<<<<<<<<<<<
@@ -11956,18 +13039,33 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_20data(struct __pyx_obj_6pygrib_
     __pyx_t_6 = (__pyx_v_lon1 == Py_None);
     __pyx_t_7 = (__pyx_t_6 != 0);
     if (__pyx_t_7) {
-      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_lons, __pyx_n_s__min); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1095; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1095; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_lons, __pyx_n_s_min); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_3);
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __Pyx_DECREF_SET(__pyx_v_lon1, __pyx_t_3);
-      __pyx_t_3 = 0;
+      __pyx_t_2 = NULL;
+      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
+        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
+        if (likely(__pyx_t_2)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+          __Pyx_INCREF(__pyx_t_2);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_3, function);
+        }
+      }
+      if (__pyx_t_2) {
+        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      } else {
+        __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      }
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_DECREF_SET(__pyx_v_lon1, __pyx_t_1);
+      __pyx_t_1 = 0;
       goto __pyx_L8;
     }
     __pyx_L8:;
 
-    /* "pygrib.pyx":1096
+    /* "pygrib.pyx":1088
  *             if lat2 is None: lat2 = lats.max()
  *             if lon1 is None: lon1 = lons.min()
  *             if lon2 is None: lon2 = lons.max()             # <<<<<<<<<<<<<<
@@ -11977,374 +13075,494 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_20data(struct __pyx_obj_6pygrib_
     __pyx_t_7 = (__pyx_v_lon2 == Py_None);
     __pyx_t_6 = (__pyx_t_7 != 0);
     if (__pyx_t_6) {
-      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_lons, __pyx_n_s__max); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1096; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_lons, __pyx_n_s_max); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1096; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_t_2 = NULL;
+      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
+        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
+        if (likely(__pyx_t_2)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+          __Pyx_INCREF(__pyx_t_2);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_3, function);
+        }
+      }
+      if (__pyx_t_2) {
+        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      } else {
+        __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      }
+      __Pyx_GOTREF(__pyx_t_1);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __Pyx_DECREF_SET(__pyx_v_lon2, __pyx_t_2);
-      __pyx_t_2 = 0;
+      __Pyx_DECREF_SET(__pyx_v_lon2, __pyx_t_1);
+      __pyx_t_1 = 0;
       goto __pyx_L9;
     }
     __pyx_L9:;
 
-    /* "pygrib.pyx":1097
+    /* "pygrib.pyx":1089
  *             if lon1 is None: lon1 = lons.min()
  *             if lon2 is None: lon2 = lons.max()
  *             masklat = (lats >= lat1) & (lats <= lat2)             # <<<<<<<<<<<<<<
  *             masklon = (lons >= lon1) & (lons <= lon2)
  *             mask = masklat & masklon
  */
-    __pyx_t_2 = PyObject_RichCompare(__pyx_v_lats, __pyx_v_lat1, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_3 = PyObject_RichCompare(__pyx_v_lats, __pyx_v_lat2, Py_LE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_1 = PyNumber_And(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_1 = PyObject_RichCompare(__pyx_v_lats, __pyx_v_lat1, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1089; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = PyObject_RichCompare(__pyx_v_lats, __pyx_v_lat2, Py_LE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1089; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = PyNumber_And(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1089; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_v_masklat = __pyx_t_1;
-    __pyx_t_1 = 0;
+    __pyx_v_masklat = __pyx_t_2;
+    __pyx_t_2 = 0;
 
-    /* "pygrib.pyx":1098
+    /* "pygrib.pyx":1090
  *             if lon2 is None: lon2 = lons.max()
  *             masklat = (lats >= lat1) & (lats <= lat2)
  *             masklon = (lons >= lon1) & (lons <= lon2)             # <<<<<<<<<<<<<<
  *             mask = masklat & masklon
  *             datsubset = data[mask]
  */
-    __pyx_t_1 = PyObject_RichCompare(__pyx_v_lons, __pyx_v_lon1, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_3 = PyObject_RichCompare(__pyx_v_lons, __pyx_v_lon2, Py_LE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_2 = PyNumber_And(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_t_2 = PyObject_RichCompare(__pyx_v_lons, __pyx_v_lon1, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1090; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = PyObject_RichCompare(__pyx_v_lons, __pyx_v_lon2, Py_LE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1090; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = PyNumber_And(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1090; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_v_masklon = __pyx_t_2;
-    __pyx_t_2 = 0;
+    __pyx_v_masklon = __pyx_t_1;
+    __pyx_t_1 = 0;
 
-    /* "pygrib.pyx":1099
+    /* "pygrib.pyx":1091
  *             masklat = (lats >= lat1) & (lats <= lat2)
  *             masklon = (lons >= lon1) & (lons <= lon2)
  *             mask = masklat & masklon             # <<<<<<<<<<<<<<
  *             datsubset = data[mask]
  *             latsubset = lats[mask]
  */
-    __pyx_t_2 = PyNumber_And(__pyx_v_masklat, __pyx_v_masklon); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_v_mask = __pyx_t_2;
-    __pyx_t_2 = 0;
+    __pyx_t_1 = PyNumber_And(__pyx_v_masklat, __pyx_v_masklon); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_v_mask = __pyx_t_1;
+    __pyx_t_1 = 0;
 
-    /* "pygrib.pyx":1100
+    /* "pygrib.pyx":1092
  *             masklon = (lons >= lon1) & (lons <= lon2)
  *             mask = masklat & masklon
  *             datsubset = data[mask]             # <<<<<<<<<<<<<<
  *             latsubset = lats[mask]
  *             lonsubset = lons[mask]
  */
-    __pyx_t_2 = PyObject_GetItem(__pyx_v_data, __pyx_v_mask); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_v_datsubset = __pyx_t_2;
-    __pyx_t_2 = 0;
+    __pyx_t_1 = PyObject_GetItem(__pyx_v_data, __pyx_v_mask); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_v_datsubset = __pyx_t_1;
+    __pyx_t_1 = 0;
 
-    /* "pygrib.pyx":1101
+    /* "pygrib.pyx":1093
  *             mask = masklat & masklon
  *             datsubset = data[mask]
  *             latsubset = lats[mask]             # <<<<<<<<<<<<<<
  *             lonsubset = lons[mask]
  *             # reshape lat/lon grids so returned arrays are 2-d instead of 1-d
  */
-    __pyx_t_2 = PyObject_GetItem(__pyx_v_lats, __pyx_v_mask); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_v_latsubset = __pyx_t_2;
-    __pyx_t_2 = 0;
+    __pyx_t_1 = PyObject_GetItem(__pyx_v_lats, __pyx_v_mask); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_v_latsubset = __pyx_t_1;
+    __pyx_t_1 = 0;
 
-    /* "pygrib.pyx":1102
+    /* "pygrib.pyx":1094
  *             datsubset = data[mask]
  *             latsubset = lats[mask]
  *             lonsubset = lons[mask]             # <<<<<<<<<<<<<<
  *             # reshape lat/lon grids so returned arrays are 2-d instead of 1-d
  *             reduced_expand = self['gridType'] in ['reduced_ll','reduced_gg'] and self.expand_reduced
  */
-    __pyx_t_2 = PyObject_GetItem(__pyx_v_lons, __pyx_v_mask); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_v_lonsubset = __pyx_t_2;
-    __pyx_t_2 = 0;
+    __pyx_t_1 = PyObject_GetItem(__pyx_v_lons, __pyx_v_mask); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_v_lonsubset = __pyx_t_1;
+    __pyx_t_1 = 0;
 
-    /* "pygrib.pyx":1104
+    /* "pygrib.pyx":1096
  *             lonsubset = lons[mask]
  *             # reshape lat/lon grids so returned arrays are 2-d instead of 1-d
  *             reduced_expand = self['gridType'] in ['reduced_ll','reduced_gg'] and self.expand_reduced             # <<<<<<<<<<<<<<
  *             if self['gridType'] in ['regular_gg','regular_ll'] or reduced_expand:
  *                 nlats = masklat[:,0].sum()
  */
-    __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__gridType)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, ((PyObject *)__pyx_n_s__reduced_ll), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    if (!((int)__pyx_t_6)) {
-      __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, ((PyObject *)__pyx_n_s__reduced_gg), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_8 = ((int)__pyx_t_7);
+    __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_gridType); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1096; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_reduced_ll, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1096; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (!__pyx_t_7) {
     } else {
-      __pyx_t_8 = ((int)__pyx_t_6);
+      __pyx_t_6 = __pyx_t_7;
+      goto __pyx_L12_bool_binop_done;
     }
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    if (__pyx_t_8) {
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __Pyx_INCREF(__pyx_v_self->expand_reduced);
-      __pyx_t_3 = __pyx_v_self->expand_reduced;
+    __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_reduced_gg, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1096; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_6 = __pyx_t_7;
+    __pyx_L12_bool_binop_done:;
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_t_7 = __pyx_t_6;
+    if (__pyx_t_7) {
     } else {
-      __pyx_t_3 = __pyx_t_2;
-      __pyx_t_2 = 0;
+      __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1096; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_1 = __pyx_t_3;
+      __pyx_t_3 = 0;
+      goto __pyx_L10_bool_binop_done;
     }
-    __pyx_v_reduced_expand = __pyx_t_3;
-    __pyx_t_3 = 0;
+    __Pyx_INCREF(__pyx_v_self->expand_reduced);
+    __pyx_t_1 = __pyx_v_self->expand_reduced;
+    __pyx_L10_bool_binop_done:;
+    __pyx_v_reduced_expand = __pyx_t_1;
+    __pyx_t_1 = 0;
 
-    /* "pygrib.pyx":1105
+    /* "pygrib.pyx":1097
  *             # reshape lat/lon grids so returned arrays are 2-d instead of 1-d
  *             reduced_expand = self['gridType'] in ['reduced_ll','reduced_gg'] and self.expand_reduced
  *             if self['gridType'] in ['regular_gg','regular_ll'] or reduced_expand:             # <<<<<<<<<<<<<<
  *                 nlats = masklat[:,0].sum()
  *                 nlons = masklon[0,:].sum()
  */
-    __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__gridType)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, ((PyObject *)__pyx_n_s__regular_gg), Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    if (!((int)__pyx_t_8)) {
-      __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, ((PyObject *)__pyx_n_s__regular_ll), Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __pyx_t_7 = ((int)__pyx_t_6);
+    __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_gridType); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_regular_gg, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (!__pyx_t_8) {
     } else {
-      __pyx_t_7 = ((int)__pyx_t_8);
+      __pyx_t_6 = __pyx_t_8;
+      goto __pyx_L17_bool_binop_done;
     }
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_8 = __pyx_t_7;
+    __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_regular_ll, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_6 = __pyx_t_8;
+    __pyx_L17_bool_binop_done:;
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_t_8 = (__pyx_t_6 != 0);
     if (!__pyx_t_8) {
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_reduced_expand); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_6 = __pyx_t_7;
     } else {
-      __pyx_t_6 = __pyx_t_8;
+      __pyx_t_7 = __pyx_t_8;
+      goto __pyx_L15_bool_binop_done;
     }
-    if (__pyx_t_6) {
+    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_reduced_expand); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_7 = __pyx_t_8;
+    __pyx_L15_bool_binop_done:;
+    if (__pyx_t_7) {
 
-      /* "pygrib.pyx":1106
+      /* "pygrib.pyx":1098
  *             reduced_expand = self['gridType'] in ['reduced_ll','reduced_gg'] and self.expand_reduced
  *             if self['gridType'] in ['regular_gg','regular_ll'] or reduced_expand:
  *                 nlats = masklat[:,0].sum()             # <<<<<<<<<<<<<<
  *                 nlons = masklon[0,:].sum()
  *                 if ma.isMA(datsubset):
  */
-      __pyx_t_3 = PyObject_GetItem(__pyx_v_masklat, ((PyObject *)__pyx_k_tuple_101)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyObject_GetItem(__pyx_v_masklat, __pyx_tuple__52); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
       __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__sum); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_sum); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_2);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_3 = NULL;
+      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
+        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+        if (likely(__pyx_t_3)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+          __Pyx_INCREF(__pyx_t_3);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_2, function);
+        }
+      }
+      if (__pyx_t_3) {
+        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      } else {
+        __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      }
+      __Pyx_GOTREF(__pyx_t_1);
       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __pyx_v_nlats = __pyx_t_3;
-      __pyx_t_3 = 0;
+      __pyx_v_nlats = __pyx_t_1;
+      __pyx_t_1 = 0;
 
-      /* "pygrib.pyx":1107
+      /* "pygrib.pyx":1099
  *             if self['gridType'] in ['regular_gg','regular_ll'] or reduced_expand:
  *                 nlats = masklat[:,0].sum()
  *                 nlons = masklon[0,:].sum()             # <<<<<<<<<<<<<<
  *                 if ma.isMA(datsubset):
  *                     datsubset = ma.reshape(datsubset,(nlats,nlons))
  */
-      __pyx_t_3 = PyObject_GetItem(__pyx_v_masklon, ((PyObject *)__pyx_k_tuple_103)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__sum); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_2 = PyObject_GetItem(__pyx_v_masklon, __pyx_tuple__54); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
       __Pyx_GOTREF(__pyx_t_2);
-      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_sum); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __pyx_v_nlons = __pyx_t_3;
-      __pyx_t_3 = 0;
+      __pyx_t_2 = NULL;
+      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
+        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
+        if (likely(__pyx_t_2)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+          __Pyx_INCREF(__pyx_t_2);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_3, function);
+        }
+      }
+      if (__pyx_t_2) {
+        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      } else {
+        __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      }
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __pyx_v_nlons = __pyx_t_1;
+      __pyx_t_1 = 0;
 
-      /* "pygrib.pyx":1108
+      /* "pygrib.pyx":1100
  *                 nlats = masklat[:,0].sum()
  *                 nlons = masklon[0,:].sum()
  *                 if ma.isMA(datsubset):             # <<<<<<<<<<<<<<
  *                     datsubset = ma.reshape(datsubset,(nlats,nlons))
  *                 else:
  */
-      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__ma); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_ma); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__isMA); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_isMA); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_2);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __Pyx_INCREF(__pyx_v_datsubset);
-      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_datsubset);
-      __Pyx_GIVEREF(__pyx_v_datsubset);
-      __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
+      __pyx_t_3 = NULL;
+      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
+        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+        if (likely(__pyx_t_3)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+          __Pyx_INCREF(__pyx_t_3);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_2, function);
+        }
+      }
+      if (!__pyx_t_3) {
+        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_datsubset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_1);
+      } else {
+        __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_4);
+        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
+        __Pyx_INCREF(__pyx_v_datsubset);
+        PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_datsubset);
+        __Pyx_GIVEREF(__pyx_v_datsubset);
+        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_1);
+        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      }
       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      if (__pyx_t_6) {
+      if (__pyx_t_7) {
 
-        /* "pygrib.pyx":1109
+        /* "pygrib.pyx":1101
  *                 nlons = masklon[0,:].sum()
  *                 if ma.isMA(datsubset):
  *                     datsubset = ma.reshape(datsubset,(nlats,nlons))             # <<<<<<<<<<<<<<
  *                 else:
  *                     datsubset = np.reshape(datsubset,(nlats,nlons))
  */
-        __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__ma); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_1);
-        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__reshape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_3);
-        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-        __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_1);
+        __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ma); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_2);
+        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_reshape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_4);
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_2);
         __Pyx_INCREF(__pyx_v_nlats);
-        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_nlats);
+        PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_nlats);
         __Pyx_GIVEREF(__pyx_v_nlats);
         __Pyx_INCREF(__pyx_v_nlons);
-        PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_nlons);
+        PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_nlons);
         __Pyx_GIVEREF(__pyx_v_nlons);
-        __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_2);
+        __pyx_t_3 = NULL;
+        __pyx_t_9 = 0;
+        if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
+          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
+          if (likely(__pyx_t_3)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+            __Pyx_INCREF(__pyx_t_3);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_4, function);
+            __pyx_t_9 = 1;
+          }
+        }
+        __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_10);
+        if (__pyx_t_3) {
+          PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
+        }
         __Pyx_INCREF(__pyx_v_datsubset);
-        PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_datsubset);
+        PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_v_datsubset);
         __Pyx_GIVEREF(__pyx_v_datsubset);
-        PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_t_1));
-        __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
-        __pyx_t_1 = 0;
-        __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_2);
+        __Pyx_GIVEREF(__pyx_t_2);
+        __pyx_t_2 = 0;
+        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         __Pyx_GOTREF(__pyx_t_1);
-        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-        __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
         __Pyx_DECREF_SET(__pyx_v_datsubset, __pyx_t_1);
         __pyx_t_1 = 0;
-        goto __pyx_L11;
+        goto __pyx_L19;
       }
       /*else*/ {
 
-        /* "pygrib.pyx":1111
+        /* "pygrib.pyx":1103
  *                     datsubset = ma.reshape(datsubset,(nlats,nlons))
  *                 else:
  *                     datsubset = np.reshape(datsubset,(nlats,nlons))             # <<<<<<<<<<<<<<
  *                 latsubset = np.reshape(latsubset,(nlats,nlons))
  *                 lonsubset = np.reshape(lonsubset,(nlats,nlons))
  */
-        __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_1);
-        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__reshape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_2);
-        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-        __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_1);
+        __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_4);
+        __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_reshape); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_10);
+        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+        __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_4);
         __Pyx_INCREF(__pyx_v_nlats);
-        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_nlats);
+        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_nlats);
         __Pyx_GIVEREF(__pyx_v_nlats);
         __Pyx_INCREF(__pyx_v_nlons);
-        PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_nlons);
+        PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_nlons);
         __Pyx_GIVEREF(__pyx_v_nlons);
-        __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_t_2 = NULL;
+        __pyx_t_9 = 0;
+        if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_10))) {
+          __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_10);
+          if (likely(__pyx_t_2)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
+            __Pyx_INCREF(__pyx_t_2);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_10, function);
+            __pyx_t_9 = 1;
+          }
+        }
+        __pyx_t_3 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         __Pyx_GOTREF(__pyx_t_3);
+        if (__pyx_t_2) {
+          PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = NULL;
+        }
         __Pyx_INCREF(__pyx_v_datsubset);
-        PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_datsubset);
+        PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_9, __pyx_v_datsubset);
         __Pyx_GIVEREF(__pyx_v_datsubset);
-        PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_t_1));
-        __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
-        __pyx_t_1 = 0;
-        __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_9, __pyx_t_4);
+        __Pyx_GIVEREF(__pyx_t_4);
+        __pyx_t_4 = 0;
+        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         __Pyx_GOTREF(__pyx_t_1);
-        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-        __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
         __Pyx_DECREF_SET(__pyx_v_datsubset, __pyx_t_1);
         __pyx_t_1 = 0;
       }
-      __pyx_L11:;
+      __pyx_L19:;
 
-      /* "pygrib.pyx":1112
+      /* "pygrib.pyx":1104
  *                 else:
  *                     datsubset = np.reshape(datsubset,(nlats,nlons))
  *                 latsubset = np.reshape(latsubset,(nlats,nlons))             # <<<<<<<<<<<<<<
  *                 lonsubset = np.reshape(lonsubset,(nlats,nlons))
  *         return datsubset,latsubset, lonsubset
  */
-      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__reshape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_10);
+      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_reshape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_3);
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+      __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_10);
       __Pyx_INCREF(__pyx_v_nlats);
-      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_nlats);
+      PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_nlats);
       __Pyx_GIVEREF(__pyx_v_nlats);
       __Pyx_INCREF(__pyx_v_nlons);
-      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_nlons);
+      PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_v_nlons);
       __Pyx_GIVEREF(__pyx_v_nlons);
-      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = NULL;
+      __pyx_t_9 = 0;
+      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
+        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+        if (likely(__pyx_t_4)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+          __Pyx_INCREF(__pyx_t_4);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_3, function);
+          __pyx_t_9 = 1;
+        }
+      }
+      __pyx_t_2 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_2);
+      if (__pyx_t_4) {
+        PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
+      }
       __Pyx_INCREF(__pyx_v_latsubset);
-      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_latsubset);
+      PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_9, __pyx_v_latsubset);
       __Pyx_GIVEREF(__pyx_v_latsubset);
-      PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_t_1));
-      __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
-      __pyx_t_1 = 0;
-      __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_9, __pyx_t_10);
+      __Pyx_GIVEREF(__pyx_t_10);
+      __pyx_t_10 = 0;
+      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
       __Pyx_DECREF_SET(__pyx_v_latsubset, __pyx_t_1);
       __pyx_t_1 = 0;
 
-      /* "pygrib.pyx":1113
+      /* "pygrib.pyx":1105
  *                     datsubset = np.reshape(datsubset,(nlats,nlons))
  *                 latsubset = np.reshape(latsubset,(nlats,nlons))
  *                 lonsubset = np.reshape(lonsubset,(nlats,nlons))             # <<<<<<<<<<<<<<
  *         return datsubset,latsubset, lonsubset
  *     def __setitem__(self, key, value):
  */
-      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__reshape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_reshape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_2);
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
       __Pyx_INCREF(__pyx_v_nlats);
-      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_nlats);
+      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_nlats);
       __Pyx_GIVEREF(__pyx_v_nlats);
       __Pyx_INCREF(__pyx_v_nlons);
-      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_nlons);
+      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_nlons);
       __Pyx_GIVEREF(__pyx_v_nlons);
-      __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_10 = NULL;
+      __pyx_t_9 = 0;
+      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
+        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_2);
+        if (likely(__pyx_t_10)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+          __Pyx_INCREF(__pyx_t_10);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_2, function);
+          __pyx_t_9 = 1;
+        }
+      }
+      __pyx_t_4 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      if (__pyx_t_10) {
+        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); __pyx_t_10 = NULL;
+      }
       __Pyx_INCREF(__pyx_v_lonsubset);
-      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_lonsubset);
+      PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_9, __pyx_v_lonsubset);
       __Pyx_GIVEREF(__pyx_v_lonsubset);
-      PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_t_1));
-      __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
-      __pyx_t_1 = 0;
-      __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_9, __pyx_t_3);
+      __Pyx_GIVEREF(__pyx_t_3);
+      __pyx_t_3 = 0;
+      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
       __Pyx_DECREF_SET(__pyx_v_lonsubset, __pyx_t_1);
       __pyx_t_1 = 0;
-      goto __pyx_L10;
+      goto __pyx_L14;
     }
-    __pyx_L10:;
+    __pyx_L14:;
   }
   __pyx_L5:;
 
-  /* "pygrib.pyx":1114
+  /* "pygrib.pyx":1106
  *                 latsubset = np.reshape(latsubset,(nlats,nlons))
  *                 lonsubset = np.reshape(lonsubset,(nlats,nlons))
  *         return datsubset,latsubset, lonsubset             # <<<<<<<<<<<<<<
@@ -12352,7 +13570,7 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_20data(struct __pyx_obj_6pygrib_
  *         """
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_INCREF(__pyx_v_datsubset);
   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_datsubset);
@@ -12363,17 +13581,25 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_20data(struct __pyx_obj_6pygrib_
   __Pyx_INCREF(__pyx_v_lonsubset);
   PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_lonsubset);
   __Pyx_GIVEREF(__pyx_v_lonsubset);
-  __pyx_r = ((PyObject *)__pyx_t_1);
+  __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "pygrib.pyx":1066
+ *                 keys_ro.append(key)
+ *         return keys_ro
+ *     def data(self,lat1=None,lat2=None,lon1=None,lon2=None):             # <<<<<<<<<<<<<<
+ *         """
+ * 	data(lat1=None,lat2=None,lon1=None,lon2=None)
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_XDECREF(__pyx_t_2);
   __Pyx_XDECREF(__pyx_t_3);
   __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_10);
   __Pyx_AddTraceback("pygrib.gribmessage.data", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_r = NULL;
   __pyx_L0:;
@@ -12398,6 +13624,14 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_20data(struct __pyx_obj_6pygrib_
   return __pyx_r;
 }
 
+/* "pygrib.pyx":1107
+ *                 lonsubset = np.reshape(lonsubset,(nlats,nlons))
+ *         return datsubset,latsubset, lonsubset
+ *     def __setitem__(self, key, value):             # <<<<<<<<<<<<<<
+ *         """
+ *         change values associated with existing grib keys.
+ */
+
 /* Python wrapper */
 static int __pyx_pw_6pygrib_11gribmessage_23__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /*proto*/
 static char __pyx_doc_6pygrib_11gribmessage_22__setitem__[] = "\n        change values associated with existing grib keys.\n        ";
@@ -12409,18 +13643,12 @@ static int __pyx_pw_6pygrib_11gribmessage_23__setitem__(PyObject *__pyx_v_self,
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_11gribmessage_22__setitem__(((struct __pyx_obj_6pygrib_gribmessage *)__pyx_v_self), ((PyObject *)__pyx_v_key), ((PyObject *)__pyx_v_value));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "pygrib.pyx":1115
- *                 lonsubset = np.reshape(lonsubset,(nlats,nlons))
- *         return datsubset,latsubset, lonsubset
- *     def __setitem__(self, key, value):             # <<<<<<<<<<<<<<
- *         """
- *         change values associated with existing grib keys.
- */
-
 static int __pyx_pf_6pygrib_11gribmessage_22__setitem__(struct __pyx_obj_6pygrib_gribmessage *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value) {
   int __pyx_v_err;
   int __pyx_v_typ;
@@ -12440,108 +13668,114 @@ static int __pyx_pf_6pygrib_11gribmessage_22__setitem__(struct __pyx_obj_6pygrib
   PyObject *__pyx_t_4 = NULL;
   char *__pyx_t_5;
   PyObject *__pyx_t_6 = NULL;
-  long __pyx_t_7;
-  size_t __pyx_t_8;
-  double __pyx_t_9;
-  Py_ssize_t __pyx_t_10;
+  PyObject *__pyx_t_7 = NULL;
+  Py_ssize_t __pyx_t_8;
+  PyObject *__pyx_t_9 = NULL;
+  long __pyx_t_10;
+  size_t __pyx_t_11;
+  double __pyx_t_12;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("__setitem__", 0);
 
-  /* "pygrib.pyx":1126
+  /* "pygrib.pyx":1118
  *         cdef ndarray datarr
  *         cdef char *strdata
  *         if key in self._ro_keys:             # <<<<<<<<<<<<<<
  *             raise KeyError('key "%s" is read only' % key)
  *         if key not in self._all_keys:
  */
-  __pyx_t_1 = (__Pyx_PySequence_Contains(__pyx_v_key, __pyx_v_self->_ro_keys, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = (__Pyx_PySequence_Contains(__pyx_v_key, __pyx_v_self->_ro_keys, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_2 = (__pyx_t_1 != 0);
   if (__pyx_t_2) {
 
-    /* "pygrib.pyx":1127
+    /* "pygrib.pyx":1119
  *         cdef char *strdata
  *         if key in self._ro_keys:
  *             raise KeyError('key "%s" is read only' % key)             # <<<<<<<<<<<<<<
  *         if key not in self._all_keys:
  *             raise KeyError('can only modify existing grib keys (key "%s" not found)'
  */
-    __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_104), __pyx_v_key); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
-    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_key_s_is_read_only, __pyx_v_key); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
-    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_3));
-    __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
+    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
+    __Pyx_GIVEREF(__pyx_t_3);
     __pyx_t_3 = 0;
-    __pyx_t_3 = PyObject_Call(__pyx_builtin_KeyError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L3;
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
-  __pyx_L3:;
 
-  /* "pygrib.pyx":1128
+  /* "pygrib.pyx":1120
  *         if key in self._ro_keys:
  *             raise KeyError('key "%s" is read only' % key)
  *         if key not in self._all_keys:             # <<<<<<<<<<<<<<
  *             raise KeyError('can only modify existing grib keys (key "%s" not found)'
  *                     % key )
  */
-  __pyx_t_2 = (__Pyx_PySequence_Contains(__pyx_v_key, __pyx_v_self->_all_keys, Py_NE)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = (__Pyx_PySequence_Contains(__pyx_v_key, __pyx_v_self->_all_keys, Py_NE)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_1 = (__pyx_t_2 != 0);
   if (__pyx_t_1) {
 
-    /* "pygrib.pyx":1130
+    /* "pygrib.pyx":1122
  *         if key not in self._all_keys:
  *             raise KeyError('can only modify existing grib keys (key "%s" not found)'
  *                     % key )             # <<<<<<<<<<<<<<
  *         bytestr = _strencode(key)
  *         name = bytestr
  */
-    __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_105), __pyx_v_key); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
-    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_can_only_modify_existing_grib_ke, __pyx_v_key); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+
+    /* "pygrib.pyx":1121
+ *             raise KeyError('key "%s" is read only' % key)
+ *         if key not in self._all_keys:
+ *             raise KeyError('can only modify existing grib keys (key "%s" not found)'             # <<<<<<<<<<<<<<
+ *                     % key )
+ *         bytestr = _strencode(key)
+ */
+    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
-    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_3));
-    __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
+    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
+    __Pyx_GIVEREF(__pyx_t_3);
     __pyx_t_3 = 0;
-    __pyx_t_3 = PyObject_Call(__pyx_builtin_KeyError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L4;
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
-  __pyx_L4:;
 
-  /* "pygrib.pyx":1131
+  /* "pygrib.pyx":1123
  *             raise KeyError('can only modify existing grib keys (key "%s" not found)'
  *                     % key )
  *         bytestr = _strencode(key)             # <<<<<<<<<<<<<<
  *         name = bytestr
  *         err = grib_get_native_type(self._gh, name, &typ)
  */
-  __pyx_t_3 = __pyx_f_6pygrib__strencode(__pyx_v_key, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __pyx_f_6pygrib__strencode(__pyx_v_key, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
   __pyx_v_bytestr = __pyx_t_3;
   __pyx_t_3 = 0;
 
-  /* "pygrib.pyx":1132
+  /* "pygrib.pyx":1124
  *                     % key )
  *         bytestr = _strencode(key)
  *         name = bytestr             # <<<<<<<<<<<<<<
  *         err = grib_get_native_type(self._gh, name, &typ)
  *         if err:
  */
-  __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_v_bytestr); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_v_bytestr); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_v_name = __pyx_t_5;
 
-  /* "pygrib.pyx":1133
+  /* "pygrib.pyx":1125
  *         bytestr = _strencode(key)
  *         name = bytestr
  *         err = grib_get_native_type(self._gh, name, &typ)             # <<<<<<<<<<<<<<
@@ -12550,7 +13784,7 @@ static int __pyx_pf_6pygrib_11gribmessage_22__setitem__(struct __pyx_obj_6pygrib
  */
   __pyx_v_err = grib_get_native_type(__pyx_v_self->_gh, __pyx_v_name, (&__pyx_v_typ));
 
-  /* "pygrib.pyx":1134
+  /* "pygrib.pyx":1126
  *         name = bytestr
  *         err = grib_get_native_type(self._gh, name, &typ)
  *         if err:             # <<<<<<<<<<<<<<
@@ -12560,30 +13794,29 @@ static int __pyx_pf_6pygrib_11gribmessage_22__setitem__(struct __pyx_obj_6pygrib
   __pyx_t_1 = (__pyx_v_err != 0);
   if (__pyx_t_1) {
 
-    /* "pygrib.pyx":1135
+    /* "pygrib.pyx":1127
  *         err = grib_get_native_type(self._gh, name, &typ)
  *         if err:
  *             raise RuntimeError(grib_get_error_message(err))             # <<<<<<<<<<<<<<
  *         elif typ == GRIB_TYPE_LONG:
  *             # is value an array or a scalar?
  */
-    __pyx_t_3 = __Pyx_PyBytes_FromString(grib_get_error_message(__pyx_v_err)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
-    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = __Pyx_PyBytes_FromString(grib_get_error_message(__pyx_v_err)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
-    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_3));
-    __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
+    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
+    __Pyx_GIVEREF(__pyx_t_3);
     __pyx_t_3 = 0;
-    __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L5;
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
 
-  /* "pygrib.pyx":1136
+  /* "pygrib.pyx":1128
  *         if err:
  *             raise RuntimeError(grib_get_error_message(err))
  *         elif typ == GRIB_TYPE_LONG:             # <<<<<<<<<<<<<<
@@ -12593,40 +13826,55 @@ static int __pyx_pf_6pygrib_11gribmessage_22__setitem__(struct __pyx_obj_6pygrib
   __pyx_t_1 = ((__pyx_v_typ == GRIB_TYPE_LONG) != 0);
   if (__pyx_t_1) {
 
-    /* "pygrib.pyx":1138
+    /* "pygrib.pyx":1130
  *         elif typ == GRIB_TYPE_LONG:
  *             # is value an array or a scalar?
  *             datarr = np.asarray(value, np.int)             # <<<<<<<<<<<<<<
  *             is_array = False
  *             if datarr.shape:
  */
-    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__asarray); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__int); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_6);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_7);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_4 = NULL;
+    __pyx_t_8 = 0;
+    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
+      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
+      if (likely(__pyx_t_4)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
+        __Pyx_INCREF(__pyx_t_4);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_6, function);
+        __pyx_t_8 = 1;
+      }
+    }
+    __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_9);
+    if (__pyx_t_4) {
+      PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
+    }
     __Pyx_INCREF(__pyx_v_value);
-    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_value);
+    PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_v_value);
     __Pyx_GIVEREF(__pyx_v_value);
-    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_6);
-    __Pyx_GIVEREF(__pyx_t_6);
-    __pyx_t_6 = 0;
-    __pyx_t_6 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-    if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_6pygrib_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_v_datarr = ((PyArrayObject *)__pyx_t_6);
-    __pyx_t_6 = 0;
+    PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_7);
+    __Pyx_GIVEREF(__pyx_t_7);
+    __pyx_t_7 = 0;
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6pygrib_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_v_datarr = ((PyArrayObject *)__pyx_t_3);
+    __pyx_t_3 = 0;
 
-    /* "pygrib.pyx":1139
+    /* "pygrib.pyx":1131
  *             # is value an array or a scalar?
  *             datarr = np.asarray(value, np.int)
  *             is_array = False             # <<<<<<<<<<<<<<
@@ -12635,20 +13883,20 @@ static int __pyx_pf_6pygrib_11gribmessage_22__setitem__(struct __pyx_obj_6pygrib
  */
     __pyx_v_is_array = 0;
 
-    /* "pygrib.pyx":1140
+    /* "pygrib.pyx":1132
  *             datarr = np.asarray(value, np.int)
  *             is_array = False
  *             if datarr.shape:             # <<<<<<<<<<<<<<
  *                 is_array = True
  *             if not is_array: # scalar
  */
-    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_datarr), __pyx_n_s__shape); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_datarr), __pyx_n_s_shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     if (__pyx_t_1) {
 
-      /* "pygrib.pyx":1141
+      /* "pygrib.pyx":1133
  *             is_array = False
  *             if datarr.shape:
  *                 is_array = True             # <<<<<<<<<<<<<<
@@ -12660,7 +13908,7 @@ static int __pyx_pf_6pygrib_11gribmessage_22__setitem__(struct __pyx_obj_6pygrib
     }
     __pyx_L6:;
 
-    /* "pygrib.pyx":1142
+    /* "pygrib.pyx":1134
  *             if datarr.shape:
  *                 is_array = True
  *             if not is_array: # scalar             # <<<<<<<<<<<<<<
@@ -12670,17 +13918,17 @@ static int __pyx_pf_6pygrib_11gribmessage_22__setitem__(struct __pyx_obj_6pygrib
     __pyx_t_1 = ((!(__pyx_v_is_array != 0)) != 0);
     if (__pyx_t_1) {
 
-      /* "pygrib.pyx":1143
+      /* "pygrib.pyx":1135
  *                 is_array = True
  *             if not is_array: # scalar
  *                 longval = value             # <<<<<<<<<<<<<<
  *                 err = grib_set_long(self._gh, name, longval)
  *                 if err:
  */
-      __pyx_t_7 = __Pyx_PyInt_AsLong(__pyx_v_value); if (unlikely((__pyx_t_7 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_v_longval = __pyx_t_7;
+      __pyx_t_10 = __Pyx_PyInt_As_long(__pyx_v_value); if (unlikely((__pyx_t_10 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_v_longval = __pyx_t_10;
 
-      /* "pygrib.pyx":1144
+      /* "pygrib.pyx":1136
  *             if not is_array: # scalar
  *                 longval = value
  *                 err = grib_set_long(self._gh, name, longval)             # <<<<<<<<<<<<<<
@@ -12689,7 +13937,7 @@ static int __pyx_pf_6pygrib_11gribmessage_22__setitem__(struct __pyx_obj_6pygrib
  */
       __pyx_v_err = grib_set_long(__pyx_v_self->_gh, __pyx_v_name, __pyx_v_longval);
 
-      /* "pygrib.pyx":1145
+      /* "pygrib.pyx":1137
  *                 longval = value
  *                 err = grib_set_long(self._gh, name, longval)
  *                 if err:             # <<<<<<<<<<<<<<
@@ -12699,71 +13947,83 @@ static int __pyx_pf_6pygrib_11gribmessage_22__setitem__(struct __pyx_obj_6pygrib
       __pyx_t_1 = (__pyx_v_err != 0);
       if (__pyx_t_1) {
 
-        /* "pygrib.pyx":1146
+        /* "pygrib.pyx":1138
  *                 err = grib_set_long(self._gh, name, longval)
  *                 if err:
  *                     raise RuntimeError(grib_get_error_message(err))             # <<<<<<<<<<<<<<
  *             else:
  *                 if key == 'values':
  */
-        __pyx_t_6 = __Pyx_PyBytes_FromString(grib_get_error_message(__pyx_v_err)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(((PyObject *)__pyx_t_6));
-        __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_t_3 = __Pyx_PyBytes_FromString(grib_get_error_message(__pyx_v_err)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         __Pyx_GOTREF(__pyx_t_3);
-        PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_6));
-        __Pyx_GIVEREF(((PyObject *)__pyx_t_6));
-        __pyx_t_6 = 0;
-        __pyx_t_6 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         __Pyx_GOTREF(__pyx_t_6);
-        __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-        __Pyx_Raise(__pyx_t_6, 0, 0, 0);
+        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3);
+        __Pyx_GIVEREF(__pyx_t_3);
+        __pyx_t_3 = 0;
+        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_3);
         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        goto __pyx_L8;
+        __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       }
-      __pyx_L8:;
       goto __pyx_L7;
     }
     /*else*/ {
 
-      /* "pygrib.pyx":1148
+      /* "pygrib.pyx":1140
  *                     raise RuntimeError(grib_get_error_message(err))
  *             else:
  *                 if key == 'values':             # <<<<<<<<<<<<<<
  *                     datarr = self._unshape_mask(datarr)
  *                 if not PyArray_ISCONTIGUOUS(datarr):
  */
-      __pyx_t_6 = PyObject_RichCompare(__pyx_v_key, ((PyObject *)__pyx_n_s__values), Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_key, __pyx_n_s_values, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       if (__pyx_t_1) {
 
-        /* "pygrib.pyx":1149
+        /* "pygrib.pyx":1141
  *             else:
  *                 if key == 'values':
  *                     datarr = self._unshape_mask(datarr)             # <<<<<<<<<<<<<<
  *                 if not PyArray_ISCONTIGUOUS(datarr):
  *                     datarr = datarr.copy()
  */
-        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s___unshape_mask); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_unshape_mask); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         __Pyx_GOTREF(__pyx_t_6);
-        __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_3);
-        __Pyx_INCREF(((PyObject *)__pyx_v_datarr));
-        PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_datarr));
-        __Pyx_GIVEREF(((PyObject *)__pyx_v_datarr));
-        __pyx_t_4 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_4);
+        __pyx_t_9 = NULL;
+        if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) {
+          __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
+          if (likely(__pyx_t_9)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
+            __Pyx_INCREF(__pyx_t_9);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_6, function);
+          }
+        }
+        if (!__pyx_t_9) {
+          __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_6, ((PyObject *)__pyx_v_datarr)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __Pyx_GOTREF(__pyx_t_3);
+        } else {
+          __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __Pyx_GOTREF(__pyx_t_7);
+          PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); __pyx_t_9 = NULL;
+          __Pyx_INCREF(((PyObject *)__pyx_v_datarr));
+          PyTuple_SET_ITEM(__pyx_t_7, 0+1, ((PyObject *)__pyx_v_datarr));
+          __Pyx_GIVEREF(((PyObject *)__pyx_v_datarr));
+          __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __Pyx_GOTREF(__pyx_t_3);
+          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+        }
         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-        __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-        if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_6pygrib_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF_SET(__pyx_v_datarr, ((PyArrayObject *)__pyx_t_4));
-        __pyx_t_4 = 0;
+        if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6pygrib_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_DECREF_SET(__pyx_v_datarr, ((PyArrayObject *)__pyx_t_3));
+        __pyx_t_3 = 0;
         goto __pyx_L9;
       }
       __pyx_L9:;
 
-      /* "pygrib.pyx":1150
+      /* "pygrib.pyx":1142
  *                 if key == 'values':
  *                     datarr = self._unshape_mask(datarr)
  *                 if not PyArray_ISCONTIGUOUS(datarr):             # <<<<<<<<<<<<<<
@@ -12773,39 +14033,54 @@ static int __pyx_pf_6pygrib_11gribmessage_22__setitem__(struct __pyx_obj_6pygrib
       __pyx_t_1 = ((!(PyArray_ISCONTIGUOUS(__pyx_v_datarr) != 0)) != 0);
       if (__pyx_t_1) {
 
-        /* "pygrib.pyx":1151
+        /* "pygrib.pyx":1143
  *                     datarr = self._unshape_mask(datarr)
  *                 if not PyArray_ISCONTIGUOUS(datarr):
  *                     datarr = datarr.copy()             # <<<<<<<<<<<<<<
  *                 size = datarr.size
  *                 err = grib_set_long_array(self._gh, name, <long *>datarr.data, size)
  */
-        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_datarr), __pyx_n_s__copy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_4);
-        __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_datarr), __pyx_n_s_copy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_6);
+        __pyx_t_7 = NULL;
+        if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) {
+          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
+          if (likely(__pyx_t_7)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
+            __Pyx_INCREF(__pyx_t_7);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_6, function);
+          }
+        }
+        if (__pyx_t_7) {
+          __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+        } else {
+          __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        }
         __Pyx_GOTREF(__pyx_t_3);
-        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-        if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6pygrib_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+        if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6pygrib_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         __Pyx_DECREF_SET(__pyx_v_datarr, ((PyArrayObject *)__pyx_t_3));
         __pyx_t_3 = 0;
         goto __pyx_L10;
       }
       __pyx_L10:;
 
-      /* "pygrib.pyx":1152
+      /* "pygrib.pyx":1144
  *                 if not PyArray_ISCONTIGUOUS(datarr):
  *                     datarr = datarr.copy()
  *                 size = datarr.size             # <<<<<<<<<<<<<<
  *                 err = grib_set_long_array(self._gh, name, <long *>datarr.data, size)
  *                 if err:
  */
-      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_datarr), __pyx_n_s__size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_datarr), __pyx_n_s_size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_8 = __Pyx_PyInt_AsSize_t(__pyx_t_3); if (unlikely((__pyx_t_8 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_11 = __Pyx_PyInt_As_size_t(__pyx_t_3); if (unlikely((__pyx_t_11 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_v_size = __pyx_t_8;
+      __pyx_v_size = __pyx_t_11;
 
-      /* "pygrib.pyx":1153
+      /* "pygrib.pyx":1145
  *                     datarr = datarr.copy()
  *                 size = datarr.size
  *                 err = grib_set_long_array(self._gh, name, <long *>datarr.data, size)             # <<<<<<<<<<<<<<
@@ -12814,7 +14089,7 @@ static int __pyx_pf_6pygrib_11gribmessage_22__setitem__(struct __pyx_obj_6pygrib
  */
       __pyx_v_err = grib_set_long_array(__pyx_v_self->_gh, __pyx_v_name, ((long *)__pyx_v_datarr->data), __pyx_v_size);
 
-      /* "pygrib.pyx":1154
+      /* "pygrib.pyx":1146
  *                 size = datarr.size
  *                 err = grib_set_long_array(self._gh, name, <long *>datarr.data, size)
  *                 if err:             # <<<<<<<<<<<<<<
@@ -12824,35 +14099,33 @@ static int __pyx_pf_6pygrib_11gribmessage_22__setitem__(struct __pyx_obj_6pygrib
       __pyx_t_1 = (__pyx_v_err != 0);
       if (__pyx_t_1) {
 
-        /* "pygrib.pyx":1155
+        /* "pygrib.pyx":1147
  *                 err = grib_set_long_array(self._gh, name, <long *>datarr.data, size)
  *                 if err:
  *                     raise RuntimeError(grib_get_error_message(err))             # <<<<<<<<<<<<<<
  *         elif typ == GRIB_TYPE_DOUBLE:
  *             # is value an array or a scalar?
  */
-        __pyx_t_3 = __Pyx_PyBytes_FromString(grib_get_error_message(__pyx_v_err)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(((PyObject *)__pyx_t_3));
-        __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_4);
-        PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_3));
-        __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
+        __pyx_t_3 = __Pyx_PyBytes_FromString(grib_get_error_message(__pyx_v_err)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_3);
+        __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_6);
+        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3);
+        __Pyx_GIVEREF(__pyx_t_3);
         __pyx_t_3 = 0;
-        __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         __Pyx_GOTREF(__pyx_t_3);
-        __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
+        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
         __Pyx_Raise(__pyx_t_3, 0, 0, 0);
         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        goto __pyx_L11;
+        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       }
-      __pyx_L11:;
     }
     __pyx_L7:;
     goto __pyx_L5;
   }
 
-  /* "pygrib.pyx":1156
+  /* "pygrib.pyx":1148
  *                 if err:
  *                     raise RuntimeError(grib_get_error_message(err))
  *         elif typ == GRIB_TYPE_DOUBLE:             # <<<<<<<<<<<<<<
@@ -12862,40 +14135,55 @@ static int __pyx_pf_6pygrib_11gribmessage_22__setitem__(struct __pyx_obj_6pygrib
   __pyx_t_1 = ((__pyx_v_typ == GRIB_TYPE_DOUBLE) != 0);
   if (__pyx_t_1) {
 
-    /* "pygrib.pyx":1158
+    /* "pygrib.pyx":1150
  *         elif typ == GRIB_TYPE_DOUBLE:
  *             # is value an array or a scalar?
  *             datarr = np.asarray(value, np.float)             # <<<<<<<<<<<<<<
  *             is_array = False
  *             if datarr.shape:
  */
-    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__asarray); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__float); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_6);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_asarray); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_7);
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_6);
+    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_float); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_9);
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __pyx_t_6 = NULL;
+    __pyx_t_8 = 0;
+    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
+      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
+      if (likely(__pyx_t_6)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
+        __Pyx_INCREF(__pyx_t_6);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_7, function);
+        __pyx_t_8 = 1;
+      }
+    }
+    __pyx_t_4 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    if (__pyx_t_6) {
+      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
+    }
     __Pyx_INCREF(__pyx_v_value);
-    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_value);
+    PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_8, __pyx_v_value);
     __Pyx_GIVEREF(__pyx_v_value);
-    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_6);
-    __Pyx_GIVEREF(__pyx_t_6);
-    __pyx_t_6 = 0;
-    __pyx_t_6 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
+    PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_8, __pyx_t_9);
+    __Pyx_GIVEREF(__pyx_t_9);
+    __pyx_t_9 = 0;
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-    if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_6pygrib_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_v_datarr = ((PyArrayObject *)__pyx_t_6);
-    __pyx_t_6 = 0;
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6pygrib_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_v_datarr = ((PyArrayObject *)__pyx_t_3);
+    __pyx_t_3 = 0;
 
-    /* "pygrib.pyx":1159
+    /* "pygrib.pyx":1151
  *             # is value an array or a scalar?
  *             datarr = np.asarray(value, np.float)
  *             is_array = False             # <<<<<<<<<<<<<<
@@ -12904,20 +14192,20 @@ static int __pyx_pf_6pygrib_11gribmessage_22__setitem__(struct __pyx_obj_6pygrib
  */
     __pyx_v_is_array = 0;
 
-    /* "pygrib.pyx":1160
+    /* "pygrib.pyx":1152
  *             datarr = np.asarray(value, np.float)
  *             is_array = False
  *             if datarr.shape:             # <<<<<<<<<<<<<<
  *                 is_array = True
  *             if not is_array: # scalar
  */
-    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_datarr), __pyx_n_s__shape); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_datarr), __pyx_n_s_shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     if (__pyx_t_1) {
 
-      /* "pygrib.pyx":1161
+      /* "pygrib.pyx":1153
  *             is_array = False
  *             if datarr.shape:
  *                 is_array = True             # <<<<<<<<<<<<<<
@@ -12929,7 +14217,7 @@ static int __pyx_pf_6pygrib_11gribmessage_22__setitem__(struct __pyx_obj_6pygrib
     }
     __pyx_L12:;
 
-    /* "pygrib.pyx":1162
+    /* "pygrib.pyx":1154
  *             if datarr.shape:
  *                 is_array = True
  *             if not is_array: # scalar             # <<<<<<<<<<<<<<
@@ -12939,17 +14227,17 @@ static int __pyx_pf_6pygrib_11gribmessage_22__setitem__(struct __pyx_obj_6pygrib
     __pyx_t_1 = ((!(__pyx_v_is_array != 0)) != 0);
     if (__pyx_t_1) {
 
-      /* "pygrib.pyx":1163
+      /* "pygrib.pyx":1155
  *                 is_array = True
  *             if not is_array: # scalar
  *                 doubleval = value             # <<<<<<<<<<<<<<
  *                 err = grib_set_double(self._gh, name, doubleval)
  *                 if err:
  */
-      __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_v_doubleval = __pyx_t_9;
+      __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_v_doubleval = __pyx_t_12;
 
-      /* "pygrib.pyx":1164
+      /* "pygrib.pyx":1156
  *             if not is_array: # scalar
  *                 doubleval = value
  *                 err = grib_set_double(self._gh, name, doubleval)             # <<<<<<<<<<<<<<
@@ -12958,7 +14246,7 @@ static int __pyx_pf_6pygrib_11gribmessage_22__setitem__(struct __pyx_obj_6pygrib
  */
       __pyx_v_err = grib_set_double(__pyx_v_self->_gh, __pyx_v_name, __pyx_v_doubleval);
 
-      /* "pygrib.pyx":1165
+      /* "pygrib.pyx":1157
  *                 doubleval = value
  *                 err = grib_set_double(self._gh, name, doubleval)
  *                 if err:             # <<<<<<<<<<<<<<
@@ -12968,71 +14256,83 @@ static int __pyx_pf_6pygrib_11gribmessage_22__setitem__(struct __pyx_obj_6pygrib
       __pyx_t_1 = (__pyx_v_err != 0);
       if (__pyx_t_1) {
 
-        /* "pygrib.pyx":1166
+        /* "pygrib.pyx":1158
  *                 err = grib_set_double(self._gh, name, doubleval)
  *                 if err:
  *                     raise RuntimeError(grib_get_error_message(err))             # <<<<<<<<<<<<<<
  *             else:
  *                 if key == 'values':
  */
-        __pyx_t_6 = __Pyx_PyBytes_FromString(grib_get_error_message(__pyx_v_err)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(((PyObject *)__pyx_t_6));
-        __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_t_3 = __Pyx_PyBytes_FromString(grib_get_error_message(__pyx_v_err)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         __Pyx_GOTREF(__pyx_t_3);
-        PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_6));
-        __Pyx_GIVEREF(((PyObject *)__pyx_t_6));
-        __pyx_t_6 = 0;
-        __pyx_t_6 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_6);
-        __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-        __Pyx_Raise(__pyx_t_6, 0, 0, 0);
-        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        goto __pyx_L14;
+        __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_7);
+        PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3);
+        __Pyx_GIVEREF(__pyx_t_3);
+        __pyx_t_3 = 0;
+        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_3);
+        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+        __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       }
-      __pyx_L14:;
       goto __pyx_L13;
     }
     /*else*/ {
 
-      /* "pygrib.pyx":1168
+      /* "pygrib.pyx":1160
  *                     raise RuntimeError(grib_get_error_message(err))
  *             else:
  *                 if key == 'values':             # <<<<<<<<<<<<<<
  *                     datarr = self._unshape_mask(datarr)
  *                 if not PyArray_ISCONTIGUOUS(datarr):
  */
-      __pyx_t_6 = PyObject_RichCompare(__pyx_v_key, ((PyObject *)__pyx_n_s__values), Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_key, __pyx_n_s_values, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       if (__pyx_t_1) {
 
-        /* "pygrib.pyx":1169
+        /* "pygrib.pyx":1161
  *             else:
  *                 if key == 'values':
  *                     datarr = self._unshape_mask(datarr)             # <<<<<<<<<<<<<<
  *                 if not PyArray_ISCONTIGUOUS(datarr):
  *                     datarr = datarr.copy()
  */
-        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s___unshape_mask); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_6);
-        __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_3);
-        __Pyx_INCREF(((PyObject *)__pyx_v_datarr));
-        PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_datarr));
-        __Pyx_GIVEREF(((PyObject *)__pyx_v_datarr));
-        __pyx_t_4 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_4);
-        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-        __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-        if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_6pygrib_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF_SET(__pyx_v_datarr, ((PyArrayObject *)__pyx_t_4));
-        __pyx_t_4 = 0;
+        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_unshape_mask); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_7);
+        __pyx_t_4 = NULL;
+        if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_7, function);
+          }
+        }
+        if (!__pyx_t_4) {
+          __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_7, ((PyObject *)__pyx_v_datarr)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __Pyx_GOTREF(__pyx_t_3);
+        } else {
+          __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __Pyx_GOTREF(__pyx_t_9);
+          PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
+          __Pyx_INCREF(((PyObject *)__pyx_v_datarr));
+          PyTuple_SET_ITEM(__pyx_t_9, 0+1, ((PyObject *)__pyx_v_datarr));
+          __Pyx_GIVEREF(((PyObject *)__pyx_v_datarr));
+          __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __Pyx_GOTREF(__pyx_t_3);
+          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+        }
+        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+        if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6pygrib_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_DECREF_SET(__pyx_v_datarr, ((PyArrayObject *)__pyx_t_3));
+        __pyx_t_3 = 0;
         goto __pyx_L15;
       }
       __pyx_L15:;
 
-      /* "pygrib.pyx":1170
+      /* "pygrib.pyx":1162
  *                 if key == 'values':
  *                     datarr = self._unshape_mask(datarr)
  *                 if not PyArray_ISCONTIGUOUS(datarr):             # <<<<<<<<<<<<<<
@@ -13042,39 +14342,54 @@ static int __pyx_pf_6pygrib_11gribmessage_22__setitem__(struct __pyx_obj_6pygrib
       __pyx_t_1 = ((!(PyArray_ISCONTIGUOUS(__pyx_v_datarr) != 0)) != 0);
       if (__pyx_t_1) {
 
-        /* "pygrib.pyx":1171
+        /* "pygrib.pyx":1163
  *                     datarr = self._unshape_mask(datarr)
  *                 if not PyArray_ISCONTIGUOUS(datarr):
  *                     datarr = datarr.copy()             # <<<<<<<<<<<<<<
  *                 size = datarr.size
  *                 err = grib_set_double_array(self._gh, name, <double *>datarr.data, size)
  */
-        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_datarr), __pyx_n_s__copy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_4);
-        __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_3);
-        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-        if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6pygrib_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF_SET(__pyx_v_datarr, ((PyArrayObject *)__pyx_t_3));
-        __pyx_t_3 = 0;
+        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_datarr), __pyx_n_s_copy); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_7);
+        __pyx_t_9 = NULL;
+        if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) {
+          __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_7);
+          if (likely(__pyx_t_9)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
+            __Pyx_INCREF(__pyx_t_9);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_7, function);
+          }
+        }
+        if (__pyx_t_9) {
+          __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_9); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+        } else {
+          __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        }
+        __Pyx_GOTREF(__pyx_t_3);
+        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+        if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6pygrib_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_DECREF_SET(__pyx_v_datarr, ((PyArrayObject *)__pyx_t_3));
+        __pyx_t_3 = 0;
         goto __pyx_L16;
       }
       __pyx_L16:;
 
-      /* "pygrib.pyx":1172
+      /* "pygrib.pyx":1164
  *                 if not PyArray_ISCONTIGUOUS(datarr):
  *                     datarr = datarr.copy()
  *                 size = datarr.size             # <<<<<<<<<<<<<<
  *                 err = grib_set_double_array(self._gh, name, <double *>datarr.data, size)
  *                 if err:
  */
-      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_datarr), __pyx_n_s__size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_datarr), __pyx_n_s_size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_8 = __Pyx_PyInt_AsSize_t(__pyx_t_3); if (unlikely((__pyx_t_8 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_11 = __Pyx_PyInt_As_size_t(__pyx_t_3); if (unlikely((__pyx_t_11 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_v_size = __pyx_t_8;
+      __pyx_v_size = __pyx_t_11;
 
-      /* "pygrib.pyx":1173
+      /* "pygrib.pyx":1165
  *                     datarr = datarr.copy()
  *                 size = datarr.size
  *                 err = grib_set_double_array(self._gh, name, <double *>datarr.data, size)             # <<<<<<<<<<<<<<
@@ -13083,7 +14398,7 @@ static int __pyx_pf_6pygrib_11gribmessage_22__setitem__(struct __pyx_obj_6pygrib
  */
       __pyx_v_err = grib_set_double_array(__pyx_v_self->_gh, __pyx_v_name, ((double *)__pyx_v_datarr->data), __pyx_v_size);
 
-      /* "pygrib.pyx":1174
+      /* "pygrib.pyx":1166
  *                 size = datarr.size
  *                 err = grib_set_double_array(self._gh, name, <double *>datarr.data, size)
  *                 if err:             # <<<<<<<<<<<<<<
@@ -13093,35 +14408,33 @@ static int __pyx_pf_6pygrib_11gribmessage_22__setitem__(struct __pyx_obj_6pygrib
       __pyx_t_1 = (__pyx_v_err != 0);
       if (__pyx_t_1) {
 
-        /* "pygrib.pyx":1175
+        /* "pygrib.pyx":1167
  *                 err = grib_set_double_array(self._gh, name, <double *>datarr.data, size)
  *                 if err:
  *                     raise RuntimeError(grib_get_error_message(err))             # <<<<<<<<<<<<<<
  *         elif typ == GRIB_TYPE_STRING:
  *             size=len(value)
  */
-        __pyx_t_3 = __Pyx_PyBytes_FromString(grib_get_error_message(__pyx_v_err)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(((PyObject *)__pyx_t_3));
-        __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_4);
-        PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_3));
-        __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
+        __pyx_t_3 = __Pyx_PyBytes_FromString(grib_get_error_message(__pyx_v_err)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_3);
+        __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_7);
+        PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3);
+        __Pyx_GIVEREF(__pyx_t_3);
         __pyx_t_3 = 0;
-        __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         __Pyx_GOTREF(__pyx_t_3);
-        __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
+        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
         __Pyx_Raise(__pyx_t_3, 0, 0, 0);
         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        goto __pyx_L17;
+        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       }
-      __pyx_L17:;
     }
     __pyx_L13:;
     goto __pyx_L5;
   }
 
-  /* "pygrib.pyx":1176
+  /* "pygrib.pyx":1168
  *                 if err:
  *                     raise RuntimeError(grib_get_error_message(err))
  *         elif typ == GRIB_TYPE_STRING:             # <<<<<<<<<<<<<<
@@ -13131,39 +14444,39 @@ static int __pyx_pf_6pygrib_11gribmessage_22__setitem__(struct __pyx_obj_6pygrib
   __pyx_t_1 = ((__pyx_v_typ == GRIB_TYPE_STRING) != 0);
   if (__pyx_t_1) {
 
-    /* "pygrib.pyx":1177
+    /* "pygrib.pyx":1169
  *                     raise RuntimeError(grib_get_error_message(err))
  *         elif typ == GRIB_TYPE_STRING:
  *             size=len(value)             # <<<<<<<<<<<<<<
  *             bytestr = _strencode(value)
  *             strdata = bytestr
  */
-    __pyx_t_10 = PyObject_Length(__pyx_v_value); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_v_size = __pyx_t_10;
+    __pyx_t_8 = PyObject_Length(__pyx_v_value); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_v_size = __pyx_t_8;
 
-    /* "pygrib.pyx":1178
+    /* "pygrib.pyx":1170
  *         elif typ == GRIB_TYPE_STRING:
  *             size=len(value)
  *             bytestr = _strencode(value)             # <<<<<<<<<<<<<<
  *             strdata = bytestr
  *             err = grib_set_string(self._gh, name, strdata, &size)
  */
-    __pyx_t_3 = __pyx_f_6pygrib__strencode(__pyx_v_value, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = __pyx_f_6pygrib__strencode(__pyx_v_value, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF_SET(__pyx_v_bytestr, __pyx_t_3);
     __pyx_t_3 = 0;
 
-    /* "pygrib.pyx":1179
+    /* "pygrib.pyx":1171
  *             size=len(value)
  *             bytestr = _strencode(value)
  *             strdata = bytestr             # <<<<<<<<<<<<<<
  *             err = grib_set_string(self._gh, name, strdata, &size)
  *             if err:
  */
-    __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_v_bytestr); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_v_bytestr); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __pyx_v_strdata = __pyx_t_5;
 
-    /* "pygrib.pyx":1180
+    /* "pygrib.pyx":1172
  *             bytestr = _strencode(value)
  *             strdata = bytestr
  *             err = grib_set_string(self._gh, name, strdata, &size)             # <<<<<<<<<<<<<<
@@ -13172,7 +14485,7 @@ static int __pyx_pf_6pygrib_11gribmessage_22__setitem__(struct __pyx_obj_6pygrib
  */
     __pyx_v_err = grib_set_string(__pyx_v_self->_gh, __pyx_v_name, __pyx_v_strdata, (&__pyx_v_size));
 
-    /* "pygrib.pyx":1181
+    /* "pygrib.pyx":1173
  *             strdata = bytestr
  *             err = grib_set_string(self._gh, name, strdata, &size)
  *             if err:             # <<<<<<<<<<<<<<
@@ -13182,65 +14495,74 @@ static int __pyx_pf_6pygrib_11gribmessage_22__setitem__(struct __pyx_obj_6pygrib
     __pyx_t_1 = (__pyx_v_err != 0);
     if (__pyx_t_1) {
 
-      /* "pygrib.pyx":1182
+      /* "pygrib.pyx":1174
  *             err = grib_set_string(self._gh, name, strdata, &size)
  *             if err:
  *                 raise RuntimeError(grib_get_error_message(err))             # <<<<<<<<<<<<<<
  *         else:
  *             raise ValueError("unrecognized grib type % d" % typ)
  */
-      __pyx_t_3 = __Pyx_PyBytes_FromString(grib_get_error_message(__pyx_v_err)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(((PyObject *)__pyx_t_3));
-      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_3));
-      __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
+      __pyx_t_3 = __Pyx_PyBytes_FromString(grib_get_error_message(__pyx_v_err)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_7);
+      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3);
+      __Pyx_GIVEREF(__pyx_t_3);
       __pyx_t_3 = 0;
-      __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_3);
-      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      goto __pyx_L18;
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     }
-    __pyx_L18:;
     goto __pyx_L5;
   }
   /*else*/ {
 
-    /* "pygrib.pyx":1184
+    /* "pygrib.pyx":1176
  *                 raise RuntimeError(grib_get_error_message(err))
  *         else:
  *             raise ValueError("unrecognized grib type % d" % typ)             # <<<<<<<<<<<<<<
  *     def __getitem__(self, key):
  *         """
  */
-    __pyx_t_3 = PyInt_FromLong(__pyx_v_typ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_typ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_106), __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
+    __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_unrecognized_grib_type_d, __pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_7);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
-    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_4));
-    __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
-    __pyx_t_4 = 0;
-    __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7);
+    __Pyx_GIVEREF(__pyx_t_7);
+    __pyx_t_7 = 0;
+    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_7);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_Raise(__pyx_t_7, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
   __pyx_L5:;
 
+  /* "pygrib.pyx":1107
+ *                 lonsubset = np.reshape(lonsubset,(nlats,nlons))
+ *         return datsubset,latsubset, lonsubset
+ *     def __setitem__(self, key, value):             # <<<<<<<<<<<<<<
+ *         """
+ *         change values associated with existing grib keys.
+ */
+
+  /* function exit code */
   __pyx_r = 0;
   goto __pyx_L0;
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_3);
   __Pyx_XDECREF(__pyx_t_4);
   __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_XDECREF(__pyx_t_9);
   __Pyx_AddTraceback("pygrib.gribmessage.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_r = -1;
   __pyx_L0:;
@@ -13250,6 +14572,14 @@ static int __pyx_pf_6pygrib_11gribmessage_22__setitem__(struct __pyx_obj_6pygrib
   return __pyx_r;
 }
 
+/* "pygrib.pyx":1177
+ *         else:
+ *             raise ValueError("unrecognized grib type % d" % typ)
+ *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
+ *         """
+ *         access values associated with grib keys.
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_6pygrib_11gribmessage_25__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
 static char __pyx_doc_6pygrib_11gribmessage_24__getitem__[] = "\n        access values associated with grib keys.\n        \n        The key \"values\" will return the data associated with the grib message.\n        The data is returned as a numpy array, or if missing values or a bitmap\n        are present, a numpy masked array.  Reduced lat/lon or gaussian grid\n        data is automatically expanded to a regular grid using linear\n        interpolation (nearest neighbor if an adjacent [...]
@@ -13261,18 +14591,12 @@ static PyObject *__pyx_pw_6pygrib_11gribmessage_25__getitem__(PyObject *__pyx_v_
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_11gribmessage_24__getitem__(((struct __pyx_obj_6pygrib_gribmessage *)__pyx_v_self), ((PyObject *)__pyx_v_key));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "pygrib.pyx":1185
- *         else:
- *             raise ValueError("unrecognized grib type % d" % typ)
- *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
- *         """
- *         access values associated with grib keys.
- */
-
 static PyObject *__pyx_pf_6pygrib_11gribmessage_24__getitem__(struct __pyx_obj_6pygrib_gribmessage *__pyx_v_self, PyObject *__pyx_v_key) {
   int __pyx_v_err;
   int __pyx_v_typ;
@@ -13291,95 +14615,99 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_24__getitem__(struct __pyx_obj_6
   __Pyx_RefNannyDeclarations
   PyObject *__pyx_t_1 = NULL;
   char *__pyx_t_2;
-  int __pyx_t_3;
-  PyObject *__pyx_t_4 = NULL;
+  PyObject *__pyx_t_3 = NULL;
+  int __pyx_t_4;
   PyObject *__pyx_t_5 = NULL;
   size_t __pyx_t_6;
   int __pyx_t_7;
-  int __pyx_t_8;
+  PyObject *__pyx_t_8 = NULL;
   PyObject *__pyx_t_9 = NULL;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("__getitem__", 0);
 
-  /* "pygrib.pyx":1202
+  /* "pygrib.pyx":1194
  *         cdef ndarray datarr
  *         cdef char strdata[1024]
  *         bytestr = _strencode(key)             # <<<<<<<<<<<<<<
  *         name = bytestr
  *         usenceplib = key == 'values' and self.packingType.startswith('grid_complex')
  */
-  __pyx_t_1 = __pyx_f_6pygrib__strencode(__pyx_v_key, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __pyx_f_6pygrib__strencode(__pyx_v_key, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_v_bytestr = __pyx_t_1;
   __pyx_t_1 = 0;
 
-  /* "pygrib.pyx":1203
+  /* "pygrib.pyx":1195
  *         cdef char strdata[1024]
  *         bytestr = _strencode(key)
  *         name = bytestr             # <<<<<<<<<<<<<<
  *         usenceplib = key == 'values' and self.packingType.startswith('grid_complex')
  *         # this workaround only needed for grib_api < 1.9.16.
  */
-  __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_v_bytestr); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_v_bytestr); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_v_name = __pyx_t_2;
 
-  /* "pygrib.pyx":1204
+  /* "pygrib.pyx":1196
  *         bytestr = _strencode(key)
  *         name = bytestr
  *         usenceplib = key == 'values' and self.packingType.startswith('grid_complex')             # <<<<<<<<<<<<<<
  *         # this workaround only needed for grib_api < 1.9.16.
  *         if usenceplib:
  */
-  __pyx_t_1 = PyObject_RichCompare(__pyx_v_key, ((PyObject *)__pyx_n_s__values), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__pyx_t_3) {
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__packingType); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__startswith); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_107), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __pyx_t_5 = __pyx_t_4;
-    __pyx_t_4 = 0;
+  __pyx_t_3 = PyObject_RichCompare(__pyx_v_key, __pyx_n_s_values, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (__pyx_t_4) {
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   } else {
-    __pyx_t_5 = __pyx_t_1;
-    __pyx_t_1 = 0;
+    __Pyx_INCREF(__pyx_t_3);
+    __pyx_t_1 = __pyx_t_3;
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    goto __pyx_L3_bool_binop_done;
   }
-  __pyx_v_usenceplib = __pyx_t_5;
-  __pyx_t_5 = 0;
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_packingType); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_startswith); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __Pyx_INCREF(__pyx_t_3);
+  __pyx_t_1 = __pyx_t_3;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_L3_bool_binop_done:;
+  __pyx_v_usenceplib = __pyx_t_1;
+  __pyx_t_1 = 0;
 
-  /* "pygrib.pyx":1206
+  /* "pygrib.pyx":1198
  *         usenceplib = key == 'values' and self.packingType.startswith('grid_complex')
  *         # this workaround only needed for grib_api < 1.9.16.
  *         if usenceplib:             # <<<<<<<<<<<<<<
  *             size = self.numberOfValues
  *         else:
  */
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_usenceplib); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__pyx_t_3) {
+  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_usenceplib); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (__pyx_t_4) {
 
-    /* "pygrib.pyx":1207
+    /* "pygrib.pyx":1199
  *         # this workaround only needed for grib_api < 1.9.16.
  *         if usenceplib:
  *             size = self.numberOfValues             # <<<<<<<<<<<<<<
  *         else:
  *             err = grib_get_size(self._gh, name, &size)
  */
-    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__numberOfValues); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_6 = __Pyx_PyInt_AsSize_t(__pyx_t_5); if (unlikely((__pyx_t_6 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_numberOfValues); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_6 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_6 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     __pyx_v_size = __pyx_t_6;
-    goto __pyx_L3;
+    goto __pyx_L5;
   }
   /*else*/ {
 
-    /* "pygrib.pyx":1209
+    /* "pygrib.pyx":1201
  *             size = self.numberOfValues
  *         else:
  *             err = grib_get_size(self._gh, name, &size)             # <<<<<<<<<<<<<<
@@ -13388,30 +14716,30 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_24__getitem__(struct __pyx_obj_6
  */
     __pyx_v_err = grib_get_size(__pyx_v_self->_gh, __pyx_v_name, (&__pyx_v_size));
 
-    /* "pygrib.pyx":1210
+    /* "pygrib.pyx":1202
  *         else:
  *             err = grib_get_size(self._gh, name, &size)
  *             if err:             # <<<<<<<<<<<<<<
  *                 if tolerate_badgrib:
  *                     return None
  */
-    __pyx_t_3 = (__pyx_v_err != 0);
-    if (__pyx_t_3) {
+    __pyx_t_4 = (__pyx_v_err != 0);
+    if (__pyx_t_4) {
 
-      /* "pygrib.pyx":1211
+      /* "pygrib.pyx":1203
  *             err = grib_get_size(self._gh, name, &size)
  *             if err:
  *                 if tolerate_badgrib:             # <<<<<<<<<<<<<<
  *                     return None
  *                 else:
  */
-      __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s__tolerate_badgrib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_3) {
+      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_tolerate_badgrib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_1);
+      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      if (__pyx_t_4) {
 
-        /* "pygrib.pyx":1212
+        /* "pygrib.pyx":1204
  *             if err:
  *                 if tolerate_badgrib:
  *                     return None             # <<<<<<<<<<<<<<
@@ -13422,49 +14750,45 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_24__getitem__(struct __pyx_obj_6
         __Pyx_INCREF(Py_None);
         __pyx_r = Py_None;
         goto __pyx_L0;
-        goto __pyx_L5;
       }
       /*else*/ {
 
-        /* "pygrib.pyx":1214
+        /* "pygrib.pyx":1206
  *                     return None
  *                 else:
  *                     raise RuntimeError(grib_get_error_message(err))             # <<<<<<<<<<<<<<
  *         # this workaround only needed for grib_api < 1.9.16.
  *         if usenceplib:
  */
-        __pyx_t_5 = __Pyx_PyBytes_FromString(grib_get_error_message(__pyx_v_err)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(((PyObject *)__pyx_t_5));
-        __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_t_1 = __Pyx_PyBytes_FromString(grib_get_error_message(__pyx_v_err)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         __Pyx_GOTREF(__pyx_t_1);
-        PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_5));
-        __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
-        __pyx_t_5 = 0;
-        __pyx_t_5 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_5);
-        __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
-        __Pyx_Raise(__pyx_t_5, 0, 0, 0);
-        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_3);
+        PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
+        __Pyx_GIVEREF(__pyx_t_1);
+        __pyx_t_1 = 0;
+        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_1);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       }
-      __pyx_L5:;
-      goto __pyx_L4;
     }
-    __pyx_L4:;
   }
-  __pyx_L3:;
+  __pyx_L5:;
 
-  /* "pygrib.pyx":1216
+  /* "pygrib.pyx":1208
  *                     raise RuntimeError(grib_get_error_message(err))
  *         # this workaround only needed for grib_api < 1.9.16.
  *         if usenceplib:             # <<<<<<<<<<<<<<
  *             typ = 2
  *             err = 0
  */
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_usenceplib); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__pyx_t_3) {
+  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_usenceplib); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (__pyx_t_4) {
 
-    /* "pygrib.pyx":1217
+    /* "pygrib.pyx":1209
  *         # this workaround only needed for grib_api < 1.9.16.
  *         if usenceplib:
  *             typ = 2             # <<<<<<<<<<<<<<
@@ -13473,7 +14797,7 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_24__getitem__(struct __pyx_obj_6
  */
     __pyx_v_typ = 2;
 
-    /* "pygrib.pyx":1218
+    /* "pygrib.pyx":1210
  *         if usenceplib:
  *             typ = 2
  *             err = 0             # <<<<<<<<<<<<<<
@@ -13481,11 +14805,11 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_24__getitem__(struct __pyx_obj_6
  *             err = grib_get_native_type(self._gh, name, &typ)
  */
     __pyx_v_err = 0;
-    goto __pyx_L6;
+    goto __pyx_L8;
   }
   /*else*/ {
 
-    /* "pygrib.pyx":1220
+    /* "pygrib.pyx":1212
  *             err = 0
  *         else:
  *             err = grib_get_native_type(self._gh, name, &typ)             # <<<<<<<<<<<<<<
@@ -13494,84 +14818,83 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_24__getitem__(struct __pyx_obj_6
  */
     __pyx_v_err = grib_get_native_type(__pyx_v_self->_gh, __pyx_v_name, (&__pyx_v_typ));
   }
-  __pyx_L6:;
+  __pyx_L8:;
 
-  /* "pygrib.pyx":1224
+  /* "pygrib.pyx":1216
  *         # which is a relic from earlier versions of grib_api in which
  *         # paramId was a string and not an integer)
  *         if key=='paramId' and typ == GRIB_TYPE_LONG: size=1             # <<<<<<<<<<<<<<
  *         if err:
  *             raise RuntimeError(grib_get_error_message(err))
  */
-  __pyx_t_5 = PyObject_RichCompare(__pyx_v_key, ((PyObject *)__pyx_n_s__paramId), Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  if (__pyx_t_3) {
-    __pyx_t_7 = (__pyx_v_typ == GRIB_TYPE_LONG);
-    __pyx_t_8 = __pyx_t_7;
+  __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_v_key, __pyx_n_s_paramId, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (__pyx_t_7) {
   } else {
-    __pyx_t_8 = __pyx_t_3;
+    __pyx_t_4 = __pyx_t_7;
+    goto __pyx_L10_bool_binop_done;
   }
-  if (__pyx_t_8) {
+  __pyx_t_7 = ((__pyx_v_typ == GRIB_TYPE_LONG) != 0);
+  __pyx_t_4 = __pyx_t_7;
+  __pyx_L10_bool_binop_done:;
+  if (__pyx_t_4) {
     __pyx_v_size = 1;
-    goto __pyx_L7;
+    goto __pyx_L9;
   }
-  __pyx_L7:;
+  __pyx_L9:;
 
-  /* "pygrib.pyx":1225
+  /* "pygrib.pyx":1217
  *         # paramId was a string and not an integer)
  *         if key=='paramId' and typ == GRIB_TYPE_LONG: size=1
  *         if err:             # <<<<<<<<<<<<<<
  *             raise RuntimeError(grib_get_error_message(err))
  *         elif typ == GRIB_TYPE_LONG:
  */
-  __pyx_t_8 = (__pyx_v_err != 0);
-  if (__pyx_t_8) {
+  __pyx_t_4 = (__pyx_v_err != 0);
+  if (__pyx_t_4) {
 
-    /* "pygrib.pyx":1226
+    /* "pygrib.pyx":1218
  *         if key=='paramId' and typ == GRIB_TYPE_LONG: size=1
  *         if err:
  *             raise RuntimeError(grib_get_error_message(err))             # <<<<<<<<<<<<<<
  *         elif typ == GRIB_TYPE_LONG:
  *             if size == 1: # scalar
  */
-    __pyx_t_5 = __Pyx_PyBytes_FromString(grib_get_error_message(__pyx_v_err)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
-    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = __Pyx_PyBytes_FromString(grib_get_error_message(__pyx_v_err)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_1);
-    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_5));
-    __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
-    __pyx_t_5 = 0;
-    __pyx_t_5 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
-    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L8;
+    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
+    __Pyx_GIVEREF(__pyx_t_1);
+    __pyx_t_1 = 0;
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
 
-  /* "pygrib.pyx":1227
+  /* "pygrib.pyx":1219
  *         if err:
  *             raise RuntimeError(grib_get_error_message(err))
  *         elif typ == GRIB_TYPE_LONG:             # <<<<<<<<<<<<<<
  *             if size == 1: # scalar
  *                 err = grib_get_long(self._gh, name, &longval)
  */
-  __pyx_t_8 = ((__pyx_v_typ == GRIB_TYPE_LONG) != 0);
-  if (__pyx_t_8) {
+  __pyx_t_4 = ((__pyx_v_typ == GRIB_TYPE_LONG) != 0);
+  if (__pyx_t_4) {
 
-    /* "pygrib.pyx":1228
+    /* "pygrib.pyx":1220
  *             raise RuntimeError(grib_get_error_message(err))
  *         elif typ == GRIB_TYPE_LONG:
  *             if size == 1: # scalar             # <<<<<<<<<<<<<<
  *                 err = grib_get_long(self._gh, name, &longval)
  *                 if err:
  */
-    __pyx_t_8 = ((__pyx_v_size == 1) != 0);
-    if (__pyx_t_8) {
+    __pyx_t_4 = ((__pyx_v_size == 1) != 0);
+    if (__pyx_t_4) {
 
-      /* "pygrib.pyx":1229
+      /* "pygrib.pyx":1221
  *         elif typ == GRIB_TYPE_LONG:
  *             if size == 1: # scalar
  *                 err = grib_get_long(self._gh, name, &longval)             # <<<<<<<<<<<<<<
@@ -13580,41 +14903,39 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_24__getitem__(struct __pyx_obj_6
  */
       __pyx_v_err = grib_get_long(__pyx_v_self->_gh, __pyx_v_name, (&__pyx_v_longval));
 
-      /* "pygrib.pyx":1230
+      /* "pygrib.pyx":1222
  *             if size == 1: # scalar
  *                 err = grib_get_long(self._gh, name, &longval)
  *                 if err:             # <<<<<<<<<<<<<<
  *                     raise RuntimeError(grib_get_error_message(err))
  *                 return longval
  */
-      __pyx_t_8 = (__pyx_v_err != 0);
-      if (__pyx_t_8) {
+      __pyx_t_4 = (__pyx_v_err != 0);
+      if (__pyx_t_4) {
 
-        /* "pygrib.pyx":1231
+        /* "pygrib.pyx":1223
  *                 err = grib_get_long(self._gh, name, &longval)
  *                 if err:
  *                     raise RuntimeError(grib_get_error_message(err))             # <<<<<<<<<<<<<<
  *                 return longval
  *             else: # array
  */
-        __pyx_t_5 = __Pyx_PyBytes_FromString(grib_get_error_message(__pyx_v_err)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(((PyObject *)__pyx_t_5));
-        __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_t_1 = __Pyx_PyBytes_FromString(grib_get_error_message(__pyx_v_err)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         __Pyx_GOTREF(__pyx_t_1);
-        PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_5));
-        __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
-        __pyx_t_5 = 0;
-        __pyx_t_5 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_5);
-        __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
-        __Pyx_Raise(__pyx_t_5, 0, 0, 0);
-        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        goto __pyx_L10;
+        __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_3);
+        PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
+        __Pyx_GIVEREF(__pyx_t_1);
+        __pyx_t_1 = 0;
+        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_1);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       }
-      __pyx_L10:;
 
-      /* "pygrib.pyx":1232
+      /* "pygrib.pyx":1224
  *                 if err:
  *                     raise RuntimeError(grib_get_error_message(err))
  *                 return longval             # <<<<<<<<<<<<<<
@@ -13622,113 +14943,114 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_24__getitem__(struct __pyx_obj_6
  *                 if self.has_key('jPointsAreConsecutive') and\
  */
       __Pyx_XDECREF(__pyx_r);
-      __pyx_t_5 = PyInt_FromLong(__pyx_v_longval); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_r = __pyx_t_5;
-      __pyx_t_5 = 0;
+      __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_longval); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_1);
+      __pyx_r = __pyx_t_1;
+      __pyx_t_1 = 0;
       goto __pyx_L0;
-      goto __pyx_L9;
     }
     /*else*/ {
 
-      /* "pygrib.pyx":1234
+      /* "pygrib.pyx":1226
  *                 return longval
  *             else: # array
  *                 if self.has_key('jPointsAreConsecutive') and\             # <<<<<<<<<<<<<<
  *                    self['jPointsAreConsecutive']:
  *                     storageorder='F'
  */
-      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__has_key); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_109), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_has_key); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_1);
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__56, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      if (__pyx_t_8) {
+      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      if (__pyx_t_7) {
+      } else {
+        __pyx_t_4 = __pyx_t_7;
+        goto __pyx_L16_bool_binop_done;
+      }
 
-        /* "pygrib.pyx":1235
+      /* "pygrib.pyx":1227
  *             else: # array
  *                 if self.has_key('jPointsAreConsecutive') and\
  *                    self['jPointsAreConsecutive']:             # <<<<<<<<<<<<<<
  *                     storageorder='F'
  *                 else:
  */
-        __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s_108)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_1);
-        __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-        __pyx_t_7 = __pyx_t_3;
-      } else {
-        __pyx_t_7 = __pyx_t_8;
-      }
-      if (__pyx_t_7) {
+      __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_jPointsAreConsecutive); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1227; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __pyx_t_4 = __pyx_t_7;
+      __pyx_L16_bool_binop_done:;
+      if (__pyx_t_4) {
 
-        /* "pygrib.pyx":1236
+        /* "pygrib.pyx":1228
  *                 if self.has_key('jPointsAreConsecutive') and\
  *                    self['jPointsAreConsecutive']:
  *                     storageorder='F'             # <<<<<<<<<<<<<<
  *                 else:
  *                     storageorder='C'
  */
-        __Pyx_INCREF(((PyObject *)__pyx_n_s__F));
-        __pyx_v_storageorder = ((PyObject *)__pyx_n_s__F);
-        goto __pyx_L11;
+        __Pyx_INCREF(__pyx_n_s_F);
+        __pyx_v_storageorder = __pyx_n_s_F;
+        goto __pyx_L15;
       }
       /*else*/ {
 
-        /* "pygrib.pyx":1238
+        /* "pygrib.pyx":1230
  *                     storageorder='F'
  *                 else:
  *                     storageorder='C'             # <<<<<<<<<<<<<<
  *                 datarr = np.zeros(size, np.int, order=storageorder)
  *                 err = grib_get_long_array(self._gh, name, <long *>datarr.data, &size)
  */
-        __Pyx_INCREF(((PyObject *)__pyx_n_s__C));
-        __pyx_v_storageorder = ((PyObject *)__pyx_n_s__C);
+        __Pyx_INCREF(__pyx_n_s_C);
+        __pyx_v_storageorder = __pyx_n_s_C;
       }
-      __pyx_L11:;
+      __pyx_L15:;
 
-      /* "pygrib.pyx":1239
+      /* "pygrib.pyx":1231
  *                 else:
  *                     storageorder='C'
  *                 datarr = np.zeros(size, np.int, order=storageorder)             # <<<<<<<<<<<<<<
  *                 err = grib_get_long_array(self._gh, name, <long *>datarr.data, &size)
  *                 if err:
  */
-      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__zeros); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_5);
+      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_8);
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_5);
+      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
+      __Pyx_GIVEREF(__pyx_t_3);
+      PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_8);
+      __Pyx_GIVEREF(__pyx_t_8);
+      __pyx_t_3 = 0;
+      __pyx_t_8 = 0;
+      __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_8);
+      if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_order, __pyx_v_storageorder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__int); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_9);
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
-      __Pyx_GIVEREF(__pyx_t_1);
-      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_9);
-      __Pyx_GIVEREF(__pyx_t_9);
-      __pyx_t_1 = 0;
-      __pyx_t_9 = 0;
-      __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(((PyObject *)__pyx_t_9));
-      if (PyDict_SetItem(__pyx_t_9, ((PyObject *)__pyx_n_s__order), __pyx_v_storageorder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_9)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-      __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
-      if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6pygrib_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_v_datarr = ((PyArrayObject *)__pyx_t_1);
-      __pyx_t_1 = 0;
+      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6pygrib_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_v_datarr = ((PyArrayObject *)__pyx_t_3);
+      __pyx_t_3 = 0;
 
-      /* "pygrib.pyx":1240
+      /* "pygrib.pyx":1232
  *                     storageorder='C'
  *                 datarr = np.zeros(size, np.int, order=storageorder)
  *                 err = grib_get_long_array(self._gh, name, <long *>datarr.data, &size)             # <<<<<<<<<<<<<<
@@ -13737,53 +15059,49 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_24__getitem__(struct __pyx_obj_6
  */
       __pyx_v_err = grib_get_long_array(__pyx_v_self->_gh, __pyx_v_name, ((long *)__pyx_v_datarr->data), (&__pyx_v_size));
 
-      /* "pygrib.pyx":1241
+      /* "pygrib.pyx":1233
  *                 datarr = np.zeros(size, np.int, order=storageorder)
  *                 err = grib_get_long_array(self._gh, name, <long *>datarr.data, &size)
  *                 if err:             # <<<<<<<<<<<<<<
  *                     raise RuntimeError(grib_get_error_message(err))
  *                 if key == 'values':
  */
-      __pyx_t_7 = (__pyx_v_err != 0);
-      if (__pyx_t_7) {
+      __pyx_t_4 = (__pyx_v_err != 0);
+      if (__pyx_t_4) {
 
-        /* "pygrib.pyx":1242
+        /* "pygrib.pyx":1234
  *                 err = grib_get_long_array(self._gh, name, <long *>datarr.data, &size)
  *                 if err:
  *                     raise RuntimeError(grib_get_error_message(err))             # <<<<<<<<<<<<<<
  *                 if key == 'values':
  *                     return self._reshape_mask(datarr)
  */
-        __pyx_t_1 = __Pyx_PyBytes_FromString(grib_get_error_message(__pyx_v_err)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(((PyObject *)__pyx_t_1));
-        __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_9);
-        PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_t_1));
-        __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
-        __pyx_t_1 = 0;
-        __pyx_t_1 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_1);
-        __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
-        __Pyx_Raise(__pyx_t_1, 0, 0, 0);
-        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        goto __pyx_L12;
+        __pyx_t_3 = __Pyx_PyBytes_FromString(grib_get_error_message(__pyx_v_err)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_3);
+        __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_8);
+        PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3);
+        __Pyx_GIVEREF(__pyx_t_3);
+        __pyx_t_3 = 0;
+        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_3);
+        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+        __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       }
-      __pyx_L12:;
 
-      /* "pygrib.pyx":1243
+      /* "pygrib.pyx":1235
  *                 if err:
  *                     raise RuntimeError(grib_get_error_message(err))
  *                 if key == 'values':             # <<<<<<<<<<<<<<
  *                     return self._reshape_mask(datarr)
  *                 else:
  */
-      __pyx_t_1 = PyObject_RichCompare(__pyx_v_key, ((PyObject *)__pyx_n_s__values), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      if (__pyx_t_7) {
+      __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_key, __pyx_n_s_values, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      if (__pyx_t_4) {
 
-        /* "pygrib.pyx":1244
+        /* "pygrib.pyx":1236
  *                     raise RuntimeError(grib_get_error_message(err))
  *                 if key == 'values':
  *                     return self._reshape_mask(datarr)             # <<<<<<<<<<<<<<
@@ -13791,25 +15109,40 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_24__getitem__(struct __pyx_obj_6
  *                     return datarr
  */
         __Pyx_XDECREF(__pyx_r);
-        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s___reshape_mask); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_1);
-        __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_9);
-        __Pyx_INCREF(((PyObject *)__pyx_v_datarr));
-        PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_v_datarr));
-        __Pyx_GIVEREF(((PyObject *)__pyx_v_datarr));
-        __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_4);
-        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-        __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
-        __pyx_r = __pyx_t_4;
-        __pyx_t_4 = 0;
-        goto __pyx_L0;
-        goto __pyx_L13;
-      }
-      /*else*/ {
+        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reshape_mask); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_8);
+        __pyx_t_5 = NULL;
+        if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_8))) {
+          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_8);
+          if (likely(__pyx_t_5)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
+            __Pyx_INCREF(__pyx_t_5);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_8, function);
+          }
+        }
+        if (!__pyx_t_5) {
+          __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_8, ((PyObject *)__pyx_v_datarr)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __Pyx_GOTREF(__pyx_t_3);
+        } else {
+          __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __Pyx_GOTREF(__pyx_t_1);
+          PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
+          __Pyx_INCREF(((PyObject *)__pyx_v_datarr));
+          PyTuple_SET_ITEM(__pyx_t_1, 0+1, ((PyObject *)__pyx_v_datarr));
+          __Pyx_GIVEREF(((PyObject *)__pyx_v_datarr));
+          __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __Pyx_GOTREF(__pyx_t_3);
+          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        }
+        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+        __pyx_r = __pyx_t_3;
+        __pyx_t_3 = 0;
+        goto __pyx_L0;
+      }
+      /*else*/ {
 
-        /* "pygrib.pyx":1246
+        /* "pygrib.pyx":1238
  *                     return self._reshape_mask(datarr)
  *                 else:
  *                     return datarr             # <<<<<<<<<<<<<<
@@ -13821,33 +15154,30 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_24__getitem__(struct __pyx_obj_6
         __pyx_r = ((PyObject *)__pyx_v_datarr);
         goto __pyx_L0;
       }
-      __pyx_L13:;
     }
-    __pyx_L9:;
-    goto __pyx_L8;
   }
 
-  /* "pygrib.pyx":1247
+  /* "pygrib.pyx":1239
  *                 else:
  *                     return datarr
  *         elif typ == GRIB_TYPE_DOUBLE:             # <<<<<<<<<<<<<<
  *             if size == 1: # scalar
  *                 err = grib_get_double(self._gh, name, &doubleval)
  */
-  __pyx_t_7 = ((__pyx_v_typ == GRIB_TYPE_DOUBLE) != 0);
-  if (__pyx_t_7) {
+  __pyx_t_4 = ((__pyx_v_typ == GRIB_TYPE_DOUBLE) != 0);
+  if (__pyx_t_4) {
 
-    /* "pygrib.pyx":1248
+    /* "pygrib.pyx":1240
  *                     return datarr
  *         elif typ == GRIB_TYPE_DOUBLE:
  *             if size == 1: # scalar             # <<<<<<<<<<<<<<
  *                 err = grib_get_double(self._gh, name, &doubleval)
  *                 if err:
  */
-    __pyx_t_7 = ((__pyx_v_size == 1) != 0);
-    if (__pyx_t_7) {
+    __pyx_t_4 = ((__pyx_v_size == 1) != 0);
+    if (__pyx_t_4) {
 
-      /* "pygrib.pyx":1249
+      /* "pygrib.pyx":1241
  *         elif typ == GRIB_TYPE_DOUBLE:
  *             if size == 1: # scalar
  *                 err = grib_get_double(self._gh, name, &doubleval)             # <<<<<<<<<<<<<<
@@ -13856,41 +15186,39 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_24__getitem__(struct __pyx_obj_6
  */
       __pyx_v_err = grib_get_double(__pyx_v_self->_gh, __pyx_v_name, (&__pyx_v_doubleval));
 
-      /* "pygrib.pyx":1250
+      /* "pygrib.pyx":1242
  *             if size == 1: # scalar
  *                 err = grib_get_double(self._gh, name, &doubleval)
  *                 if err:             # <<<<<<<<<<<<<<
  *                     raise RuntimeError(grib_get_error_message(err))
  *                 return doubleval
  */
-      __pyx_t_7 = (__pyx_v_err != 0);
-      if (__pyx_t_7) {
+      __pyx_t_4 = (__pyx_v_err != 0);
+      if (__pyx_t_4) {
 
-        /* "pygrib.pyx":1251
+        /* "pygrib.pyx":1243
  *                 err = grib_get_double(self._gh, name, &doubleval)
  *                 if err:
  *                     raise RuntimeError(grib_get_error_message(err))             # <<<<<<<<<<<<<<
  *                 return doubleval
  *             else: # array
  */
-        __pyx_t_4 = __Pyx_PyBytes_FromString(grib_get_error_message(__pyx_v_err)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(((PyObject *)__pyx_t_4));
-        __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_9);
-        PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_t_4));
-        __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
-        __pyx_t_4 = 0;
-        __pyx_t_4 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_4);
-        __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
-        __Pyx_Raise(__pyx_t_4, 0, 0, 0);
-        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        goto __pyx_L15;
+        __pyx_t_3 = __Pyx_PyBytes_FromString(grib_get_error_message(__pyx_v_err)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_3);
+        __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_8);
+        PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3);
+        __Pyx_GIVEREF(__pyx_t_3);
+        __pyx_t_3 = 0;
+        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_3);
+        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+        __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       }
-      __pyx_L15:;
 
-      /* "pygrib.pyx":1252
+      /* "pygrib.pyx":1244
  *                 if err:
  *                     raise RuntimeError(grib_get_error_message(err))
  *                 return doubleval             # <<<<<<<<<<<<<<
@@ -13898,117 +15226,130 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_24__getitem__(struct __pyx_obj_6
  *                 if self.has_key('jPointsAreConsecutive') and\
  */
       __Pyx_XDECREF(__pyx_r);
-      __pyx_t_4 = PyFloat_FromDouble(__pyx_v_doubleval); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __pyx_r = __pyx_t_4;
-      __pyx_t_4 = 0;
+      __pyx_t_3 = PyFloat_FromDouble(__pyx_v_doubleval); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_r = __pyx_t_3;
+      __pyx_t_3 = 0;
       goto __pyx_L0;
-      goto __pyx_L14;
     }
     /*else*/ {
 
-      /* "pygrib.pyx":1254
+      /* "pygrib.pyx":1246
  *                 return doubleval
  *             else: # array
  *                 if self.has_key('jPointsAreConsecutive') and\             # <<<<<<<<<<<<<<
  *                    self['jPointsAreConsecutive']:
  *                     storageorder='F'
  */
-      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__has_key); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __pyx_t_9 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_110), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_9);
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_has_key); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__57, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_8);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
       if (__pyx_t_7) {
+      } else {
+        __pyx_t_4 = __pyx_t_7;
+        goto __pyx_L23_bool_binop_done;
+      }
 
-        /* "pygrib.pyx":1255
+      /* "pygrib.pyx":1247
  *             else: # array
  *                 if self.has_key('jPointsAreConsecutive') and\
  *                    self['jPointsAreConsecutive']:             # <<<<<<<<<<<<<<
  *                     storageorder='F'
  *                 else:
  */
-        __pyx_t_9 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s_108)); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_9);
-        __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-        __pyx_t_3 = __pyx_t_8;
-      } else {
-        __pyx_t_3 = __pyx_t_7;
-      }
-      if (__pyx_t_3) {
+      __pyx_t_8 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_jPointsAreConsecutive); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1247; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+      __Pyx_GOTREF(__pyx_t_8);
+      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+      __pyx_t_4 = __pyx_t_7;
+      __pyx_L23_bool_binop_done:;
+      if (__pyx_t_4) {
 
-        /* "pygrib.pyx":1256
+        /* "pygrib.pyx":1248
  *                 if self.has_key('jPointsAreConsecutive') and\
  *                    self['jPointsAreConsecutive']:
  *                     storageorder='F'             # <<<<<<<<<<<<<<
  *                 else:
  *                     storageorder='C'
  */
-        __Pyx_INCREF(((PyObject *)__pyx_n_s__F));
-        __pyx_v_storageorder = ((PyObject *)__pyx_n_s__F);
-        goto __pyx_L16;
+        __Pyx_INCREF(__pyx_n_s_F);
+        __pyx_v_storageorder = __pyx_n_s_F;
+        goto __pyx_L22;
       }
       /*else*/ {
 
-        /* "pygrib.pyx":1258
+        /* "pygrib.pyx":1250
  *                     storageorder='F'
  *                 else:
  *                     storageorder='C'             # <<<<<<<<<<<<<<
  *                 if usenceplib:
  *                     # use ncep lib to decode data (workaround for grib_api
  */
-        __Pyx_INCREF(((PyObject *)__pyx_n_s__C));
-        __pyx_v_storageorder = ((PyObject *)__pyx_n_s__C);
+        __Pyx_INCREF(__pyx_n_s_C);
+        __pyx_v_storageorder = __pyx_n_s_C;
       }
-      __pyx_L16:;
+      __pyx_L22:;
 
-      /* "pygrib.pyx":1259
+      /* "pygrib.pyx":1251
  *                 else:
  *                     storageorder='C'
  *                 if usenceplib:             # <<<<<<<<<<<<<<
  *                     # use ncep lib to decode data (workaround for grib_api
  *                     # bug with second-order complex packing).
  */
-      __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_usenceplib); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      if (__pyx_t_3) {
+      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_usenceplib); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      if (__pyx_t_4) {
 
-        /* "pygrib.pyx":1262
+        /* "pygrib.pyx":1254
  *                     # use ncep lib to decode data (workaround for grib_api
  *                     # bug with second-order complex packing).
  *                     grb = Grib2Decode(self.tostring(), gribmsg=True)             # <<<<<<<<<<<<<<
  *                     return grb.data()
  *                 else:
  */
-        __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s__Grib2Decode); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_9);
-        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__tostring); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_4);
-        __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_Grib2Decode); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_8);
+        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_tostring); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         __Pyx_GOTREF(__pyx_t_1);
-        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-        __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_4);
-        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
-        __Pyx_GIVEREF(__pyx_t_1);
-        __pyx_t_1 = 0;
-        __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(((PyObject *)__pyx_t_1));
-        __pyx_t_5 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_5);
-        if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__gribmsg), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-        __pyx_t_5 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_t_5 = NULL;
+        if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
+          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
+          if (likely(__pyx_t_5)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
+            __Pyx_INCREF(__pyx_t_5);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_1, function);
+          }
+        }
+        if (__pyx_t_5) {
+          __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+        } else {
+          __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        }
+        __Pyx_GOTREF(__pyx_t_3);
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_1);
+        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
+        __Pyx_GIVEREF(__pyx_t_3);
+        __pyx_t_3 = 0;
+        __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_3);
+        if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_gribmsg, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         __Pyx_GOTREF(__pyx_t_5);
-        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-        __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-        __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
+        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
         __pyx_v_grb = __pyx_t_5;
         __pyx_t_5 = 0;
 
-        /* "pygrib.pyx":1263
+        /* "pygrib.pyx":1255
  *                     # bug with second-order complex packing).
  *                     grb = Grib2Decode(self.tostring(), gribmsg=True)
  *                     return grb.data()             # <<<<<<<<<<<<<<
@@ -14016,58 +15357,72 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_24__getitem__(struct __pyx_obj_6
  *                     datarr = np.zeros(size, np.double, order=storageorder)
  */
         __Pyx_XDECREF(__pyx_r);
-        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_grb, __pyx_n_s__data); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_grb, __pyx_n_s_data); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_3);
+        __pyx_t_1 = NULL;
+        if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_1)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_1);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        if (__pyx_t_1) {
+          __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        } else {
+          __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        }
         __Pyx_GOTREF(__pyx_t_5);
-        __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_1);
-        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-        __pyx_r = __pyx_t_1;
-        __pyx_t_1 = 0;
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_5;
+        __pyx_t_5 = 0;
         goto __pyx_L0;
-        goto __pyx_L17;
       }
       /*else*/ {
 
-        /* "pygrib.pyx":1265
+        /* "pygrib.pyx":1257
  *                     return grb.data()
  *                 else:
  *                     datarr = np.zeros(size, np.double, order=storageorder)             # <<<<<<<<<<<<<<
  *                     err = grib_get_double_array(self._gh, name, <double *>datarr.data, &size)
  *                     if err:
  */
-        __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_1);
-        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__zeros); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         __Pyx_GOTREF(__pyx_t_5);
-        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-        __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_3);
+        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+        __pyx_t_5 = __Pyx_PyInt_FromSize_t(__pyx_v_size); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_5);
+        __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         __Pyx_GOTREF(__pyx_t_1);
-        __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_4);
-        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__double); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_9);
-        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-        __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_4);
-        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
-        __Pyx_GIVEREF(__pyx_t_1);
-        PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_9);
-        __Pyx_GIVEREF(__pyx_t_9);
-        __pyx_t_1 = 0;
-        __pyx_t_9 = 0;
-        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(((PyObject *)__pyx_t_9));
-        if (PyDict_SetItem(__pyx_t_9, ((PyObject *)__pyx_n_s__order), __pyx_v_storageorder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_9)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_double); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_8);
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         __Pyx_GOTREF(__pyx_t_1);
-        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-        __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-        __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
-        if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6pygrib_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __pyx_v_datarr = ((PyArrayObject *)__pyx_t_1);
-        __pyx_t_1 = 0;
+        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5);
+        __Pyx_GIVEREF(__pyx_t_5);
+        PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_8);
+        __Pyx_GIVEREF(__pyx_t_8);
+        __pyx_t_5 = 0;
+        __pyx_t_8 = 0;
+        __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_8);
+        if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_order, __pyx_v_storageorder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_5);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+        if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_6pygrib_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_v_datarr = ((PyArrayObject *)__pyx_t_5);
+        __pyx_t_5 = 0;
 
-        /* "pygrib.pyx":1266
+        /* "pygrib.pyx":1258
  *                 else:
  *                     datarr = np.zeros(size, np.double, order=storageorder)
  *                     err = grib_get_double_array(self._gh, name, <double *>datarr.data, &size)             # <<<<<<<<<<<<<<
@@ -14076,53 +15431,49 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_24__getitem__(struct __pyx_obj_6
  */
         __pyx_v_err = grib_get_double_array(__pyx_v_self->_gh, __pyx_v_name, ((double *)__pyx_v_datarr->data), (&__pyx_v_size));
 
-        /* "pygrib.pyx":1267
+        /* "pygrib.pyx":1259
  *                     datarr = np.zeros(size, np.double, order=storageorder)
  *                     err = grib_get_double_array(self._gh, name, <double *>datarr.data, &size)
  *                     if err:             # <<<<<<<<<<<<<<
  *                         raise RuntimeError(grib_get_error_message(err))
  *                     if key == 'values':
  */
-        __pyx_t_3 = (__pyx_v_err != 0);
-        if (__pyx_t_3) {
+        __pyx_t_4 = (__pyx_v_err != 0);
+        if (__pyx_t_4) {
 
-          /* "pygrib.pyx":1268
+          /* "pygrib.pyx":1260
  *                     err = grib_get_double_array(self._gh, name, <double *>datarr.data, &size)
  *                     if err:
  *                         raise RuntimeError(grib_get_error_message(err))             # <<<<<<<<<<<<<<
  *                     if key == 'values':
  *                         return self._reshape_mask(datarr)
  */
-          __pyx_t_1 = __Pyx_PyBytes_FromString(grib_get_error_message(__pyx_v_err)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(((PyObject *)__pyx_t_1));
-          __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_9);
-          PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_t_1));
-          __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
-          __pyx_t_1 = 0;
-          __pyx_t_1 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_1);
-          __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
-          __Pyx_Raise(__pyx_t_1, 0, 0, 0);
-          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          goto __pyx_L18;
+          __pyx_t_5 = __Pyx_PyBytes_FromString(grib_get_error_message(__pyx_v_err)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __Pyx_GOTREF(__pyx_t_5);
+          __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __Pyx_GOTREF(__pyx_t_8);
+          PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5);
+          __Pyx_GIVEREF(__pyx_t_5);
+          __pyx_t_5 = 0;
+          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __Pyx_GOTREF(__pyx_t_5);
+          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+          __Pyx_Raise(__pyx_t_5, 0, 0, 0);
+          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         }
-        __pyx_L18:;
 
-        /* "pygrib.pyx":1269
+        /* "pygrib.pyx":1261
  *                     if err:
  *                         raise RuntimeError(grib_get_error_message(err))
  *                     if key == 'values':             # <<<<<<<<<<<<<<
  *                         return self._reshape_mask(datarr)
  *                     else:
  */
-        __pyx_t_1 = PyObject_RichCompare(__pyx_v_key, ((PyObject *)__pyx_n_s__values), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-        if (__pyx_t_3) {
+        __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_key, __pyx_n_s_values, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        if (__pyx_t_4) {
 
-          /* "pygrib.pyx":1270
+          /* "pygrib.pyx":1262
  *                         raise RuntimeError(grib_get_error_message(err))
  *                     if key == 'values':
  *                         return self._reshape_mask(datarr)             # <<<<<<<<<<<<<<
@@ -14130,25 +15481,40 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_24__getitem__(struct __pyx_obj_6
  *                         return datarr
  */
           __Pyx_XDECREF(__pyx_r);
-          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s___reshape_mask); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_1);
-          __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_9);
-          __Pyx_INCREF(((PyObject *)__pyx_v_datarr));
-          PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_v_datarr));
-          __Pyx_GIVEREF(((PyObject *)__pyx_v_datarr));
-          __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_4);
-          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-          __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
-          __pyx_r = __pyx_t_4;
-          __pyx_t_4 = 0;
+          __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reshape_mask); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __Pyx_GOTREF(__pyx_t_8);
+          __pyx_t_1 = NULL;
+          if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_8))) {
+            __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_8);
+            if (likely(__pyx_t_1)) {
+              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
+              __Pyx_INCREF(__pyx_t_1);
+              __Pyx_INCREF(function);
+              __Pyx_DECREF_SET(__pyx_t_8, function);
+            }
+          }
+          if (!__pyx_t_1) {
+            __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_8, ((PyObject *)__pyx_v_datarr)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+            __Pyx_GOTREF(__pyx_t_5);
+          } else {
+            __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+            __Pyx_GOTREF(__pyx_t_3);
+            PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = NULL;
+            __Pyx_INCREF(((PyObject *)__pyx_v_datarr));
+            PyTuple_SET_ITEM(__pyx_t_3, 0+1, ((PyObject *)__pyx_v_datarr));
+            __Pyx_GIVEREF(((PyObject *)__pyx_v_datarr));
+            __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+            __Pyx_GOTREF(__pyx_t_5);
+            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+          }
+          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+          __pyx_r = __pyx_t_5;
+          __pyx_t_5 = 0;
           goto __pyx_L0;
-          goto __pyx_L19;
         }
         /*else*/ {
 
-          /* "pygrib.pyx":1272
+          /* "pygrib.pyx":1264
  *                         return self._reshape_mask(datarr)
  *                     else:
  *                         return datarr             # <<<<<<<<<<<<<<
@@ -14160,25 +15526,21 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_24__getitem__(struct __pyx_obj_6
           __pyx_r = ((PyObject *)__pyx_v_datarr);
           goto __pyx_L0;
         }
-        __pyx_L19:;
       }
-      __pyx_L17:;
     }
-    __pyx_L14:;
-    goto __pyx_L8;
   }
 
-  /* "pygrib.pyx":1273
+  /* "pygrib.pyx":1265
  *                     else:
  *                         return datarr
  *         elif typ == GRIB_TYPE_STRING:             # <<<<<<<<<<<<<<
  *             size=1024 # grib_get_size returns 1 ?
  *             err = grib_get_string(self._gh, name, strdata, &size)
  */
-  __pyx_t_3 = ((__pyx_v_typ == GRIB_TYPE_STRING) != 0);
-  if (__pyx_t_3) {
+  __pyx_t_4 = ((__pyx_v_typ == GRIB_TYPE_STRING) != 0);
+  if (__pyx_t_4) {
 
-    /* "pygrib.pyx":1274
+    /* "pygrib.pyx":1266
  *                         return datarr
  *         elif typ == GRIB_TYPE_STRING:
  *             size=1024 # grib_get_size returns 1 ?             # <<<<<<<<<<<<<<
@@ -14187,7 +15549,7 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_24__getitem__(struct __pyx_obj_6
  */
     __pyx_v_size = 1024;
 
-    /* "pygrib.pyx":1275
+    /* "pygrib.pyx":1267
  *         elif typ == GRIB_TYPE_STRING:
  *             size=1024 # grib_get_size returns 1 ?
  *             err = grib_get_string(self._gh, name, strdata, &size)             # <<<<<<<<<<<<<<
@@ -14196,67 +15558,82 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_24__getitem__(struct __pyx_obj_6
  */
     __pyx_v_err = grib_get_string(__pyx_v_self->_gh, __pyx_v_name, __pyx_v_strdata, (&__pyx_v_size));
 
-    /* "pygrib.pyx":1276
+    /* "pygrib.pyx":1268
  *             size=1024 # grib_get_size returns 1 ?
  *             err = grib_get_string(self._gh, name, strdata, &size)
  *             if err:             # <<<<<<<<<<<<<<
  *                 raise RuntimeError(grib_get_error_message(err))
  *             msg = strdata.decode(default_encoding)
  */
-    __pyx_t_3 = (__pyx_v_err != 0);
-    if (__pyx_t_3) {
+    __pyx_t_4 = (__pyx_v_err != 0);
+    if (__pyx_t_4) {
 
-      /* "pygrib.pyx":1277
+      /* "pygrib.pyx":1269
  *             err = grib_get_string(self._gh, name, strdata, &size)
  *             if err:
  *                 raise RuntimeError(grib_get_error_message(err))             # <<<<<<<<<<<<<<
  *             msg = strdata.decode(default_encoding)
  *             return msg.rstrip()
  */
-      __pyx_t_4 = __Pyx_PyBytes_FromString(grib_get_error_message(__pyx_v_err)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(((PyObject *)__pyx_t_4));
-      __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_9);
-      PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_t_4));
-      __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
-      __pyx_t_4 = 0;
-      __pyx_t_4 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
-      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      goto __pyx_L20;
+      __pyx_t_5 = __Pyx_PyBytes_FromString(grib_get_error_message(__pyx_v_err)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_5);
+      __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_8);
+      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5);
+      __Pyx_GIVEREF(__pyx_t_5);
+      __pyx_t_5 = 0;
+      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_5);
+      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+      __Pyx_Raise(__pyx_t_5, 0, 0, 0);
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     }
-    __pyx_L20:;
 
-    /* "pygrib.pyx":1278
+    /* "pygrib.pyx":1270
  *             if err:
  *                 raise RuntimeError(grib_get_error_message(err))
  *             msg = strdata.decode(default_encoding)             # <<<<<<<<<<<<<<
  *             return msg.rstrip()
  *         else:
  */
-    __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_strdata); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
-    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_t_4), __pyx_n_s__decode); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_9);
-    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__default_encoding); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
-    __Pyx_GIVEREF(__pyx_t_4);
-    __pyx_t_4 = 0;
-    __pyx_t_4 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
-    __pyx_v_msg = __pyx_t_4;
-    __pyx_t_4 = 0;
+    __pyx_t_8 = __Pyx_PyBytes_FromString(__pyx_v_strdata); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_8);
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_decode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+    __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_default_encoding); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_8);
+    __pyx_t_1 = NULL;
+    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
+      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
+      if (likely(__pyx_t_1)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+        __Pyx_INCREF(__pyx_t_1);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_3, function);
+      }
+    }
+    if (!__pyx_t_1) {
+      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_8); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+      __Pyx_GOTREF(__pyx_t_5);
+    } else {
+      __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_9);
+      PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = NULL;
+      PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_8);
+      __Pyx_GIVEREF(__pyx_t_8);
+      __pyx_t_8 = 0;
+      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_5);
+      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+    }
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_v_msg = __pyx_t_5;
+    __pyx_t_5 = 0;
 
-    /* "pygrib.pyx":1279
+    /* "pygrib.pyx":1271
  *                 raise RuntimeError(grib_get_error_message(err))
  *             msg = strdata.decode(default_encoding)
  *             return msg.rstrip()             # <<<<<<<<<<<<<<
@@ -14264,50 +15641,71 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_24__getitem__(struct __pyx_obj_6
  *             raise ValueError("unrecognized grib type % d" % typ)
  */
     __Pyx_XDECREF(__pyx_r);
-    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_msg, __pyx_n_s__rstrip); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_r = __pyx_t_1;
-    __pyx_t_1 = 0;
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_msg, __pyx_n_s_rstrip); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_9 = NULL;
+    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
+      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3);
+      if (likely(__pyx_t_9)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+        __Pyx_INCREF(__pyx_t_9);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_3, function);
+      }
+    }
+    if (__pyx_t_9) {
+      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_9); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+    } else {
+      __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    }
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_r = __pyx_t_5;
+    __pyx_t_5 = 0;
     goto __pyx_L0;
-    goto __pyx_L8;
   }
   /*else*/ {
 
-    /* "pygrib.pyx":1281
+    /* "pygrib.pyx":1273
  *             return msg.rstrip()
  *         else:
  *             raise ValueError("unrecognized grib type % d" % typ)             # <<<<<<<<<<<<<<
  *     def has_key(self,key):
  *         """
  */
-    __pyx_t_1 = PyInt_FromLong(__pyx_v_typ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_106), __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_4));
-    __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
-    __pyx_t_4 = 0;
-    __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
-    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_typ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_unrecognized_grib_type_d, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
+    __Pyx_GIVEREF(__pyx_t_3);
+    __pyx_t_3 = 0;
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
-  __pyx_L8:;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "pygrib.pyx":1177
+ *         else:
+ *             raise ValueError("unrecognized grib type % d" % typ)
+ *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
+ *         """
+ *         access values associated with grib keys.
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_3);
   __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_8);
   __Pyx_XDECREF(__pyx_t_9);
   __Pyx_AddTraceback("pygrib.gribmessage.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_r = NULL;
@@ -14323,19 +15721,7 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_24__getitem__(struct __pyx_obj_6
   return __pyx_r;
 }
 
-/* Python wrapper */
-static PyObject *__pyx_pw_6pygrib_11gribmessage_27has_key(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
-static char __pyx_doc_6pygrib_11gribmessage_26has_key[] = "\n        has_key(key)\n\n        tests whether a grib message object has a specified key.\n        ";
-static PyObject *__pyx_pw_6pygrib_11gribmessage_27has_key(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("has_key (wrapper)", 0);
-  __pyx_r = __pyx_pf_6pygrib_11gribmessage_26has_key(((struct __pyx_obj_6pygrib_gribmessage *)__pyx_v_self), ((PyObject *)__pyx_v_key));
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pygrib.pyx":1282
+/* "pygrib.pyx":1274
  *         else:
  *             raise ValueError("unrecognized grib type % d" % typ)
  *     def has_key(self,key):             # <<<<<<<<<<<<<<
@@ -14343,6 +15729,20 @@ static PyObject *__pyx_pw_6pygrib_11gribmessage_27has_key(PyObject *__pyx_v_self
  *         has_key(key)
  */
 
+/* Python wrapper */
+static PyObject *__pyx_pw_6pygrib_11gribmessage_27has_key(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
+static char __pyx_doc_6pygrib_11gribmessage_26has_key[] = "\n        has_key(key)\n\n        tests whether a grib message object has a specified key.\n        ";
+static PyObject *__pyx_pw_6pygrib_11gribmessage_27has_key(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("has_key (wrapper)", 0);
+  __pyx_r = __pyx_pf_6pygrib_11gribmessage_26has_key(((struct __pyx_obj_6pygrib_gribmessage *)__pyx_v_self), ((PyObject *)__pyx_v_key));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 static PyObject *__pyx_pf_6pygrib_11gribmessage_26has_key(struct __pyx_obj_6pygrib_gribmessage *__pyx_v_self, PyObject *__pyx_v_key) {
   PyObject *__pyx_r = NULL;
   __Pyx_RefNannyDeclarations
@@ -14353,7 +15753,7 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_26has_key(struct __pyx_obj_6pygr
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("has_key", 0);
 
-  /* "pygrib.pyx":1288
+  /* "pygrib.pyx":1280
  *         tests whether a grib message object has a specified key.
  *         """
  *         return key in self._all_keys             # <<<<<<<<<<<<<<
@@ -14361,15 +15761,22 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_26has_key(struct __pyx_obj_6pygr
  *         """
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = (__Pyx_PySequence_Contains(__pyx_v_key, __pyx_v_self->_all_keys, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = (__Pyx_PySequence_Contains(__pyx_v_key, __pyx_v_self->_all_keys, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_r = __pyx_t_2;
   __pyx_t_2 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "pygrib.pyx":1274
+ *         else:
+ *             raise ValueError("unrecognized grib type % d" % typ)
+ *     def has_key(self,key):             # <<<<<<<<<<<<<<
+ *         """
+ *         has_key(key)
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_2);
   __Pyx_AddTraceback("pygrib.gribmessage.has_key", __pyx_clineno, __pyx_lineno, __pyx_filename);
@@ -14380,6 +15787,14 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_26has_key(struct __pyx_obj_6pygr
   return __pyx_r;
 }
 
+/* "pygrib.pyx":1281
+ *         """
+ *         return key in self._all_keys
+ *     def valid_key(self,key):             # <<<<<<<<<<<<<<
+ *         """
+ *         valid_key(key)
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_6pygrib_11gribmessage_29valid_key(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
 static char __pyx_doc_6pygrib_11gribmessage_28valid_key[] = "\n        valid_key(key)\n\n        tests whether a grib message object has a specified key,\n        it is not missing and it has a value that can be read.\n        ";
@@ -14388,96 +15803,105 @@ static PyObject *__pyx_pw_6pygrib_11gribmessage_29valid_key(PyObject *__pyx_v_se
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("valid_key (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_11gribmessage_28valid_key(((struct __pyx_obj_6pygrib_gribmessage *)__pyx_v_self), ((PyObject *)__pyx_v_key));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "pygrib.pyx":1289
- *         """
- *         return key in self._all_keys
- *     def valid_key(self,key):             # <<<<<<<<<<<<<<
- *         """
- *         valid_key(key)
- */
-
 static PyObject *__pyx_pf_6pygrib_11gribmessage_28valid_key(struct __pyx_obj_6pygrib_gribmessage *__pyx_v_self, PyObject *__pyx_v_key) {
   PyObject *__pyx_v_ret = NULL;
   PyObject *__pyx_r = NULL;
   __Pyx_RefNannyDeclarations
   int __pyx_t_1;
   PyObject *__pyx_t_2 = NULL;
-  PyObject *__pyx_t_3 = NULL;
+  int __pyx_t_3;
   PyObject *__pyx_t_4 = NULL;
-  int __pyx_t_5;
-  int __pyx_t_6;
+  PyObject *__pyx_t_5 = NULL;
+  PyObject *__pyx_t_6 = NULL;
   PyObject *__pyx_t_7 = NULL;
   PyObject *__pyx_t_8 = NULL;
   PyObject *__pyx_t_9 = NULL;
-  PyObject *__pyx_t_10 = NULL;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("valid_key", 0);
 
-  /* "pygrib.pyx":1296
+  /* "pygrib.pyx":1288
  *         it is not missing and it has a value that can be read.
  *         """
  *         ret =  key in self._all_keys             # <<<<<<<<<<<<<<
  *         # if key exists, but value is missing, return False.
  *         if ret and self.is_missing(key): ret = False
  */
-  __pyx_t_1 = (__Pyx_PySequence_Contains(__pyx_v_key, __pyx_v_self->_all_keys, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = (__Pyx_PySequence_Contains(__pyx_v_key, __pyx_v_self->_all_keys, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_v_ret = __pyx_t_2;
   __pyx_t_2 = 0;
 
-  /* "pygrib.pyx":1298
+  /* "pygrib.pyx":1290
  *         ret =  key in self._all_keys
  *         # if key exists, but value is missing, return False.
  *         if ret and self.is_missing(key): ret = False             # <<<<<<<<<<<<<<
  *         if ret:
  *             try:
  */
-  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_ret); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__pyx_t_1) {
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__is_missing); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_ret); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (__pyx_t_3) {
+  } else {
+    __pyx_t_1 = __pyx_t_3;
+    goto __pyx_L4_bool_binop_done;
+  }
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_missing); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_5 = NULL;
+  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
+    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
+    if (likely(__pyx_t_5)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+      __Pyx_INCREF(__pyx_t_5);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_4, function);
+    }
+  }
+  if (!__pyx_t_5) {
+    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_key); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
+  } else {
+    __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_6);
+    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
     __Pyx_INCREF(__pyx_v_key);
-    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_key);
+    PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_key);
     __Pyx_GIVEREF(__pyx_v_key);
-    __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_t_6 = __pyx_t_5;
-  } else {
-    __pyx_t_6 = __pyx_t_1;
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   }
-  if (__pyx_t_6) {
-    __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF_SET(__pyx_v_ret, __pyx_t_4);
-    __pyx_t_4 = 0;
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_1 = __pyx_t_3;
+  __pyx_L4_bool_binop_done:;
+  if (__pyx_t_1) {
+    __Pyx_INCREF(Py_False);
+    __Pyx_DECREF_SET(__pyx_v_ret, Py_False);
     goto __pyx_L3;
   }
   __pyx_L3:;
 
-  /* "pygrib.pyx":1299
+  /* "pygrib.pyx":1291
  *         # if key exists, but value is missing, return False.
  *         if ret and self.is_missing(key): ret = False
  *         if ret:             # <<<<<<<<<<<<<<
  *             try:
  *                 self[key]
  */
-  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_ret); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__pyx_t_6) {
+  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_ret); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (__pyx_t_1) {
 
-    /* "pygrib.pyx":1300
+    /* "pygrib.pyx":1292
  *         if ret and self.is_missing(key): ret = False
  *         if ret:
  *             try:             # <<<<<<<<<<<<<<
@@ -14491,27 +15915,28 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_28valid_key(struct __pyx_obj_6py
       __Pyx_XGOTREF(__pyx_t_9);
       /*try:*/ {
 
-        /* "pygrib.pyx":1301
+        /* "pygrib.pyx":1293
  *         if ret:
  *             try:
  *                 self[key]             # <<<<<<<<<<<<<<
  *             except:
  *                 ret = False
  */
-        __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_key); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1301; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
-        __Pyx_GOTREF(__pyx_t_4);
-        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+        __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_key); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1293; __pyx_clineno = __LINE__; goto __pyx_L7_error;};
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
       }
       __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
       __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
       __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
-      goto __pyx_L12_try_end;
-      __pyx_L5_error:;
-      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      goto __pyx_L14_try_end;
+      __pyx_L7_error:;
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
       __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-      /* "pygrib.pyx":1302
+      /* "pygrib.pyx":1294
  *             try:
  *                 self[key]
  *             except:             # <<<<<<<<<<<<<<
@@ -14520,45 +15945,43 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_28valid_key(struct __pyx_obj_6py
  */
       /*except:*/ {
         __Pyx_AddTraceback("pygrib.gribmessage.valid_key", __pyx_clineno, __pyx_lineno, __pyx_filename);
-        if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_3, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1302; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
-        __Pyx_GOTREF(__pyx_t_4);
-        __Pyx_GOTREF(__pyx_t_3);
+        if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_4, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1294; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
         __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_GOTREF(__pyx_t_4);
+        __Pyx_GOTREF(__pyx_t_6);
 
-        /* "pygrib.pyx":1303
+        /* "pygrib.pyx":1295
  *                 self[key]
  *             except:
  *                 ret = False             # <<<<<<<<<<<<<<
  *         return ret
  *     def tostring(self):
  */
-        __pyx_t_10 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1303; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
-        __Pyx_GOTREF(__pyx_t_10);
-        __Pyx_DECREF_SET(__pyx_v_ret, __pyx_t_10);
-        __pyx_t_10 = 0;
-        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __Pyx_INCREF(Py_False);
+        __Pyx_DECREF_SET(__pyx_v_ret, Py_False);
         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-        goto __pyx_L6_exception_handled;
+        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+        goto __pyx_L8_exception_handled;
       }
-      __pyx_L7_except_error:;
+      __pyx_L9_except_error:;
       __Pyx_XGIVEREF(__pyx_t_7);
       __Pyx_XGIVEREF(__pyx_t_8);
       __Pyx_XGIVEREF(__pyx_t_9);
       __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
       goto __pyx_L1_error;
-      __pyx_L6_exception_handled:;
+      __pyx_L8_exception_handled:;
       __Pyx_XGIVEREF(__pyx_t_7);
       __Pyx_XGIVEREF(__pyx_t_8);
       __Pyx_XGIVEREF(__pyx_t_9);
       __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
-      __pyx_L12_try_end:;
+      __pyx_L14_try_end:;
     }
-    goto __pyx_L4;
+    goto __pyx_L6;
   }
-  __pyx_L4:;
+  __pyx_L6:;
 
-  /* "pygrib.pyx":1304
+  /* "pygrib.pyx":1296
  *             except:
  *                 ret = False
  *         return ret             # <<<<<<<<<<<<<<
@@ -14570,13 +15993,20 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_28valid_key(struct __pyx_obj_6py
   __pyx_r = __pyx_v_ret;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "pygrib.pyx":1281
+ *         """
+ *         return key in self._all_keys
+ *     def valid_key(self,key):             # <<<<<<<<<<<<<<
+ *         """
+ *         valid_key(key)
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
   __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_XDECREF(__pyx_t_10);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
   __Pyx_AddTraceback("pygrib.gribmessage.valid_key", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_r = NULL;
   __pyx_L0:;
@@ -14586,6 +16016,14 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_28valid_key(struct __pyx_obj_6py
   return __pyx_r;
 }
 
+/* "pygrib.pyx":1297
+ *                 ret = False
+ *         return ret
+ *     def tostring(self):             # <<<<<<<<<<<<<<
+ *         """
+ *         tostring()
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_6pygrib_11gribmessage_31tostring(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
 static char __pyx_doc_6pygrib_11gribmessage_30tostring[] = "\n        tostring()\n\n        return coded grib message in a binary string.\n        ";
@@ -14594,18 +16032,12 @@ static PyObject *__pyx_pw_6pygrib_11gribmessage_31tostring(PyObject *__pyx_v_sel
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("tostring (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_11gribmessage_30tostring(((struct __pyx_obj_6pygrib_gribmessage *)__pyx_v_self));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "pygrib.pyx":1305
- *                 ret = False
- *         return ret
- *     def tostring(self):             # <<<<<<<<<<<<<<
- *         """
- *         tostring()
- */
-
 static PyObject *__pyx_pf_6pygrib_11gribmessage_30tostring(struct __pyx_obj_6pygrib_gribmessage *__pyx_v_self) {
   int __pyx_v_err;
   size_t __pyx_v_size;
@@ -14626,71 +16058,71 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_30tostring(struct __pyx_obj_6pyg
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("tostring", 0);
 
-  /* "pygrib.pyx":1316
+  /* "pygrib.pyx":1308
  *         cdef char *name
  *         cdef FILE *out
  *         bytestr = b'values'             # <<<<<<<<<<<<<<
  *         name = bytestr
  *         usenceplib = self.packingType.startswith('grid_complex')
  */
-  __Pyx_INCREF(((PyObject *)__pyx_n_b__values));
-  __pyx_v_bytestr = __pyx_n_b__values;
+  __Pyx_INCREF(__pyx_n_b_values);
+  __pyx_v_bytestr = __pyx_n_b_values;
 
-  /* "pygrib.pyx":1317
+  /* "pygrib.pyx":1309
  *         cdef FILE *out
  *         bytestr = b'values'
  *         name = bytestr             # <<<<<<<<<<<<<<
  *         usenceplib = self.packingType.startswith('grid_complex')
  *         # this workaround only needed for grib_api < 1.9.16.
  */
-  __pyx_t_1 = __Pyx_PyObject_AsString(((PyObject *)__pyx_v_bytestr)); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_PyObject_AsString(__pyx_v_bytestr); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_v_name = __pyx_t_1;
 
-  /* "pygrib.pyx":1318
+  /* "pygrib.pyx":1310
  *         bytestr = b'values'
  *         name = bytestr
  *         usenceplib = self.packingType.startswith('grid_complex')             # <<<<<<<<<<<<<<
  *         # this workaround only needed for grib_api < 1.9.16.
  *         if usenceplib:
  */
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__packingType); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_packingType); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__startswith); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_startswith); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_111), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__58, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   __pyx_v_usenceplib = __pyx_t_2;
   __pyx_t_2 = 0;
 
-  /* "pygrib.pyx":1320
+  /* "pygrib.pyx":1312
  *         usenceplib = self.packingType.startswith('grid_complex')
  *         # this workaround only needed for grib_api < 1.9.16.
  *         if usenceplib:             # <<<<<<<<<<<<<<
  *             size = self.numberOfValues
  *         else:
  */
-  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_usenceplib); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_usenceplib); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   if (__pyx_t_4) {
 
-    /* "pygrib.pyx":1321
+    /* "pygrib.pyx":1313
  *         # this workaround only needed for grib_api < 1.9.16.
  *         if usenceplib:
  *             size = self.numberOfValues             # <<<<<<<<<<<<<<
  *         else:
  *             err = grib_get_size(self._gh, name, &size)
  */
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__numberOfValues); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_numberOfValues); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_5 = __Pyx_PyInt_AsSize_t(__pyx_t_2); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_5 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     __pyx_v_size = __pyx_t_5;
     goto __pyx_L3;
   }
   /*else*/ {
 
-    /* "pygrib.pyx":1323
+    /* "pygrib.pyx":1315
  *             size = self.numberOfValues
  *         else:
  *             err = grib_get_size(self._gh, name, &size)             # <<<<<<<<<<<<<<
@@ -14699,7 +16131,7 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_30tostring(struct __pyx_obj_6pyg
  */
     __pyx_v_err = grib_get_size(__pyx_v_self->_gh, __pyx_v_name, (&__pyx_v_size));
 
-    /* "pygrib.pyx":1324
+    /* "pygrib.pyx":1316
  *         else:
  *             err = grib_get_size(self._gh, name, &size)
  *             if err:             # <<<<<<<<<<<<<<
@@ -14709,33 +16141,31 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_30tostring(struct __pyx_obj_6pyg
     __pyx_t_4 = (__pyx_v_err != 0);
     if (__pyx_t_4) {
 
-      /* "pygrib.pyx":1325
+      /* "pygrib.pyx":1317
  *             err = grib_get_size(self._gh, name, &size)
  *             if err:
  *                 raise RuntimeError(grib_get_error_message(err))             # <<<<<<<<<<<<<<
  *         err = grib_get_message(self._gh, &message, &size)
  *         if err:
  */
-      __pyx_t_2 = __Pyx_PyBytes_FromString(grib_get_error_message(__pyx_v_err)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
-      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_2 = __Pyx_PyBytes_FromString(grib_get_error_message(__pyx_v_err)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_3);
-      PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_2));
-      __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
+      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
+      __Pyx_GIVEREF(__pyx_t_2);
       __pyx_t_2 = 0;
-      __pyx_t_2 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_2);
-      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
       __Pyx_Raise(__pyx_t_2, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      goto __pyx_L4;
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     }
-    __pyx_L4:;
   }
   __pyx_L3:;
 
-  /* "pygrib.pyx":1326
+  /* "pygrib.pyx":1318
  *             if err:
  *                 raise RuntimeError(grib_get_error_message(err))
  *         err = grib_get_message(self._gh, &message, &size)             # <<<<<<<<<<<<<<
@@ -14744,7 +16174,7 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_30tostring(struct __pyx_obj_6pyg
  */
   __pyx_v_err = grib_get_message(__pyx_v_self->_gh, (&__pyx_v_message), (&__pyx_v_size));
 
-  /* "pygrib.pyx":1327
+  /* "pygrib.pyx":1319
  *                 raise RuntimeError(grib_get_error_message(err))
  *         err = grib_get_message(self._gh, &message, &size)
  *         if err:             # <<<<<<<<<<<<<<
@@ -14754,43 +16184,41 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_30tostring(struct __pyx_obj_6pyg
   __pyx_t_4 = (__pyx_v_err != 0);
   if (__pyx_t_4) {
 
-    /* "pygrib.pyx":1328
+    /* "pygrib.pyx":1320
  *         err = grib_get_message(self._gh, &message, &size)
  *         if err:
  *             raise RuntimeError(grib_get_error_message(err))             # <<<<<<<<<<<<<<
  *         msg = PyBytes_FromStringAndSize(<char *>message, size)
  *         return msg
  */
-    __pyx_t_2 = __Pyx_PyBytes_FromString(grib_get_error_message(__pyx_v_err)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
-    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = __Pyx_PyBytes_FromString(grib_get_error_message(__pyx_v_err)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
-    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_2));
-    __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
+    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
+    __Pyx_GIVEREF(__pyx_t_2);
     __pyx_t_2 = 0;
-    __pyx_t_2 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L5;
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
-  __pyx_L5:;
 
-  /* "pygrib.pyx":1329
+  /* "pygrib.pyx":1321
  *         if err:
  *             raise RuntimeError(grib_get_error_message(err))
  *         msg = PyBytes_FromStringAndSize(<char *>message, size)             # <<<<<<<<<<<<<<
  *         return msg
  *     def _unshape_mask(self, datarr):
  */
-  __pyx_t_2 = PyBytes_FromStringAndSize(((char *)__pyx_v_message), __pyx_v_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyBytes_FromStringAndSize(((char *)__pyx_v_message), __pyx_v_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_v_msg = __pyx_t_2;
   __pyx_t_2 = 0;
 
-  /* "pygrib.pyx":1330
+  /* "pygrib.pyx":1322
  *             raise RuntimeError(grib_get_error_message(err))
  *         msg = PyBytes_FromStringAndSize(<char *>message, size)
  *         return msg             # <<<<<<<<<<<<<<
@@ -14802,8 +16230,15 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_30tostring(struct __pyx_obj_6pyg
   __pyx_r = __pyx_v_msg;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "pygrib.pyx":1297
+ *                 ret = False
+ *         return ret
+ *     def tostring(self):             # <<<<<<<<<<<<<<
+ *         """
+ *         tostring()
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_2);
   __Pyx_XDECREF(__pyx_t_3);
@@ -14818,6 +16253,14 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_30tostring(struct __pyx_obj_6pyg
   return __pyx_r;
 }
 
+/* "pygrib.pyx":1323
+ *         msg = PyBytes_FromStringAndSize(<char *>message, size)
+ *         return msg
+ *     def _unshape_mask(self, datarr):             # <<<<<<<<<<<<<<
+ *         """private method for reshaping and removing mask from "values" array"""
+ *         if datarr.ndim > 2:
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_6pygrib_11gribmessage_33_unshape_mask(PyObject *__pyx_v_self, PyObject *__pyx_v_datarr); /*proto*/
 static char __pyx_doc_6pygrib_11gribmessage_32_unshape_mask[] = "private method for reshaping and removing mask from \"values\" array";
@@ -14826,18 +16269,12 @@ static PyObject *__pyx_pw_6pygrib_11gribmessage_33_unshape_mask(PyObject *__pyx_
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("_unshape_mask (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_11gribmessage_32_unshape_mask(((struct __pyx_obj_6pygrib_gribmessage *)__pyx_v_self), ((PyObject *)__pyx_v_datarr));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "pygrib.pyx":1331
- *         msg = PyBytes_FromStringAndSize(<char *>message, size)
- *         return msg
- *     def _unshape_mask(self, datarr):             # <<<<<<<<<<<<<<
- *         """private method for reshaping and removing mask from "values" array"""
- *         if datarr.ndim > 2:
- */
-
 static PyObject *__pyx_pf_6pygrib_11gribmessage_32_unshape_mask(struct __pyx_obj_6pygrib_gribmessage *__pyx_v_self, PyObject *__pyx_v_datarr) {
   PyObject *__pyx_v_datsave = NULL;
   PyObject *__pyx_r = NULL;
@@ -14846,78 +16283,108 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_32_unshape_mask(struct __pyx_obj
   PyObject *__pyx_t_2 = NULL;
   int __pyx_t_3;
   PyObject *__pyx_t_4 = NULL;
+  PyObject *__pyx_t_5 = NULL;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("_unshape_mask", 0);
   __Pyx_INCREF(__pyx_v_datarr);
 
-  /* "pygrib.pyx":1333
+  /* "pygrib.pyx":1325
  *     def _unshape_mask(self, datarr):
  *         """private method for reshaping and removing mask from "values" array"""
  *         if datarr.ndim > 2:             # <<<<<<<<<<<<<<
  *             raise ValueError('array must be 1d or 2d')
  *         # if array is masked, put in masked values and convert to plain numpy array.
  */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_datarr, __pyx_n_s__ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_datarr, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_2, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_2, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   if (__pyx_t_3) {
 
-    /* "pygrib.pyx":1334
+    /* "pygrib.pyx":1326
  *         """private method for reshaping and removing mask from "values" array"""
  *         if datarr.ndim > 2:
  *             raise ValueError('array must be 1d or 2d')             # <<<<<<<<<<<<<<
  *         # if array is masked, put in masked values and convert to plain numpy array.
  *         if ma.isMA(datarr):
  */
-    __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_113), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__59, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L3;
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
-  __pyx_L3:;
 
-  /* "pygrib.pyx":1336
+  /* "pygrib.pyx":1328
  *             raise ValueError('array must be 1d or 2d')
  *         # if array is masked, put in masked values and convert to plain numpy array.
  *         if ma.isMA(datarr):             # <<<<<<<<<<<<<<
  *             datarr = datarr.filled()
  *         # raise error is expanded reduced grid array is supplied.
  */
-  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__ma); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__isMA); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_ma); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_INCREF(__pyx_v_datarr);
-  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_datarr);
-  __Pyx_GIVEREF(__pyx_v_datarr);
-  __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_isMA); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = NULL;
+  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
+    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
+    if (likely(__pyx_t_1)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+      __Pyx_INCREF(__pyx_t_1);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_4, function);
+    }
+  }
+  if (!__pyx_t_1) {
+    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_datarr); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+  } else {
+    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = NULL;
+    __Pyx_INCREF(__pyx_v_datarr);
+    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_datarr);
+    __Pyx_GIVEREF(__pyx_v_datarr);
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  }
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   if (__pyx_t_3) {
 
-    /* "pygrib.pyx":1337
+    /* "pygrib.pyx":1329
  *         # if array is masked, put in masked values and convert to plain numpy array.
  *         if ma.isMA(datarr):
  *             datarr = datarr.filled()             # <<<<<<<<<<<<<<
  *         # raise error is expanded reduced grid array is supplied.
  *         if self['gridType'].startswith('reduced'):
  */
-    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_datarr, __pyx_n_s__filled); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_datarr, __pyx_n_s_filled); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_5 = NULL;
+    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
+      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
+      if (likely(__pyx_t_5)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+        __Pyx_INCREF(__pyx_t_5);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_4, function);
+      }
+    }
+    if (__pyx_t_5) {
+      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    } else {
+      __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    }
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_DECREF_SET(__pyx_v_datarr, __pyx_t_2);
@@ -14926,113 +16393,126 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_32_unshape_mask(struct __pyx_obj
   }
   __pyx_L4:;
 
-  /* "pygrib.pyx":1339
+  /* "pygrib.pyx":1331
  *             datarr = datarr.filled()
  *         # raise error is expanded reduced grid array is supplied.
  *         if self['gridType'].startswith('reduced'):             # <<<<<<<<<<<<<<
  *             if datarr.ndim != 1:
  *                 raise ValueError("reduced grid data array must be 1d")
  */
-  __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__gridType)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_gridType); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1331; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__startswith); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_startswith); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_114), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__60, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   if (__pyx_t_3) {
 
-    /* "pygrib.pyx":1340
+    /* "pygrib.pyx":1332
  *         # raise error is expanded reduced grid array is supplied.
  *         if self['gridType'].startswith('reduced'):
  *             if datarr.ndim != 1:             # <<<<<<<<<<<<<<
  *                 raise ValueError("reduced grid data array must be 1d")
  *         if datarr.ndim == 2:
  */
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_datarr, __pyx_n_s__ndim); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_datarr, __pyx_n_s_ndim); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_int_1, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_int_1, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     if (__pyx_t_3) {
 
-      /* "pygrib.pyx":1341
+      /* "pygrib.pyx":1333
  *         if self['gridType'].startswith('reduced'):
  *             if datarr.ndim != 1:
  *                 raise ValueError("reduced grid data array must be 1d")             # <<<<<<<<<<<<<<
  *         if datarr.ndim == 2:
  *             # check scan modes for rect grids.
  */
-      __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_116), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__61, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_4);
       __Pyx_Raise(__pyx_t_4, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      goto __pyx_L6;
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     }
-    __pyx_L6:;
     goto __pyx_L5;
   }
   __pyx_L5:;
 
-  /* "pygrib.pyx":1342
+  /* "pygrib.pyx":1334
  *             if datarr.ndim != 1:
  *                 raise ValueError("reduced grid data array must be 1d")
  *         if datarr.ndim == 2:             # <<<<<<<<<<<<<<
  *             # check scan modes for rect grids.
  *             # columns scan in the -y direction (so flip)
  */
-  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_datarr, __pyx_n_s__ndim); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_datarr, __pyx_n_s_ndim); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_2 = PyObject_RichCompare(__pyx_t_4, __pyx_int_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyObject_RichCompare(__pyx_t_4, __pyx_int_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   if (__pyx_t_3) {
 
-    /* "pygrib.pyx":1354
+    /* "pygrib.pyx":1346
  *             # adjacent rows scan in opposite direction.
  *             # (flip every other row)
  *             if self['alternativeRowScanning']:             # <<<<<<<<<<<<<<
  *                 datsave = datarr.copy()
  *                 datarr[1::2,::-1] = datsave[1::2,:]
  */
-    __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s_117)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_alternativeRowScanning); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1346; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     if (__pyx_t_3) {
 
-      /* "pygrib.pyx":1355
+      /* "pygrib.pyx":1347
  *             # (flip every other row)
  *             if self['alternativeRowScanning']:
  *                 datsave = datarr.copy()             # <<<<<<<<<<<<<<
  *                 datarr[1::2,::-1] = datsave[1::2,:]
  *         return datarr
  */
-      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_datarr, __pyx_n_s__copy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_datarr, __pyx_n_s_copy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_4);
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __pyx_v_datsave = __pyx_t_4;
-      __pyx_t_4 = 0;
+      __pyx_t_5 = NULL;
+      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
+        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
+        if (likely(__pyx_t_5)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+          __Pyx_INCREF(__pyx_t_5);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_4, function);
+        }
+      }
+      if (__pyx_t_5) {
+        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      } else {
+        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      }
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_v_datsave = __pyx_t_2;
+      __pyx_t_2 = 0;
 
-      /* "pygrib.pyx":1356
+      /* "pygrib.pyx":1348
  *             if self['alternativeRowScanning']:
  *                 datsave = datarr.copy()
  *                 datarr[1::2,::-1] = datsave[1::2,:]             # <<<<<<<<<<<<<<
  *         return datarr
  *     def _reshape_mask(self, datarr):
  */
-      __pyx_t_4 = PyObject_GetItem(__pyx_v_datsave, ((PyObject *)__pyx_k_tuple_120)); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      if (PyObject_SetItem(__pyx_v_datarr, ((PyObject *)__pyx_k_tuple_123), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_2 = PyObject_GetItem(__pyx_v_datsave, __pyx_tuple__64); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1348; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+      __Pyx_GOTREF(__pyx_t_2);
+      if (unlikely(PyObject_SetItem(__pyx_v_datarr, __pyx_tuple__67, __pyx_t_2) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
       goto __pyx_L8;
     }
     __pyx_L8:;
@@ -15040,7 +16520,7 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_32_unshape_mask(struct __pyx_obj
   }
   __pyx_L7:;
 
-  /* "pygrib.pyx":1357
+  /* "pygrib.pyx":1349
  *                 datsave = datarr.copy()
  *                 datarr[1::2,::-1] = datsave[1::2,:]
  *         return datarr             # <<<<<<<<<<<<<<
@@ -15052,12 +16532,20 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_32_unshape_mask(struct __pyx_obj
   __pyx_r = __pyx_v_datarr;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "pygrib.pyx":1323
+ *         msg = PyBytes_FromStringAndSize(<char *>message, size)
+ *         return msg
+ *     def _unshape_mask(self, datarr):             # <<<<<<<<<<<<<<
+ *         """private method for reshaping and removing mask from "values" array"""
+ *         if datarr.ndim > 2:
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_XDECREF(__pyx_t_2);
   __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
   __Pyx_AddTraceback("pygrib.gribmessage._unshape_mask", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_r = NULL;
   __pyx_L0:;
@@ -15068,6 +16556,14 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_32_unshape_mask(struct __pyx_obj
   return __pyx_r;
 }
 
+/* "pygrib.pyx":1350
+ *                 datarr[1::2,::-1] = datsave[1::2,:]
+ *         return datarr
+ *     def _reshape_mask(self, datarr):             # <<<<<<<<<<<<<<
+ *         """private method for reshaping and adding mask to "values" array"""
+ *         cdef double missval
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_6pygrib_11gribmessage_35_reshape_mask(PyObject *__pyx_v_self, PyObject *__pyx_v_datarr); /*proto*/
 static char __pyx_doc_6pygrib_11gribmessage_34_reshape_mask[] = "private method for reshaping and adding mask to \"values\" array";
@@ -15076,18 +16572,12 @@ static PyObject *__pyx_pw_6pygrib_11gribmessage_35_reshape_mask(PyObject *__pyx_
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("_reshape_mask (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_11gribmessage_34_reshape_mask(((struct __pyx_obj_6pygrib_gribmessage *)__pyx_v_self), ((PyObject *)__pyx_v_datarr));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "pygrib.pyx":1358
- *                 datarr[1::2,::-1] = datsave[1::2,:]
- *         return datarr
- *     def _reshape_mask(self, datarr):             # <<<<<<<<<<<<<<
- *         """private method for reshaping and adding mask to "values" array"""
- *         cdef double missval
- */
-
 static PyObject *__pyx_pf_6pygrib_11gribmessage_34_reshape_mask(struct __pyx_obj_6pygrib_gribmessage *__pyx_v_self, PyObject *__pyx_v_datarr) {
   double __pyx_v_missval;
   PyObject *__pyx_v__redtoreg = NULL;
@@ -15105,88 +16595,88 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_34_reshape_mask(struct __pyx_obj
   PyObject *__pyx_t_7 = NULL;
   PyObject *__pyx_t_8 = NULL;
   double __pyx_t_9;
-  int __pyx_t_10;
-  int __pyx_t_11;
-  int __pyx_t_12;
+  PyObject *__pyx_t_10 = NULL;
+  PyObject *__pyx_t_11 = NULL;
+  Py_ssize_t __pyx_t_12;
+  PyObject *__pyx_t_13 = NULL;
+  int __pyx_t_14;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("_reshape_mask", 0);
   __Pyx_INCREF(__pyx_v_datarr);
 
-  /* "pygrib.pyx":1361
+  /* "pygrib.pyx":1353
  *         """private method for reshaping and adding mask to "values" array"""
  *         cdef double missval
  *         from redtoreg import _redtoreg             # <<<<<<<<<<<<<<
  *         if datarr.ndim > 2:
  *             raise ValueError('array must be 1d or 2d')
  */
-  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_INCREF(((PyObject *)__pyx_n_s___redtoreg));
-  PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s___redtoreg));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s___redtoreg));
-  __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s__redtoreg), ((PyObject *)__pyx_t_1), -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_INCREF(__pyx_n_s_redtoreg_2);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_redtoreg_2);
+  __Pyx_GIVEREF(__pyx_n_s_redtoreg_2);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_redtoreg, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
-  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s___redtoreg); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_redtoreg_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_INCREF(__pyx_t_1);
   __pyx_v__redtoreg = __pyx_t_1;
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pygrib.pyx":1362
+  /* "pygrib.pyx":1354
  *         cdef double missval
  *         from redtoreg import _redtoreg
  *         if datarr.ndim > 2:             # <<<<<<<<<<<<<<
  *             raise ValueError('array must be 1d or 2d')
  *         # reduced grid.
  */
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_datarr, __pyx_n_s__ndim); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_datarr, __pyx_n_s_ndim); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_int_2, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_int_2, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (__pyx_t_3) {
 
-    /* "pygrib.pyx":1363
+    /* "pygrib.pyx":1355
  *         from redtoreg import _redtoreg
  *         if datarr.ndim > 2:
  *             raise ValueError('array must be 1d or 2d')             # <<<<<<<<<<<<<<
  *         # reduced grid.
  *         if self['gridType'].startswith('reduced'):
  */
-    __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_124), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__68, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_Raise(__pyx_t_1, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L3;
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
-  __pyx_L3:;
 
-  /* "pygrib.pyx":1365
+  /* "pygrib.pyx":1357
  *             raise ValueError('array must be 1d or 2d')
  *         # reduced grid.
  *         if self['gridType'].startswith('reduced'):             # <<<<<<<<<<<<<<
  *             try:
  *                 ny = self['Ny']
  */
-  __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__gridType)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_gridType); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1357; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__startswith); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_startswith); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_125), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__69, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (__pyx_t_3) {
 
-    /* "pygrib.pyx":1366
+    /* "pygrib.pyx":1358
  *         # reduced grid.
  *         if self['gridType'].startswith('reduced'):
  *             try:             # <<<<<<<<<<<<<<
@@ -15200,14 +16690,14 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_34_reshape_mask(struct __pyx_obj
       __Pyx_XGOTREF(__pyx_t_6);
       /*try:*/ {
 
-        /* "pygrib.pyx":1367
+        /* "pygrib.pyx":1359
  *         if self['gridType'].startswith('reduced'):
  *             try:
  *                 ny = self['Ny']             # <<<<<<<<<<<<<<
  *             except:
  *                 ny = self['Nj']
  */
-        __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__Ny)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1367; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
+        __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_Ny); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1359; __pyx_clineno = __LINE__; goto __pyx_L5_error;};
         __Pyx_GOTREF(__pyx_t_1);
         __pyx_v_ny = __pyx_t_1;
         __pyx_t_1 = 0;
@@ -15220,7 +16710,7 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_34_reshape_mask(struct __pyx_obj
       __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
       __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-      /* "pygrib.pyx":1368
+      /* "pygrib.pyx":1360
  *             try:
  *                 ny = self['Ny']
  *             except:             # <<<<<<<<<<<<<<
@@ -15229,19 +16719,19 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_34_reshape_mask(struct __pyx_obj
  */
       /*except:*/ {
         __Pyx_AddTraceback("pygrib.gribmessage._reshape_mask", __pyx_clineno, __pyx_lineno, __pyx_filename);
-        if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1368; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
+        if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1360; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
         __Pyx_GOTREF(__pyx_t_1);
         __Pyx_GOTREF(__pyx_t_2);
         __Pyx_GOTREF(__pyx_t_7);
 
-        /* "pygrib.pyx":1369
+        /* "pygrib.pyx":1361
  *                 ny = self['Ny']
  *             except:
  *                 ny = self['Nj']             # <<<<<<<<<<<<<<
  *             if self.has_key('missingValue'):
  *                 missval = self['missingValue']
  */
-        __pyx_t_8 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__Nj)); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1369; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
+        __pyx_t_8 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_Nj); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1361; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;};
         __Pyx_GOTREF(__pyx_t_8);
         __Pyx_XDECREF_SET(__pyx_v_ny, __pyx_t_8);
         __pyx_t_8 = 0;
@@ -15264,39 +16754,39 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_34_reshape_mask(struct __pyx_obj
       __pyx_L12_try_end:;
     }
 
-    /* "pygrib.pyx":1370
+    /* "pygrib.pyx":1362
  *             except:
  *                 ny = self['Nj']
  *             if self.has_key('missingValue'):             # <<<<<<<<<<<<<<
  *                 missval = self['missingValue']
  *             else:
  */
-    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__has_key); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_has_key); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_7);
-    __pyx_t_2 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_k_tuple_126), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__70, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     if (__pyx_t_3) {
 
-      /* "pygrib.pyx":1371
+      /* "pygrib.pyx":1363
  *                 ny = self['Nj']
  *             if self.has_key('missingValue'):
  *                 missval = self['missingValue']             # <<<<<<<<<<<<<<
  *             else:
  *                 missval = 1.e30
  */
-      __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__missingValue)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_missingValue); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1363; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
       __Pyx_GOTREF(__pyx_t_2);
-      __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
       __pyx_v_missval = __pyx_t_9;
       goto __pyx_L15;
     }
     /*else*/ {
 
-      /* "pygrib.pyx":1373
+      /* "pygrib.pyx":1365
  *                 missval = self['missingValue']
  *             else:
  *                 missval = 1.e30             # <<<<<<<<<<<<<<
@@ -15307,65 +16797,82 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_34_reshape_mask(struct __pyx_obj
     }
     __pyx_L15:;
 
-    /* "pygrib.pyx":1374
+    /* "pygrib.pyx":1366
  *             else:
  *                 missval = 1.e30
  *             if self.expand_reduced:             # <<<<<<<<<<<<<<
  *                 nx = 2*ny
  *                 datarr = _redtoreg(2*ny, self['pl'], datarr, missval)
  */
-    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_self->expand_reduced); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_self->expand_reduced); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     if (__pyx_t_3) {
 
-      /* "pygrib.pyx":1375
+      /* "pygrib.pyx":1367
  *                 missval = 1.e30
  *             if self.expand_reduced:
  *                 nx = 2*ny             # <<<<<<<<<<<<<<
  *                 datarr = _redtoreg(2*ny, self['pl'], datarr, missval)
  *             else:
  */
-      __pyx_t_2 = PyNumber_Multiply(__pyx_int_2, __pyx_v_ny); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_2 = PyNumber_Multiply(__pyx_int_2, __pyx_v_ny); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_2);
       __pyx_v_nx = __pyx_t_2;
       __pyx_t_2 = 0;
 
-      /* "pygrib.pyx":1376
+      /* "pygrib.pyx":1368
  *             if self.expand_reduced:
  *                 nx = 2*ny
  *                 datarr = _redtoreg(2*ny, self['pl'], datarr, missval)             # <<<<<<<<<<<<<<
  *             else:
  *                 nx = None
  */
-      __pyx_t_2 = PyNumber_Multiply(__pyx_int_2, __pyx_v_ny); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__pl)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_7 = PyNumber_Multiply(__pyx_int_2, __pyx_v_ny); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_7);
-      __pyx_t_1 = PyFloat_FromDouble(__pyx_v_missval); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_pl); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1368; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
       __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_8 = PyTuple_New(4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_8 = PyFloat_FromDouble(__pyx_v_missval); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_8);
-      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2);
-      __Pyx_GIVEREF(__pyx_t_2);
-      PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7);
+      __Pyx_INCREF(__pyx_v__redtoreg);
+      __pyx_t_10 = __pyx_v__redtoreg; __pyx_t_11 = NULL;
+      __pyx_t_12 = 0;
+      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_10))) {
+        __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10);
+        if (likely(__pyx_t_11)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
+          __Pyx_INCREF(__pyx_t_11);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_10, function);
+          __pyx_t_12 = 1;
+        }
+      }
+      __pyx_t_13 = PyTuple_New(4+__pyx_t_12); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_13);
+      if (__pyx_t_11) {
+        PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __Pyx_GIVEREF(__pyx_t_11); __pyx_t_11 = NULL;
+      }
+      PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_12, __pyx_t_7);
       __Pyx_GIVEREF(__pyx_t_7);
+      PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_12, __pyx_t_1);
+      __Pyx_GIVEREF(__pyx_t_1);
       __Pyx_INCREF(__pyx_v_datarr);
-      PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_v_datarr);
+      PyTuple_SET_ITEM(__pyx_t_13, 2+__pyx_t_12, __pyx_v_datarr);
       __Pyx_GIVEREF(__pyx_v_datarr);
-      PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_1);
-      __Pyx_GIVEREF(__pyx_t_1);
-      __pyx_t_2 = 0;
+      PyTuple_SET_ITEM(__pyx_t_13, 3+__pyx_t_12, __pyx_t_8);
+      __Pyx_GIVEREF(__pyx_t_8);
       __pyx_t_7 = 0;
       __pyx_t_1 = 0;
-      __pyx_t_1 = PyObject_Call(__pyx_v__redtoreg, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
-      __Pyx_DECREF_SET(__pyx_v_datarr, __pyx_t_1);
-      __pyx_t_1 = 0;
+      __pyx_t_8 = 0;
+      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_13, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+      __Pyx_DECREF_SET(__pyx_v_datarr, __pyx_t_2);
+      __pyx_t_2 = 0;
       goto __pyx_L16;
     }
     /*else*/ {
 
-      /* "pygrib.pyx":1378
+      /* "pygrib.pyx":1370
  *                 datarr = _redtoreg(2*ny, self['pl'], datarr, missval)
  *             else:
  *                 nx = None             # <<<<<<<<<<<<<<
@@ -15379,116 +16886,120 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_34_reshape_mask(struct __pyx_obj
     goto __pyx_L4;
   }
 
-  /* "pygrib.pyx":1379
+  /* "pygrib.pyx":1371
  *             else:
  *                 nx = None
  *         elif self.has_key('Nx') and self.has_key('Ny'):             # <<<<<<<<<<<<<<
  *             nx = self['Nx']
  *             ny = self['Ny']
  */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__has_key); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_8 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_127), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_8);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-  if (__pyx_t_3) {
-    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__has_key); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __pyx_t_1 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_k_tuple_128), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-    __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_11 = __pyx_t_10;
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_has_key); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__71, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_10);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+  if (__pyx_t_14) {
   } else {
-    __pyx_t_11 = __pyx_t_3;
+    __pyx_t_3 = __pyx_t_14;
+    goto __pyx_L17_bool_binop_done;
   }
-  if (__pyx_t_11) {
+  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_has_key); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_10);
+  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__72, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+  __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_3 = __pyx_t_14;
+  __pyx_L17_bool_binop_done:;
+  if (__pyx_t_3) {
 
-    /* "pygrib.pyx":1380
+    /* "pygrib.pyx":1372
  *                 nx = None
  *         elif self.has_key('Nx') and self.has_key('Ny'):
  *             nx = self['Nx']             # <<<<<<<<<<<<<<
  *             ny = self['Ny']
  *         # key renamed from Ni to Nx in grib_api 1.8.0.1
  */
-    __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__Nx)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_v_nx = __pyx_t_1;
-    __pyx_t_1 = 0;
+    __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_Nx); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1372; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_v_nx = __pyx_t_2;
+    __pyx_t_2 = 0;
 
-    /* "pygrib.pyx":1381
+    /* "pygrib.pyx":1373
  *         elif self.has_key('Nx') and self.has_key('Ny'):
  *             nx = self['Nx']
  *             ny = self['Ny']             # <<<<<<<<<<<<<<
  *         # key renamed from Ni to Nx in grib_api 1.8.0.1
  *         elif self.has_key('Ni') and self.has_key('Nj'):
  */
-    __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__Ny)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_v_ny = __pyx_t_1;
-    __pyx_t_1 = 0;
+    __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_Ny); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1373; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_v_ny = __pyx_t_2;
+    __pyx_t_2 = 0;
     goto __pyx_L4;
   }
 
-  /* "pygrib.pyx":1383
+  /* "pygrib.pyx":1375
  *             ny = self['Ny']
  *         # key renamed from Ni to Nx in grib_api 1.8.0.1
  *         elif self.has_key('Ni') and self.has_key('Nj'):             # <<<<<<<<<<<<<<
  *             nx = self['Ni']
  *             ny = self['Nj']
  */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__has_key); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_8 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_129), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_8);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-  if (__pyx_t_11) {
-    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__has_key); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __pyx_t_1 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_k_tuple_130), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_10 = __pyx_t_3;
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_has_key); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__73, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_10);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+  if (__pyx_t_14) {
   } else {
-    __pyx_t_10 = __pyx_t_11;
+    __pyx_t_3 = __pyx_t_14;
+    goto __pyx_L19_bool_binop_done;
   }
-  if (__pyx_t_10) {
+  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_has_key); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_10);
+  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__74, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+  __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_3 = __pyx_t_14;
+  __pyx_L19_bool_binop_done:;
+  if (__pyx_t_3) {
 
-    /* "pygrib.pyx":1384
+    /* "pygrib.pyx":1376
  *         # key renamed from Ni to Nx in grib_api 1.8.0.1
  *         elif self.has_key('Ni') and self.has_key('Nj'):
  *             nx = self['Ni']             # <<<<<<<<<<<<<<
  *             ny = self['Nj']
  *         else: # probably spectral data.
  */
-    __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__Ni)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_v_nx = __pyx_t_1;
-    __pyx_t_1 = 0;
+    __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_Ni); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1376; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_v_nx = __pyx_t_2;
+    __pyx_t_2 = 0;
 
-    /* "pygrib.pyx":1385
+    /* "pygrib.pyx":1377
  *         elif self.has_key('Ni') and self.has_key('Nj'):
  *             nx = self['Ni']
  *             ny = self['Nj']             # <<<<<<<<<<<<<<
  *         else: # probably spectral data.
  *             return datarr
  */
-    __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__Nj)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_v_ny = __pyx_t_1;
-    __pyx_t_1 = 0;
+    __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_Nj); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1377; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_v_ny = __pyx_t_2;
+    __pyx_t_2 = 0;
     goto __pyx_L4;
   }
   /*else*/ {
 
-    /* "pygrib.pyx":1387
+    /* "pygrib.pyx":1379
  *             ny = self['Nj']
  *         else: # probably spectral data.
  *             return datarr             # <<<<<<<<<<<<<<
@@ -15502,186 +17013,220 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_34_reshape_mask(struct __pyx_obj
   }
   __pyx_L4:;
 
-  /* "pygrib.pyx":1388
+  /* "pygrib.pyx":1380
  *         else: # probably spectral data.
  *             return datarr
  *         if ny != GRIB_MISSING_LONG and nx != GRIB_MISSING_LONG and\             # <<<<<<<<<<<<<<
  *            self.expand_reduced:
  *             datarr.shape = (ny,nx)
  */
-  __pyx_t_1 = PyInt_FromLong(GRIB_MISSING_LONG); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_8 = PyObject_RichCompare(__pyx_v_ny, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-  if (__pyx_t_10) {
-    __pyx_t_8 = PyInt_FromLong(GRIB_MISSING_LONG); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __pyx_t_1 = PyObject_RichCompare(__pyx_v_nx, __pyx_t_8, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-    __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    if (__pyx_t_11) {
+  __pyx_t_2 = __Pyx_PyInt_From_int(GRIB_MISSING_LONG); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_10 = PyObject_RichCompare(__pyx_v_ny, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+  if (__pyx_t_14) {
+  } else {
+    __pyx_t_3 = __pyx_t_14;
+    goto __pyx_L22_bool_binop_done;
+  }
+  __pyx_t_10 = __Pyx_PyInt_From_int(GRIB_MISSING_LONG); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_10);
+  __pyx_t_2 = PyObject_RichCompare(__pyx_v_nx, __pyx_t_10, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+  __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  if (__pyx_t_14) {
+  } else {
+    __pyx_t_3 = __pyx_t_14;
+    goto __pyx_L22_bool_binop_done;
+  }
 
-      /* "pygrib.pyx":1389
+  /* "pygrib.pyx":1381
  *             return datarr
  *         if ny != GRIB_MISSING_LONG and nx != GRIB_MISSING_LONG and\
  *            self.expand_reduced:             # <<<<<<<<<<<<<<
  *             datarr.shape = (ny,nx)
  *         # check scan modes for rect grids.
  */
-      __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_self->expand_reduced); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_12 = __pyx_t_3;
-    } else {
-      __pyx_t_12 = __pyx_t_11;
-    }
-    __pyx_t_11 = __pyx_t_12;
-  } else {
-    __pyx_t_11 = __pyx_t_10;
-  }
-  if (__pyx_t_11) {
+  __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_v_self->expand_reduced); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __pyx_t_14;
+  __pyx_L22_bool_binop_done:;
+  if (__pyx_t_3) {
 
-    /* "pygrib.pyx":1390
+    /* "pygrib.pyx":1382
  *         if ny != GRIB_MISSING_LONG and nx != GRIB_MISSING_LONG and\
  *            self.expand_reduced:
  *             datarr.shape = (ny,nx)             # <<<<<<<<<<<<<<
  *         # check scan modes for rect grids.
  *         if datarr.ndim == 2:
  */
-    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
     __Pyx_INCREF(__pyx_v_ny);
-    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_ny);
+    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_ny);
     __Pyx_GIVEREF(__pyx_v_ny);
     __Pyx_INCREF(__pyx_v_nx);
-    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_nx);
+    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_nx);
     __Pyx_GIVEREF(__pyx_v_nx);
-    if (__Pyx_PyObject_SetAttrStr(__pyx_v_datarr, __pyx_n_s__shape, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
-    goto __pyx_L17;
+    if (__Pyx_PyObject_SetAttrStr(__pyx_v_datarr, __pyx_n_s_shape, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    goto __pyx_L21;
   }
-  __pyx_L17:;
+  __pyx_L21:;
 
-  /* "pygrib.pyx":1392
+  /* "pygrib.pyx":1384
  *             datarr.shape = (ny,nx)
  *         # check scan modes for rect grids.
  *         if datarr.ndim == 2:             # <<<<<<<<<<<<<<
  *            # columns scan in the -y direction (so flip)
  *            #if not self['jScansPositively']:
  */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_datarr, __pyx_n_s__ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_8 = PyObject_RichCompare(__pyx_t_1, __pyx_int_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-  if (__pyx_t_11) {
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_datarr, __pyx_n_s_ndim); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_10 = PyObject_RichCompare(__pyx_t_2, __pyx_int_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+  if (__pyx_t_3) {
 
-    /* "pygrib.pyx":1403
+    /* "pygrib.pyx":1395
  *            # adjacent rows scan in opposite direction.
  *            # (flip every other row)
  *            if self['alternativeRowScanning']:             # <<<<<<<<<<<<<<
  *                datsave = datarr.copy()
  *                datarr[1::2,:] = datsave[1::2,::-1]
  */
-    __pyx_t_8 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s_117)); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-    if (__pyx_t_11) {
+    __pyx_t_10 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_alternativeRowScanning); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1395; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_10);
+    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+    if (__pyx_t_3) {
 
-      /* "pygrib.pyx":1404
+      /* "pygrib.pyx":1396
  *            # (flip every other row)
  *            if self['alternativeRowScanning']:
  *                datsave = datarr.copy()             # <<<<<<<<<<<<<<
  *                datarr[1::2,:] = datsave[1::2,::-1]
  *            # if there is a missingValue, and some values missing,
  */
-      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_datarr, __pyx_n_s__copy); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-      __pyx_t_1 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      __pyx_v_datsave = __pyx_t_1;
-      __pyx_t_1 = 0;
+      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_datarr, __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_t_13 = NULL;
+      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
+        __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_2);
+        if (likely(__pyx_t_13)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+          __Pyx_INCREF(__pyx_t_13);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_2, function);
+        }
+      }
+      if (__pyx_t_13) {
+        __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_13); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+      } else {
+        __pyx_t_10 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      }
+      __Pyx_GOTREF(__pyx_t_10);
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __pyx_v_datsave = __pyx_t_10;
+      __pyx_t_10 = 0;
 
-      /* "pygrib.pyx":1405
+      /* "pygrib.pyx":1397
  *            if self['alternativeRowScanning']:
  *                datsave = datarr.copy()
  *                datarr[1::2,:] = datsave[1::2,::-1]             # <<<<<<<<<<<<<<
  *            # if there is a missingValue, and some values missing,
  *            # create a masked array.
  */
-      __pyx_t_1 = PyObject_GetItem(__pyx_v_datsave, ((PyObject *)__pyx_k_tuple_133)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      if (PyObject_SetItem(__pyx_v_datarr, ((PyObject *)__pyx_k_tuple_136), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      goto __pyx_L19;
+      __pyx_t_10 = PyObject_GetItem(__pyx_v_datsave, __pyx_tuple__77); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1397; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+      __Pyx_GOTREF(__pyx_t_10);
+      if (unlikely(PyObject_SetItem(__pyx_v_datarr, __pyx_tuple__80, __pyx_t_10) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+      goto __pyx_L26;
     }
-    __pyx_L19:;
+    __pyx_L26:;
 
-    /* "pygrib.pyx":1408
+    /* "pygrib.pyx":1400
  *            # if there is a missingValue, and some values missing,
  *            # create a masked array.
  *            if self.has_key('missingValue') and self['numberOfMissing']:             # <<<<<<<<<<<<<<
  *                datarr = ma.masked_values(datarr, self['missingValue'])
  *         return datarr
  */
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__has_key); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_8 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_137), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-    if (__pyx_t_11) {
-      __pyx_t_8 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__numberOfMissing)); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-      __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      __pyx_t_12 = __pyx_t_10;
+    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_has_key); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_10);
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__81, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+    __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    if (__pyx_t_14) {
     } else {
-      __pyx_t_12 = __pyx_t_11;
+      __pyx_t_3 = __pyx_t_14;
+      goto __pyx_L28_bool_binop_done;
     }
-    if (__pyx_t_12) {
+    __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_numberOfMissing); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1400; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_3 = __pyx_t_14;
+    __pyx_L28_bool_binop_done:;
+    if (__pyx_t_3) {
 
-      /* "pygrib.pyx":1409
+      /* "pygrib.pyx":1401
  *            # create a masked array.
  *            if self.has_key('missingValue') and self['numberOfMissing']:
  *                datarr = ma.masked_values(datarr, self['missingValue'])             # <<<<<<<<<<<<<<
  *         return datarr
  * 
  */
-      __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s__ma); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s__masked_values); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_ma); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_10);
+      __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_masked_values); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_13);
+      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+      __pyx_t_10 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_missingValue); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+      __Pyx_GOTREF(__pyx_t_10);
+      __pyx_t_8 = NULL;
+      __pyx_t_12 = 0;
+      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_13))) {
+        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_13);
+        if (likely(__pyx_t_8)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
+          __Pyx_INCREF(__pyx_t_8);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_13, function);
+          __pyx_t_12 = 1;
+        }
+      }
+      __pyx_t_1 = PyTuple_New(2+__pyx_t_12); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_1);
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      __pyx_t_8 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__missingValue)); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_7);
+      if (__pyx_t_8) {
+        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_8 = NULL;
+      }
       __Pyx_INCREF(__pyx_v_datarr);
-      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_datarr);
+      PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_12, __pyx_v_datarr);
       __Pyx_GIVEREF(__pyx_v_datarr);
-      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_8);
-      __Pyx_GIVEREF(__pyx_t_8);
-      __pyx_t_8 = 0;
-      __pyx_t_8 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
+      PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_12, __pyx_t_10);
+      __Pyx_GIVEREF(__pyx_t_10);
+      __pyx_t_10 = 0;
+      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_2);
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
-      __Pyx_DECREF_SET(__pyx_v_datarr, __pyx_t_8);
-      __pyx_t_8 = 0;
-      goto __pyx_L20;
+      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+      __Pyx_DECREF_SET(__pyx_v_datarr, __pyx_t_2);
+      __pyx_t_2 = 0;
+      goto __pyx_L27;
     }
-    __pyx_L20:;
-    goto __pyx_L18;
+    __pyx_L27:;
+    goto __pyx_L25;
   }
-  __pyx_L18:;
+  __pyx_L25:;
 
-  /* "pygrib.pyx":1410
+  /* "pygrib.pyx":1402
  *            if self.has_key('missingValue') and self['numberOfMissing']:
  *                datarr = ma.masked_values(datarr, self['missingValue'])
  *         return datarr             # <<<<<<<<<<<<<<
@@ -15693,13 +17238,23 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_34_reshape_mask(struct __pyx_obj
   __pyx_r = __pyx_v_datarr;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "pygrib.pyx":1350
+ *                 datarr[1::2,::-1] = datsave[1::2,:]
+ *         return datarr
+ *     def _reshape_mask(self, datarr):             # <<<<<<<<<<<<<<
+ *         """private method for reshaping and adding mask to "values" array"""
+ *         cdef double missval
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_XDECREF(__pyx_t_2);
   __Pyx_XDECREF(__pyx_t_7);
   __Pyx_XDECREF(__pyx_t_8);
+  __Pyx_XDECREF(__pyx_t_10);
+  __Pyx_XDECREF(__pyx_t_11);
+  __Pyx_XDECREF(__pyx_t_13);
   __Pyx_AddTraceback("pygrib.gribmessage._reshape_mask", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_r = NULL;
   __pyx_L0:;
@@ -15713,6 +17268,14 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_34_reshape_mask(struct __pyx_obj
   return __pyx_r;
 }
 
+/* "pygrib.pyx":1404
+ *         return datarr
+ * 
+ *     def _set_projparams(self):             # <<<<<<<<<<<<<<
+ *         """
+ *         sets the C{projparams} instance variable to a dictionary containing
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_6pygrib_11gribmessage_37_set_projparams(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
 static char __pyx_doc_6pygrib_11gribmessage_36_set_projparams[] = "\n        sets the C{projparams} instance variable to a dictionary containing \n        proj4 key/value pairs describing the grid.\n        ";
@@ -15721,18 +17284,12 @@ static PyObject *__pyx_pw_6pygrib_11gribmessage_37_set_projparams(PyObject *__py
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("_set_projparams (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_11gribmessage_36_set_projparams(((struct __pyx_obj_6pygrib_gribmessage *)__pyx_v_self));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "pygrib.pyx":1412
- *         return datarr
- * 
- *     def _set_projparams(self):             # <<<<<<<<<<<<<<
- *         """
- *         sets the C{projparams} instance variable to a dictionary containing
- */
-
 static PyObject *__pyx_pf_6pygrib_11gribmessage_36_set_projparams(struct __pyx_obj_6pygrib_gribmessage *__pyx_v_self) {
   PyObject *__pyx_v_projparams = NULL;
   PyObject *__pyx_v_scalea = NULL;
@@ -15753,259 +17310,270 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_36_set_projparams(struct __pyx_o
   int __pyx_t_5;
   PyObject *__pyx_t_6 = NULL;
   PyObject *__pyx_t_7 = NULL;
-  double __pyx_t_8;
+  Py_ssize_t __pyx_t_8;
+  PyObject *__pyx_t_9 = NULL;
+  double __pyx_t_10;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("_set_projparams", 0);
 
-  /* "pygrib.pyx":1417
+  /* "pygrib.pyx":1409
  *         proj4 key/value pairs describing the grid.
  *         """
  *         projparams = {}             # <<<<<<<<<<<<<<
  * 
  *         # check for radius key, if it exists just use it
  */
-  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
-  __pyx_v_projparams = ((PyObject *)__pyx_t_1);
+  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_projparams = __pyx_t_1;
   __pyx_t_1 = 0;
 
-  /* "pygrib.pyx":1421
+  /* "pygrib.pyx":1413
  *         # check for radius key, if it exists just use it
  *         # and don't bother with shapeOfTheEarth
  *         if self.has_key('radius'):             # <<<<<<<<<<<<<<
  *             projparams['a'] = self['radius']
  *             projparams['b'] = self['radius']
  */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__has_key); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_has_key); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_138), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__82, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   if (__pyx_t_3) {
 
-    /* "pygrib.pyx":1422
+    /* "pygrib.pyx":1414
  *         # and don't bother with shapeOfTheEarth
  *         if self.has_key('radius'):
  *             projparams['a'] = self['radius']             # <<<<<<<<<<<<<<
  *             projparams['b'] = self['radius']
  *         else:
  */
-    __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__radius)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_radius); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1414; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
     __Pyx_GOTREF(__pyx_t_2);
-    if (PyObject_SetItem(__pyx_v_projparams, ((PyObject *)__pyx_n_s__a), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (unlikely(PyObject_SetItem(__pyx_v_projparams, __pyx_n_s_a, __pyx_t_2) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-    /* "pygrib.pyx":1423
+    /* "pygrib.pyx":1415
  *         if self.has_key('radius'):
  *             projparams['a'] = self['radius']
  *             projparams['b'] = self['radius']             # <<<<<<<<<<<<<<
  *         else:
  *             if self['shapeOfTheEarth'] == 6:
  */
-    __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__radius)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_radius); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1415; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
     __Pyx_GOTREF(__pyx_t_2);
-    if (PyObject_SetItem(__pyx_v_projparams, ((PyObject *)__pyx_n_s__b), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (unlikely(PyObject_SetItem(__pyx_v_projparams, __pyx_n_s_b, __pyx_t_2) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     goto __pyx_L3;
   }
   /*else*/ {
 
-    /* "pygrib.pyx":1425
+    /* "pygrib.pyx":1417
  *             projparams['b'] = self['radius']
  *         else:
  *             if self['shapeOfTheEarth'] == 6:             # <<<<<<<<<<<<<<
  *                 projparams['a']=6371229.0
  *                 projparams['b']=6371229.0
  */
-    __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__shapeOfTheEarth)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_shapeOfTheEarth); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1417; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_int_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_int_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     if (__pyx_t_3) {
 
-      /* "pygrib.pyx":1426
+      /* "pygrib.pyx":1418
  *         else:
  *             if self['shapeOfTheEarth'] == 6:
  *                 projparams['a']=6371229.0             # <<<<<<<<<<<<<<
  *                 projparams['b']=6371229.0
  *             elif self['shapeOfTheEarth'] in [3,7]:
  */
-      __pyx_t_1 = PyFloat_FromDouble(6371229.0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      if (PyObject_SetItem(__pyx_v_projparams, ((PyObject *)__pyx_n_s__a), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      if (unlikely(PyObject_SetItem(__pyx_v_projparams, __pyx_n_s_a, __pyx_float_6371229_0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
-      /* "pygrib.pyx":1427
+      /* "pygrib.pyx":1419
  *             if self['shapeOfTheEarth'] == 6:
  *                 projparams['a']=6371229.0
  *                 projparams['b']=6371229.0             # <<<<<<<<<<<<<<
  *             elif self['shapeOfTheEarth'] in [3,7]:
  *                 if self.has_key('scaleFactorOfMajorAxisOfOblateSpheroidEarth'):
  */
-      __pyx_t_1 = PyFloat_FromDouble(6371229.0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      if (PyObject_SetItem(__pyx_v_projparams, ((PyObject *)__pyx_n_s__b), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      if (unlikely(PyObject_SetItem(__pyx_v_projparams, __pyx_n_s_b, __pyx_float_6371229_0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       goto __pyx_L4;
     }
 
-    /* "pygrib.pyx":1428
+    /* "pygrib.pyx":1420
  *                 projparams['a']=6371229.0
  *                 projparams['b']=6371229.0
  *             elif self['shapeOfTheEarth'] in [3,7]:             # <<<<<<<<<<<<<<
  *                 if self.has_key('scaleFactorOfMajorAxisOfOblateSpheroidEarth'):
  *                     scalea = self['scaleFactorOfMajorAxisOfOblateSpheroidEarth']
  */
-    __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__shapeOfTheEarth)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_shapeOfTheEarth); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1420; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
     __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    if (!((int)__pyx_t_3)) {
-      __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __pyx_t_5 = ((int)__pyx_t_4);
+    if (!__pyx_t_4) {
     } else {
-      __pyx_t_5 = ((int)__pyx_t_3);
+      __pyx_t_3 = __pyx_t_4;
+      goto __pyx_L5_bool_binop_done;
     }
+    __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_3 = __pyx_t_4;
+    __pyx_L5_bool_binop_done:;
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_3 = (__pyx_t_5 != 0);
-    if (__pyx_t_3) {
+    __pyx_t_4 = (__pyx_t_3 != 0);
+    if (__pyx_t_4) {
 
-      /* "pygrib.pyx":1429
+      /* "pygrib.pyx":1421
  *                 projparams['b']=6371229.0
  *             elif self['shapeOfTheEarth'] in [3,7]:
  *                 if self.has_key('scaleFactorOfMajorAxisOfOblateSpheroidEarth'):             # <<<<<<<<<<<<<<
  *                     scalea = self['scaleFactorOfMajorAxisOfOblateSpheroidEarth']
  *                     scaleb = self['scaleFactorOfMinorAxisOfOblateSpheroidEarth']
  */
-      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__has_key); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_has_key); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_140), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__83, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_2);
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      if (__pyx_t_3) {
+      if (__pyx_t_4) {
 
-        /* "pygrib.pyx":1430
+        /* "pygrib.pyx":1422
  *             elif self['shapeOfTheEarth'] in [3,7]:
  *                 if self.has_key('scaleFactorOfMajorAxisOfOblateSpheroidEarth'):
  *                     scalea = self['scaleFactorOfMajorAxisOfOblateSpheroidEarth']             # <<<<<<<<<<<<<<
  *                     scaleb = self['scaleFactorOfMinorAxisOfOblateSpheroidEarth']
  *                     if scalea and scalea is not missingvalue_int:
  */
-        __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s_139)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_scaleFactorOfMajorAxisOfOblateSp); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1422; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
         __Pyx_GOTREF(__pyx_t_2);
         __pyx_v_scalea = __pyx_t_2;
         __pyx_t_2 = 0;
 
-        /* "pygrib.pyx":1431
+        /* "pygrib.pyx":1423
  *                 if self.has_key('scaleFactorOfMajorAxisOfOblateSpheroidEarth'):
  *                     scalea = self['scaleFactorOfMajorAxisOfOblateSpheroidEarth']
  *                     scaleb = self['scaleFactorOfMinorAxisOfOblateSpheroidEarth']             # <<<<<<<<<<<<<<
  *                     if scalea and scalea is not missingvalue_int:
  *                         scalea = np.power(10.0,-scalea)
  */
-        __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s_141)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_scaleFactorOfMinorAxisOfOblateSp); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1423; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
         __Pyx_GOTREF(__pyx_t_2);
         __pyx_v_scaleb = __pyx_t_2;
         __pyx_t_2 = 0;
 
-        /* "pygrib.pyx":1432
+        /* "pygrib.pyx":1424
  *                     scalea = self['scaleFactorOfMajorAxisOfOblateSpheroidEarth']
  *                     scaleb = self['scaleFactorOfMinorAxisOfOblateSpheroidEarth']
  *                     if scalea and scalea is not missingvalue_int:             # <<<<<<<<<<<<<<
  *                         scalea = np.power(10.0,-scalea)
  *                         if self['shapeOfTheEarth'] == 3: # radius in km
  */
-        __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_scalea); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_scalea); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         if (__pyx_t_3) {
-          __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__missingvalue_int); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_2);
-          __pyx_t_5 = (__pyx_v_scalea != __pyx_t_2);
-          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-          __pyx_t_4 = __pyx_t_5;
         } else {
           __pyx_t_4 = __pyx_t_3;
+          goto __pyx_L9_bool_binop_done;
         }
+        __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_missingvalue_int); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_2);
+        __pyx_t_3 = (__pyx_v_scalea != __pyx_t_2);
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __pyx_t_5 = (__pyx_t_3 != 0);
+        __pyx_t_4 = __pyx_t_5;
+        __pyx_L9_bool_binop_done:;
         if (__pyx_t_4) {
 
-          /* "pygrib.pyx":1433
+          /* "pygrib.pyx":1425
  *                     scaleb = self['scaleFactorOfMinorAxisOfOblateSpheroidEarth']
  *                     if scalea and scalea is not missingvalue_int:
  *                         scalea = np.power(10.0,-scalea)             # <<<<<<<<<<<<<<
  *                         if self['shapeOfTheEarth'] == 3: # radius in km
  *                             scalea = 1000.*scalea
  */
-          __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_2);
-          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__power); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
           __Pyx_GOTREF(__pyx_t_1);
-          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-          __pyx_t_2 = PyFloat_FromDouble(10.0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_2);
-          __pyx_t_6 = PyNumber_Negative(__pyx_v_scalea); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_6);
-          __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_7);
-          PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2);
-          __Pyx_GIVEREF(__pyx_t_2);
-          PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6);
-          __Pyx_GIVEREF(__pyx_t_6);
-          __pyx_t_2 = 0;
-          __pyx_t_6 = 0;
-          __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_power); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
           __Pyx_GOTREF(__pyx_t_6);
           __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-          __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
-          __Pyx_DECREF_SET(__pyx_v_scalea, __pyx_t_6);
-          __pyx_t_6 = 0;
+          __pyx_t_1 = PyNumber_Negative(__pyx_v_scalea); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __Pyx_GOTREF(__pyx_t_1);
+          __pyx_t_7 = NULL;
+          __pyx_t_8 = 0;
+          if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
+            __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
+            if (likely(__pyx_t_7)) {
+              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
+              __Pyx_INCREF(__pyx_t_7);
+              __Pyx_INCREF(function);
+              __Pyx_DECREF_SET(__pyx_t_6, function);
+              __pyx_t_8 = 1;
+            }
+          }
+          __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __Pyx_GOTREF(__pyx_t_9);
+          if (__pyx_t_7) {
+            PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = NULL;
+          }
+          __Pyx_INCREF(__pyx_float_10_0);
+          PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_float_10_0);
+          __Pyx_GIVEREF(__pyx_float_10_0);
+          PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_1);
+          __Pyx_GIVEREF(__pyx_t_1);
+          __pyx_t_1 = 0;
+          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __Pyx_GOTREF(__pyx_t_2);
+          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+          __Pyx_DECREF_SET(__pyx_v_scalea, __pyx_t_2);
+          __pyx_t_2 = 0;
 
-          /* "pygrib.pyx":1434
+          /* "pygrib.pyx":1426
  *                     if scalea and scalea is not missingvalue_int:
  *                         scalea = np.power(10.0,-scalea)
  *                         if self['shapeOfTheEarth'] == 3: # radius in km             # <<<<<<<<<<<<<<
  *                             scalea = 1000.*scalea
  *                     else:
  */
-          __pyx_t_6 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__shapeOfTheEarth)); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_6);
-          __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, __pyx_int_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_shapeOfTheEarth); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1426; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+          __Pyx_GOTREF(__pyx_t_2);
+          __pyx_t_6 = PyObject_RichCompare(__pyx_t_2, __pyx_int_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+          __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
           __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-          __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
           if (__pyx_t_4) {
 
-            /* "pygrib.pyx":1435
+            /* "pygrib.pyx":1427
  *                         scalea = np.power(10.0,-scalea)
  *                         if self['shapeOfTheEarth'] == 3: # radius in km
  *                             scalea = 1000.*scalea             # <<<<<<<<<<<<<<
  *                     else:
  *                         scalea = 1
  */
-            __pyx_t_7 = PyFloat_FromDouble(1000.); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-            __Pyx_GOTREF(__pyx_t_7);
-            __pyx_t_6 = PyNumber_Multiply(__pyx_t_7, __pyx_v_scalea); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+            __pyx_t_6 = PyNumber_Multiply(__pyx_float_1000_, __pyx_v_scalea); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
             __Pyx_GOTREF(__pyx_t_6);
-            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
             __Pyx_DECREF_SET(__pyx_v_scalea, __pyx_t_6);
             __pyx_t_6 = 0;
-            goto __pyx_L7;
+            goto __pyx_L11;
           }
-          __pyx_L7:;
-          goto __pyx_L6;
+          __pyx_L11:;
+          goto __pyx_L8;
         }
         /*else*/ {
 
-          /* "pygrib.pyx":1437
+          /* "pygrib.pyx":1429
  *                             scalea = 1000.*scalea
  *                     else:
  *                         scalea = 1             # <<<<<<<<<<<<<<
@@ -16015,357 +17583,374 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_36_set_projparams(struct __pyx_o
           __Pyx_INCREF(__pyx_int_1);
           __Pyx_DECREF_SET(__pyx_v_scalea, __pyx_int_1);
         }
-        __pyx_L6:;
+        __pyx_L8:;
 
-        /* "pygrib.pyx":1438
+        /* "pygrib.pyx":1430
  *                     else:
  *                         scalea = 1
  *                     if scaleb and scaleb is not missingvalue_int:             # <<<<<<<<<<<<<<
  *                         scaleb = np.power(10.0,-scaleb)
  *                         if self['shapeOfTheEarth'] == 3: # radius in km
  */
-        __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_scaleb); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        if (__pyx_t_4) {
-          __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s__missingvalue_int); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_6);
-          __pyx_t_3 = (__pyx_v_scaleb != __pyx_t_6);
-          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-          __pyx_t_5 = __pyx_t_3;
+        __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_scaleb); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        if (__pyx_t_5) {
         } else {
-          __pyx_t_5 = __pyx_t_4;
+          __pyx_t_4 = __pyx_t_5;
+          goto __pyx_L13_bool_binop_done;
         }
-        if (__pyx_t_5) {
+        __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_missingvalue_int); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_6);
+        __pyx_t_5 = (__pyx_v_scaleb != __pyx_t_6);
+        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+        __pyx_t_3 = (__pyx_t_5 != 0);
+        __pyx_t_4 = __pyx_t_3;
+        __pyx_L13_bool_binop_done:;
+        if (__pyx_t_4) {
 
-          /* "pygrib.pyx":1439
+          /* "pygrib.pyx":1431
  *                         scalea = 1
  *                     if scaleb and scaleb is not missingvalue_int:
  *                         scaleb = np.power(10.0,-scaleb)             # <<<<<<<<<<<<<<
  *                         if self['shapeOfTheEarth'] == 3: # radius in km
  *                             scaleb = 1000.*scaleb
  */
-          __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_6);
-          __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s__power); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __Pyx_GOTREF(__pyx_t_2);
+          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_power); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __Pyx_GOTREF(__pyx_t_9);
+          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+          __pyx_t_2 = PyNumber_Negative(__pyx_v_scaleb); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __Pyx_GOTREF(__pyx_t_2);
+          __pyx_t_1 = NULL;
+          __pyx_t_8 = 0;
+          if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) {
+            __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_9);
+            if (likely(__pyx_t_1)) {
+              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
+              __Pyx_INCREF(__pyx_t_1);
+              __Pyx_INCREF(function);
+              __Pyx_DECREF_SET(__pyx_t_9, function);
+              __pyx_t_8 = 1;
+            }
+          }
+          __pyx_t_7 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
           __Pyx_GOTREF(__pyx_t_7);
-          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-          __pyx_t_6 = PyFloat_FromDouble(10.0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          if (__pyx_t_1) {
+            PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = NULL;
+          }
+          __Pyx_INCREF(__pyx_float_10_0);
+          PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_float_10_0);
+          __Pyx_GIVEREF(__pyx_float_10_0);
+          PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_t_2);
+          __Pyx_GIVEREF(__pyx_t_2);
+          __pyx_t_2 = 0;
+          __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
           __Pyx_GOTREF(__pyx_t_6);
-          __pyx_t_1 = PyNumber_Negative(__pyx_v_scaleb); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_1);
-          __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_2);
-          PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6);
-          __Pyx_GIVEREF(__pyx_t_6);
-          PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
-          __Pyx_GIVEREF(__pyx_t_1);
-          __pyx_t_6 = 0;
-          __pyx_t_1 = 0;
-          __pyx_t_1 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_1);
           __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-          __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
-          __Pyx_DECREF_SET(__pyx_v_scaleb, __pyx_t_1);
-          __pyx_t_1 = 0;
+          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+          __Pyx_DECREF_SET(__pyx_v_scaleb, __pyx_t_6);
+          __pyx_t_6 = 0;
 
-          /* "pygrib.pyx":1440
+          /* "pygrib.pyx":1432
  *                     if scaleb and scaleb is not missingvalue_int:
  *                         scaleb = np.power(10.0,-scaleb)
  *                         if self['shapeOfTheEarth'] == 3: # radius in km             # <<<<<<<<<<<<<<
  *                             scaleb = 1000.*scaleb
  *                     else:
  */
-          __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__shapeOfTheEarth)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_1);
-          __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-          __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-          if (__pyx_t_5) {
+          __pyx_t_6 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_shapeOfTheEarth); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1432; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+          __Pyx_GOTREF(__pyx_t_6);
+          __pyx_t_9 = PyObject_RichCompare(__pyx_t_6, __pyx_int_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+          __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+          if (__pyx_t_4) {
 
-            /* "pygrib.pyx":1441
+            /* "pygrib.pyx":1433
  *                         scaleb = np.power(10.0,-scaleb)
  *                         if self['shapeOfTheEarth'] == 3: # radius in km
  *                             scaleb = 1000.*scaleb             # <<<<<<<<<<<<<<
  *                     else:
  *                         scaleb = 1.
  */
-            __pyx_t_2 = PyFloat_FromDouble(1000.); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-            __Pyx_GOTREF(__pyx_t_2);
-            __pyx_t_1 = PyNumber_Multiply(__pyx_t_2, __pyx_v_scaleb); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-            __Pyx_GOTREF(__pyx_t_1);
-            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-            __Pyx_DECREF_SET(__pyx_v_scaleb, __pyx_t_1);
-            __pyx_t_1 = 0;
-            goto __pyx_L9;
+            __pyx_t_9 = PyNumber_Multiply(__pyx_float_1000_, __pyx_v_scaleb); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+            __Pyx_GOTREF(__pyx_t_9);
+            __Pyx_DECREF_SET(__pyx_v_scaleb, __pyx_t_9);
+            __pyx_t_9 = 0;
+            goto __pyx_L15;
           }
-          __pyx_L9:;
-          goto __pyx_L8;
+          __pyx_L15:;
+          goto __pyx_L12;
         }
         /*else*/ {
 
-          /* "pygrib.pyx":1443
+          /* "pygrib.pyx":1435
  *                             scaleb = 1000.*scaleb
  *                     else:
  *                         scaleb = 1.             # <<<<<<<<<<<<<<
  *                 else:
  *                     scalea = 1.
  */
-          __pyx_t_1 = PyFloat_FromDouble(1.); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_1);
-          __Pyx_DECREF_SET(__pyx_v_scaleb, __pyx_t_1);
-          __pyx_t_1 = 0;
+          __Pyx_INCREF(__pyx_float_1_);
+          __Pyx_DECREF_SET(__pyx_v_scaleb, __pyx_float_1_);
         }
-        __pyx_L8:;
-        goto __pyx_L5;
+        __pyx_L12:;
+        goto __pyx_L7;
       }
       /*else*/ {
 
-        /* "pygrib.pyx":1445
+        /* "pygrib.pyx":1437
  *                         scaleb = 1.
  *                 else:
  *                     scalea = 1.             # <<<<<<<<<<<<<<
  *                     scaleb = 1.
  *                 if grib_api_version < 10900:
  */
-        __pyx_t_1 = PyFloat_FromDouble(1.); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_1);
-        __pyx_v_scalea = __pyx_t_1;
-        __pyx_t_1 = 0;
+        __Pyx_INCREF(__pyx_float_1_);
+        __pyx_v_scalea = __pyx_float_1_;
 
-        /* "pygrib.pyx":1446
+        /* "pygrib.pyx":1438
  *                 else:
  *                     scalea = 1.
  *                     scaleb = 1.             # <<<<<<<<<<<<<<
  *                 if grib_api_version < 10900:
  *                     projparams['a']=self['scaledValueOfMajorAxisOfOblateSpheroidEarth']*scalea
  */
-        __pyx_t_1 = PyFloat_FromDouble(1.); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_1);
-        __pyx_v_scaleb = __pyx_t_1;
-        __pyx_t_1 = 0;
+        __Pyx_INCREF(__pyx_float_1_);
+        __pyx_v_scaleb = __pyx_float_1_;
       }
-      __pyx_L5:;
+      __pyx_L7:;
 
-      /* "pygrib.pyx":1447
+      /* "pygrib.pyx":1439
  *                     scalea = 1.
  *                     scaleb = 1.
  *                 if grib_api_version < 10900:             # <<<<<<<<<<<<<<
  *                     projparams['a']=self['scaledValueOfMajorAxisOfOblateSpheroidEarth']*scalea
  *                     projparams['b']=self['scaledValueOfMinorAxisOfOblateSpheroidEarth']*scaleb
  */
-      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__grib_api_version); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_10900, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      if (__pyx_t_5) {
+      __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_grib_api_version); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_9);
+      __pyx_t_6 = PyObject_RichCompare(__pyx_t_9, __pyx_int_10900, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+      if (__pyx_t_4) {
 
-        /* "pygrib.pyx":1448
+        /* "pygrib.pyx":1440
  *                     scaleb = 1.
  *                 if grib_api_version < 10900:
  *                     projparams['a']=self['scaledValueOfMajorAxisOfOblateSpheroidEarth']*scalea             # <<<<<<<<<<<<<<
  *                     projparams['b']=self['scaledValueOfMinorAxisOfOblateSpheroidEarth']*scaleb
  *                 else:
  */
-        __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s_142)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_2);
-        __pyx_t_1 = PyNumber_Multiply(__pyx_t_2, __pyx_v_scalea); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_1);
-        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-        if (PyObject_SetItem(__pyx_v_projparams, ((PyObject *)__pyx_n_s__a), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        __pyx_t_6 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_scaledValueOfMajorAxisOfOblateSp); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1440; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+        __Pyx_GOTREF(__pyx_t_6);
+        __pyx_t_9 = PyNumber_Multiply(__pyx_t_6, __pyx_v_scalea); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_9);
+        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+        if (unlikely(PyObject_SetItem(__pyx_v_projparams, __pyx_n_s_a, __pyx_t_9) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
 
-        /* "pygrib.pyx":1449
+        /* "pygrib.pyx":1441
  *                 if grib_api_version < 10900:
  *                     projparams['a']=self['scaledValueOfMajorAxisOfOblateSpheroidEarth']*scalea
  *                     projparams['b']=self['scaledValueOfMinorAxisOfOblateSpheroidEarth']*scaleb             # <<<<<<<<<<<<<<
  *                 else:
  *                     projparams['a']=self['scaledValueOfEarthMajorAxis']*scalea
  */
-        __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s_143)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_1);
-        __pyx_t_2 = PyNumber_Multiply(__pyx_t_1, __pyx_v_scaleb); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_2);
-        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-        if (PyObject_SetItem(__pyx_v_projparams, ((PyObject *)__pyx_n_s__b), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-        goto __pyx_L10;
+        __pyx_t_9 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_scaledValueOfMinorAxisOfOblateSp); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+        __Pyx_GOTREF(__pyx_t_9);
+        __pyx_t_6 = PyNumber_Multiply(__pyx_t_9, __pyx_v_scaleb); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_6);
+        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+        if (unlikely(PyObject_SetItem(__pyx_v_projparams, __pyx_n_s_b, __pyx_t_6) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+        goto __pyx_L16;
       }
       /*else*/ {
 
-        /* "pygrib.pyx":1451
+        /* "pygrib.pyx":1443
  *                     projparams['b']=self['scaledValueOfMinorAxisOfOblateSpheroidEarth']*scaleb
  *                 else:
  *                     projparams['a']=self['scaledValueOfEarthMajorAxis']*scalea             # <<<<<<<<<<<<<<
  *                     projparams['b']=self['scaledValueOfEarthMinorAxis']*scaleb
  *             elif self['shapeOfTheEarth'] == 2:
  */
-        __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s_144)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_2);
-        __pyx_t_1 = PyNumber_Multiply(__pyx_t_2, __pyx_v_scalea); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_1);
-        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-        if (PyObject_SetItem(__pyx_v_projparams, ((PyObject *)__pyx_n_s__a), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        __pyx_t_6 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_scaledValueOfEarthMajorAxis); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1443; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+        __Pyx_GOTREF(__pyx_t_6);
+        __pyx_t_9 = PyNumber_Multiply(__pyx_t_6, __pyx_v_scalea); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_9);
+        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+        if (unlikely(PyObject_SetItem(__pyx_v_projparams, __pyx_n_s_a, __pyx_t_9) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
 
-        /* "pygrib.pyx":1452
+        /* "pygrib.pyx":1444
  *                 else:
  *                     projparams['a']=self['scaledValueOfEarthMajorAxis']*scalea
  *                     projparams['b']=self['scaledValueOfEarthMinorAxis']*scaleb             # <<<<<<<<<<<<<<
  *             elif self['shapeOfTheEarth'] == 2:
  *                 projparams['a']=6378160.0
  */
-        __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s_145)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_1);
-        __pyx_t_2 = PyNumber_Multiply(__pyx_t_1, __pyx_v_scaleb); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_2);
-        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-        if (PyObject_SetItem(__pyx_v_projparams, ((PyObject *)__pyx_n_s__b), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __pyx_t_9 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_scaledValueOfEarthMinorAxis); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1444; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+        __Pyx_GOTREF(__pyx_t_9);
+        __pyx_t_6 = PyNumber_Multiply(__pyx_t_9, __pyx_v_scaleb); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_6);
+        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+        if (unlikely(PyObject_SetItem(__pyx_v_projparams, __pyx_n_s_b, __pyx_t_6) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
       }
-      __pyx_L10:;
+      __pyx_L16:;
       goto __pyx_L4;
     }
 
-    /* "pygrib.pyx":1453
+    /* "pygrib.pyx":1445
  *                     projparams['a']=self['scaledValueOfEarthMajorAxis']*scalea
  *                     projparams['b']=self['scaledValueOfEarthMinorAxis']*scaleb
  *             elif self['shapeOfTheEarth'] == 2:             # <<<<<<<<<<<<<<
  *                 projparams['a']=6378160.0
  *                 projparams['b']=6356775.0
  */
-    __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__shapeOfTheEarth)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_int_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    if (__pyx_t_5) {
+    __pyx_t_6 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_shapeOfTheEarth); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1445; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_6);
+    __pyx_t_9 = PyObject_RichCompare(__pyx_t_6, __pyx_int_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+    if (__pyx_t_4) {
 
-      /* "pygrib.pyx":1454
+      /* "pygrib.pyx":1446
  *                     projparams['b']=self['scaledValueOfEarthMinorAxis']*scaleb
  *             elif self['shapeOfTheEarth'] == 2:
  *                 projparams['a']=6378160.0             # <<<<<<<<<<<<<<
  *                 projparams['b']=6356775.0
  *             elif self['shapeOfTheEarth'] == 1:
  */
-      __pyx_t_1 = PyFloat_FromDouble(6378160.0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      if (PyObject_SetItem(__pyx_v_projparams, ((PyObject *)__pyx_n_s__a), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      if (unlikely(PyObject_SetItem(__pyx_v_projparams, __pyx_n_s_a, __pyx_float_6378160_0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
-      /* "pygrib.pyx":1455
+      /* "pygrib.pyx":1447
  *             elif self['shapeOfTheEarth'] == 2:
  *                 projparams['a']=6378160.0
  *                 projparams['b']=6356775.0             # <<<<<<<<<<<<<<
  *             elif self['shapeOfTheEarth'] == 1:
  *                 if self.has_key('scaleFactorOfRadiusOfSphericalEarth'):
  */
-      __pyx_t_1 = PyFloat_FromDouble(6356775.0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      if (PyObject_SetItem(__pyx_v_projparams, ((PyObject *)__pyx_n_s__b), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      if (unlikely(PyObject_SetItem(__pyx_v_projparams, __pyx_n_s_b, __pyx_float_6356775_0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       goto __pyx_L4;
     }
 
-    /* "pygrib.pyx":1456
+    /* "pygrib.pyx":1448
  *                 projparams['a']=6378160.0
  *                 projparams['b']=6356775.0
  *             elif self['shapeOfTheEarth'] == 1:             # <<<<<<<<<<<<<<
  *                 if self.has_key('scaleFactorOfRadiusOfSphericalEarth'):
  *                     scalea = self['scaleFactorOfRadiusOfSphericalEarth']
  */
-    __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__shapeOfTheEarth)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    if (__pyx_t_5) {
+    __pyx_t_9 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_shapeOfTheEarth); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1448; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_9);
+    __pyx_t_6 = PyObject_RichCompare(__pyx_t_9, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    if (__pyx_t_4) {
 
-      /* "pygrib.pyx":1457
+      /* "pygrib.pyx":1449
  *                 projparams['b']=6356775.0
  *             elif self['shapeOfTheEarth'] == 1:
  *                 if self.has_key('scaleFactorOfRadiusOfSphericalEarth'):             # <<<<<<<<<<<<<<
  *                     scalea = self['scaleFactorOfRadiusOfSphericalEarth']
  *                     if scalea and scalea is not missingvalue_int:
  */
-      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__has_key); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_147), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      if (__pyx_t_5) {
+      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_has_key); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_6);
+      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__84, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_9);
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+      if (__pyx_t_4) {
 
-        /* "pygrib.pyx":1458
+        /* "pygrib.pyx":1450
  *             elif self['shapeOfTheEarth'] == 1:
  *                 if self.has_key('scaleFactorOfRadiusOfSphericalEarth'):
  *                     scalea = self['scaleFactorOfRadiusOfSphericalEarth']             # <<<<<<<<<<<<<<
  *                     if scalea and scalea is not missingvalue_int:
  *                         scalea = np.power(10.0,-scalea)
  */
-        __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s_146)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_1);
-        __pyx_v_scalea = __pyx_t_1;
-        __pyx_t_1 = 0;
+        __pyx_t_9 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_scaleFactorOfRadiusOfSphericalEa); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1450; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+        __Pyx_GOTREF(__pyx_t_9);
+        __pyx_v_scalea = __pyx_t_9;
+        __pyx_t_9 = 0;
 
-        /* "pygrib.pyx":1459
+        /* "pygrib.pyx":1451
  *                 if self.has_key('scaleFactorOfRadiusOfSphericalEarth'):
  *                     scalea = self['scaleFactorOfRadiusOfSphericalEarth']
  *                     if scalea and scalea is not missingvalue_int:             # <<<<<<<<<<<<<<
  *                         scalea = np.power(10.0,-scalea)
  *                     else:
  */
-        __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_scalea); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        if (__pyx_t_5) {
-          __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__missingvalue_int); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_1);
-          __pyx_t_4 = (__pyx_v_scalea != __pyx_t_1);
-          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-          __pyx_t_3 = __pyx_t_4;
+        __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_scalea); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        if (__pyx_t_3) {
         } else {
-          __pyx_t_3 = __pyx_t_5;
+          __pyx_t_4 = __pyx_t_3;
+          goto __pyx_L19_bool_binop_done;
         }
-        if (__pyx_t_3) {
+        __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_missingvalue_int); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_9);
+        __pyx_t_3 = (__pyx_v_scalea != __pyx_t_9);
+        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+        __pyx_t_5 = (__pyx_t_3 != 0);
+        __pyx_t_4 = __pyx_t_5;
+        __pyx_L19_bool_binop_done:;
+        if (__pyx_t_4) {
 
-          /* "pygrib.pyx":1460
+          /* "pygrib.pyx":1452
  *                     scalea = self['scaleFactorOfRadiusOfSphericalEarth']
  *                     if scalea and scalea is not missingvalue_int:
  *                         scalea = np.power(10.0,-scalea)             # <<<<<<<<<<<<<<
  *                     else:
  *                         scalea = 1
  */
-          __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_1);
-          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__power); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_2);
-          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-          __pyx_t_1 = PyFloat_FromDouble(10.0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_1);
-          __pyx_t_7 = PyNumber_Negative(__pyx_v_scalea); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_7);
-          __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
           __Pyx_GOTREF(__pyx_t_6);
-          PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
-          __Pyx_GIVEREF(__pyx_t_1);
-          PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_7);
-          __Pyx_GIVEREF(__pyx_t_7);
-          __pyx_t_1 = 0;
-          __pyx_t_7 = 0;
-          __pyx_t_7 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_power); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
           __Pyx_GOTREF(__pyx_t_7);
-          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-          __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
-          __Pyx_DECREF_SET(__pyx_v_scalea, __pyx_t_7);
-          __pyx_t_7 = 0;
-          goto __pyx_L12;
+          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+          __pyx_t_6 = PyNumber_Negative(__pyx_v_scalea); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __Pyx_GOTREF(__pyx_t_6);
+          __pyx_t_2 = NULL;
+          __pyx_t_8 = 0;
+          if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
+            __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7);
+            if (likely(__pyx_t_2)) {
+              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
+              __Pyx_INCREF(__pyx_t_2);
+              __Pyx_INCREF(function);
+              __Pyx_DECREF_SET(__pyx_t_7, function);
+              __pyx_t_8 = 1;
+            }
+          }
+          __pyx_t_1 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __Pyx_GOTREF(__pyx_t_1);
+          if (__pyx_t_2) {
+            PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = NULL;
+          }
+          __Pyx_INCREF(__pyx_float_10_0);
+          PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_8, __pyx_float_10_0);
+          __Pyx_GIVEREF(__pyx_float_10_0);
+          PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_8, __pyx_t_6);
+          __Pyx_GIVEREF(__pyx_t_6);
+          __pyx_t_6 = 0;
+          __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_1, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __Pyx_GOTREF(__pyx_t_9);
+          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+          __Pyx_DECREF_SET(__pyx_v_scalea, __pyx_t_9);
+          __pyx_t_9 = 0;
+          goto __pyx_L18;
         }
         /*else*/ {
 
-          /* "pygrib.pyx":1462
+          /* "pygrib.pyx":1454
  *                         scalea = np.power(10.0,-scalea)
  *                     else:
  *                         scalea = 1             # <<<<<<<<<<<<<<
@@ -16375,9 +17960,9 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_36_set_projparams(struct __pyx_o
           __Pyx_INCREF(__pyx_int_1);
           __Pyx_DECREF_SET(__pyx_v_scalea, __pyx_int_1);
         }
-        __pyx_L12:;
+        __pyx_L18:;
 
-        /* "pygrib.pyx":1463
+        /* "pygrib.pyx":1455
  *                     else:
  *                         scalea = 1
  *                     scaleb = scalea             # <<<<<<<<<<<<<<
@@ -16386,1407 +17971,1268 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_36_set_projparams(struct __pyx_o
  */
         __Pyx_INCREF(__pyx_v_scalea);
         __pyx_v_scaleb = __pyx_v_scalea;
-        goto __pyx_L11;
+        goto __pyx_L17;
       }
       /*else*/ {
 
-        /* "pygrib.pyx":1465
+        /* "pygrib.pyx":1457
  *                     scaleb = scalea
  *                 else:
  *                     scalea = 1.             # <<<<<<<<<<<<<<
  *                     scaleb = 1.
  *                 projparams['a']=self['scaledValueOfRadiusOfSphericalEarth']*scalea
  */
-        __pyx_t_7 = PyFloat_FromDouble(1.); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_7);
-        __pyx_v_scalea = __pyx_t_7;
-        __pyx_t_7 = 0;
+        __Pyx_INCREF(__pyx_float_1_);
+        __pyx_v_scalea = __pyx_float_1_;
 
-        /* "pygrib.pyx":1466
+        /* "pygrib.pyx":1458
  *                 else:
  *                     scalea = 1.
  *                     scaleb = 1.             # <<<<<<<<<<<<<<
  *                 projparams['a']=self['scaledValueOfRadiusOfSphericalEarth']*scalea
  *                 projparams['b']=self['scaledValueOfRadiusOfSphericalEarth']*scaleb
  */
-        __pyx_t_7 = PyFloat_FromDouble(1.); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_7);
-        __pyx_v_scaleb = __pyx_t_7;
-        __pyx_t_7 = 0;
+        __Pyx_INCREF(__pyx_float_1_);
+        __pyx_v_scaleb = __pyx_float_1_;
       }
-      __pyx_L11:;
+      __pyx_L17:;
 
-      /* "pygrib.pyx":1467
+      /* "pygrib.pyx":1459
  *                     scalea = 1.
  *                     scaleb = 1.
  *                 projparams['a']=self['scaledValueOfRadiusOfSphericalEarth']*scalea             # <<<<<<<<<<<<<<
  *                 projparams['b']=self['scaledValueOfRadiusOfSphericalEarth']*scaleb
  *             elif self['shapeOfTheEarth'] == 0:
  */
-      __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s_148)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_9 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_scaledValueOfRadiusOfSphericalEa); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1459; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+      __Pyx_GOTREF(__pyx_t_9);
+      __pyx_t_7 = PyNumber_Multiply(__pyx_t_9, __pyx_v_scalea); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_7);
-      __pyx_t_6 = PyNumber_Multiply(__pyx_t_7, __pyx_v_scalea); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_6);
+      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+      if (unlikely(PyObject_SetItem(__pyx_v_projparams, __pyx_n_s_a, __pyx_t_7) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      if (PyObject_SetItem(__pyx_v_projparams, ((PyObject *)__pyx_n_s__a), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
-      /* "pygrib.pyx":1468
+      /* "pygrib.pyx":1460
  *                     scaleb = 1.
  *                 projparams['a']=self['scaledValueOfRadiusOfSphericalEarth']*scalea
  *                 projparams['b']=self['scaledValueOfRadiusOfSphericalEarth']*scaleb             # <<<<<<<<<<<<<<
  *             elif self['shapeOfTheEarth'] == 0:
  *                 projparams['a']=6367470.0
  */
-      __pyx_t_6 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s_148)); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_6);
-      __pyx_t_7 = PyNumber_Multiply(__pyx_t_6, __pyx_v_scaleb); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_scaledValueOfRadiusOfSphericalEa); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1460; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
       __Pyx_GOTREF(__pyx_t_7);
-      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-      if (PyObject_SetItem(__pyx_v_projparams, ((PyObject *)__pyx_n_s__b), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_9 = PyNumber_Multiply(__pyx_t_7, __pyx_v_scaleb); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_9);
       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+      if (unlikely(PyObject_SetItem(__pyx_v_projparams, __pyx_n_s_b, __pyx_t_9) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
       goto __pyx_L4;
     }
 
-    /* "pygrib.pyx":1469
+    /* "pygrib.pyx":1461
  *                 projparams['a']=self['scaledValueOfRadiusOfSphericalEarth']*scalea
  *                 projparams['b']=self['scaledValueOfRadiusOfSphericalEarth']*scaleb
  *             elif self['shapeOfTheEarth'] == 0:             # <<<<<<<<<<<<<<
  *                 projparams['a']=6367470.0
  *                 projparams['b']=6367470.0
  */
-    __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__shapeOfTheEarth)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __pyx_t_6 = PyObject_RichCompare(__pyx_t_7, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_9 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_shapeOfTheEarth); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1461; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_9);
+    __pyx_t_7 = PyObject_RichCompare(__pyx_t_9, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    if (__pyx_t_3) {
+    if (__pyx_t_4) {
 
-      /* "pygrib.pyx":1470
+      /* "pygrib.pyx":1462
  *                 projparams['b']=self['scaledValueOfRadiusOfSphericalEarth']*scaleb
  *             elif self['shapeOfTheEarth'] == 0:
  *                 projparams['a']=6367470.0             # <<<<<<<<<<<<<<
  *                 projparams['b']=6367470.0
  *             elif self['shapeOfTheEarth'] == 5: # WGS84
  */
-      __pyx_t_6 = PyFloat_FromDouble(6367470.0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_6);
-      if (PyObject_SetItem(__pyx_v_projparams, ((PyObject *)__pyx_n_s__a), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+      if (unlikely(PyObject_SetItem(__pyx_v_projparams, __pyx_n_s_a, __pyx_float_6367470_0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
-      /* "pygrib.pyx":1471
+      /* "pygrib.pyx":1463
  *             elif self['shapeOfTheEarth'] == 0:
  *                 projparams['a']=6367470.0
  *                 projparams['b']=6367470.0             # <<<<<<<<<<<<<<
  *             elif self['shapeOfTheEarth'] == 5: # WGS84
  *                 projparams['a']=6378137.0
  */
-      __pyx_t_6 = PyFloat_FromDouble(6367470.0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_6);
-      if (PyObject_SetItem(__pyx_v_projparams, ((PyObject *)__pyx_n_s__b), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+      if (unlikely(PyObject_SetItem(__pyx_v_projparams, __pyx_n_s_b, __pyx_float_6367470_0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       goto __pyx_L4;
     }
 
-    /* "pygrib.pyx":1472
+    /* "pygrib.pyx":1464
  *                 projparams['a']=6367470.0
  *                 projparams['b']=6367470.0
  *             elif self['shapeOfTheEarth'] == 5: # WGS84             # <<<<<<<<<<<<<<
  *                 projparams['a']=6378137.0
  *                 projparams['b']=6356752.3142
  */
-    __pyx_t_6 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__shapeOfTheEarth)); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, __pyx_int_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_shapeOfTheEarth); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1464; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_7);
+    __pyx_t_9 = PyObject_RichCompare(__pyx_t_7, __pyx_int_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    if (__pyx_t_3) {
+    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+    if (__pyx_t_4) {
 
-      /* "pygrib.pyx":1473
+      /* "pygrib.pyx":1465
  *                 projparams['b']=6367470.0
  *             elif self['shapeOfTheEarth'] == 5: # WGS84
  *                 projparams['a']=6378137.0             # <<<<<<<<<<<<<<
  *                 projparams['b']=6356752.3142
  *             elif self['shapeOfTheEarth'] == 8:
  */
-      __pyx_t_7 = PyFloat_FromDouble(6378137.0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_7);
-      if (PyObject_SetItem(__pyx_v_projparams, ((PyObject *)__pyx_n_s__a), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+      if (unlikely(PyObject_SetItem(__pyx_v_projparams, __pyx_n_s_a, __pyx_float_6378137_0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
-      /* "pygrib.pyx":1474
+      /* "pygrib.pyx":1466
  *             elif self['shapeOfTheEarth'] == 5: # WGS84
  *                 projparams['a']=6378137.0
  *                 projparams['b']=6356752.3142             # <<<<<<<<<<<<<<
  *             elif self['shapeOfTheEarth'] == 8:
  *                 projparams['a']=6371200.0
  */
-      __pyx_t_7 = PyFloat_FromDouble(6356752.3142); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_7);
-      if (PyObject_SetItem(__pyx_v_projparams, ((PyObject *)__pyx_n_s__b), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+      if (unlikely(PyObject_SetItem(__pyx_v_projparams, __pyx_n_s_b, __pyx_float_6356752_3142) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       goto __pyx_L4;
     }
 
-    /* "pygrib.pyx":1475
+    /* "pygrib.pyx":1467
  *                 projparams['a']=6378137.0
  *                 projparams['b']=6356752.3142
  *             elif self['shapeOfTheEarth'] == 8:             # <<<<<<<<<<<<<<
  *                 projparams['a']=6371200.0
  *                 projparams['b']=6371200.0
  */
-    __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__shapeOfTheEarth)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __pyx_t_6 = PyObject_RichCompare(__pyx_t_7, __pyx_int_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_9 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_shapeOfTheEarth); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1467; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_9);
+    __pyx_t_7 = PyObject_RichCompare(__pyx_t_9, __pyx_int_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    if (__pyx_t_3) {
+    if (__pyx_t_4) {
 
-      /* "pygrib.pyx":1476
+      /* "pygrib.pyx":1468
  *                 projparams['b']=6356752.3142
  *             elif self['shapeOfTheEarth'] == 8:
  *                 projparams['a']=6371200.0             # <<<<<<<<<<<<<<
  *                 projparams['b']=6371200.0
  *             else:
  */
-      __pyx_t_6 = PyFloat_FromDouble(6371200.0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_6);
-      if (PyObject_SetItem(__pyx_v_projparams, ((PyObject *)__pyx_n_s__a), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+      if (unlikely(PyObject_SetItem(__pyx_v_projparams, __pyx_n_s_a, __pyx_float_6371200_0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
-      /* "pygrib.pyx":1477
+      /* "pygrib.pyx":1469
  *             elif self['shapeOfTheEarth'] == 8:
  *                 projparams['a']=6371200.0
  *                 projparams['b']=6371200.0             # <<<<<<<<<<<<<<
  *             else:
  *                 if not tolerate_badgrib: raise ValueError('unknown shape of the earth flag')
  */
-      __pyx_t_6 = PyFloat_FromDouble(6371200.0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_6);
-      if (PyObject_SetItem(__pyx_v_projparams, ((PyObject *)__pyx_n_s__b), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+      if (unlikely(PyObject_SetItem(__pyx_v_projparams, __pyx_n_s_b, __pyx_float_6371200_0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       goto __pyx_L4;
     }
     /*else*/ {
 
-      /* "pygrib.pyx":1479
+      /* "pygrib.pyx":1471
  *                 projparams['b']=6371200.0
  *             else:
  *                 if not tolerate_badgrib: raise ValueError('unknown shape of the earth flag')             # <<<<<<<<<<<<<<
  * 
  *         if self['gridType'] in ['reduced_gg','reduced_ll','regular_gg','regular_ll']: # regular lat/lon grid
  */
-      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s__tolerate_badgrib); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_6);
-      __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-      __pyx_t_5 = ((!__pyx_t_3) != 0);
+      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_tolerate_badgrib); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_7);
+      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+      __pyx_t_5 = ((!__pyx_t_4) != 0);
       if (__pyx_t_5) {
-        __pyx_t_6 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_150), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_6);
-        __Pyx_Raise(__pyx_t_6, 0, 0, 0);
-        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        goto __pyx_L13;
+        __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__85, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_7);
+        __Pyx_Raise(__pyx_t_7, 0, 0, 0);
+        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       }
-      __pyx_L13:;
     }
     __pyx_L4:;
   }
   __pyx_L3:;
 
-  /* "pygrib.pyx":1481
+  /* "pygrib.pyx":1473
  *                 if not tolerate_badgrib: raise ValueError('unknown shape of the earth flag')
  * 
  *         if self['gridType'] in ['reduced_gg','reduced_ll','regular_gg','regular_ll']: # regular lat/lon grid             # <<<<<<<<<<<<<<
  *             projparams['proj']='cyl'
  *         elif self['gridType'] == 'polar_stereographic':
  */
-  __pyx_t_6 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__gridType)); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, ((PyObject *)__pyx_n_s__reduced_gg), Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  if (!((int)__pyx_t_5)) {
-    __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, ((PyObject *)__pyx_n_s__reduced_ll), Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __pyx_t_4 = ((int)__pyx_t_3);
+  __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_gridType); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1473; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+  __Pyx_GOTREF(__pyx_t_7);
+  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_t_7, __pyx_n_s_reduced_gg, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (!__pyx_t_4) {
   } else {
-    __pyx_t_4 = ((int)__pyx_t_5);
+    __pyx_t_5 = __pyx_t_4;
+    goto __pyx_L23_bool_binop_done;
   }
+  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_t_7, __pyx_n_s_reduced_ll, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   if (!__pyx_t_4) {
-    __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, ((PyObject *)__pyx_n_s__regular_gg), Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __pyx_t_3 = ((int)__pyx_t_5);
   } else {
-    __pyx_t_3 = __pyx_t_4;
+    __pyx_t_5 = __pyx_t_4;
+    goto __pyx_L23_bool_binop_done;
   }
-  if (!__pyx_t_3) {
-    __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, ((PyObject *)__pyx_n_s__regular_ll), Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __pyx_t_5 = ((int)__pyx_t_4);
+  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_t_7, __pyx_n_s_regular_gg, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (!__pyx_t_4) {
   } else {
-    __pyx_t_5 = __pyx_t_3;
+    __pyx_t_5 = __pyx_t_4;
+    goto __pyx_L23_bool_binop_done;
   }
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  __pyx_t_3 = (__pyx_t_5 != 0);
-  if (__pyx_t_3) {
+  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_t_7, __pyx_n_s_regular_ll, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __pyx_t_4;
+  __pyx_L23_bool_binop_done:;
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_4 = (__pyx_t_5 != 0);
+  if (__pyx_t_4) {
 
-    /* "pygrib.pyx":1482
+    /* "pygrib.pyx":1474
  * 
  *         if self['gridType'] in ['reduced_gg','reduced_ll','regular_gg','regular_ll']: # regular lat/lon grid
  *             projparams['proj']='cyl'             # <<<<<<<<<<<<<<
  *         elif self['gridType'] == 'polar_stereographic':
  *             projparams['proj']='stere'
  */
-    if (PyObject_SetItem(__pyx_v_projparams, ((PyObject *)__pyx_n_s__proj), ((PyObject *)__pyx_n_s__cyl)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L14;
+    if (unlikely(PyObject_SetItem(__pyx_v_projparams, __pyx_n_s_proj, __pyx_n_s_cyl) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    goto __pyx_L22;
   }
 
-  /* "pygrib.pyx":1483
+  /* "pygrib.pyx":1475
  *         if self['gridType'] in ['reduced_gg','reduced_ll','regular_gg','regular_ll']: # regular lat/lon grid
  *             projparams['proj']='cyl'
  *         elif self['gridType'] == 'polar_stereographic':             # <<<<<<<<<<<<<<
  *             projparams['proj']='stere'
  *             projparams['lat_ts']=self['latitudeWhereDxAndDyAreSpecifiedInDegrees']
  */
-  __pyx_t_6 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__gridType)); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, ((PyObject *)__pyx_n_s__polar_stereographic), Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_gridType); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1475; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+  __Pyx_GOTREF(__pyx_t_7);
+  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_t_7, __pyx_n_s_polar_stereographic, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  if (__pyx_t_3) {
+  if (__pyx_t_4) {
 
-    /* "pygrib.pyx":1484
+    /* "pygrib.pyx":1476
  *             projparams['proj']='cyl'
  *         elif self['gridType'] == 'polar_stereographic':
  *             projparams['proj']='stere'             # <<<<<<<<<<<<<<
  *             projparams['lat_ts']=self['latitudeWhereDxAndDyAreSpecifiedInDegrees']
  *             if self.has_key('projectionCentreFlag'):
  */
-    if (PyObject_SetItem(__pyx_v_projparams, ((PyObject *)__pyx_n_s__proj), ((PyObject *)__pyx_n_s__stere)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (unlikely(PyObject_SetItem(__pyx_v_projparams, __pyx_n_s_proj, __pyx_n_s_stere) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
-    /* "pygrib.pyx":1485
+    /* "pygrib.pyx":1477
  *         elif self['gridType'] == 'polar_stereographic':
  *             projparams['proj']='stere'
  *             projparams['lat_ts']=self['latitudeWhereDxAndDyAreSpecifiedInDegrees']             # <<<<<<<<<<<<<<
  *             if self.has_key('projectionCentreFlag'):
  *                 projcenterflag = self['projectionCentreFlag']
  */
-    __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s_151)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_latitudeWhereDxAndDyAreSpecified); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1477; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
     __Pyx_GOTREF(__pyx_t_7);
-    if (PyObject_SetItem(__pyx_v_projparams, ((PyObject *)__pyx_n_s__lat_ts), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (unlikely(PyObject_SetItem(__pyx_v_projparams, __pyx_n_s_lat_ts, __pyx_t_7) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-    /* "pygrib.pyx":1486
+    /* "pygrib.pyx":1478
  *             projparams['proj']='stere'
  *             projparams['lat_ts']=self['latitudeWhereDxAndDyAreSpecifiedInDegrees']
  *             if self.has_key('projectionCentreFlag'):             # <<<<<<<<<<<<<<
  *                 projcenterflag = self['projectionCentreFlag']
  *             elif self.has_key('projectionCenterFlag'):
  */
-    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__has_key); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_has_key); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_7);
-    __pyx_t_6 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_k_tuple_153), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
+    __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__86, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_9);
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    if (__pyx_t_3) {
+    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+    if (__pyx_t_4) {
 
-      /* "pygrib.pyx":1487
+      /* "pygrib.pyx":1479
  *             projparams['lat_ts']=self['latitudeWhereDxAndDyAreSpecifiedInDegrees']
  *             if self.has_key('projectionCentreFlag'):
  *                 projcenterflag = self['projectionCentreFlag']             # <<<<<<<<<<<<<<
  *             elif self.has_key('projectionCenterFlag'):
  *                 projcenterflag = self['projectionCenterFlag']
  */
-      __pyx_t_6 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s_152)); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_6);
-      __pyx_v_projcenterflag = __pyx_t_6;
-      __pyx_t_6 = 0;
-      goto __pyx_L15;
+      __pyx_t_9 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_projectionCentreFlag); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1479; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+      __Pyx_GOTREF(__pyx_t_9);
+      __pyx_v_projcenterflag = __pyx_t_9;
+      __pyx_t_9 = 0;
+      goto __pyx_L27;
     }
 
-    /* "pygrib.pyx":1488
+    /* "pygrib.pyx":1480
  *             if self.has_key('projectionCentreFlag'):
  *                 projcenterflag = self['projectionCentreFlag']
  *             elif self.has_key('projectionCenterFlag'):             # <<<<<<<<<<<<<<
  *                 projcenterflag = self['projectionCenterFlag']
  *             else:
  */
-    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__has_key); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __pyx_t_7 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_k_tuple_155), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_has_key); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_9);
+    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__87, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    if (__pyx_t_3) {
+    if (__pyx_t_4) {
 
-      /* "pygrib.pyx":1489
+      /* "pygrib.pyx":1481
  *                 projcenterflag = self['projectionCentreFlag']
  *             elif self.has_key('projectionCenterFlag'):
  *                 projcenterflag = self['projectionCenterFlag']             # <<<<<<<<<<<<<<
  *             else:
  *                 if not tolerate_badgrib: raise KeyError('cannot find projection center flag')
  */
-      __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s_154)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_projectionCenterFlag); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1481; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
       __Pyx_GOTREF(__pyx_t_7);
       __pyx_v_projcenterflag = __pyx_t_7;
       __pyx_t_7 = 0;
-      goto __pyx_L15;
+      goto __pyx_L27;
     }
     /*else*/ {
 
-      /* "pygrib.pyx":1491
+      /* "pygrib.pyx":1483
  *                 projcenterflag = self['projectionCenterFlag']
  *             else:
  *                 if not tolerate_badgrib: raise KeyError('cannot find projection center flag')             # <<<<<<<<<<<<<<
  *             if projcenterflag == 0:
  *                 projparams['lat_0']=90.
  */
-      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s__tolerate_badgrib); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_tolerate_badgrib); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_7);
-      __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      __pyx_t_5 = ((!__pyx_t_3) != 0);
+      __pyx_t_5 = ((!__pyx_t_4) != 0);
       if (__pyx_t_5) {
-        __pyx_t_7 = PyObject_Call(__pyx_builtin_KeyError, ((PyObject *)__pyx_k_tuple_157), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_tuple__88, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         __Pyx_GOTREF(__pyx_t_7);
         __Pyx_Raise(__pyx_t_7, 0, 0, 0);
         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        goto __pyx_L16;
+        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       }
-      __pyx_L16:;
     }
-    __pyx_L15:;
+    __pyx_L27:;
 
-    /* "pygrib.pyx":1492
+    /* "pygrib.pyx":1484
  *             else:
  *                 if not tolerate_badgrib: raise KeyError('cannot find projection center flag')
  *             if projcenterflag == 0:             # <<<<<<<<<<<<<<
  *                 projparams['lat_0']=90.
  *             else:
  */
-    if (unlikely(!__pyx_v_projcenterflag)) { __Pyx_RaiseUnboundLocalError("projcenterflag"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
-    __pyx_t_7 = PyObject_RichCompare(__pyx_v_projcenterflag, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (unlikely(!__pyx_v_projcenterflag)) { __Pyx_RaiseUnboundLocalError("projcenterflag"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+    __pyx_t_7 = PyObject_RichCompare(__pyx_v_projcenterflag, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
     if (__pyx_t_5) {
 
-      /* "pygrib.pyx":1493
+      /* "pygrib.pyx":1485
  *                 if not tolerate_badgrib: raise KeyError('cannot find projection center flag')
  *             if projcenterflag == 0:
  *                 projparams['lat_0']=90.             # <<<<<<<<<<<<<<
  *             else:
  *                 projparams['lat_0']=-90.
  */
-      __pyx_t_7 = PyFloat_FromDouble(90.); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_7);
-      if (PyObject_SetItem(__pyx_v_projparams, ((PyObject *)__pyx_n_s__lat_0), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      goto __pyx_L17;
+      if (unlikely(PyObject_SetItem(__pyx_v_projparams, __pyx_n_s_lat_0, __pyx_float_90_) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      goto __pyx_L29;
     }
     /*else*/ {
 
-      /* "pygrib.pyx":1495
+      /* "pygrib.pyx":1487
  *                 projparams['lat_0']=90.
  *             else:
  *                 projparams['lat_0']=-90.             # <<<<<<<<<<<<<<
  *             projparams['lon_0']=self['orientationOfTheGridInDegrees']
  *         elif self['gridType'] == 'lambert':
  */
-      __pyx_t_7 = PyFloat_FromDouble(-90.); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_7);
-      if (PyObject_SetItem(__pyx_v_projparams, ((PyObject *)__pyx_n_s__lat_0), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+      if (unlikely(PyObject_SetItem(__pyx_v_projparams, __pyx_n_s_lat_0, __pyx_float_neg_90_) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     }
-    __pyx_L17:;
+    __pyx_L29:;
 
-    /* "pygrib.pyx":1496
+    /* "pygrib.pyx":1488
  *             else:
  *                 projparams['lat_0']=-90.
  *             projparams['lon_0']=self['orientationOfTheGridInDegrees']             # <<<<<<<<<<<<<<
  *         elif self['gridType'] == 'lambert':
  *             projparams['proj']='lcc'
  */
-    __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s_158)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_orientationOfTheGridInDegrees); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1488; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
     __Pyx_GOTREF(__pyx_t_7);
-    if (PyObject_SetItem(__pyx_v_projparams, ((PyObject *)__pyx_n_s__lon_0), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (unlikely(PyObject_SetItem(__pyx_v_projparams, __pyx_n_s_lon_0, __pyx_t_7) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    goto __pyx_L14;
+    goto __pyx_L22;
   }
 
-  /* "pygrib.pyx":1497
+  /* "pygrib.pyx":1489
  *                 projparams['lat_0']=-90.
  *             projparams['lon_0']=self['orientationOfTheGridInDegrees']
  *         elif self['gridType'] == 'lambert':             # <<<<<<<<<<<<<<
  *             projparams['proj']='lcc'
  *             projparams['lon_0']=self['LoVInDegrees']
  */
-  __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__gridType)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_gridType); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1489; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
   __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_6 = PyObject_RichCompare(__pyx_t_7, ((PyObject *)__pyx_n_s__lambert), Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_t_7, __pyx_n_s_lambert, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   if (__pyx_t_5) {
 
-    /* "pygrib.pyx":1498
+    /* "pygrib.pyx":1490
  *             projparams['lon_0']=self['orientationOfTheGridInDegrees']
  *         elif self['gridType'] == 'lambert':
  *             projparams['proj']='lcc'             # <<<<<<<<<<<<<<
  *             projparams['lon_0']=self['LoVInDegrees']
  *             projparams['lat_0']=self['LaDInDegrees']
  */
-    if (PyObject_SetItem(__pyx_v_projparams, ((PyObject *)__pyx_n_s__proj), ((PyObject *)__pyx_n_s__lcc)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (unlikely(PyObject_SetItem(__pyx_v_projparams, __pyx_n_s_proj, __pyx_n_s_lcc) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
-    /* "pygrib.pyx":1499
+    /* "pygrib.pyx":1491
  *         elif self['gridType'] == 'lambert':
  *             projparams['proj']='lcc'
  *             projparams['lon_0']=self['LoVInDegrees']             # <<<<<<<<<<<<<<
  *             projparams['lat_0']=self['LaDInDegrees']
  *             projparams['lat_1']=self['Latin1InDegrees']
  */
-    __pyx_t_6 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__LoVInDegrees)); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    if (PyObject_SetItem(__pyx_v_projparams, ((PyObject *)__pyx_n_s__lon_0), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_LoVInDegrees); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_7);
+    if (unlikely(PyObject_SetItem(__pyx_v_projparams, __pyx_n_s_lon_0, __pyx_t_7) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-    /* "pygrib.pyx":1500
+    /* "pygrib.pyx":1492
  *             projparams['proj']='lcc'
  *             projparams['lon_0']=self['LoVInDegrees']
  *             projparams['lat_0']=self['LaDInDegrees']             # <<<<<<<<<<<<<<
  *             projparams['lat_1']=self['Latin1InDegrees']
  *             projparams['lat_2']=self['Latin2InDegrees']
  */
-    __pyx_t_6 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__LaDInDegrees)); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    if (PyObject_SetItem(__pyx_v_projparams, ((PyObject *)__pyx_n_s__lat_0), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_LaDInDegrees); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1492; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_7);
+    if (unlikely(PyObject_SetItem(__pyx_v_projparams, __pyx_n_s_lat_0, __pyx_t_7) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-    /* "pygrib.pyx":1501
+    /* "pygrib.pyx":1493
  *             projparams['lon_0']=self['LoVInDegrees']
  *             projparams['lat_0']=self['LaDInDegrees']
  *             projparams['lat_1']=self['Latin1InDegrees']             # <<<<<<<<<<<<<<
  *             projparams['lat_2']=self['Latin2InDegrees']
  *         elif self['gridType'] =='albers':
  */
-    __pyx_t_6 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__Latin1InDegrees)); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    if (PyObject_SetItem(__pyx_v_projparams, ((PyObject *)__pyx_n_s__lat_1), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_Latin1InDegrees); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1493; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_7);
+    if (unlikely(PyObject_SetItem(__pyx_v_projparams, __pyx_n_s_lat_1, __pyx_t_7) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-    /* "pygrib.pyx":1502
+    /* "pygrib.pyx":1494
  *             projparams['lat_0']=self['LaDInDegrees']
  *             projparams['lat_1']=self['Latin1InDegrees']
  *             projparams['lat_2']=self['Latin2InDegrees']             # <<<<<<<<<<<<<<
  *         elif self['gridType'] =='albers':
  *             projparams['proj']='aea'
  */
-    __pyx_t_6 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__Latin2InDegrees)); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    if (PyObject_SetItem(__pyx_v_projparams, ((PyObject *)__pyx_n_s__lat_2), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    goto __pyx_L14;
+    __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_Latin2InDegrees); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1494; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_7);
+    if (unlikely(PyObject_SetItem(__pyx_v_projparams, __pyx_n_s_lat_2, __pyx_t_7) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    goto __pyx_L22;
   }
 
-  /* "pygrib.pyx":1503
+  /* "pygrib.pyx":1495
  *             projparams['lat_1']=self['Latin1InDegrees']
  *             projparams['lat_2']=self['Latin2InDegrees']
  *         elif self['gridType'] =='albers':             # <<<<<<<<<<<<<<
  *             projparams['proj']='aea'
  *             scale = float(self['grib2divider'])
  */
-  __pyx_t_6 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__gridType)); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, ((PyObject *)__pyx_n_s__albers), Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_gridType); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1495; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+  __Pyx_GOTREF(__pyx_t_7);
+  __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_t_7, __pyx_n_s_albers, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   if (__pyx_t_5) {
 
-    /* "pygrib.pyx":1504
+    /* "pygrib.pyx":1496
  *             projparams['lat_2']=self['Latin2InDegrees']
  *         elif self['gridType'] =='albers':
  *             projparams['proj']='aea'             # <<<<<<<<<<<<<<
  *             scale = float(self['grib2divider'])
  *             projparams['lon_0']=self['LoV']/scale
  */
-    if (PyObject_SetItem(__pyx_v_projparams, ((PyObject *)__pyx_n_s__proj), ((PyObject *)__pyx_n_s__aea)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (unlikely(PyObject_SetItem(__pyx_v_projparams, __pyx_n_s_proj, __pyx_n_s_aea) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
-    /* "pygrib.pyx":1505
+    /* "pygrib.pyx":1497
  *         elif self['gridType'] =='albers':
  *             projparams['proj']='aea'
  *             scale = float(self['grib2divider'])             # <<<<<<<<<<<<<<
  *             projparams['lon_0']=self['LoV']/scale
  *             if self['truncateDegrees']:
  */
-    __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__grib2divider)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_grib2divider); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1497; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
     __Pyx_GOTREF(__pyx_t_7);
-    __pyx_t_8 = __Pyx_PyObject_AsDouble(__pyx_t_7); if (unlikely(__pyx_t_8 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_10 = __Pyx_PyObject_AsDouble(__pyx_t_7); if (unlikely(__pyx_t_10 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __pyx_t_7 = PyFloat_FromDouble(__pyx_t_8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_7 = PyFloat_FromDouble(__pyx_t_10); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_7);
     __pyx_v_scale = __pyx_t_7;
     __pyx_t_7 = 0;
 
-    /* "pygrib.pyx":1506
+    /* "pygrib.pyx":1498
  *             projparams['proj']='aea'
  *             scale = float(self['grib2divider'])
  *             projparams['lon_0']=self['LoV']/scale             # <<<<<<<<<<<<<<
  *             if self['truncateDegrees']:
  *                 projparams['lon_0'] = int(projparams['lon_0'])
  */
-    __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__LoV)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_LoV); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1498; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
     __Pyx_GOTREF(__pyx_t_7);
-    __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_t_7, __pyx_v_scale); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
+    __pyx_t_9 = __Pyx_PyNumber_Divide(__pyx_t_7, __pyx_v_scale); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_9);
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    if (PyObject_SetItem(__pyx_v_projparams, ((PyObject *)__pyx_n_s__lon_0), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    if (unlikely(PyObject_SetItem(__pyx_v_projparams, __pyx_n_s_lon_0, __pyx_t_9) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
 
-    /* "pygrib.pyx":1507
+    /* "pygrib.pyx":1499
  *             scale = float(self['grib2divider'])
  *             projparams['lon_0']=self['LoV']/scale
  *             if self['truncateDegrees']:             # <<<<<<<<<<<<<<
  *                 projparams['lon_0'] = int(projparams['lon_0'])
  *             projparams['lat_0']=self['LaD']/scale
  */
-    __pyx_t_6 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__truncateDegrees)); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __pyx_t_9 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_truncateDegrees); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1499; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_9);
+    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
     if (__pyx_t_5) {
 
-      /* "pygrib.pyx":1508
+      /* "pygrib.pyx":1500
  *             projparams['lon_0']=self['LoV']/scale
  *             if self['truncateDegrees']:
  *                 projparams['lon_0'] = int(projparams['lon_0'])             # <<<<<<<<<<<<<<
  *             projparams['lat_0']=self['LaD']/scale
  *             if self['truncateDegrees']:
  */
-      __pyx_t_6 = PyObject_GetItem(__pyx_v_projparams, ((PyObject *)__pyx_n_s__lon_0)); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_6);
-      __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_9 = PyObject_GetItem(__pyx_v_projparams, __pyx_n_s_lon_0); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+      __Pyx_GOTREF(__pyx_t_9);
+      __pyx_t_7 = PyNumber_Int(__pyx_t_9); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_7);
-      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6);
-      __Pyx_GIVEREF(__pyx_t_6);
-      __pyx_t_6 = 0;
-      __pyx_t_6 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_6);
-      __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
-      if (PyObject_SetItem(__pyx_v_projparams, ((PyObject *)__pyx_n_s__lon_0), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-      goto __pyx_L18;
+      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+      if (unlikely(PyObject_SetItem(__pyx_v_projparams, __pyx_n_s_lon_0, __pyx_t_7) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+      goto __pyx_L30;
     }
-    __pyx_L18:;
+    __pyx_L30:;
 
-    /* "pygrib.pyx":1509
+    /* "pygrib.pyx":1501
  *             if self['truncateDegrees']:
  *                 projparams['lon_0'] = int(projparams['lon_0'])
  *             projparams['lat_0']=self['LaD']/scale             # <<<<<<<<<<<<<<
  *             if self['truncateDegrees']:
  *                 projparams['lat_0'] = int(projparams['lat_0'])
  */
-    __pyx_t_6 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__LaD)); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_t_6, __pyx_v_scale); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_LaD); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1501; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
     __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    if (PyObject_SetItem(__pyx_v_projparams, ((PyObject *)__pyx_n_s__lat_0), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_9 = __Pyx_PyNumber_Divide(__pyx_t_7, __pyx_v_scale); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_9);
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    if (unlikely(PyObject_SetItem(__pyx_v_projparams, __pyx_n_s_lat_0, __pyx_t_9) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
 
-    /* "pygrib.pyx":1510
+    /* "pygrib.pyx":1502
  *                 projparams['lon_0'] = int(projparams['lon_0'])
  *             projparams['lat_0']=self['LaD']/scale
  *             if self['truncateDegrees']:             # <<<<<<<<<<<<<<
  *                 projparams['lat_0'] = int(projparams['lat_0'])
  *             projparams['lat_1']=self['Latin1']/scale
  */
-    __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__truncateDegrees)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __pyx_t_9 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_truncateDegrees); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1502; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_9);
+    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
     if (__pyx_t_5) {
 
-      /* "pygrib.pyx":1511
+      /* "pygrib.pyx":1503
  *             projparams['lat_0']=self['LaD']/scale
  *             if self['truncateDegrees']:
  *                 projparams['lat_0'] = int(projparams['lat_0'])             # <<<<<<<<<<<<<<
  *             projparams['lat_1']=self['Latin1']/scale
  *             if self['truncateDegrees']:
  */
-      __pyx_t_7 = PyObject_GetItem(__pyx_v_projparams, ((PyObject *)__pyx_n_s__lat_0)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_7);
-      __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_6);
-      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7);
-      __Pyx_GIVEREF(__pyx_t_7);
-      __pyx_t_7 = 0;
-      __pyx_t_7 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_9 = PyObject_GetItem(__pyx_v_projparams, __pyx_n_s_lat_0); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1503; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+      __Pyx_GOTREF(__pyx_t_9);
+      __pyx_t_7 = PyNumber_Int(__pyx_t_9); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_7);
-      __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
-      if (PyObject_SetItem(__pyx_v_projparams, ((PyObject *)__pyx_n_s__lat_0), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+      if (unlikely(PyObject_SetItem(__pyx_v_projparams, __pyx_n_s_lat_0, __pyx_t_7) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      goto __pyx_L19;
+      goto __pyx_L31;
     }
-    __pyx_L19:;
+    __pyx_L31:;
 
-    /* "pygrib.pyx":1512
+    /* "pygrib.pyx":1504
  *             if self['truncateDegrees']:
  *                 projparams['lat_0'] = int(projparams['lat_0'])
  *             projparams['lat_1']=self['Latin1']/scale             # <<<<<<<<<<<<<<
  *             if self['truncateDegrees']:
  *                 projparams['lat_1'] = int(projparams['lat_1'])
  */
-    __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__Latin1)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_Latin1); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1504; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
     __Pyx_GOTREF(__pyx_t_7);
-    __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_t_7, __pyx_v_scale); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
+    __pyx_t_9 = __Pyx_PyNumber_Divide(__pyx_t_7, __pyx_v_scale); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_9);
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    if (PyObject_SetItem(__pyx_v_projparams, ((PyObject *)__pyx_n_s__lat_1), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    if (unlikely(PyObject_SetItem(__pyx_v_projparams, __pyx_n_s_lat_1, __pyx_t_9) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
 
-    /* "pygrib.pyx":1513
+    /* "pygrib.pyx":1505
  *                 projparams['lat_0'] = int(projparams['lat_0'])
  *             projparams['lat_1']=self['Latin1']/scale
  *             if self['truncateDegrees']:             # <<<<<<<<<<<<<<
  *                 projparams['lat_1'] = int(projparams['lat_1'])
  *             projparams['lat_2']=self['Latin2']/scale
  */
-    __pyx_t_6 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__truncateDegrees)); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __pyx_t_9 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_truncateDegrees); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1505; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_9);
+    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
     if (__pyx_t_5) {
 
-      /* "pygrib.pyx":1514
+      /* "pygrib.pyx":1506
  *             projparams['lat_1']=self['Latin1']/scale
  *             if self['truncateDegrees']:
  *                 projparams['lat_1'] = int(projparams['lat_1'])             # <<<<<<<<<<<<<<
  *             projparams['lat_2']=self['Latin2']/scale
  *             if self['truncateDegrees']:
  */
-      __pyx_t_6 = PyObject_GetItem(__pyx_v_projparams, ((PyObject *)__pyx_n_s__lat_1)); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_6);
-      __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_9 = PyObject_GetItem(__pyx_v_projparams, __pyx_n_s_lat_1); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1506; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+      __Pyx_GOTREF(__pyx_t_9);
+      __pyx_t_7 = PyNumber_Int(__pyx_t_9); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_7);
-      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6);
-      __Pyx_GIVEREF(__pyx_t_6);
-      __pyx_t_6 = 0;
-      __pyx_t_6 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_6);
-      __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
-      if (PyObject_SetItem(__pyx_v_projparams, ((PyObject *)__pyx_n_s__lat_1), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-      goto __pyx_L20;
+      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+      if (unlikely(PyObject_SetItem(__pyx_v_projparams, __pyx_n_s_lat_1, __pyx_t_7) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+      goto __pyx_L32;
     }
-    __pyx_L20:;
+    __pyx_L32:;
 
-    /* "pygrib.pyx":1515
+    /* "pygrib.pyx":1507
  *             if self['truncateDegrees']:
  *                 projparams['lat_1'] = int(projparams['lat_1'])
  *             projparams['lat_2']=self['Latin2']/scale             # <<<<<<<<<<<<<<
  *             if self['truncateDegrees']:
  *                 projparams['lat_2'] = int(projparams['lat_2'])
  */
-    __pyx_t_6 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__Latin2)); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_t_6, __pyx_v_scale); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_Latin2); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1507; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
     __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    if (PyObject_SetItem(__pyx_v_projparams, ((PyObject *)__pyx_n_s__lat_2), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_9 = __Pyx_PyNumber_Divide(__pyx_t_7, __pyx_v_scale); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_9);
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    if (unlikely(PyObject_SetItem(__pyx_v_projparams, __pyx_n_s_lat_2, __pyx_t_9) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
 
-    /* "pygrib.pyx":1516
+    /* "pygrib.pyx":1508
  *                 projparams['lat_1'] = int(projparams['lat_1'])
  *             projparams['lat_2']=self['Latin2']/scale
  *             if self['truncateDegrees']:             # <<<<<<<<<<<<<<
  *                 projparams['lat_2'] = int(projparams['lat_2'])
  *         elif self['gridType'] == 'space_view':
  */
-    __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__truncateDegrees)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __pyx_t_9 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_truncateDegrees); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1508; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_9);
+    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
     if (__pyx_t_5) {
 
-      /* "pygrib.pyx":1517
+      /* "pygrib.pyx":1509
  *             projparams['lat_2']=self['Latin2']/scale
  *             if self['truncateDegrees']:
  *                 projparams['lat_2'] = int(projparams['lat_2'])             # <<<<<<<<<<<<<<
  *         elif self['gridType'] == 'space_view':
  *             projparams['lon_0']=self['longitudeOfSubSatellitePointInDegrees']
  */
-      __pyx_t_7 = PyObject_GetItem(__pyx_v_projparams, ((PyObject *)__pyx_n_s__lat_2)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_7);
-      __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_6);
-      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7);
-      __Pyx_GIVEREF(__pyx_t_7);
-      __pyx_t_7 = 0;
-      __pyx_t_7 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_9 = PyObject_GetItem(__pyx_v_projparams, __pyx_n_s_lat_2); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1509; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+      __Pyx_GOTREF(__pyx_t_9);
+      __pyx_t_7 = PyNumber_Int(__pyx_t_9); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_7);
-      __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
-      if (PyObject_SetItem(__pyx_v_projparams, ((PyObject *)__pyx_n_s__lat_2), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+      if (unlikely(PyObject_SetItem(__pyx_v_projparams, __pyx_n_s_lat_2, __pyx_t_7) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      goto __pyx_L21;
+      goto __pyx_L33;
     }
-    __pyx_L21:;
-    goto __pyx_L14;
+    __pyx_L33:;
+    goto __pyx_L22;
   }
 
-  /* "pygrib.pyx":1518
+  /* "pygrib.pyx":1510
  *             if self['truncateDegrees']:
  *                 projparams['lat_2'] = int(projparams['lat_2'])
  *         elif self['gridType'] == 'space_view':             # <<<<<<<<<<<<<<
  *             projparams['lon_0']=self['longitudeOfSubSatellitePointInDegrees']
  *             projparams['lat_0']=self['latitudeOfSubSatellitePointInDegrees']
  */
-  __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__gridType)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_gridType); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1510; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
   __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_6 = PyObject_RichCompare(__pyx_t_7, ((PyObject *)__pyx_n_s__space_view), Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_t_7, __pyx_n_s_space_view, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   if (__pyx_t_5) {
 
-    /* "pygrib.pyx":1519
+    /* "pygrib.pyx":1511
  *                 projparams['lat_2'] = int(projparams['lat_2'])
  *         elif self['gridType'] == 'space_view':
  *             projparams['lon_0']=self['longitudeOfSubSatellitePointInDegrees']             # <<<<<<<<<<<<<<
  *             projparams['lat_0']=self['latitudeOfSubSatellitePointInDegrees']
  *             if projparams['lat_0'] == 0.: # if lat_0 is equator, it's a
  */
-    __pyx_t_6 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s_159)); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    if (PyObject_SetItem(__pyx_v_projparams, ((PyObject *)__pyx_n_s__lon_0), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_longitudeOfSubSatellitePointInDe); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1511; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_7);
+    if (unlikely(PyObject_SetItem(__pyx_v_projparams, __pyx_n_s_lon_0, __pyx_t_7) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-    /* "pygrib.pyx":1520
+    /* "pygrib.pyx":1512
  *         elif self['gridType'] == 'space_view':
  *             projparams['lon_0']=self['longitudeOfSubSatellitePointInDegrees']
  *             projparams['lat_0']=self['latitudeOfSubSatellitePointInDegrees']             # <<<<<<<<<<<<<<
  *             if projparams['lat_0'] == 0.: # if lat_0 is equator, it's a
  *                 projparams['proj'] = 'geos'
  */
-    __pyx_t_6 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s_160)); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    if (PyObject_SetItem(__pyx_v_projparams, ((PyObject *)__pyx_n_s__lat_0), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_latitudeOfSubSatellitePointInDeg); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1512; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_7);
+    if (unlikely(PyObject_SetItem(__pyx_v_projparams, __pyx_n_s_lat_0, __pyx_t_7) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-    /* "pygrib.pyx":1521
+    /* "pygrib.pyx":1513
  *             projparams['lon_0']=self['longitudeOfSubSatellitePointInDegrees']
  *             projparams['lat_0']=self['latitudeOfSubSatellitePointInDegrees']
  *             if projparams['lat_0'] == 0.: # if lat_0 is equator, it's a             # <<<<<<<<<<<<<<
  *                 projparams['proj'] = 'geos'
  *             # general case of 'near-side perspective projection' (untested)
  */
-    __pyx_t_6 = PyObject_GetItem(__pyx_v_projparams, ((PyObject *)__pyx_n_s__lat_0)); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __pyx_t_7 = PyFloat_FromDouble(0.); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_7 = PyObject_GetItem(__pyx_v_projparams, __pyx_n_s_lat_0); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1513; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
     __Pyx_GOTREF(__pyx_t_7);
-    __pyx_t_2 = PyObject_RichCompare(__pyx_t_6, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __pyx_t_9 = PyObject_RichCompare(__pyx_t_7, __pyx_float_0_, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
     if (__pyx_t_5) {
 
-      /* "pygrib.pyx":1522
+      /* "pygrib.pyx":1514
  *             projparams['lat_0']=self['latitudeOfSubSatellitePointInDegrees']
  *             if projparams['lat_0'] == 0.: # if lat_0 is equator, it's a
  *                 projparams['proj'] = 'geos'             # <<<<<<<<<<<<<<
  *             # general case of 'near-side perspective projection' (untested)
  *             else:
  */
-      if (PyObject_SetItem(__pyx_v_projparams, ((PyObject *)__pyx_n_s__proj), ((PyObject *)__pyx_n_s__geos)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      goto __pyx_L22;
+      if (unlikely(PyObject_SetItem(__pyx_v_projparams, __pyx_n_s_proj, __pyx_n_s_geos) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      goto __pyx_L34;
     }
     /*else*/ {
 
-      /* "pygrib.pyx":1525
+      /* "pygrib.pyx":1517
  *             # general case of 'near-side perspective projection' (untested)
  *             else:
  *                 projparams['proj'] = 'nsper'             # <<<<<<<<<<<<<<
  *             scale = float(self['grib2divider'])
  *             projparams['h'] = projparams['a'] * self['Nr']/scale
  */
-      if (PyObject_SetItem(__pyx_v_projparams, ((PyObject *)__pyx_n_s__proj), ((PyObject *)__pyx_n_s__nsper)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      if (unlikely(PyObject_SetItem(__pyx_v_projparams, __pyx_n_s_proj, __pyx_n_s_nsper) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     }
-    __pyx_L22:;
+    __pyx_L34:;
 
-    /* "pygrib.pyx":1526
+    /* "pygrib.pyx":1518
  *             else:
  *                 projparams['proj'] = 'nsper'
  *             scale = float(self['grib2divider'])             # <<<<<<<<<<<<<<
  *             projparams['h'] = projparams['a'] * self['Nr']/scale
  *             # h is measured from surface of earth at equator.
  */
-    __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__grib2divider)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_8 = __Pyx_PyObject_AsDouble(__pyx_t_2); if (unlikely(__pyx_t_8 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_2 = PyFloat_FromDouble(__pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_v_scale = __pyx_t_2;
-    __pyx_t_2 = 0;
+    __pyx_t_9 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_grib2divider); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1518; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_9);
+    __pyx_t_10 = __Pyx_PyObject_AsDouble(__pyx_t_9); if (unlikely(__pyx_t_10 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+    __pyx_t_9 = PyFloat_FromDouble(__pyx_t_10); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_9);
+    __pyx_v_scale = __pyx_t_9;
+    __pyx_t_9 = 0;
 
-    /* "pygrib.pyx":1527
+    /* "pygrib.pyx":1519
  *                 projparams['proj'] = 'nsper'
  *             scale = float(self['grib2divider'])
  *             projparams['h'] = projparams['a'] * self['Nr']/scale             # <<<<<<<<<<<<<<
  *             # h is measured from surface of earth at equator.
  *             projparams['h'] = projparams['h']-projparams['a']
  */
-    __pyx_t_2 = PyObject_GetItem(__pyx_v_projparams, ((PyObject *)__pyx_n_s__a)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__Nr)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_9 = PyObject_GetItem(__pyx_v_projparams, __pyx_n_s_a); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1519; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_9);
+    __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_Nr); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1519; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
     __Pyx_GOTREF(__pyx_t_7);
-    __pyx_t_6 = PyNumber_Multiply(__pyx_t_2, __pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_1 = PyNumber_Multiply(__pyx_t_9, __pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_t_6, __pyx_v_scale); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_v_scale); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    if (PyObject_SetItem(__pyx_v_projparams, ((PyObject *)__pyx_n_s__h), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    if (unlikely(PyObject_SetItem(__pyx_v_projparams, __pyx_n_s_h, __pyx_t_7) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-    /* "pygrib.pyx":1529
+    /* "pygrib.pyx":1521
  *             projparams['h'] = projparams['a'] * self['Nr']/scale
  *             # h is measured from surface of earth at equator.
  *             projparams['h'] = projparams['h']-projparams['a']             # <<<<<<<<<<<<<<
  *         elif self['gridType'] == "equatorial_azimuthal_equidistant":
  *             projparams['lat_0'] = self['standardParallel']/1.e6
  */
-    __pyx_t_7 = PyObject_GetItem(__pyx_v_projparams, ((PyObject *)__pyx_n_s__h)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_7 = PyObject_GetItem(__pyx_v_projparams, __pyx_n_s_h); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1521; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
     __Pyx_GOTREF(__pyx_t_7);
-    __pyx_t_6 = PyObject_GetItem(__pyx_v_projparams, ((PyObject *)__pyx_n_s__a)); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __pyx_t_2 = PyNumber_Subtract(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_1 = PyObject_GetItem(__pyx_v_projparams, __pyx_n_s_a); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1521; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_9 = PyNumber_Subtract(__pyx_t_7, __pyx_t_1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_9);
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    if (PyObject_SetItem(__pyx_v_projparams, ((PyObject *)__pyx_n_s__h), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    goto __pyx_L14;
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    if (unlikely(PyObject_SetItem(__pyx_v_projparams, __pyx_n_s_h, __pyx_t_9) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+    goto __pyx_L22;
   }
 
-  /* "pygrib.pyx":1530
+  /* "pygrib.pyx":1522
  *             # h is measured from surface of earth at equator.
  *             projparams['h'] = projparams['h']-projparams['a']
  *         elif self['gridType'] == "equatorial_azimuthal_equidistant":             # <<<<<<<<<<<<<<
  *             projparams['lat_0'] = self['standardParallel']/1.e6
  *             projparams['lon_0'] = self['centralLongitude']/1.e6
  */
-  __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__gridType)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_6 = PyObject_RichCompare(__pyx_t_2, ((PyObject *)__pyx_n_s_161), Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __pyx_t_9 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_gridType); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1522; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+  __Pyx_GOTREF(__pyx_t_9);
+  __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_t_9, __pyx_n_s_equatorial_azimuthal_equidistant, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
   if (__pyx_t_5) {
 
-    /* "pygrib.pyx":1531
+    /* "pygrib.pyx":1523
  *             projparams['h'] = projparams['h']-projparams['a']
  *         elif self['gridType'] == "equatorial_azimuthal_equidistant":
  *             projparams['lat_0'] = self['standardParallel']/1.e6             # <<<<<<<<<<<<<<
  *             projparams['lon_0'] = self['centralLongitude']/1.e6
  *             projparams['proj'] = 'aeqd'
  */
-    __pyx_t_6 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__standardParallel)); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __pyx_t_2 = PyFloat_FromDouble(1.e6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    if (PyObject_SetItem(__pyx_v_projparams, ((PyObject *)__pyx_n_s__lat_0), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __pyx_t_9 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_standardParallel); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1523; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_9);
+    __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_9, __pyx_float_1_e6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+    if (unlikely(PyObject_SetItem(__pyx_v_projparams, __pyx_n_s_lat_0, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-    /* "pygrib.pyx":1532
+    /* "pygrib.pyx":1524
  *         elif self['gridType'] == "equatorial_azimuthal_equidistant":
  *             projparams['lat_0'] = self['standardParallel']/1.e6
  *             projparams['lon_0'] = self['centralLongitude']/1.e6             # <<<<<<<<<<<<<<
  *             projparams['proj'] = 'aeqd'
  *         elif self['gridType'] == "lambert_azimuthal_equal_area":
  */
-    __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__centralLongitude)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __pyx_t_2 = PyFloat_FromDouble(1.e6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_t_7, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    if (PyObject_SetItem(__pyx_v_projparams, ((PyObject *)__pyx_n_s__lon_0), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_centralLongitude); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1524; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_9 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_float_1_e6); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_9);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    if (unlikely(PyObject_SetItem(__pyx_v_projparams, __pyx_n_s_lon_0, __pyx_t_9) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
 
-    /* "pygrib.pyx":1533
+    /* "pygrib.pyx":1525
  *             projparams['lat_0'] = self['standardParallel']/1.e6
  *             projparams['lon_0'] = self['centralLongitude']/1.e6
  *             projparams['proj'] = 'aeqd'             # <<<<<<<<<<<<<<
  *         elif self['gridType'] == "lambert_azimuthal_equal_area":
  *             projparams['lat_0'] = self['standardParallel']/1.e6
  */
-    if (PyObject_SetItem(__pyx_v_projparams, ((PyObject *)__pyx_n_s__proj), ((PyObject *)__pyx_n_s__aeqd)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L14;
+    if (unlikely(PyObject_SetItem(__pyx_v_projparams, __pyx_n_s_proj, __pyx_n_s_aeqd) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    goto __pyx_L22;
   }
 
-  /* "pygrib.pyx":1534
+  /* "pygrib.pyx":1526
  *             projparams['lon_0'] = self['centralLongitude']/1.e6
  *             projparams['proj'] = 'aeqd'
  *         elif self['gridType'] == "lambert_azimuthal_equal_area":             # <<<<<<<<<<<<<<
  *             projparams['lat_0'] = self['standardParallel']/1.e6
  *             projparams['lon_0'] = self['centralLongitude']/1.e6
  */
-  __pyx_t_6 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__gridType)); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_2 = PyObject_RichCompare(__pyx_t_6, ((PyObject *)__pyx_n_s_162), Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_9 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_gridType); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+  __Pyx_GOTREF(__pyx_t_9);
+  __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_t_9, __pyx_n_s_lambert_azimuthal_equal_area, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
   if (__pyx_t_5) {
 
-    /* "pygrib.pyx":1535
+    /* "pygrib.pyx":1527
  *             projparams['proj'] = 'aeqd'
  *         elif self['gridType'] == "lambert_azimuthal_equal_area":
  *             projparams['lat_0'] = self['standardParallel']/1.e6             # <<<<<<<<<<<<<<
  *             projparams['lon_0'] = self['centralLongitude']/1.e6
  *             projparams['proj'] = 'laea'
  */
-    __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__standardParallel)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_6 = PyFloat_FromDouble(1.e6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    if (PyObject_SetItem(__pyx_v_projparams, ((PyObject *)__pyx_n_s__lat_0), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __pyx_t_9 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_standardParallel); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1527; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_9);
+    __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_9, __pyx_float_1_e6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+    if (unlikely(PyObject_SetItem(__pyx_v_projparams, __pyx_n_s_lat_0, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-    /* "pygrib.pyx":1536
+    /* "pygrib.pyx":1528
  *         elif self['gridType'] == "lambert_azimuthal_equal_area":
  *             projparams['lat_0'] = self['standardParallel']/1.e6
  *             projparams['lon_0'] = self['centralLongitude']/1.e6             # <<<<<<<<<<<<<<
  *             projparams['proj'] = 'laea'
  *         elif self['gridType'] == 'mercator':
  */
-    __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__centralLongitude)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __pyx_t_6 = PyFloat_FromDouble(1.e6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    if (PyObject_SetItem(__pyx_v_projparams, ((PyObject *)__pyx_n_s__lon_0), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_centralLongitude); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1528; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_9 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_float_1_e6); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_9);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    if (unlikely(PyObject_SetItem(__pyx_v_projparams, __pyx_n_s_lon_0, __pyx_t_9) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
 
-    /* "pygrib.pyx":1537
+    /* "pygrib.pyx":1529
  *             projparams['lat_0'] = self['standardParallel']/1.e6
  *             projparams['lon_0'] = self['centralLongitude']/1.e6
  *             projparams['proj'] = 'laea'             # <<<<<<<<<<<<<<
  *         elif self['gridType'] == 'mercator':
  *             scale = self._get_key('grib2divider',False)
  */
-    if (PyObject_SetItem(__pyx_v_projparams, ((PyObject *)__pyx_n_s__proj), ((PyObject *)__pyx_n_s__laea)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L14;
+    if (unlikely(PyObject_SetItem(__pyx_v_projparams, __pyx_n_s_proj, __pyx_n_s_laea) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    goto __pyx_L22;
   }
 
-  /* "pygrib.pyx":1538
+  /* "pygrib.pyx":1530
  *             projparams['lon_0'] = self['centralLongitude']/1.e6
  *             projparams['proj'] = 'laea'
  *         elif self['gridType'] == 'mercator':             # <<<<<<<<<<<<<<
  *             scale = self._get_key('grib2divider',False)
  *             if scale:
  */
-  __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__gridType)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_6 = PyObject_RichCompare(__pyx_t_2, ((PyObject *)__pyx_n_s__mercator), Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __pyx_t_9 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_gridType); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1530; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+  __Pyx_GOTREF(__pyx_t_9);
+  __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_t_9, __pyx_n_s_mercator, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
   if (__pyx_t_5) {
 
-    /* "pygrib.pyx":1539
+    /* "pygrib.pyx":1531
  *             projparams['proj'] = 'laea'
  *         elif self['gridType'] == 'mercator':
  *             scale = self._get_key('grib2divider',False)             # <<<<<<<<<<<<<<
  *             if scale:
  *                 scale = float(scale)
  */
-    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s___get_key); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_INCREF(((PyObject *)__pyx_n_s__grib2divider));
-    PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_n_s__grib2divider));
-    __Pyx_GIVEREF(((PyObject *)__pyx_n_s__grib2divider));
-    PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_2);
-    __Pyx_GIVEREF(__pyx_t_2);
-    __pyx_t_2 = 0;
-    __pyx_t_2 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
-    __pyx_v_scale = __pyx_t_2;
-    __pyx_t_2 = 0;
+    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_key); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_9);
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__89, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+    __pyx_v_scale = __pyx_t_1;
+    __pyx_t_1 = 0;
 
-    /* "pygrib.pyx":1540
+    /* "pygrib.pyx":1532
  *         elif self['gridType'] == 'mercator':
  *             scale = self._get_key('grib2divider',False)
  *             if scale:             # <<<<<<<<<<<<<<
  *                 scale = float(scale)
  *             else:
  */
-    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_scale); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_scale); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     if (__pyx_t_5) {
 
-      /* "pygrib.pyx":1541
+      /* "pygrib.pyx":1533
  *             scale = self._get_key('grib2divider',False)
  *             if scale:
  *                 scale = float(scale)             # <<<<<<<<<<<<<<
  *             else:
  *                 scale = 1000.
  */
-      __pyx_t_8 = __Pyx_PyObject_AsDouble(__pyx_v_scale); if (unlikely(__pyx_t_8 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_2 = PyFloat_FromDouble(__pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __Pyx_DECREF_SET(__pyx_v_scale, __pyx_t_2);
-      __pyx_t_2 = 0;
-      goto __pyx_L23;
+      __pyx_t_10 = __Pyx_PyObject_AsDouble(__pyx_v_scale); if (unlikely(__pyx_t_10 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_1 = PyFloat_FromDouble(__pyx_t_10); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF_SET(__pyx_v_scale, __pyx_t_1);
+      __pyx_t_1 = 0;
+      goto __pyx_L35;
     }
     /*else*/ {
 
-      /* "pygrib.pyx":1543
+      /* "pygrib.pyx":1535
  *                 scale = float(scale)
  *             else:
  *                 scale = 1000.             # <<<<<<<<<<<<<<
  *             lon1 = self['longitudeOfFirstGridPoint']/scale
  *             lon2 = self['longitudeOfLastGridPoint']/scale
  */
-      __pyx_t_2 = PyFloat_FromDouble(1000.); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __Pyx_DECREF_SET(__pyx_v_scale, __pyx_t_2);
-      __pyx_t_2 = 0;
+      __Pyx_INCREF(__pyx_float_1000_);
+      __Pyx_DECREF_SET(__pyx_v_scale, __pyx_float_1000_);
     }
-    __pyx_L23:;
+    __pyx_L35:;
 
-    /* "pygrib.pyx":1544
+    /* "pygrib.pyx":1536
  *             else:
  *                 scale = 1000.
  *             lon1 = self['longitudeOfFirstGridPoint']/scale             # <<<<<<<<<<<<<<
  *             lon2 = self['longitudeOfLastGridPoint']/scale
  *             if self._get_key('truncateDegrees',False):
  */
-    __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s_163)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_v_scale); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_v_lon1 = __pyx_t_7;
-    __pyx_t_7 = 0;
+    __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_longitudeOfFirstGridPoint); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1536; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_9 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_v_scale); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_9);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_v_lon1 = __pyx_t_9;
+    __pyx_t_9 = 0;
 
-    /* "pygrib.pyx":1545
+    /* "pygrib.pyx":1537
  *                 scale = 1000.
  *             lon1 = self['longitudeOfFirstGridPoint']/scale
  *             lon2 = self['longitudeOfLastGridPoint']/scale             # <<<<<<<<<<<<<<
  *             if self._get_key('truncateDegrees',False):
  *                 lon1 = int(lon1)
  */
-    __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s_164)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_7, __pyx_v_scale); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __pyx_v_lon2 = __pyx_t_2;
-    __pyx_t_2 = 0;
+    __pyx_t_9 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_longitudeOfLastGridPoint); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1537; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_9);
+    __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_9, __pyx_v_scale); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+    __pyx_v_lon2 = __pyx_t_1;
+    __pyx_t_1 = 0;
 
-    /* "pygrib.pyx":1546
+    /* "pygrib.pyx":1538
  *             lon1 = self['longitudeOfFirstGridPoint']/scale
  *             lon2 = self['longitudeOfLastGridPoint']/scale
  *             if self._get_key('truncateDegrees',False):             # <<<<<<<<<<<<<<
  *                 lon1 = int(lon1)
  *                 lon2 = int(lon2)
  */
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s___get_key); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_7 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __Pyx_INCREF(((PyObject *)__pyx_n_s__truncateDegrees));
-    PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_n_s__truncateDegrees));
-    __Pyx_GIVEREF(((PyObject *)__pyx_n_s__truncateDegrees));
-    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_7);
-    __Pyx_GIVEREF(__pyx_t_7);
-    __pyx_t_7 = 0;
-    __pyx_t_7 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
-    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_key); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__90, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_9);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
     if (__pyx_t_5) {
 
-      /* "pygrib.pyx":1547
+      /* "pygrib.pyx":1539
  *             lon2 = self['longitudeOfLastGridPoint']/scale
  *             if self._get_key('truncateDegrees',False):
  *                 lon1 = int(lon1)             # <<<<<<<<<<<<<<
  *                 lon2 = int(lon2)
  *             if self._get_key('LaD',False):
  */
-      __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_7);
-      __Pyx_INCREF(__pyx_v_lon1);
-      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_lon1);
-      __Pyx_GIVEREF(__pyx_v_lon1);
-      __pyx_t_6 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_6);
-      __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
-      __Pyx_DECREF_SET(__pyx_v_lon1, __pyx_t_6);
-      __pyx_t_6 = 0;
+      __pyx_t_9 = PyNumber_Int(__pyx_v_lon1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_9);
+      __Pyx_DECREF_SET(__pyx_v_lon1, __pyx_t_9);
+      __pyx_t_9 = 0;
 
-      /* "pygrib.pyx":1548
+      /* "pygrib.pyx":1540
  *             if self._get_key('truncateDegrees',False):
  *                 lon1 = int(lon1)
  *                 lon2 = int(lon2)             # <<<<<<<<<<<<<<
  *             if self._get_key('LaD',False):
  *                 projparams['lat_ts'] = self['LaD']/scale
  */
-      __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_6);
-      __Pyx_INCREF(__pyx_v_lon2);
-      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_lon2);
-      __Pyx_GIVEREF(__pyx_v_lon2);
-      __pyx_t_7 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_7);
-      __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
-      __Pyx_DECREF_SET(__pyx_v_lon2, __pyx_t_7);
-      __pyx_t_7 = 0;
-      goto __pyx_L24;
+      __pyx_t_9 = PyNumber_Int(__pyx_v_lon2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_9);
+      __Pyx_DECREF_SET(__pyx_v_lon2, __pyx_t_9);
+      __pyx_t_9 = 0;
+      goto __pyx_L36;
     }
-    __pyx_L24:;
+    __pyx_L36:;
 
-    /* "pygrib.pyx":1549
+    /* "pygrib.pyx":1541
  *                 lon1 = int(lon1)
  *                 lon2 = int(lon2)
  *             if self._get_key('LaD',False):             # <<<<<<<<<<<<<<
  *                 projparams['lat_ts'] = self['LaD']/scale
  *             else:
  */
-    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s___get_key); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __pyx_t_6 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_INCREF(((PyObject *)__pyx_n_s__LaD));
-    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_n_s__LaD));
-    __Pyx_GIVEREF(((PyObject *)__pyx_n_s__LaD));
-    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_6);
-    __Pyx_GIVEREF(__pyx_t_6);
-    __pyx_t_6 = 0;
-    __pyx_t_6 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
-    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_key); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_9);
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__91, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     if (__pyx_t_5) {
 
-      /* "pygrib.pyx":1550
+      /* "pygrib.pyx":1542
  *                 lon2 = int(lon2)
  *             if self._get_key('LaD',False):
  *                 projparams['lat_ts'] = self['LaD']/scale             # <<<<<<<<<<<<<<
  *             else:
  *                 projparams['lat_ts'] = self['Latin']/scale
  */
-      __pyx_t_6 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__LaD)); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_6);
-      __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_6, __pyx_v_scale); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-      if (PyObject_SetItem(__pyx_v_projparams, ((PyObject *)__pyx_n_s__lat_ts), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      goto __pyx_L25;
+      __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_LaD); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1542; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+      __Pyx_GOTREF(__pyx_t_1);
+      __pyx_t_9 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_v_scale); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_9);
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      if (unlikely(PyObject_SetItem(__pyx_v_projparams, __pyx_n_s_lat_ts, __pyx_t_9) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+      goto __pyx_L37;
     }
     /*else*/ {
 
-      /* "pygrib.pyx":1552
+      /* "pygrib.pyx":1544
  *                 projparams['lat_ts'] = self['LaD']/scale
  *             else:
  *                 projparams['lat_ts'] = self['Latin']/scale             # <<<<<<<<<<<<<<
  *             projparams['lon_0']=0.5*(lon1+lon2)
  *             projparams['proj']='merc'
  */
-      __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__Latin)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_v_scale); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_6);
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      if (PyObject_SetItem(__pyx_v_projparams, ((PyObject *)__pyx_n_s__lat_ts), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __pyx_t_9 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_Latin); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1544; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+      __Pyx_GOTREF(__pyx_t_9);
+      __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_9, __pyx_v_scale); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+      if (unlikely(PyObject_SetItem(__pyx_v_projparams, __pyx_n_s_lat_ts, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     }
-    __pyx_L25:;
+    __pyx_L37:;
 
-    /* "pygrib.pyx":1553
+    /* "pygrib.pyx":1545
  *             else:
  *                 projparams['lat_ts'] = self['Latin']/scale
  *             projparams['lon_0']=0.5*(lon1+lon2)             # <<<<<<<<<<<<<<
  *             projparams['proj']='merc'
  *         elif self['gridType'] in ['rotated_ll','rotated_gg']:
  */
-    __pyx_t_6 = PyFloat_FromDouble(0.5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __pyx_t_2 = PyNumber_Add(__pyx_v_lon1, __pyx_v_lon2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_7 = PyNumber_Multiply(__pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    if (PyObject_SetItem(__pyx_v_projparams, ((PyObject *)__pyx_n_s__lon_0), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __pyx_t_1 = PyNumber_Add(__pyx_v_lon1, __pyx_v_lon2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_9 = PyNumber_Multiply(__pyx_float_0_5, __pyx_t_1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_9);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    if (unlikely(PyObject_SetItem(__pyx_v_projparams, __pyx_n_s_lon_0, __pyx_t_9) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
 
-    /* "pygrib.pyx":1554
+    /* "pygrib.pyx":1546
  *                 projparams['lat_ts'] = self['Latin']/scale
  *             projparams['lon_0']=0.5*(lon1+lon2)
  *             projparams['proj']='merc'             # <<<<<<<<<<<<<<
  *         elif self['gridType'] in ['rotated_ll','rotated_gg']:
  *             rot_angle = self['angleOfRotationInDegrees']
  */
-    if (PyObject_SetItem(__pyx_v_projparams, ((PyObject *)__pyx_n_s__proj), ((PyObject *)__pyx_n_s__merc)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L14;
+    if (unlikely(PyObject_SetItem(__pyx_v_projparams, __pyx_n_s_proj, __pyx_n_s_merc) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    goto __pyx_L22;
   }
 
-  /* "pygrib.pyx":1555
+  /* "pygrib.pyx":1547
  *             projparams['lon_0']=0.5*(lon1+lon2)
  *             projparams['proj']='merc'
  *         elif self['gridType'] in ['rotated_ll','rotated_gg']:             # <<<<<<<<<<<<<<
  *             rot_angle = self['angleOfRotationInDegrees']
  *             pole_lat = self['latitudeOfSouthernPoleInDegrees']
  */
-  __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__gridType)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_2 = PyObject_RichCompare(__pyx_t_7, ((PyObject *)__pyx_n_s__rotated_ll), Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (!((int)__pyx_t_5)) {
-    __pyx_t_2 = PyObject_RichCompare(__pyx_t_7, ((PyObject *)__pyx_n_s__rotated_gg), Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_4 = ((int)__pyx_t_3);
+  __pyx_t_9 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_gridType); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1547; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+  __Pyx_GOTREF(__pyx_t_9);
+  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_t_9, __pyx_n_s_rotated_ll, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (!__pyx_t_4) {
   } else {
-    __pyx_t_4 = ((int)__pyx_t_5);
+    __pyx_t_5 = __pyx_t_4;
+    goto __pyx_L38_bool_binop_done;
   }
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  __pyx_t_5 = (__pyx_t_4 != 0);
-  if (__pyx_t_5) {
+  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_t_9, __pyx_n_s_rotated_gg, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __pyx_t_4;
+  __pyx_L38_bool_binop_done:;
+  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+  __pyx_t_4 = (__pyx_t_5 != 0);
+  if (__pyx_t_4) {
 
-    /* "pygrib.pyx":1556
+    /* "pygrib.pyx":1548
  *             projparams['proj']='merc'
  *         elif self['gridType'] in ['rotated_ll','rotated_gg']:
  *             rot_angle = self['angleOfRotationInDegrees']             # <<<<<<<<<<<<<<
  *             pole_lat = self['latitudeOfSouthernPoleInDegrees']
  *             pole_lon = self['longitudeOfSouthernPoleInDegrees']
  */
-    __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s_165)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __pyx_v_rot_angle = __pyx_t_7;
-    __pyx_t_7 = 0;
+    __pyx_t_9 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_angleOfRotationInDegrees); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1548; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_9);
+    __pyx_v_rot_angle = __pyx_t_9;
+    __pyx_t_9 = 0;
 
-    /* "pygrib.pyx":1557
+    /* "pygrib.pyx":1549
  *         elif self['gridType'] in ['rotated_ll','rotated_gg']:
  *             rot_angle = self['angleOfRotationInDegrees']
  *             pole_lat = self['latitudeOfSouthernPoleInDegrees']             # <<<<<<<<<<<<<<
  *             pole_lon = self['longitudeOfSouthernPoleInDegrees']
  *             projparams['o_proj']='longlat'
  */
-    __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s_166)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __pyx_v_pole_lat = __pyx_t_7;
-    __pyx_t_7 = 0;
+    __pyx_t_9 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_latitudeOfSouthernPoleInDegrees); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1549; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_9);
+    __pyx_v_pole_lat = __pyx_t_9;
+    __pyx_t_9 = 0;
 
-    /* "pygrib.pyx":1558
+    /* "pygrib.pyx":1550
  *             rot_angle = self['angleOfRotationInDegrees']
  *             pole_lat = self['latitudeOfSouthernPoleInDegrees']
  *             pole_lon = self['longitudeOfSouthernPoleInDegrees']             # <<<<<<<<<<<<<<
  *             projparams['o_proj']='longlat'
  *             projparams['proj']='ob_tran'
  */
-    __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s_167)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __pyx_v_pole_lon = __pyx_t_7;
-    __pyx_t_7 = 0;
+    __pyx_t_9 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_longitudeOfSouthernPoleInDegrees); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1550; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_9);
+    __pyx_v_pole_lon = __pyx_t_9;
+    __pyx_t_9 = 0;
 
-    /* "pygrib.pyx":1559
+    /* "pygrib.pyx":1551
  *             pole_lat = self['latitudeOfSouthernPoleInDegrees']
  *             pole_lon = self['longitudeOfSouthernPoleInDegrees']
  *             projparams['o_proj']='longlat'             # <<<<<<<<<<<<<<
  *             projparams['proj']='ob_tran'
  *             projparams['o_lat_p']=-pole_lat
  */
-    if (PyObject_SetItem(__pyx_v_projparams, ((PyObject *)__pyx_n_s__o_proj), ((PyObject *)__pyx_n_s__longlat)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (unlikely(PyObject_SetItem(__pyx_v_projparams, __pyx_n_s_o_proj, __pyx_n_s_longlat) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
-    /* "pygrib.pyx":1560
+    /* "pygrib.pyx":1552
  *             pole_lon = self['longitudeOfSouthernPoleInDegrees']
  *             projparams['o_proj']='longlat'
  *             projparams['proj']='ob_tran'             # <<<<<<<<<<<<<<
  *             projparams['o_lat_p']=-pole_lat
  *             projparams['o_lon_p']=rot_angle
  */
-    if (PyObject_SetItem(__pyx_v_projparams, ((PyObject *)__pyx_n_s__proj), ((PyObject *)__pyx_n_s__ob_tran)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (unlikely(PyObject_SetItem(__pyx_v_projparams, __pyx_n_s_proj, __pyx_n_s_ob_tran) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
-    /* "pygrib.pyx":1561
+    /* "pygrib.pyx":1553
  *             projparams['o_proj']='longlat'
  *             projparams['proj']='ob_tran'
  *             projparams['o_lat_p']=-pole_lat             # <<<<<<<<<<<<<<
  *             projparams['o_lon_p']=rot_angle
  *             projparams['lon_0']=pole_lon
  */
-    __pyx_t_7 = PyNumber_Negative(__pyx_v_pole_lat); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    if (PyObject_SetItem(__pyx_v_projparams, ((PyObject *)__pyx_n_s__o_lat_p), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __pyx_t_9 = PyNumber_Negative(__pyx_v_pole_lat); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_9);
+    if (unlikely(PyObject_SetItem(__pyx_v_projparams, __pyx_n_s_o_lat_p, __pyx_t_9) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
 
-    /* "pygrib.pyx":1562
+    /* "pygrib.pyx":1554
  *             projparams['proj']='ob_tran'
  *             projparams['o_lat_p']=-pole_lat
  *             projparams['o_lon_p']=rot_angle             # <<<<<<<<<<<<<<
  *             projparams['lon_0']=pole_lon
  *         else: # unsupported grid type.
  */
-    if (PyObject_SetItem(__pyx_v_projparams, ((PyObject *)__pyx_n_s__o_lon_p), __pyx_v_rot_angle) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (unlikely(PyObject_SetItem(__pyx_v_projparams, __pyx_n_s_o_lon_p, __pyx_v_rot_angle) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
-    /* "pygrib.pyx":1563
+    /* "pygrib.pyx":1555
  *             projparams['o_lat_p']=-pole_lat
  *             projparams['o_lon_p']=rot_angle
  *             projparams['lon_0']=pole_lon             # <<<<<<<<<<<<<<
  *         else: # unsupported grid type.
  *             projparams = None
  */
-    if (PyObject_SetItem(__pyx_v_projparams, ((PyObject *)__pyx_n_s__lon_0), __pyx_v_pole_lon) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L14;
+    if (unlikely(PyObject_SetItem(__pyx_v_projparams, __pyx_n_s_lon_0, __pyx_v_pole_lon) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    goto __pyx_L22;
   }
   /*else*/ {
 
-    /* "pygrib.pyx":1565
+    /* "pygrib.pyx":1557
  *             projparams['lon_0']=pole_lon
  *         else: # unsupported grid type.
  *             projparams = None             # <<<<<<<<<<<<<<
@@ -17796,9 +19242,9 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_36_set_projparams(struct __pyx_o
     __Pyx_INCREF(Py_None);
     __Pyx_DECREF_SET(__pyx_v_projparams, Py_None);
   }
-  __pyx_L14:;
+  __pyx_L22:;
 
-  /* "pygrib.pyx":1566
+  /* "pygrib.pyx":1558
  *         else: # unsupported grid type.
  *             projparams = None
  *         self.projparams = projparams             # <<<<<<<<<<<<<<
@@ -17811,6 +19257,15 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_36_set_projparams(struct __pyx_o
   __Pyx_DECREF(__pyx_v_self->projparams);
   __pyx_v_self->projparams = __pyx_v_projparams;
 
+  /* "pygrib.pyx":1404
+ *         return datarr
+ * 
+ *     def _set_projparams(self):             # <<<<<<<<<<<<<<
+ *         """
+ *         sets the C{projparams} instance variable to a dictionary containing
+ */
+
+  /* function exit code */
   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
   goto __pyx_L0;
   __pyx_L1_error:;
@@ -17818,6 +19273,7 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_36_set_projparams(struct __pyx_o
   __Pyx_XDECREF(__pyx_t_2);
   __Pyx_XDECREF(__pyx_t_6);
   __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_XDECREF(__pyx_t_9);
   __Pyx_AddTraceback("pygrib.gribmessage._set_projparams", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_r = NULL;
   __pyx_L0:;
@@ -17836,6 +19292,14 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_36_set_projparams(struct __pyx_o
   return __pyx_r;
 }
 
+/* "pygrib.pyx":1560
+ *         self.projparams = projparams
+ * 
+ *     def latlons(self):             # <<<<<<<<<<<<<<
+ *         """
+ *         latlons()
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_6pygrib_11gribmessage_39latlons(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
 static char __pyx_doc_6pygrib_11gribmessage_38latlons[] = "\n        latlons()\n\n        compute lats and lons (in degrees) of grid.\n        Currently handles reg. lat/lon, global gaussian, mercator, stereographic,\n        lambert conformal, albers equal-area, space-view, azimuthal \n        equidistant, reduced gaussian, reduced lat/lon,\n        lambert azimuthal equal-area, rotated lat/lon and rotated gaussian grids.\n\n        @return: C{B{lats},B{lons}}, numpy arrays \n        co [...]
@@ -17844,18 +19308,12 @@ static PyObject *__pyx_pw_6pygrib_11gribmessage_39latlons(PyObject *__pyx_v_self
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("latlons (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_11gribmessage_38latlons(((struct __pyx_obj_6pygrib_gribmessage *)__pyx_v_self));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "pygrib.pyx":1568
- *         self.projparams = projparams
- * 
- *     def latlons(self):             # <<<<<<<<<<<<<<
- *         """
- *         latlons()
- */
-
 static PyObject *__pyx_pf_6pygrib_11gribmessage_38latlons(struct __pyx_obj_6pygrib_gribmessage *__pyx_v_self) {
   PyObject *__pyx_v_nx = NULL;
   PyObject *__pyx_v_ny = NULL;
@@ -17900,22 +19358,23 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_38latlons(struct __pyx_obj_6pygr
   int __pyx_t_2;
   PyObject *__pyx_t_3 = NULL;
   PyObject *__pyx_t_4 = NULL;
-  int __pyx_t_5;
-  int __pyx_t_6;
+  PyObject *__pyx_t_5 = NULL;
+  Py_ssize_t __pyx_t_6;
   PyObject *__pyx_t_7 = NULL;
-  PyObject *__pyx_t_8 = NULL;
-  PyObject *(*__pyx_t_9)(PyObject *);
+  PyObject *(*__pyx_t_8)(PyObject *);
+  PyObject *__pyx_t_9 = NULL;
   PyObject *__pyx_t_10 = NULL;
   PyObject *__pyx_t_11 = NULL;
-  PyObject *__pyx_t_12 = NULL;
-  double __pyx_t_13;
+  double __pyx_t_12;
+  PyObject *__pyx_t_13 = NULL;
   PyObject *__pyx_t_14 = NULL;
+  PyObject *__pyx_t_15 = NULL;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("latlons", 0);
 
-  /* "pygrib.pyx":1582
+  /* "pygrib.pyx":1574
  *         """
  * 
  *         if self.projparams is None:             # <<<<<<<<<<<<<<
@@ -17926,433 +19385,495 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_38latlons(struct __pyx_obj_6pygr
   __pyx_t_2 = (__pyx_t_1 != 0);
   if (__pyx_t_2) {
 
-    /* "pygrib.pyx":1583
+    /* "pygrib.pyx":1575
  * 
  *         if self.projparams is None:
  *             raise ValueError('unsupported grid %s' % self['gridType'])             # <<<<<<<<<<<<<<
  * 
  *         if self['gridType'] in ['regular_gg','regular_ll']: # regular lat/lon grid
  */
-    __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__gridType)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_gridType); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1575; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
     __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_168), __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
+    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_unsupported_grid_s, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
-    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_4));
-    __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
+    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
+    __Pyx_GIVEREF(__pyx_t_4);
     __pyx_t_4 = 0;
-    __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_Raise(__pyx_t_4, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L3;
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
-  __pyx_L3:;
 
-  /* "pygrib.pyx":1585
+  /* "pygrib.pyx":1577
  *             raise ValueError('unsupported grid %s' % self['gridType'])
  * 
  *         if self['gridType'] in ['regular_gg','regular_ll']: # regular lat/lon grid             # <<<<<<<<<<<<<<
  *             nx = self['Ni']
  *             ny = self['Nj']
  */
-  __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__gridType)); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_gridType); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1577; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
   __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, ((PyObject *)__pyx_n_s__regular_gg), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  if (!((int)__pyx_t_2)) {
-    __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, ((PyObject *)__pyx_n_s__regular_ll), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_5 = ((int)__pyx_t_1);
+  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_n_s_regular_gg, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (!__pyx_t_1) {
   } else {
-    __pyx_t_5 = ((int)__pyx_t_2);
+    __pyx_t_2 = __pyx_t_1;
+    goto __pyx_L5_bool_binop_done;
   }
+  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_n_s_regular_ll, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __pyx_t_1;
+  __pyx_L5_bool_binop_done:;
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_t_2 = (__pyx_t_5 != 0);
-  if (__pyx_t_2) {
+  __pyx_t_1 = (__pyx_t_2 != 0);
+  if (__pyx_t_1) {
 
-    /* "pygrib.pyx":1586
+    /* "pygrib.pyx":1578
  * 
  *         if self['gridType'] in ['regular_gg','regular_ll']: # regular lat/lon grid
  *             nx = self['Ni']             # <<<<<<<<<<<<<<
  *             ny = self['Nj']
  *             lon1 = self['longitudeOfFirstGridPointInDegrees']
  */
-    __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__Ni)); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_Ni); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1578; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
     __Pyx_GOTREF(__pyx_t_4);
     __pyx_v_nx = __pyx_t_4;
     __pyx_t_4 = 0;
 
-    /* "pygrib.pyx":1587
+    /* "pygrib.pyx":1579
  *         if self['gridType'] in ['regular_gg','regular_ll']: # regular lat/lon grid
  *             nx = self['Ni']
  *             ny = self['Nj']             # <<<<<<<<<<<<<<
  *             lon1 = self['longitudeOfFirstGridPointInDegrees']
  *             lon2 = self['longitudeOfLastGridPointInDegrees']
  */
-    __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__Nj)); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_Nj); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1579; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
     __Pyx_GOTREF(__pyx_t_4);
     __pyx_v_ny = __pyx_t_4;
     __pyx_t_4 = 0;
 
-    /* "pygrib.pyx":1588
+    /* "pygrib.pyx":1580
  *             nx = self['Ni']
  *             ny = self['Nj']
  *             lon1 = self['longitudeOfFirstGridPointInDegrees']             # <<<<<<<<<<<<<<
  *             lon2 = self['longitudeOfLastGridPointInDegrees']
  *             if lon1 >= 0 and lon2 < 0 and self.iDirectionIncrement > 0:
  */
-    __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s_169)); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_longitudeOfFirstGridPointInDegre); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1580; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
     __Pyx_GOTREF(__pyx_t_4);
     __pyx_v_lon1 = __pyx_t_4;
     __pyx_t_4 = 0;
 
-    /* "pygrib.pyx":1589
+    /* "pygrib.pyx":1581
  *             ny = self['Nj']
  *             lon1 = self['longitudeOfFirstGridPointInDegrees']
  *             lon2 = self['longitudeOfLastGridPointInDegrees']             # <<<<<<<<<<<<<<
  *             if lon1 >= 0 and lon2 < 0 and self.iDirectionIncrement > 0:
  *                 lon2 = 360+lon2
  */
-    __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s_170)); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_longitudeOfLastGridPointInDegree); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1581; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
     __Pyx_GOTREF(__pyx_t_4);
     __pyx_v_lon2 = __pyx_t_4;
     __pyx_t_4 = 0;
 
-    /* "pygrib.pyx":1590
+    /* "pygrib.pyx":1582
  *             lon1 = self['longitudeOfFirstGridPointInDegrees']
  *             lon2 = self['longitudeOfLastGridPointInDegrees']
  *             if lon1 >= 0 and lon2 < 0 and self.iDirectionIncrement > 0:             # <<<<<<<<<<<<<<
  *                 lon2 = 360+lon2
  *             if lon1 >= 0 and lon2 < lon1 and self.iDirectionIncrement > 0:
  */
-    __pyx_t_4 = PyObject_RichCompare(__pyx_v_lon1, __pyx_int_0, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1590; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1590; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = PyObject_RichCompare(__pyx_v_lon1, __pyx_int_0, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     if (__pyx_t_2) {
-      __pyx_t_4 = PyObject_RichCompare(__pyx_v_lon2, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1590; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1590; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      if (__pyx_t_5) {
-        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__iDirectionIncrement); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1590; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_4);
-        __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1590; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-        __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1590; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-        __pyx_t_6 = __pyx_t_1;
-      } else {
-        __pyx_t_6 = __pyx_t_5;
-      }
-      __pyx_t_5 = __pyx_t_6;
     } else {
-      __pyx_t_5 = __pyx_t_2;
+      __pyx_t_1 = __pyx_t_2;
+      goto __pyx_L8_bool_binop_done;
     }
-    if (__pyx_t_5) {
+    __pyx_t_4 = PyObject_RichCompare(__pyx_v_lon2, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    if (__pyx_t_2) {
+    } else {
+      __pyx_t_1 = __pyx_t_2;
+      goto __pyx_L8_bool_binop_done;
+    }
+    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_iDirectionIncrement); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_t_1 = __pyx_t_2;
+    __pyx_L8_bool_binop_done:;
+    if (__pyx_t_1) {
 
-      /* "pygrib.pyx":1591
+      /* "pygrib.pyx":1583
  *             lon2 = self['longitudeOfLastGridPointInDegrees']
  *             if lon1 >= 0 and lon2 < 0 and self.iDirectionIncrement > 0:
  *                 lon2 = 360+lon2             # <<<<<<<<<<<<<<
  *             if lon1 >= 0 and lon2 < lon1 and self.iDirectionIncrement > 0:
  *                 lon1 = lon1-360
  */
-      __pyx_t_3 = PyNumber_Add(__pyx_int_360, __pyx_v_lon2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyNumber_Add(__pyx_int_360, __pyx_v_lon2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_DECREF_SET(__pyx_v_lon2, __pyx_t_3);
       __pyx_t_3 = 0;
-      goto __pyx_L5;
+      goto __pyx_L7;
     }
-    __pyx_L5:;
+    __pyx_L7:;
 
-    /* "pygrib.pyx":1592
+    /* "pygrib.pyx":1584
  *             if lon1 >= 0 and lon2 < 0 and self.iDirectionIncrement > 0:
  *                 lon2 = 360+lon2
  *             if lon1 >= 0 and lon2 < lon1 and self.iDirectionIncrement > 0:             # <<<<<<<<<<<<<<
  *                 lon1 = lon1-360
  *             lat1 = self['latitudeOfFirstGridPointInDegrees']
  */
-    __pyx_t_3 = PyObject_RichCompare(__pyx_v_lon1, __pyx_int_0, Py_GE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = PyObject_RichCompare(__pyx_v_lon1, __pyx_int_0, Py_GE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    if (__pyx_t_5) {
-      __pyx_t_3 = PyObject_RichCompare(__pyx_v_lon2, __pyx_v_lon1, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (__pyx_t_2) {
-        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__iDirectionIncrement); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_3);
-        __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-        __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-        __pyx_t_1 = __pyx_t_6;
-      } else {
-        __pyx_t_1 = __pyx_t_2;
-      }
-      __pyx_t_2 = __pyx_t_1;
+    if (__pyx_t_2) {
     } else {
-      __pyx_t_2 = __pyx_t_5;
+      __pyx_t_1 = __pyx_t_2;
+      goto __pyx_L12_bool_binop_done;
     }
+    __pyx_t_3 = PyObject_RichCompare(__pyx_v_lon2, __pyx_v_lon1, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     if (__pyx_t_2) {
+    } else {
+      __pyx_t_1 = __pyx_t_2;
+      goto __pyx_L12_bool_binop_done;
+    }
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_iDirectionIncrement); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_1 = __pyx_t_2;
+    __pyx_L12_bool_binop_done:;
+    if (__pyx_t_1) {
 
-      /* "pygrib.pyx":1593
+      /* "pygrib.pyx":1585
  *                 lon2 = 360+lon2
  *             if lon1 >= 0 and lon2 < lon1 and self.iDirectionIncrement > 0:
  *                 lon1 = lon1-360             # <<<<<<<<<<<<<<
  *             lat1 = self['latitudeOfFirstGridPointInDegrees']
  *             lat2 = self['latitudeOfLastGridPointInDegrees']
  */
-      __pyx_t_4 = PyNumber_Subtract(__pyx_v_lon1, __pyx_int_360); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PyNumber_Subtract(__pyx_v_lon1, __pyx_int_360); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_4);
       __Pyx_DECREF_SET(__pyx_v_lon1, __pyx_t_4);
       __pyx_t_4 = 0;
-      goto __pyx_L6;
+      goto __pyx_L11;
     }
-    __pyx_L6:;
+    __pyx_L11:;
 
-    /* "pygrib.pyx":1594
+    /* "pygrib.pyx":1586
  *             if lon1 >= 0 and lon2 < lon1 and self.iDirectionIncrement > 0:
  *                 lon1 = lon1-360
  *             lat1 = self['latitudeOfFirstGridPointInDegrees']             # <<<<<<<<<<<<<<
  *             lat2 = self['latitudeOfLastGridPointInDegrees']
  *             # workaround for grib_api bug with complex packing.
  */
-    __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s_171)); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_latitudeOfFirstGridPointInDegree); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1586; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
     __Pyx_GOTREF(__pyx_t_4);
     __pyx_v_lat1 = __pyx_t_4;
     __pyx_t_4 = 0;
 
-    /* "pygrib.pyx":1595
+    /* "pygrib.pyx":1587
  *                 lon1 = lon1-360
  *             lat1 = self['latitudeOfFirstGridPointInDegrees']
  *             lat2 = self['latitudeOfLastGridPointInDegrees']             # <<<<<<<<<<<<<<
  *             # workaround for grib_api bug with complex packing.
  *             # (distinctLongitudes, distinctLatitudes throws error,
  */
-    __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s_172)); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1595; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_latitudeOfLastGridPointInDegrees); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1587; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
     __Pyx_GOTREF(__pyx_t_4);
     __pyx_v_lat2 = __pyx_t_4;
     __pyx_t_4 = 0;
 
-    /* "pygrib.pyx":1599
+    /* "pygrib.pyx":1591
  *             # (distinctLongitudes, distinctLatitudes throws error,
  *             #  so use np.linspace to define values)
  *             if self.packingType.startswith('grid_complex'):             # <<<<<<<<<<<<<<
  *                 # this is not strictly correct for gaussian grids,
  *                 # but the error is very small.
  */
-    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__packingType); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_packingType); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__startswith); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_startswith); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_173), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__92, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    if (__pyx_t_2) {
+    if (__pyx_t_1) {
 
-      /* "pygrib.pyx":1602
+      /* "pygrib.pyx":1594
  *                 # this is not strictly correct for gaussian grids,
  *                 # but the error is very small.
  *                 lats = np.linspace(lat1,lat2,ny)             # <<<<<<<<<<<<<<
  *                 lons = np.linspace(lon1,lon2,nx)
  *             else:
  */
-      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__linspace); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_3);
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_linspace); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_5);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __pyx_t_3 = NULL;
+      __pyx_t_6 = 0;
+      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
+        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
+        if (likely(__pyx_t_3)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+          __Pyx_INCREF(__pyx_t_3);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_5, function);
+          __pyx_t_6 = 1;
+        }
+      }
+      __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_7);
+      if (__pyx_t_3) {
+        PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
+      }
       __Pyx_INCREF(__pyx_v_lat1);
-      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_lat1);
+      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_lat1);
       __Pyx_GIVEREF(__pyx_v_lat1);
       __Pyx_INCREF(__pyx_v_lat2);
-      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_lat2);
+      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_lat2);
       __Pyx_GIVEREF(__pyx_v_lat2);
       __Pyx_INCREF(__pyx_v_ny);
-      PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_ny);
+      PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_v_ny);
       __Pyx_GIVEREF(__pyx_v_ny);
-      __pyx_t_7 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_7);
-      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-      __pyx_v_lats = __pyx_t_7;
-      __pyx_t_7 = 0;
+      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __pyx_v_lats = __pyx_t_4;
+      __pyx_t_4 = 0;
 
-      /* "pygrib.pyx":1603
+      /* "pygrib.pyx":1595
  *                 # but the error is very small.
  *                 lats = np.linspace(lat1,lat2,ny)
  *                 lons = np.linspace(lon1,lon2,nx)             # <<<<<<<<<<<<<<
  *             else:
  *                 lats = self['distinctLatitudes']
  */
-      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_7);
-      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s__linspace); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1595; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_5);
+      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_linspace); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1595; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_7);
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __pyx_t_5 = NULL;
+      __pyx_t_6 = 0;
+      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
+        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
+        if (likely(__pyx_t_5)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
+          __Pyx_INCREF(__pyx_t_5);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_7, function);
+          __pyx_t_6 = 1;
+        }
+      }
+      __pyx_t_3 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1595; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      if (__pyx_t_5) {
+        PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
+      }
       __Pyx_INCREF(__pyx_v_lon1);
-      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_lon1);
+      PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_6, __pyx_v_lon1);
       __Pyx_GIVEREF(__pyx_v_lon1);
       __Pyx_INCREF(__pyx_v_lon2);
-      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_lon2);
+      PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_6, __pyx_v_lon2);
       __Pyx_GIVEREF(__pyx_v_lon2);
       __Pyx_INCREF(__pyx_v_nx);
-      PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_v_nx);
+      PyTuple_SET_ITEM(__pyx_t_3, 2+__pyx_t_6, __pyx_v_nx);
       __Pyx_GIVEREF(__pyx_v_nx);
-      __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
-      __pyx_v_lons = __pyx_t_3;
-      __pyx_t_3 = 0;
-      goto __pyx_L7;
-    }
+      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1595; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+      __pyx_v_lons = __pyx_t_4;
+      __pyx_t_4 = 0;
+      goto __pyx_L15;
+    }
     /*else*/ {
 
-      /* "pygrib.pyx":1605
+      /* "pygrib.pyx":1597
  *                 lons = np.linspace(lon1,lon2,nx)
  *             else:
  *                 lats = self['distinctLatitudes']             # <<<<<<<<<<<<<<
  *                 if lat2 < lat1 and lats[-1] > lats[0]: lats = lats[::-1]
  *                 lons = self['distinctLongitudes']
  */
-      __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__distinctLatitudes)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_v_lats = __pyx_t_3;
-      __pyx_t_3 = 0;
+      __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_distinctLatitudes); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1597; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_v_lats = __pyx_t_4;
+      __pyx_t_4 = 0;
 
-      /* "pygrib.pyx":1606
+      /* "pygrib.pyx":1598
  *             else:
  *                 lats = self['distinctLatitudes']
  *                 if lat2 < lat1 and lats[-1] > lats[0]: lats = lats[::-1]             # <<<<<<<<<<<<<<
  *                 lons = self['distinctLongitudes']
  *             # don't trust distinctLongitudes
  */
-      __pyx_t_3 = PyObject_RichCompare(__pyx_v_lat2, __pyx_v_lat1, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __pyx_t_4 = PyObject_RichCompare(__pyx_v_lat2, __pyx_v_lat1, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       if (__pyx_t_2) {
-        __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_lats, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_3);
-        __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_lats, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_7);
-        __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_7, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-        __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-        __pyx_t_1 = __pyx_t_5;
       } else {
         __pyx_t_1 = __pyx_t_2;
+        goto __pyx_L17_bool_binop_done;
       }
+      __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_lats, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_lats, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+      __Pyx_GOTREF(__pyx_t_7);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_t_7, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __pyx_t_1 = __pyx_t_2;
+      __pyx_L17_bool_binop_done:;
       if (__pyx_t_1) {
-        __pyx_t_4 = PyObject_GetItem(__pyx_v_lats, __pyx_k_slice_174); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_4);
-        __Pyx_DECREF_SET(__pyx_v_lats, __pyx_t_4);
-        __pyx_t_4 = 0;
-        goto __pyx_L8;
+        __pyx_t_3 = PyObject_GetItem(__pyx_v_lats, __pyx_slice__93); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+        __Pyx_GOTREF(__pyx_t_3);
+        __Pyx_DECREF_SET(__pyx_v_lats, __pyx_t_3);
+        __pyx_t_3 = 0;
+        goto __pyx_L16;
       }
-      __pyx_L8:;
+      __pyx_L16:;
 
-      /* "pygrib.pyx":1607
+      /* "pygrib.pyx":1599
  *                 lats = self['distinctLatitudes']
  *                 if lat2 < lat1 and lats[-1] > lats[0]: lats = lats[::-1]
  *                 lons = self['distinctLongitudes']             # <<<<<<<<<<<<<<
  *             # don't trust distinctLongitudes
  *             # when longitudeOfLastGridPointInDegrees < 0
  */
-      __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__distinctLongitudes)); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __pyx_v_lons = __pyx_t_4;
-      __pyx_t_4 = 0;
+      __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_distinctLongitudes); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1599; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_v_lons = __pyx_t_3;
+      __pyx_t_3 = 0;
     }
-    __pyx_L7:;
+    __pyx_L15:;
 
-    /* "pygrib.pyx":1611
+    /* "pygrib.pyx":1603
  *             # when longitudeOfLastGridPointInDegrees < 0
  *             # (bug in grib_api 1.9.16)
  *             if lon2 < 0:             # <<<<<<<<<<<<<<
  *                 lons = np.linspace(lon1,lon2,nx)
  *             lons,lats = np.meshgrid(lons,lats)
  */
-    __pyx_t_4 = PyObject_RichCompare(__pyx_v_lon2, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1611; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1611; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_3 = PyObject_RichCompare(__pyx_v_lon2, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     if (__pyx_t_1) {
 
-      /* "pygrib.pyx":1612
+      /* "pygrib.pyx":1604
  *             # (bug in grib_api 1.9.16)
  *             if lon2 < 0:
  *                 lons = np.linspace(lon1,lon2,nx)             # <<<<<<<<<<<<<<
  *             lons,lats = np.meshgrid(lons,lats)
  *         elif self['gridType'] == 'reduced_gg': # reduced global gaussian grid
  */
-      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__linspace); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_7);
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_linspace); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+      __pyx_t_7 = NULL;
+      __pyx_t_6 = 0;
+      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
+        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
+        if (likely(__pyx_t_7)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+          __Pyx_INCREF(__pyx_t_7);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_4, function);
+          __pyx_t_6 = 1;
+        }
+      }
+      __pyx_t_5 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_5);
+      if (__pyx_t_7) {
+        PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = NULL;
+      }
       __Pyx_INCREF(__pyx_v_lon1);
-      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_lon1);
+      PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_6, __pyx_v_lon1);
       __Pyx_GIVEREF(__pyx_v_lon1);
       __Pyx_INCREF(__pyx_v_lon2);
-      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_lon2);
+      PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_6, __pyx_v_lon2);
       __Pyx_GIVEREF(__pyx_v_lon2);
       __Pyx_INCREF(__pyx_v_nx);
-      PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_nx);
+      PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_6, __pyx_v_nx);
       __Pyx_GIVEREF(__pyx_v_nx);
-      __pyx_t_3 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_3);
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       __Pyx_DECREF_SET(__pyx_v_lons, __pyx_t_3);
       __pyx_t_3 = 0;
-      goto __pyx_L9;
+      goto __pyx_L19;
     }
-    __pyx_L9:;
+    __pyx_L19:;
 
-    /* "pygrib.pyx":1613
+    /* "pygrib.pyx":1605
  *             if lon2 < 0:
  *                 lons = np.linspace(lon1,lon2,nx)
  *             lons,lats = np.meshgrid(lons,lats)             # <<<<<<<<<<<<<<
  *         elif self['gridType'] == 'reduced_gg': # reduced global gaussian grid
  *             if self.expand_reduced:
  */
-    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__meshgrid); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_meshgrid); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_4 = NULL;
+    __pyx_t_6 = 0;
+    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
+      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
+      if (likely(__pyx_t_4)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+        __Pyx_INCREF(__pyx_t_4);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_5, function);
+        __pyx_t_6 = 1;
+      }
+    }
+    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_7);
+    if (__pyx_t_4) {
+      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
+    }
     __Pyx_INCREF(__pyx_v_lons);
-    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_lons);
+    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_lons);
     __Pyx_GIVEREF(__pyx_v_lons);
     __Pyx_INCREF(__pyx_v_lats);
-    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_lats);
+    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_lats);
     __Pyx_GIVEREF(__pyx_v_lats);
-    __pyx_t_7 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-    if ((likely(PyTuple_CheckExact(__pyx_t_7))) || (PyList_CheckExact(__pyx_t_7))) {
-      PyObject* sequence = __pyx_t_7;
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
+      PyObject* sequence = __pyx_t_3;
       #if CYTHON_COMPILING_IN_CPYTHON
       Py_ssize_t size = Py_SIZE(sequence);
       #else
@@ -18361,252 +19882,281 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_38latlons(struct __pyx_obj_6pygr
       if (unlikely(size != 2)) {
         if (size > 2) __Pyx_RaiseTooManyValuesError(2);
         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       }
       #if CYTHON_COMPILING_IN_CPYTHON
       if (likely(PyTuple_CheckExact(sequence))) {
-        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
-        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
+        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
+        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); 
       } else {
-        __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
-        __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
+        __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
+        __pyx_t_7 = PyList_GET_ITEM(sequence, 1); 
       }
-      __Pyx_INCREF(__pyx_t_3);
-      __Pyx_INCREF(__pyx_t_4);
+      __Pyx_INCREF(__pyx_t_5);
+      __Pyx_INCREF(__pyx_t_7);
       #else
-      __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_5);
+      __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_7);
       #endif
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    } else
-    {
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    } else {
       Py_ssize_t index = -1;
-      __pyx_t_8 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
-      index = 0; __pyx_t_3 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_3)) goto __pyx_L10_unpacking_failed;
-      __Pyx_GOTREF(__pyx_t_3);
-      index = 1; __pyx_t_4 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_4)) goto __pyx_L10_unpacking_failed;
+      __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_4);
-      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_9 = NULL;
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      goto __pyx_L11_unpacking_done;
-      __pyx_L10_unpacking_failed:;
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      __pyx_t_9 = NULL;
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __pyx_t_8 = Py_TYPE(__pyx_t_4)->tp_iternext;
+      index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_4); if (unlikely(!__pyx_t_5)) goto __pyx_L20_unpacking_failed;
+      __Pyx_GOTREF(__pyx_t_5);
+      index = 1; __pyx_t_7 = __pyx_t_8(__pyx_t_4); if (unlikely(!__pyx_t_7)) goto __pyx_L20_unpacking_failed;
+      __Pyx_GOTREF(__pyx_t_7);
+      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_8 = NULL;
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      goto __pyx_L21_unpacking_done;
+      __pyx_L20_unpacking_failed:;
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_8 = NULL;
       if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_L11_unpacking_done:;
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_L21_unpacking_done:;
     }
-    __Pyx_DECREF_SET(__pyx_v_lons, __pyx_t_3);
-    __pyx_t_3 = 0;
-    __Pyx_DECREF_SET(__pyx_v_lats, __pyx_t_4);
-    __pyx_t_4 = 0;
+    __Pyx_DECREF_SET(__pyx_v_lons, __pyx_t_5);
+    __pyx_t_5 = 0;
+    __Pyx_DECREF_SET(__pyx_v_lats, __pyx_t_7);
+    __pyx_t_7 = 0;
     goto __pyx_L4;
   }
 
-  /* "pygrib.pyx":1614
+  /* "pygrib.pyx":1606
  *                 lons = np.linspace(lon1,lon2,nx)
  *             lons,lats = np.meshgrid(lons,lats)
  *         elif self['gridType'] == 'reduced_gg': # reduced global gaussian grid             # <<<<<<<<<<<<<<
  *             if self.expand_reduced:
  *                 lat1 = self['latitudeOfFirstGridPointInDegrees']
  */
-  __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__gridType)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_4 = PyObject_RichCompare(__pyx_t_7, ((PyObject *)__pyx_n_s__reduced_gg), Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_gridType); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1606; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_reduced_gg, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   if (__pyx_t_1) {
 
-    /* "pygrib.pyx":1615
+    /* "pygrib.pyx":1607
  *             lons,lats = np.meshgrid(lons,lats)
  *         elif self['gridType'] == 'reduced_gg': # reduced global gaussian grid
  *             if self.expand_reduced:             # <<<<<<<<<<<<<<
  *                 lat1 = self['latitudeOfFirstGridPointInDegrees']
  *                 lat2 = self['latitudeOfLastGridPointInDegrees']
  */
-    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->expand_reduced); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->expand_reduced); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     if (__pyx_t_1) {
 
-      /* "pygrib.pyx":1616
+      /* "pygrib.pyx":1608
  *         elif self['gridType'] == 'reduced_gg': # reduced global gaussian grid
  *             if self.expand_reduced:
  *                 lat1 = self['latitudeOfFirstGridPointInDegrees']             # <<<<<<<<<<<<<<
  *                 lat2 = self['latitudeOfLastGridPointInDegrees']
  *                 lats = self['distinctLatitudes']
  */
-      __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s_171)); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __pyx_v_lat1 = __pyx_t_4;
-      __pyx_t_4 = 0;
+      __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_latitudeOfFirstGridPointInDegree); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1608; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_v_lat1 = __pyx_t_3;
+      __pyx_t_3 = 0;
 
-      /* "pygrib.pyx":1617
+      /* "pygrib.pyx":1609
  *             if self.expand_reduced:
  *                 lat1 = self['latitudeOfFirstGridPointInDegrees']
  *                 lat2 = self['latitudeOfLastGridPointInDegrees']             # <<<<<<<<<<<<<<
  *                 lats = self['distinctLatitudes']
  *                 if lat2 < lat1 and lats[-1] > lats[0]: lats = lats[::-1]
  */
-      __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s_172)); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __pyx_v_lat2 = __pyx_t_4;
-      __pyx_t_4 = 0;
+      __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_latitudeOfLastGridPointInDegrees); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1609; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_v_lat2 = __pyx_t_3;
+      __pyx_t_3 = 0;
 
-      /* "pygrib.pyx":1618
+      /* "pygrib.pyx":1610
  *                 lat1 = self['latitudeOfFirstGridPointInDegrees']
  *                 lat2 = self['latitudeOfLastGridPointInDegrees']
  *                 lats = self['distinctLatitudes']             # <<<<<<<<<<<<<<
  *                 if lat2 < lat1 and lats[-1] > lats[0]: lats = lats[::-1]
  *                 ny = self['Nj']
  */
-      __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__distinctLatitudes)); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __pyx_v_lats = __pyx_t_4;
-      __pyx_t_4 = 0;
+      __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_distinctLatitudes); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1610; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_v_lats = __pyx_t_3;
+      __pyx_t_3 = 0;
 
-      /* "pygrib.pyx":1619
+      /* "pygrib.pyx":1611
  *                 lat2 = self['latitudeOfLastGridPointInDegrees']
  *                 lats = self['distinctLatitudes']
  *                 if lat2 < lat1 and lats[-1] > lats[0]: lats = lats[::-1]             # <<<<<<<<<<<<<<
  *                 ny = self['Nj']
  *                 nx = 2*ny
  */
-      __pyx_t_4 = PyObject_RichCompare(__pyx_v_lat2, __pyx_v_lat1, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      if (__pyx_t_1) {
-        __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_lats, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_4);
-        __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_lats, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_7);
-        __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_t_7, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-        __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-        __pyx_t_5 = __pyx_t_2;
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_lat2, __pyx_v_lat1, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1611; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1611; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      if (__pyx_t_2) {
       } else {
-        __pyx_t_5 = __pyx_t_1;
+        __pyx_t_1 = __pyx_t_2;
+        goto __pyx_L24_bool_binop_done;
       }
-      if (__pyx_t_5) {
-        __pyx_t_3 = PyObject_GetItem(__pyx_v_lats, __pyx_k_slice_175); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_3);
-        __Pyx_DECREF_SET(__pyx_v_lats, __pyx_t_3);
-        __pyx_t_3 = 0;
-        goto __pyx_L13;
+      __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_lats, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1611; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_lats, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1611; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+      __Pyx_GOTREF(__pyx_t_7);
+      __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_7, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1611; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1611; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __pyx_t_1 = __pyx_t_2;
+      __pyx_L24_bool_binop_done:;
+      if (__pyx_t_1) {
+        __pyx_t_5 = PyObject_GetItem(__pyx_v_lats, __pyx_slice__94); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1611; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+        __Pyx_GOTREF(__pyx_t_5);
+        __Pyx_DECREF_SET(__pyx_v_lats, __pyx_t_5);
+        __pyx_t_5 = 0;
+        goto __pyx_L23;
       }
-      __pyx_L13:;
+      __pyx_L23:;
 
-      /* "pygrib.pyx":1620
+      /* "pygrib.pyx":1612
  *                 lats = self['distinctLatitudes']
  *                 if lat2 < lat1 and lats[-1] > lats[0]: lats = lats[::-1]
  *                 ny = self['Nj']             # <<<<<<<<<<<<<<
  *                 nx = 2*ny
  *                 lon1 = self['longitudeOfFirstGridPointInDegrees']
  */
-      __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__Nj)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_v_ny = __pyx_t_3;
-      __pyx_t_3 = 0;
+      __pyx_t_5 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_Nj); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1612; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+      __Pyx_GOTREF(__pyx_t_5);
+      __pyx_v_ny = __pyx_t_5;
+      __pyx_t_5 = 0;
 
-      /* "pygrib.pyx":1621
+      /* "pygrib.pyx":1613
  *                 if lat2 < lat1 and lats[-1] > lats[0]: lats = lats[::-1]
  *                 ny = self['Nj']
  *                 nx = 2*ny             # <<<<<<<<<<<<<<
  *                 lon1 = self['longitudeOfFirstGridPointInDegrees']
  *                 lon2 = self['longitudeOfLastGridPointInDegrees']
  */
-      __pyx_t_3 = PyNumber_Multiply(__pyx_int_2, __pyx_v_ny); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_v_nx = __pyx_t_3;
-      __pyx_t_3 = 0;
+      __pyx_t_5 = PyNumber_Multiply(__pyx_int_2, __pyx_v_ny); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_5);
+      __pyx_v_nx = __pyx_t_5;
+      __pyx_t_5 = 0;
 
-      /* "pygrib.pyx":1622
+      /* "pygrib.pyx":1614
  *                 ny = self['Nj']
  *                 nx = 2*ny
  *                 lon1 = self['longitudeOfFirstGridPointInDegrees']             # <<<<<<<<<<<<<<
  *                 lon2 = self['longitudeOfLastGridPointInDegrees']
  *                 lons = np.linspace(lon1,lon2,nx)
  */
-      __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s_169)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_v_lon1 = __pyx_t_3;
-      __pyx_t_3 = 0;
+      __pyx_t_5 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_longitudeOfFirstGridPointInDegre); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1614; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+      __Pyx_GOTREF(__pyx_t_5);
+      __pyx_v_lon1 = __pyx_t_5;
+      __pyx_t_5 = 0;
 
-      /* "pygrib.pyx":1623
+      /* "pygrib.pyx":1615
  *                 nx = 2*ny
  *                 lon1 = self['longitudeOfFirstGridPointInDegrees']
  *                 lon2 = self['longitudeOfLastGridPointInDegrees']             # <<<<<<<<<<<<<<
  *                 lons = np.linspace(lon1,lon2,nx)
  *                 lons,lats = np.meshgrid(lons,lats)
  */
-      __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s_170)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_v_lon2 = __pyx_t_3;
-      __pyx_t_3 = 0;
+      __pyx_t_5 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_longitudeOfLastGridPointInDegree); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1615; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+      __Pyx_GOTREF(__pyx_t_5);
+      __pyx_v_lon2 = __pyx_t_5;
+      __pyx_t_5 = 0;
 
-      /* "pygrib.pyx":1624
+      /* "pygrib.pyx":1616
  *                 lon1 = self['longitudeOfFirstGridPointInDegrees']
  *                 lon2 = self['longitudeOfLastGridPointInDegrees']
  *                 lons = np.linspace(lon1,lon2,nx)             # <<<<<<<<<<<<<<
  *                 lons,lats = np.meshgrid(lons,lats)
  *             else:
  */
-      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__linspace); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_7);
-      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_linspace); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+      __pyx_t_7 = NULL;
+      __pyx_t_6 = 0;
+      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
+        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
+        if (likely(__pyx_t_7)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+          __Pyx_INCREF(__pyx_t_7);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_3, function);
+          __pyx_t_6 = 1;
+        }
+      }
+      __pyx_t_4 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      if (__pyx_t_7) {
+        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = NULL;
+      }
       __Pyx_INCREF(__pyx_v_lon1);
-      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_lon1);
+      PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_6, __pyx_v_lon1);
       __Pyx_GIVEREF(__pyx_v_lon1);
       __Pyx_INCREF(__pyx_v_lon2);
-      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_lon2);
+      PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_6, __pyx_v_lon2);
       __Pyx_GIVEREF(__pyx_v_lon2);
       __Pyx_INCREF(__pyx_v_nx);
-      PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_nx);
+      PyTuple_SET_ITEM(__pyx_t_4, 2+__pyx_t_6, __pyx_v_nx);
       __Pyx_GIVEREF(__pyx_v_nx);
-      __pyx_t_4 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-      __pyx_v_lons = __pyx_t_4;
-      __pyx_t_4 = 0;
+      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_5);
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __pyx_v_lons = __pyx_t_5;
+      __pyx_t_5 = 0;
 
-      /* "pygrib.pyx":1625
+      /* "pygrib.pyx":1617
  *                 lon2 = self['longitudeOfLastGridPointInDegrees']
  *                 lons = np.linspace(lon1,lon2,nx)
  *                 lons,lats = np.meshgrid(lons,lats)             # <<<<<<<<<<<<<<
  *             else:
  *                 lats = self['latitudes']
  */
-      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__meshgrid); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_3);
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_meshgrid); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __pyx_t_3 = NULL;
+      __pyx_t_6 = 0;
+      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
+        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
+        if (likely(__pyx_t_3)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+          __Pyx_INCREF(__pyx_t_3);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_4, function);
+          __pyx_t_6 = 1;
+        }
+      }
+      __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_7);
+      if (__pyx_t_3) {
+        PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
+      }
       __Pyx_INCREF(__pyx_v_lons);
-      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_lons);
+      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_lons);
       __Pyx_GIVEREF(__pyx_v_lons);
       __Pyx_INCREF(__pyx_v_lats);
-      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_lats);
+      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_lats);
       __Pyx_GIVEREF(__pyx_v_lats);
-      __pyx_t_7 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_7);
-      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-      if ((likely(PyTuple_CheckExact(__pyx_t_7))) || (PyList_CheckExact(__pyx_t_7))) {
-        PyObject* sequence = __pyx_t_7;
+      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_5);
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
+        PyObject* sequence = __pyx_t_5;
         #if CYTHON_COMPILING_IN_CPYTHON
         Py_ssize_t size = Py_SIZE(sequence);
         #else
@@ -18615,266 +20165,308 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_38latlons(struct __pyx_obj_6pygr
         if (unlikely(size != 2)) {
           if (size > 2) __Pyx_RaiseTooManyValuesError(2);
           else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         }
         #if CYTHON_COMPILING_IN_CPYTHON
         if (likely(PyTuple_CheckExact(sequence))) {
           __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); 
-          __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
+          __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); 
         } else {
           __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
-          __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
+          __pyx_t_7 = PyList_GET_ITEM(sequence, 1); 
         }
         __Pyx_INCREF(__pyx_t_4);
-        __Pyx_INCREF(__pyx_t_3);
+        __Pyx_INCREF(__pyx_t_7);
         #else
-        __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         __Pyx_GOTREF(__pyx_t_4);
-        __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_3);
+        __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_7);
         #endif
-        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      } else
-      {
+        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      } else {
         Py_ssize_t index = -1;
-        __pyx_t_8 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_8);
-        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-        __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
-        index = 0; __pyx_t_4 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_4)) goto __pyx_L14_unpacking_failed;
-        __Pyx_GOTREF(__pyx_t_4);
-        index = 1; __pyx_t_3 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_3)) goto __pyx_L14_unpacking_failed;
+        __pyx_t_3 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         __Pyx_GOTREF(__pyx_t_3);
-        if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __pyx_t_9 = NULL;
-        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-        goto __pyx_L15_unpacking_done;
-        __pyx_L14_unpacking_failed:;
-        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-        __pyx_t_9 = NULL;
+        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+        __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext;
+        index = 0; __pyx_t_4 = __pyx_t_8(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L26_unpacking_failed;
+        __Pyx_GOTREF(__pyx_t_4);
+        index = 1; __pyx_t_7 = __pyx_t_8(__pyx_t_3); if (unlikely(!__pyx_t_7)) goto __pyx_L26_unpacking_failed;
+        __Pyx_GOTREF(__pyx_t_7);
+        if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_t_8 = NULL;
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        goto __pyx_L27_unpacking_done;
+        __pyx_L26_unpacking_failed:;
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_t_8 = NULL;
         if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __pyx_L15_unpacking_done:;
+        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_L27_unpacking_done:;
       }
       __Pyx_DECREF_SET(__pyx_v_lons, __pyx_t_4);
       __pyx_t_4 = 0;
-      __Pyx_DECREF_SET(__pyx_v_lats, __pyx_t_3);
-      __pyx_t_3 = 0;
-      goto __pyx_L12;
+      __Pyx_DECREF_SET(__pyx_v_lats, __pyx_t_7);
+      __pyx_t_7 = 0;
+      goto __pyx_L22;
     }
     /*else*/ {
 
-      /* "pygrib.pyx":1627
+      /* "pygrib.pyx":1619
  *                 lons,lats = np.meshgrid(lons,lats)
  *             else:
  *                 lats = self['latitudes']             # <<<<<<<<<<<<<<
  *                 lons = self['longitudes']
  *         elif self['gridType'] == 'reduced_ll': # reduced lat/lon grid
  */
-      __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__latitudes)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_7);
-      __pyx_v_lats = __pyx_t_7;
-      __pyx_t_7 = 0;
+      __pyx_t_5 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_latitudes); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1619; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+      __Pyx_GOTREF(__pyx_t_5);
+      __pyx_v_lats = __pyx_t_5;
+      __pyx_t_5 = 0;
 
-      /* "pygrib.pyx":1628
+      /* "pygrib.pyx":1620
  *             else:
  *                 lats = self['latitudes']
  *                 lons = self['longitudes']             # <<<<<<<<<<<<<<
  *         elif self['gridType'] == 'reduced_ll': # reduced lat/lon grid
  *             if self.expand_reduced:
  */
-      __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__longitudes)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1628; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_7);
-      __pyx_v_lons = __pyx_t_7;
-      __pyx_t_7 = 0;
+      __pyx_t_5 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_longitudes); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1620; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+      __Pyx_GOTREF(__pyx_t_5);
+      __pyx_v_lons = __pyx_t_5;
+      __pyx_t_5 = 0;
     }
-    __pyx_L12:;
+    __pyx_L22:;
     goto __pyx_L4;
   }
 
-  /* "pygrib.pyx":1629
+  /* "pygrib.pyx":1621
  *                 lats = self['latitudes']
  *                 lons = self['longitudes']
  *         elif self['gridType'] == 'reduced_ll': # reduced lat/lon grid             # <<<<<<<<<<<<<<
  *             if self.expand_reduced:
  *                 ny = self['Nj']
  */
-  __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__gridType)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_3 = PyObject_RichCompare(__pyx_t_7, ((PyObject *)__pyx_n_s__reduced_ll), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  if (__pyx_t_5) {
+  __pyx_t_5 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_gridType); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1621; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_5, __pyx_n_s_reduced_ll, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  if (__pyx_t_1) {
 
-    /* "pygrib.pyx":1630
+    /* "pygrib.pyx":1622
  *                 lons = self['longitudes']
  *         elif self['gridType'] == 'reduced_ll': # reduced lat/lon grid
  *             if self.expand_reduced:             # <<<<<<<<<<<<<<
  *                 ny = self['Nj']
  *                 nx = 2*ny
  */
-    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_self->expand_reduced); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    if (__pyx_t_5) {
+    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->expand_reduced); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (__pyx_t_1) {
 
-      /* "pygrib.pyx":1631
+      /* "pygrib.pyx":1623
  *         elif self['gridType'] == 'reduced_ll': # reduced lat/lon grid
  *             if self.expand_reduced:
  *                 ny = self['Nj']             # <<<<<<<<<<<<<<
  *                 nx = 2*ny
  *                 lat1 = self['latitudeOfFirstGridPointInDegrees']
  */
-      __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__Nj)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_v_ny = __pyx_t_3;
-      __pyx_t_3 = 0;
+      __pyx_t_5 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_Nj); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1623; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+      __Pyx_GOTREF(__pyx_t_5);
+      __pyx_v_ny = __pyx_t_5;
+      __pyx_t_5 = 0;
 
-      /* "pygrib.pyx":1632
+      /* "pygrib.pyx":1624
  *             if self.expand_reduced:
  *                 ny = self['Nj']
  *                 nx = 2*ny             # <<<<<<<<<<<<<<
  *                 lat1 = self['latitudeOfFirstGridPointInDegrees']
  *                 lat2 = self['latitudeOfLastGridPointInDegrees']
  */
-      __pyx_t_3 = PyNumber_Multiply(__pyx_int_2, __pyx_v_ny); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_v_nx = __pyx_t_3;
-      __pyx_t_3 = 0;
+      __pyx_t_5 = PyNumber_Multiply(__pyx_int_2, __pyx_v_ny); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_5);
+      __pyx_v_nx = __pyx_t_5;
+      __pyx_t_5 = 0;
 
-      /* "pygrib.pyx":1633
+      /* "pygrib.pyx":1625
  *                 ny = self['Nj']
  *                 nx = 2*ny
  *                 lat1 = self['latitudeOfFirstGridPointInDegrees']             # <<<<<<<<<<<<<<
  *                 lat2 = self['latitudeOfLastGridPointInDegrees']
  *                 lon1 = self['longitudeOfFirstGridPointInDegrees']
  */
-      __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s_171)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_v_lat1 = __pyx_t_3;
-      __pyx_t_3 = 0;
+      __pyx_t_5 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_latitudeOfFirstGridPointInDegree); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1625; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+      __Pyx_GOTREF(__pyx_t_5);
+      __pyx_v_lat1 = __pyx_t_5;
+      __pyx_t_5 = 0;
 
-      /* "pygrib.pyx":1634
+      /* "pygrib.pyx":1626
  *                 nx = 2*ny
  *                 lat1 = self['latitudeOfFirstGridPointInDegrees']
  *                 lat2 = self['latitudeOfLastGridPointInDegrees']             # <<<<<<<<<<<<<<
  *                 lon1 = self['longitudeOfFirstGridPointInDegrees']
  *                 lon2 = self['longitudeOfLastGridPointInDegrees']
  */
-      __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s_172)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_v_lat2 = __pyx_t_3;
-      __pyx_t_3 = 0;
+      __pyx_t_5 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_latitudeOfLastGridPointInDegrees); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1626; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+      __Pyx_GOTREF(__pyx_t_5);
+      __pyx_v_lat2 = __pyx_t_5;
+      __pyx_t_5 = 0;
 
-      /* "pygrib.pyx":1635
+      /* "pygrib.pyx":1627
  *                 lat1 = self['latitudeOfFirstGridPointInDegrees']
  *                 lat2 = self['latitudeOfLastGridPointInDegrees']
  *                 lon1 = self['longitudeOfFirstGridPointInDegrees']             # <<<<<<<<<<<<<<
  *                 lon2 = self['longitudeOfLastGridPointInDegrees']
  *                 lons = np.linspace(lon1,lon2,nx)
  */
-      __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s_169)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_v_lon1 = __pyx_t_3;
-      __pyx_t_3 = 0;
+      __pyx_t_5 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_longitudeOfFirstGridPointInDegre); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1627; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+      __Pyx_GOTREF(__pyx_t_5);
+      __pyx_v_lon1 = __pyx_t_5;
+      __pyx_t_5 = 0;
 
-      /* "pygrib.pyx":1636
+      /* "pygrib.pyx":1628
  *                 lat2 = self['latitudeOfLastGridPointInDegrees']
  *                 lon1 = self['longitudeOfFirstGridPointInDegrees']
  *                 lon2 = self['longitudeOfLastGridPointInDegrees']             # <<<<<<<<<<<<<<
  *                 lons = np.linspace(lon1,lon2,nx)
  *                 lats = np.linspace(lat1,lat2,ny)
  */
-      __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s_170)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_v_lon2 = __pyx_t_3;
-      __pyx_t_3 = 0;
+      __pyx_t_5 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_longitudeOfLastGridPointInDegree); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1628; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+      __Pyx_GOTREF(__pyx_t_5);
+      __pyx_v_lon2 = __pyx_t_5;
+      __pyx_t_5 = 0;
 
-      /* "pygrib.pyx":1637
+      /* "pygrib.pyx":1629
  *                 lon1 = self['longitudeOfFirstGridPointInDegrees']
  *                 lon2 = self['longitudeOfLastGridPointInDegrees']
  *                 lons = np.linspace(lon1,lon2,nx)             # <<<<<<<<<<<<<<
  *                 lats = np.linspace(lat1,lat2,ny)
  *                 lons,lats = np.meshgrid(lons,lats)
  */
-      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__linspace); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_7);
-      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_linspace); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+      __pyx_t_7 = NULL;
+      __pyx_t_6 = 0;
+      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
+        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
+        if (likely(__pyx_t_7)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+          __Pyx_INCREF(__pyx_t_7);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_4, function);
+          __pyx_t_6 = 1;
+        }
+      }
+      __pyx_t_3 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_3);
+      if (__pyx_t_7) {
+        PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = NULL;
+      }
       __Pyx_INCREF(__pyx_v_lon1);
-      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_lon1);
+      PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_6, __pyx_v_lon1);
       __Pyx_GIVEREF(__pyx_v_lon1);
       __Pyx_INCREF(__pyx_v_lon2);
-      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_lon2);
+      PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_6, __pyx_v_lon2);
       __Pyx_GIVEREF(__pyx_v_lon2);
       __Pyx_INCREF(__pyx_v_nx);
-      PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_nx);
+      PyTuple_SET_ITEM(__pyx_t_3, 2+__pyx_t_6, __pyx_v_nx);
       __Pyx_GIVEREF(__pyx_v_nx);
-      __pyx_t_4 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-      __pyx_v_lons = __pyx_t_4;
-      __pyx_t_4 = 0;
+      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_5);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_v_lons = __pyx_t_5;
+      __pyx_t_5 = 0;
 
-      /* "pygrib.pyx":1638
+      /* "pygrib.pyx":1630
  *                 lon2 = self['longitudeOfLastGridPointInDegrees']
  *                 lons = np.linspace(lon1,lon2,nx)
  *                 lats = np.linspace(lat1,lat2,ny)             # <<<<<<<<<<<<<<
  *                 lons,lats = np.meshgrid(lons,lats)
  *             else:
  */
-      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_4);
-      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__linspace); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_linspace); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_4 = NULL;
+      __pyx_t_6 = 0;
+      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
+        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+        if (likely(__pyx_t_4)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+          __Pyx_INCREF(__pyx_t_4);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_3, function);
+          __pyx_t_6 = 1;
+        }
+      }
+      __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_7);
+      if (__pyx_t_4) {
+        PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
+      }
       __Pyx_INCREF(__pyx_v_lat1);
-      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_lat1);
+      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_lat1);
       __Pyx_GIVEREF(__pyx_v_lat1);
       __Pyx_INCREF(__pyx_v_lat2);
-      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_lat2);
+      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_lat2);
       __Pyx_GIVEREF(__pyx_v_lat2);
       __Pyx_INCREF(__pyx_v_ny);
-      PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_ny);
+      PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_v_ny);
       __Pyx_GIVEREF(__pyx_v_ny);
-      __pyx_t_7 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_7);
+      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_5);
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-      __pyx_v_lats = __pyx_t_7;
-      __pyx_t_7 = 0;
+      __pyx_v_lats = __pyx_t_5;
+      __pyx_t_5 = 0;
 
-      /* "pygrib.pyx":1639
+      /* "pygrib.pyx":1631
  *                 lons = np.linspace(lon1,lon2,nx)
  *                 lats = np.linspace(lat1,lat2,ny)
  *                 lons,lats = np.meshgrid(lons,lats)             # <<<<<<<<<<<<<<
  *             else:
  *                 lats = self['latitudes']
  */
-      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_meshgrid); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_7);
-      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s__meshgrid); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __pyx_t_3 = NULL;
+      __pyx_t_6 = 0;
+      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
+        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7);
+        if (likely(__pyx_t_3)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
+          __Pyx_INCREF(__pyx_t_3);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_7, function);
+          __pyx_t_6 = 1;
+        }
+      }
+      __pyx_t_4 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_4);
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_7);
+      if (__pyx_t_3) {
+        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
+      }
       __Pyx_INCREF(__pyx_v_lons);
-      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_lons);
+      PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_6, __pyx_v_lons);
       __Pyx_GIVEREF(__pyx_v_lons);
       __Pyx_INCREF(__pyx_v_lats);
-      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_lats);
+      PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_6, __pyx_v_lats);
       __Pyx_GIVEREF(__pyx_v_lats);
-      __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_5);
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
-      if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
-        PyObject* sequence = __pyx_t_3;
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+      if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
+        PyObject* sequence = __pyx_t_5;
         #if CYTHON_COMPILING_IN_CPYTHON
         Py_ssize_t size = Py_SIZE(sequence);
         #else
@@ -18883,7 +20475,7 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_38latlons(struct __pyx_obj_6pygr
         if (unlikely(size != 2)) {
           if (size > 2) __Pyx_RaiseTooManyValuesError(2);
           else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         }
         #if CYTHON_COMPILING_IN_CPYTHON
         if (likely(PyTuple_CheckExact(sequence))) {
@@ -18896,110 +20488,107 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_38latlons(struct __pyx_obj_6pygr
         __Pyx_INCREF(__pyx_t_7);
         __Pyx_INCREF(__pyx_t_4);
         #else
-        __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         __Pyx_GOTREF(__pyx_t_7);
-        __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         __Pyx_GOTREF(__pyx_t_4);
         #endif
-        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      } else
-      {
+        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      } else {
         Py_ssize_t index = -1;
-        __pyx_t_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_8);
-        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-        __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
-        index = 0; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L17_unpacking_failed;
+        __pyx_t_3 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_3);
+        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+        __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext;
+        index = 0; __pyx_t_7 = __pyx_t_8(__pyx_t_3); if (unlikely(!__pyx_t_7)) goto __pyx_L29_unpacking_failed;
         __Pyx_GOTREF(__pyx_t_7);
-        index = 1; __pyx_t_4 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_4)) goto __pyx_L17_unpacking_failed;
+        index = 1; __pyx_t_4 = __pyx_t_8(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L29_unpacking_failed;
         __Pyx_GOTREF(__pyx_t_4);
-        if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __pyx_t_9 = NULL;
-        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-        goto __pyx_L18_unpacking_done;
-        __pyx_L17_unpacking_failed:;
-        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-        __pyx_t_9 = NULL;
+        if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_t_8 = NULL;
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        goto __pyx_L30_unpacking_done;
+        __pyx_L29_unpacking_failed:;
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_t_8 = NULL;
         if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __pyx_L18_unpacking_done:;
+        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_L30_unpacking_done:;
       }
       __Pyx_DECREF_SET(__pyx_v_lons, __pyx_t_7);
       __pyx_t_7 = 0;
       __Pyx_DECREF_SET(__pyx_v_lats, __pyx_t_4);
       __pyx_t_4 = 0;
-      goto __pyx_L16;
+      goto __pyx_L28;
     }
     /*else*/ {
 
-      /* "pygrib.pyx":1641
+      /* "pygrib.pyx":1633
  *                 lons,lats = np.meshgrid(lons,lats)
  *             else:
  *                 lats = self['latitudes']             # <<<<<<<<<<<<<<
  *                 lons = self['longitudes']
  *         elif self['gridType'] == 'polar_stereographic':
  */
-      __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__latitudes)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_v_lats = __pyx_t_3;
-      __pyx_t_3 = 0;
+      __pyx_t_5 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_latitudes); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1633; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+      __Pyx_GOTREF(__pyx_t_5);
+      __pyx_v_lats = __pyx_t_5;
+      __pyx_t_5 = 0;
 
-      /* "pygrib.pyx":1642
+      /* "pygrib.pyx":1634
  *             else:
  *                 lats = self['latitudes']
  *                 lons = self['longitudes']             # <<<<<<<<<<<<<<
  *         elif self['gridType'] == 'polar_stereographic':
  *             lat1 = self['latitudeOfFirstGridPointInDegrees']
  */
-      __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__longitudes)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1642; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_v_lons = __pyx_t_3;
-      __pyx_t_3 = 0;
+      __pyx_t_5 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_longitudes); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1634; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+      __Pyx_GOTREF(__pyx_t_5);
+      __pyx_v_lons = __pyx_t_5;
+      __pyx_t_5 = 0;
     }
-    __pyx_L16:;
+    __pyx_L28:;
     goto __pyx_L4;
   }
 
-  /* "pygrib.pyx":1643
+  /* "pygrib.pyx":1635
  *                 lats = self['latitudes']
  *                 lons = self['longitudes']
  *         elif self['gridType'] == 'polar_stereographic':             # <<<<<<<<<<<<<<
  *             lat1 = self['latitudeOfFirstGridPointInDegrees']
  *             lon1 = self['longitudeOfFirstGridPointInDegrees']
  */
-  __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__gridType)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, ((PyObject *)__pyx_n_s__polar_stereographic), Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  if (__pyx_t_5) {
+  __pyx_t_5 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_gridType); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1635; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_5, __pyx_n_s_polar_stereographic, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  if (__pyx_t_1) {
 
-    /* "pygrib.pyx":1644
+    /* "pygrib.pyx":1636
  *                 lons = self['longitudes']
  *         elif self['gridType'] == 'polar_stereographic':
  *             lat1 = self['latitudeOfFirstGridPointInDegrees']             # <<<<<<<<<<<<<<
  *             lon1 = self['longitudeOfFirstGridPointInDegrees']
  *             try:
  */
-    __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s_171)); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1644; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __pyx_v_lat1 = __pyx_t_4;
-    __pyx_t_4 = 0;
+    __pyx_t_5 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_latitudeOfFirstGridPointInDegree); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1636; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_v_lat1 = __pyx_t_5;
+    __pyx_t_5 = 0;
 
-    /* "pygrib.pyx":1645
+    /* "pygrib.pyx":1637
  *         elif self['gridType'] == 'polar_stereographic':
  *             lat1 = self['latitudeOfFirstGridPointInDegrees']
  *             lon1 = self['longitudeOfFirstGridPointInDegrees']             # <<<<<<<<<<<<<<
  *             try:
  *                 nx = self['Nx']
  */
-    __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s_169)); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __pyx_v_lon1 = __pyx_t_4;
-    __pyx_t_4 = 0;
+    __pyx_t_5 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_longitudeOfFirstGridPointInDegre); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1637; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_v_lon1 = __pyx_t_5;
+    __pyx_t_5 = 0;
 
-    /* "pygrib.pyx":1646
+    /* "pygrib.pyx":1638
  *             lat1 = self['latitudeOfFirstGridPointInDegrees']
  *             lon1 = self['longitudeOfFirstGridPointInDegrees']
  *             try:             # <<<<<<<<<<<<<<
@@ -19007,47 +20596,47 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_38latlons(struct __pyx_obj_6pygr
  *                 ny = self['Ny']
  */
     {
-      __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
+      __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
+      __Pyx_XGOTREF(__pyx_t_9);
       __Pyx_XGOTREF(__pyx_t_10);
       __Pyx_XGOTREF(__pyx_t_11);
-      __Pyx_XGOTREF(__pyx_t_12);
       /*try:*/ {
 
-        /* "pygrib.pyx":1647
+        /* "pygrib.pyx":1639
  *             lon1 = self['longitudeOfFirstGridPointInDegrees']
  *             try:
  *                 nx = self['Nx']             # <<<<<<<<<<<<<<
  *                 ny = self['Ny']
  *             except:
  */
-        __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__Nx)); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1647; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
-        __Pyx_GOTREF(__pyx_t_4);
-        __pyx_v_nx = __pyx_t_4;
-        __pyx_t_4 = 0;
+        __pyx_t_5 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_Nx); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1639; __pyx_clineno = __LINE__; goto __pyx_L31_error;};
+        __Pyx_GOTREF(__pyx_t_5);
+        __pyx_v_nx = __pyx_t_5;
+        __pyx_t_5 = 0;
 
-        /* "pygrib.pyx":1648
+        /* "pygrib.pyx":1640
  *             try:
  *                 nx = self['Nx']
  *                 ny = self['Ny']             # <<<<<<<<<<<<<<
  *             except:
  *                 nx = self['Ni']
  */
-        __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__Ny)); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1648; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
-        __Pyx_GOTREF(__pyx_t_4);
-        __pyx_v_ny = __pyx_t_4;
-        __pyx_t_4 = 0;
+        __pyx_t_5 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_Ny); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1640; __pyx_clineno = __LINE__; goto __pyx_L31_error;};
+        __Pyx_GOTREF(__pyx_t_5);
+        __pyx_v_ny = __pyx_t_5;
+        __pyx_t_5 = 0;
       }
+      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
       __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
       __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
-      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
-      goto __pyx_L26_try_end;
-      __pyx_L19_error:;
-      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
-      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+      goto __pyx_L38_try_end;
+      __pyx_L31_error:;
       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
       __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-      /* "pygrib.pyx":1649
+      /* "pygrib.pyx":1641
  *                 nx = self['Nx']
  *                 ny = self['Ny']
  *             except:             # <<<<<<<<<<<<<<
@@ -19056,54 +20645,54 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_38latlons(struct __pyx_obj_6pygr
  */
       /*except:*/ {
         __Pyx_AddTraceback("pygrib.gribmessage.latlons", __pyx_clineno, __pyx_lineno, __pyx_filename);
-        if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_3, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1649; __pyx_clineno = __LINE__; goto __pyx_L21_except_error;}
+        if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1641; __pyx_clineno = __LINE__; goto __pyx_L33_except_error;}
+        __Pyx_GOTREF(__pyx_t_5);
         __Pyx_GOTREF(__pyx_t_4);
-        __Pyx_GOTREF(__pyx_t_3);
         __Pyx_GOTREF(__pyx_t_7);
 
-        /* "pygrib.pyx":1650
+        /* "pygrib.pyx":1642
  *                 ny = self['Ny']
  *             except:
  *                 nx = self['Ni']             # <<<<<<<<<<<<<<
  *                 ny = self['Nj']
  *             # key renamed from xDirectionGridLengthInMetres to
  */
-        __pyx_t_8 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__Ni)); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1650; __pyx_clineno = __LINE__; goto __pyx_L21_except_error;}
-        __Pyx_GOTREF(__pyx_t_8);
-        __Pyx_XDECREF_SET(__pyx_v_nx, __pyx_t_8);
-        __pyx_t_8 = 0;
+        __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_Ni); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1642; __pyx_clineno = __LINE__; goto __pyx_L33_except_error;};
+        __Pyx_GOTREF(__pyx_t_3);
+        __Pyx_XDECREF_SET(__pyx_v_nx, __pyx_t_3);
+        __pyx_t_3 = 0;
 
-        /* "pygrib.pyx":1651
+        /* "pygrib.pyx":1643
  *             except:
  *                 nx = self['Ni']
  *                 ny = self['Nj']             # <<<<<<<<<<<<<<
  *             # key renamed from xDirectionGridLengthInMetres to
  *             # DxInMetres grib_api 1.8.0.1.
  */
-        __pyx_t_8 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__Nj)); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1651; __pyx_clineno = __LINE__; goto __pyx_L21_except_error;}
-        __Pyx_GOTREF(__pyx_t_8);
-        __Pyx_XDECREF_SET(__pyx_v_ny, __pyx_t_8);
-        __pyx_t_8 = 0;
+        __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_Nj); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1643; __pyx_clineno = __LINE__; goto __pyx_L33_except_error;};
+        __Pyx_GOTREF(__pyx_t_3);
+        __Pyx_XDECREF_SET(__pyx_v_ny, __pyx_t_3);
+        __pyx_t_3 = 0;
+        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-        goto __pyx_L20_exception_handled;
+        goto __pyx_L32_exception_handled;
       }
-      __pyx_L21_except_error:;
+      __pyx_L33_except_error:;
+      __Pyx_XGIVEREF(__pyx_t_9);
       __Pyx_XGIVEREF(__pyx_t_10);
       __Pyx_XGIVEREF(__pyx_t_11);
-      __Pyx_XGIVEREF(__pyx_t_12);
-      __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
+      __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
       goto __pyx_L1_error;
-      __pyx_L20_exception_handled:;
+      __pyx_L32_exception_handled:;
+      __Pyx_XGIVEREF(__pyx_t_9);
       __Pyx_XGIVEREF(__pyx_t_10);
       __Pyx_XGIVEREF(__pyx_t_11);
-      __Pyx_XGIVEREF(__pyx_t_12);
-      __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
-      __pyx_L26_try_end:;
+      __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
+      __pyx_L38_try_end:;
     }
 
-    /* "pygrib.pyx":1654
+    /* "pygrib.pyx":1646
  *             # key renamed from xDirectionGridLengthInMetres to
  *             # DxInMetres grib_api 1.8.0.1.
  *             try:             # <<<<<<<<<<<<<<
@@ -19111,35 +20700,35 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_38latlons(struct __pyx_obj_6pygr
  *             except:
  */
     {
-      __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
-      __Pyx_XGOTREF(__pyx_t_12);
+      __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
       __Pyx_XGOTREF(__pyx_t_11);
       __Pyx_XGOTREF(__pyx_t_10);
+      __Pyx_XGOTREF(__pyx_t_9);
       /*try:*/ {
 
-        /* "pygrib.pyx":1655
+        /* "pygrib.pyx":1647
  *             # DxInMetres grib_api 1.8.0.1.
  *             try:
  *                 dx = self['DxInMetres']             # <<<<<<<<<<<<<<
  *             except:
  *                 dx = self['xDirectionGridLengthInMetres']
  */
-        __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__DxInMetres)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1655; __pyx_clineno = __LINE__; goto __pyx_L29_error;}
+        __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_DxInMetres); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1647; __pyx_clineno = __LINE__; goto __pyx_L41_error;};
         __Pyx_GOTREF(__pyx_t_7);
         __pyx_v_dx = __pyx_t_7;
         __pyx_t_7 = 0;
       }
-      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
       __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
       __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
-      goto __pyx_L36_try_end;
-      __pyx_L29_error:;
-      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
-      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+      goto __pyx_L48_try_end;
+      __pyx_L41_error:;
       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
       __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-      /* "pygrib.pyx":1656
+      /* "pygrib.pyx":1648
  *             try:
  *                 dx = self['DxInMetres']
  *             except:             # <<<<<<<<<<<<<<
@@ -19148,42 +20737,42 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_38latlons(struct __pyx_obj_6pygr
  */
       /*except:*/ {
         __Pyx_AddTraceback("pygrib.gribmessage.latlons", __pyx_clineno, __pyx_lineno, __pyx_filename);
-        if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_3, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1656; __pyx_clineno = __LINE__; goto __pyx_L31_except_error;}
+        if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_4, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1648; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;}
         __Pyx_GOTREF(__pyx_t_7);
-        __Pyx_GOTREF(__pyx_t_3);
         __Pyx_GOTREF(__pyx_t_4);
+        __Pyx_GOTREF(__pyx_t_5);
 
-        /* "pygrib.pyx":1657
+        /* "pygrib.pyx":1649
  *                 dx = self['DxInMetres']
  *             except:
  *                 dx = self['xDirectionGridLengthInMetres']             # <<<<<<<<<<<<<<
  *             try:
  *                 dy = self['DyInMetres']
  */
-        __pyx_t_8 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s_176)); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1657; __pyx_clineno = __LINE__; goto __pyx_L31_except_error;}
-        __Pyx_GOTREF(__pyx_t_8);
-        __Pyx_XDECREF_SET(__pyx_v_dx, __pyx_t_8);
-        __pyx_t_8 = 0;
+        __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_xDirectionGridLengthInMetres); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1649; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;};
+        __Pyx_GOTREF(__pyx_t_3);
+        __Pyx_XDECREF_SET(__pyx_v_dx, __pyx_t_3);
+        __pyx_t_3 = 0;
         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-        goto __pyx_L30_exception_handled;
+        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+        goto __pyx_L42_exception_handled;
       }
-      __pyx_L31_except_error:;
-      __Pyx_XGIVEREF(__pyx_t_12);
+      __pyx_L43_except_error:;
       __Pyx_XGIVEREF(__pyx_t_11);
       __Pyx_XGIVEREF(__pyx_t_10);
-      __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_11, __pyx_t_10);
+      __Pyx_XGIVEREF(__pyx_t_9);
+      __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_10, __pyx_t_9);
       goto __pyx_L1_error;
-      __pyx_L30_exception_handled:;
-      __Pyx_XGIVEREF(__pyx_t_12);
+      __pyx_L42_exception_handled:;
       __Pyx_XGIVEREF(__pyx_t_11);
       __Pyx_XGIVEREF(__pyx_t_10);
-      __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_11, __pyx_t_10);
-      __pyx_L36_try_end:;
+      __Pyx_XGIVEREF(__pyx_t_9);
+      __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_10, __pyx_t_9);
+      __pyx_L48_try_end:;
     }
 
-    /* "pygrib.pyx":1658
+    /* "pygrib.pyx":1650
  *             except:
  *                 dx = self['xDirectionGridLengthInMetres']
  *             try:             # <<<<<<<<<<<<<<
@@ -19191,35 +20780,35 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_38latlons(struct __pyx_obj_6pygr
  *             except:
  */
     {
-      __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
+      __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
+      __Pyx_XGOTREF(__pyx_t_9);
       __Pyx_XGOTREF(__pyx_t_10);
       __Pyx_XGOTREF(__pyx_t_11);
-      __Pyx_XGOTREF(__pyx_t_12);
       /*try:*/ {
 
-        /* "pygrib.pyx":1659
+        /* "pygrib.pyx":1651
  *                 dx = self['xDirectionGridLengthInMetres']
  *             try:
  *                 dy = self['DyInMetres']             # <<<<<<<<<<<<<<
  *             except:
  *                 dy = self['yDirectionGridLengthInMetres']
  */
-        __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__DyInMetres)); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1659; __pyx_clineno = __LINE__; goto __pyx_L39_error;}
-        __Pyx_GOTREF(__pyx_t_4);
-        __pyx_v_dy = __pyx_t_4;
-        __pyx_t_4 = 0;
+        __pyx_t_5 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_DyInMetres); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1651; __pyx_clineno = __LINE__; goto __pyx_L51_error;};
+        __Pyx_GOTREF(__pyx_t_5);
+        __pyx_v_dy = __pyx_t_5;
+        __pyx_t_5 = 0;
       }
+      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
       __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
       __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
-      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
-      goto __pyx_L46_try_end;
-      __pyx_L39_error:;
-      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
-      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+      goto __pyx_L58_try_end;
+      __pyx_L51_error:;
       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
       __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-      /* "pygrib.pyx":1660
+      /* "pygrib.pyx":1652
  *             try:
  *                 dy = self['DyInMetres']
  *             except:             # <<<<<<<<<<<<<<
@@ -19228,83 +20817,116 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_38latlons(struct __pyx_obj_6pygr
  */
       /*except:*/ {
         __Pyx_AddTraceback("pygrib.gribmessage.latlons", __pyx_clineno, __pyx_lineno, __pyx_filename);
-        if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_3, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1660; __pyx_clineno = __LINE__; goto __pyx_L41_except_error;}
+        if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1652; __pyx_clineno = __LINE__; goto __pyx_L53_except_error;}
+        __Pyx_GOTREF(__pyx_t_5);
         __Pyx_GOTREF(__pyx_t_4);
-        __Pyx_GOTREF(__pyx_t_3);
         __Pyx_GOTREF(__pyx_t_7);
 
-        /* "pygrib.pyx":1661
+        /* "pygrib.pyx":1653
  *                 dy = self['DyInMetres']
  *             except:
  *                 dy = self['yDirectionGridLengthInMetres']             # <<<<<<<<<<<<<<
  *             pj = pyproj.Proj(self.projparams)
  *             llcrnrx, llcrnry = pj(lon1,lat1)
  */
-        __pyx_t_8 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s_177)); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1661; __pyx_clineno = __LINE__; goto __pyx_L41_except_error;}
-        __Pyx_GOTREF(__pyx_t_8);
-        __Pyx_XDECREF_SET(__pyx_v_dy, __pyx_t_8);
-        __pyx_t_8 = 0;
+        __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_yDirectionGridLengthInMetres); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1653; __pyx_clineno = __LINE__; goto __pyx_L53_except_error;};
+        __Pyx_GOTREF(__pyx_t_3);
+        __Pyx_XDECREF_SET(__pyx_v_dy, __pyx_t_3);
+        __pyx_t_3 = 0;
+        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-        goto __pyx_L40_exception_handled;
+        goto __pyx_L52_exception_handled;
       }
-      __pyx_L41_except_error:;
+      __pyx_L53_except_error:;
+      __Pyx_XGIVEREF(__pyx_t_9);
       __Pyx_XGIVEREF(__pyx_t_10);
       __Pyx_XGIVEREF(__pyx_t_11);
-      __Pyx_XGIVEREF(__pyx_t_12);
-      __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
+      __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
       goto __pyx_L1_error;
-      __pyx_L40_exception_handled:;
+      __pyx_L52_exception_handled:;
+      __Pyx_XGIVEREF(__pyx_t_9);
       __Pyx_XGIVEREF(__pyx_t_10);
       __Pyx_XGIVEREF(__pyx_t_11);
-      __Pyx_XGIVEREF(__pyx_t_12);
-      __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
-      __pyx_L46_try_end:;
+      __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
+      __pyx_L58_try_end:;
     }
 
-    /* "pygrib.pyx":1662
+    /* "pygrib.pyx":1654
  *             except:
  *                 dy = self['yDirectionGridLengthInMetres']
  *             pj = pyproj.Proj(self.projparams)             # <<<<<<<<<<<<<<
  *             llcrnrx, llcrnry = pj(lon1,lat1)
  *             x = llcrnrx+dx*np.arange(nx)
  */
-    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s__pyproj); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s__Proj); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_INCREF(__pyx_v_self->projparams);
-    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_self->projparams);
-    __Pyx_GIVEREF(__pyx_v_self->projparams);
-    __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyproj); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
-    __pyx_v_pj = __pyx_t_4;
-    __pyx_t_4 = 0;
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Proj); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_4 = NULL;
+    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
+      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
+      if (likely(__pyx_t_4)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+        __Pyx_INCREF(__pyx_t_4);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_5, function);
+      }
+    }
+    if (!__pyx_t_4) {
+      __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_self->projparams); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_7);
+    } else {
+      __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
+      __Pyx_INCREF(__pyx_v_self->projparams);
+      PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_v_self->projparams);
+      __Pyx_GIVEREF(__pyx_v_self->projparams);
+      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_7);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    }
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __pyx_v_pj = __pyx_t_7;
+    __pyx_t_7 = 0;
 
-    /* "pygrib.pyx":1663
+    /* "pygrib.pyx":1655
  *                 dy = self['yDirectionGridLengthInMetres']
  *             pj = pyproj.Proj(self.projparams)
  *             llcrnrx, llcrnry = pj(lon1,lat1)             # <<<<<<<<<<<<<<
  *             x = llcrnrx+dx*np.arange(nx)
  *             y = llcrnry+dy*np.arange(ny)
  */
-    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_INCREF(__pyx_v_pj);
+    __pyx_t_5 = __pyx_v_pj; __pyx_t_3 = NULL;
+    __pyx_t_6 = 0;
+    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
+      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
+      if (likely(__pyx_t_3)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+        __Pyx_INCREF(__pyx_t_3);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_5, function);
+        __pyx_t_6 = 1;
+      }
+    }
+    __pyx_t_4 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
+    if (__pyx_t_3) {
+      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
+    }
     __Pyx_INCREF(__pyx_v_lon1);
-    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_lon1);
+    PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_6, __pyx_v_lon1);
     __Pyx_GIVEREF(__pyx_v_lon1);
     __Pyx_INCREF(__pyx_v_lat1);
-    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_lat1);
+    PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_6, __pyx_v_lat1);
     __Pyx_GIVEREF(__pyx_v_lat1);
-    __pyx_t_7 = PyObject_Call(__pyx_v_pj, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     if ((likely(PyTuple_CheckExact(__pyx_t_7))) || (PyList_CheckExact(__pyx_t_7))) {
       PyObject* sequence = __pyx_t_7;
       #if CYTHON_COMPILING_IN_CPYTHON
@@ -19315,136 +20937,182 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_38latlons(struct __pyx_obj_6pygr
       if (unlikely(size != 2)) {
         if (size > 2) __Pyx_RaiseTooManyValuesError(2);
         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       }
       #if CYTHON_COMPILING_IN_CPYTHON
       if (likely(PyTuple_CheckExact(sequence))) {
-        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); 
-        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
+        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
+        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
       } else {
-        __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
-        __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
+        __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
+        __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
       }
+      __Pyx_INCREF(__pyx_t_5);
       __Pyx_INCREF(__pyx_t_4);
-      __Pyx_INCREF(__pyx_t_3);
       #else
-      __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_5);
+      __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_4);
-      __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
       #endif
       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    } else
-    {
+    } else {
       Py_ssize_t index = -1;
-      __pyx_t_8 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
+      __pyx_t_3 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
-      index = 0; __pyx_t_4 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_4)) goto __pyx_L49_unpacking_failed;
+      __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext;
+      index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_3); if (unlikely(!__pyx_t_5)) goto __pyx_L61_unpacking_failed;
+      __Pyx_GOTREF(__pyx_t_5);
+      index = 1; __pyx_t_4 = __pyx_t_8(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L61_unpacking_failed;
       __Pyx_GOTREF(__pyx_t_4);
-      index = 1; __pyx_t_3 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_3)) goto __pyx_L49_unpacking_failed;
-      __Pyx_GOTREF(__pyx_t_3);
-      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_9 = NULL;
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      goto __pyx_L50_unpacking_done;
-      __pyx_L49_unpacking_failed:;
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      __pyx_t_9 = NULL;
+      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_8 = NULL;
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      goto __pyx_L62_unpacking_done;
+      __pyx_L61_unpacking_failed:;
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __pyx_t_8 = NULL;
       if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_L50_unpacking_done:;
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_L62_unpacking_done:;
     }
-    __pyx_v_llcrnrx = __pyx_t_4;
+    __pyx_v_llcrnrx = __pyx_t_5;
+    __pyx_t_5 = 0;
+    __pyx_v_llcrnry = __pyx_t_4;
     __pyx_t_4 = 0;
-    __pyx_v_llcrnry = __pyx_t_3;
-    __pyx_t_3 = 0;
 
-    /* "pygrib.pyx":1664
+    /* "pygrib.pyx":1656
  *             pj = pyproj.Proj(self.projparams)
  *             llcrnrx, llcrnry = pj(lon1,lat1)
  *             x = llcrnrx+dx*np.arange(nx)             # <<<<<<<<<<<<<<
  *             y = llcrnry+dy*np.arange(ny)
  *             x, y = np.meshgrid(x, y)
  */
-    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s__arange); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_INCREF(__pyx_v_nx);
-    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_nx);
-    __Pyx_GIVEREF(__pyx_v_nx);
-    __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
-    __pyx_t_7 = PyNumber_Multiply(__pyx_v_dx, __pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_arange); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_t_4 = PyNumber_Add(__pyx_v_llcrnrx, __pyx_t_7); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_4 = NULL;
+    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
+      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
+      if (likely(__pyx_t_4)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+        __Pyx_INCREF(__pyx_t_4);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_5, function);
+      }
+    }
+    if (!__pyx_t_4) {
+      __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_nx); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_7);
+    } else {
+      __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
+      __Pyx_INCREF(__pyx_v_nx);
+      PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_v_nx);
+      __Pyx_GIVEREF(__pyx_v_nx);
+      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_7);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    }
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __pyx_t_5 = PyNumber_Multiply(__pyx_v_dx, __pyx_t_7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __pyx_v_x = __pyx_t_4;
-    __pyx_t_4 = 0;
+    __pyx_t_7 = PyNumber_Add(__pyx_v_llcrnrx, __pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_7);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __pyx_v_x = __pyx_t_7;
+    __pyx_t_7 = 0;
 
-    /* "pygrib.pyx":1665
+    /* "pygrib.pyx":1657
  *             llcrnrx, llcrnry = pj(lon1,lat1)
  *             x = llcrnrx+dx*np.arange(nx)
  *             y = llcrnry+dy*np.arange(ny)             # <<<<<<<<<<<<<<
  *             x, y = np.meshgrid(x, y)
  *             lons, lats = pj(x, y, inverse=True)
  */
-    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__arange); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_INCREF(__pyx_v_ny);
-    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_ny);
-    __Pyx_GIVEREF(__pyx_v_ny);
-    __pyx_t_3 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_arange); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-    __pyx_t_4 = PyNumber_Multiply(__pyx_v_dy, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __pyx_t_5 = NULL;
+    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
+      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
+      if (likely(__pyx_t_5)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+        __Pyx_INCREF(__pyx_t_5);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_3, function);
+      }
+    }
+    if (!__pyx_t_5) {
+      __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_ny); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_7);
+    } else {
+      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
+      __Pyx_INCREF(__pyx_v_ny);
+      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_ny);
+      __Pyx_GIVEREF(__pyx_v_ny);
+      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_7);
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    }
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_3 = PyNumber_Add(__pyx_v_llcrnry, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = PyNumber_Multiply(__pyx_v_dy, __pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_v_y = __pyx_t_3;
-    __pyx_t_3 = 0;
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __pyx_t_7 = PyNumber_Add(__pyx_v_llcrnry, __pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_7);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_v_y = __pyx_t_7;
+    __pyx_t_7 = 0;
 
-    /* "pygrib.pyx":1666
+    /* "pygrib.pyx":1658
  *             x = llcrnrx+dx*np.arange(nx)
  *             y = llcrnry+dy*np.arange(ny)
  *             x, y = np.meshgrid(x, y)             # <<<<<<<<<<<<<<
  *             lons, lats = pj(x, y, inverse=True)
  *         elif self['gridType'] == 'lambert':
  */
-    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__meshgrid); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_meshgrid); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_3 = NULL;
+    __pyx_t_6 = 0;
+    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
+      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
+      if (likely(__pyx_t_3)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+        __Pyx_INCREF(__pyx_t_3);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_4, function);
+        __pyx_t_6 = 1;
+      }
+    }
+    __pyx_t_5 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    if (__pyx_t_3) {
+      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
+    }
     __Pyx_INCREF(__pyx_v_x);
-    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_x);
+    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_6, __pyx_v_x);
     __Pyx_GIVEREF(__pyx_v_x);
     __Pyx_INCREF(__pyx_v_y);
-    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_y);
+    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_6, __pyx_v_y);
     __Pyx_GIVEREF(__pyx_v_y);
-    __pyx_t_7 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_7);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
     if ((likely(PyTuple_CheckExact(__pyx_t_7))) || (PyList_CheckExact(__pyx_t_7))) {
       PyObject* sequence = __pyx_t_7;
       #if CYTHON_COMPILING_IN_CPYTHON
@@ -19455,60 +21123,59 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_38latlons(struct __pyx_obj_6pygr
       if (unlikely(size != 2)) {
         if (size > 2) __Pyx_RaiseTooManyValuesError(2);
         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       }
       #if CYTHON_COMPILING_IN_CPYTHON
       if (likely(PyTuple_CheckExact(sequence))) {
-        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
-        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
+        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); 
+        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
       } else {
-        __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
-        __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
+        __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
+        __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
       }
-      __Pyx_INCREF(__pyx_t_3);
       __Pyx_INCREF(__pyx_t_4);
+      __Pyx_INCREF(__pyx_t_5);
       #else
-      __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_5);
       #endif
       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    } else
-    {
+    } else {
       Py_ssize_t index = -1;
-      __pyx_t_8 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
-      index = 0; __pyx_t_3 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_3)) goto __pyx_L51_unpacking_failed;
+      __pyx_t_3 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_3);
-      index = 1; __pyx_t_4 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_4)) goto __pyx_L51_unpacking_failed;
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+      __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext;
+      index = 0; __pyx_t_4 = __pyx_t_8(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L63_unpacking_failed;
       __Pyx_GOTREF(__pyx_t_4);
-      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_9 = NULL;
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      goto __pyx_L52_unpacking_done;
-      __pyx_L51_unpacking_failed:;
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      __pyx_t_9 = NULL;
+      index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_3); if (unlikely(!__pyx_t_5)) goto __pyx_L63_unpacking_failed;
+      __Pyx_GOTREF(__pyx_t_5);
+      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_8 = NULL;
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      goto __pyx_L64_unpacking_done;
+      __pyx_L63_unpacking_failed:;
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __pyx_t_8 = NULL;
       if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_L52_unpacking_done:;
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_L64_unpacking_done:;
     }
-    __Pyx_DECREF_SET(__pyx_v_x, __pyx_t_3);
-    __pyx_t_3 = 0;
-    __Pyx_DECREF_SET(__pyx_v_y, __pyx_t_4);
+    __Pyx_DECREF_SET(__pyx_v_x, __pyx_t_4);
     __pyx_t_4 = 0;
+    __Pyx_DECREF_SET(__pyx_v_y, __pyx_t_5);
+    __pyx_t_5 = 0;
 
-    /* "pygrib.pyx":1667
+    /* "pygrib.pyx":1659
  *             y = llcrnry+dy*np.arange(ny)
  *             x, y = np.meshgrid(x, y)
  *             lons, lats = pj(x, y, inverse=True)             # <<<<<<<<<<<<<<
  *         elif self['gridType'] == 'lambert':
  *             lat1 = self['latitudeOfFirstGridPointInDegrees']
  */
-    __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_7);
     __Pyx_INCREF(__pyx_v_x);
     PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_x);
@@ -19516,18 +21183,15 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_38latlons(struct __pyx_obj_6pygr
     __Pyx_INCREF(__pyx_v_y);
     PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_y);
     __Pyx_GIVEREF(__pyx_v_y);
-    __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
-    __pyx_t_3 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__inverse), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_3 = PyObject_Call(__pyx_v_pj, ((PyObject *)__pyx_t_7), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-    if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
-      PyObject* sequence = __pyx_t_3;
+    __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_inverse, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_v_pj, __pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
+      PyObject* sequence = __pyx_t_4;
       #if CYTHON_COMPILING_IN_CPYTHON
       Py_ssize_t size = Py_SIZE(sequence);
       #else
@@ -19536,94 +21200,91 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_38latlons(struct __pyx_obj_6pygr
       if (unlikely(size != 2)) {
         if (size > 2) __Pyx_RaiseTooManyValuesError(2);
         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       }
       #if CYTHON_COMPILING_IN_CPYTHON
       if (likely(PyTuple_CheckExact(sequence))) {
-        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); 
+        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
         __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); 
       } else {
-        __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
+        __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
         __pyx_t_7 = PyList_GET_ITEM(sequence, 1); 
       }
-      __Pyx_INCREF(__pyx_t_4);
+      __Pyx_INCREF(__pyx_t_5);
       __Pyx_INCREF(__pyx_t_7);
       #else
-      __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_5);
+      __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_7);
       #endif
-      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    } else
-    {
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    } else {
       Py_ssize_t index = -1;
-      __pyx_t_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
-      index = 0; __pyx_t_4 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_4)) goto __pyx_L53_unpacking_failed;
-      __Pyx_GOTREF(__pyx_t_4);
-      index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L53_unpacking_failed;
+      __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext;
+      index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_3); if (unlikely(!__pyx_t_5)) goto __pyx_L65_unpacking_failed;
+      __Pyx_GOTREF(__pyx_t_5);
+      index = 1; __pyx_t_7 = __pyx_t_8(__pyx_t_3); if (unlikely(!__pyx_t_7)) goto __pyx_L65_unpacking_failed;
       __Pyx_GOTREF(__pyx_t_7);
-      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_9 = NULL;
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      goto __pyx_L54_unpacking_done;
-      __pyx_L53_unpacking_failed:;
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      __pyx_t_9 = NULL;
+      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_8 = NULL;
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      goto __pyx_L66_unpacking_done;
+      __pyx_L65_unpacking_failed:;
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __pyx_t_8 = NULL;
       if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_L54_unpacking_done:;
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_L66_unpacking_done:;
     }
-    __pyx_v_lons = __pyx_t_4;
-    __pyx_t_4 = 0;
+    __pyx_v_lons = __pyx_t_5;
+    __pyx_t_5 = 0;
     __pyx_v_lats = __pyx_t_7;
     __pyx_t_7 = 0;
     goto __pyx_L4;
   }
 
-  /* "pygrib.pyx":1668
+  /* "pygrib.pyx":1660
  *             x, y = np.meshgrid(x, y)
  *             lons, lats = pj(x, y, inverse=True)
  *         elif self['gridType'] == 'lambert':             # <<<<<<<<<<<<<<
  *             lat1 = self['latitudeOfFirstGridPointInDegrees']
  *             lon1 = self['longitudeOfFirstGridPointInDegrees']
  */
-  __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__gridType)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_7 = PyObject_RichCompare(__pyx_t_3, ((PyObject *)__pyx_n_s__lambert), Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  if (__pyx_t_5) {
+  __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_gridType); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1660; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_n_s_lambert, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  if (__pyx_t_1) {
 
-    /* "pygrib.pyx":1669
+    /* "pygrib.pyx":1661
  *             lons, lats = pj(x, y, inverse=True)
  *         elif self['gridType'] == 'lambert':
  *             lat1 = self['latitudeOfFirstGridPointInDegrees']             # <<<<<<<<<<<<<<
  *             lon1 = self['longitudeOfFirstGridPointInDegrees']
  *             try:
  */
-    __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s_171)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1669; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __pyx_v_lat1 = __pyx_t_7;
-    __pyx_t_7 = 0;
+    __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_latitudeOfFirstGridPointInDegree); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1661; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_v_lat1 = __pyx_t_4;
+    __pyx_t_4 = 0;
 
-    /* "pygrib.pyx":1670
+    /* "pygrib.pyx":1662
  *         elif self['gridType'] == 'lambert':
  *             lat1 = self['latitudeOfFirstGridPointInDegrees']
  *             lon1 = self['longitudeOfFirstGridPointInDegrees']             # <<<<<<<<<<<<<<
  *             try:
  *                 nx = self['Nx']
  */
-    __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s_169)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1670; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __pyx_v_lon1 = __pyx_t_7;
-    __pyx_t_7 = 0;
+    __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_longitudeOfFirstGridPointInDegre); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1662; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_v_lon1 = __pyx_t_4;
+    __pyx_t_4 = 0;
 
-    /* "pygrib.pyx":1671
+    /* "pygrib.pyx":1663
  *             lat1 = self['latitudeOfFirstGridPointInDegrees']
  *             lon1 = self['longitudeOfFirstGridPointInDegrees']
  *             try:             # <<<<<<<<<<<<<<
@@ -19631,47 +21292,47 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_38latlons(struct __pyx_obj_6pygr
  *                 ny = self['Ny']
  */
     {
-      __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
-      __Pyx_XGOTREF(__pyx_t_12);
+      __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
       __Pyx_XGOTREF(__pyx_t_11);
       __Pyx_XGOTREF(__pyx_t_10);
+      __Pyx_XGOTREF(__pyx_t_9);
       /*try:*/ {
 
-        /* "pygrib.pyx":1672
+        /* "pygrib.pyx":1664
  *             lon1 = self['longitudeOfFirstGridPointInDegrees']
  *             try:
  *                 nx = self['Nx']             # <<<<<<<<<<<<<<
  *                 ny = self['Ny']
  *             except:
  */
-        __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__Nx)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1672; __pyx_clineno = __LINE__; goto __pyx_L55_error;}
-        __Pyx_GOTREF(__pyx_t_7);
-        __pyx_v_nx = __pyx_t_7;
-        __pyx_t_7 = 0;
+        __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_Nx); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1664; __pyx_clineno = __LINE__; goto __pyx_L67_error;};
+        __Pyx_GOTREF(__pyx_t_4);
+        __pyx_v_nx = __pyx_t_4;
+        __pyx_t_4 = 0;
 
-        /* "pygrib.pyx":1673
+        /* "pygrib.pyx":1665
  *             try:
  *                 nx = self['Nx']
  *                 ny = self['Ny']             # <<<<<<<<<<<<<<
  *             except:
  *                 nx = self['Ni']
  */
-        __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__Ny)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1673; __pyx_clineno = __LINE__; goto __pyx_L55_error;}
-        __Pyx_GOTREF(__pyx_t_7);
-        __pyx_v_ny = __pyx_t_7;
-        __pyx_t_7 = 0;
+        __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_Ny); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1665; __pyx_clineno = __LINE__; goto __pyx_L67_error;};
+        __Pyx_GOTREF(__pyx_t_4);
+        __pyx_v_ny = __pyx_t_4;
+        __pyx_t_4 = 0;
       }
-      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
       __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
       __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
-      goto __pyx_L62_try_end;
-      __pyx_L55_error:;
-      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
-      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+      goto __pyx_L74_try_end;
+      __pyx_L67_error:;
       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
       __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
 
-      /* "pygrib.pyx":1674
+      /* "pygrib.pyx":1666
  *                 nx = self['Nx']
  *                 ny = self['Ny']
  *             except:             # <<<<<<<<<<<<<<
@@ -19680,121 +21341,154 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_38latlons(struct __pyx_obj_6pygr
  */
       /*except:*/ {
         __Pyx_AddTraceback("pygrib.gribmessage.latlons", __pyx_clineno, __pyx_lineno, __pyx_filename);
-        if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_3, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1674; __pyx_clineno = __LINE__; goto __pyx_L57_except_error;}
-        __Pyx_GOTREF(__pyx_t_7);
-        __Pyx_GOTREF(__pyx_t_3);
+        if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_7, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1666; __pyx_clineno = __LINE__; goto __pyx_L69_except_error;}
         __Pyx_GOTREF(__pyx_t_4);
+        __Pyx_GOTREF(__pyx_t_7);
+        __Pyx_GOTREF(__pyx_t_5);
 
-        /* "pygrib.pyx":1675
+        /* "pygrib.pyx":1667
  *                 ny = self['Ny']
  *             except:
  *                 nx = self['Ni']             # <<<<<<<<<<<<<<
  *                 ny = self['Nj']
  *             dx = self['DxInMetres']
  */
-        __pyx_t_8 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__Ni)); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1675; __pyx_clineno = __LINE__; goto __pyx_L57_except_error;}
-        __Pyx_GOTREF(__pyx_t_8);
-        __Pyx_XDECREF_SET(__pyx_v_nx, __pyx_t_8);
-        __pyx_t_8 = 0;
+        __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_Ni); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1667; __pyx_clineno = __LINE__; goto __pyx_L69_except_error;};
+        __Pyx_GOTREF(__pyx_t_3);
+        __Pyx_XDECREF_SET(__pyx_v_nx, __pyx_t_3);
+        __pyx_t_3 = 0;
 
-        /* "pygrib.pyx":1676
+        /* "pygrib.pyx":1668
  *             except:
  *                 nx = self['Ni']
  *                 ny = self['Nj']             # <<<<<<<<<<<<<<
  *             dx = self['DxInMetres']
  *             dy = self['DyInMetres']
  */
-        __pyx_t_8 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__Nj)); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1676; __pyx_clineno = __LINE__; goto __pyx_L57_except_error;}
-        __Pyx_GOTREF(__pyx_t_8);
-        __Pyx_XDECREF_SET(__pyx_v_ny, __pyx_t_8);
-        __pyx_t_8 = 0;
-        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_Nj); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1668; __pyx_clineno = __LINE__; goto __pyx_L69_except_error;};
+        __Pyx_GOTREF(__pyx_t_3);
+        __Pyx_XDECREF_SET(__pyx_v_ny, __pyx_t_3);
+        __pyx_t_3 = 0;
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-        goto __pyx_L56_exception_handled;
+        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+        goto __pyx_L68_exception_handled;
       }
-      __pyx_L57_except_error:;
-      __Pyx_XGIVEREF(__pyx_t_12);
+      __pyx_L69_except_error:;
       __Pyx_XGIVEREF(__pyx_t_11);
       __Pyx_XGIVEREF(__pyx_t_10);
-      __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_11, __pyx_t_10);
+      __Pyx_XGIVEREF(__pyx_t_9);
+      __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_10, __pyx_t_9);
       goto __pyx_L1_error;
-      __pyx_L56_exception_handled:;
-      __Pyx_XGIVEREF(__pyx_t_12);
+      __pyx_L68_exception_handled:;
       __Pyx_XGIVEREF(__pyx_t_11);
       __Pyx_XGIVEREF(__pyx_t_10);
-      __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_11, __pyx_t_10);
-      __pyx_L62_try_end:;
+      __Pyx_XGIVEREF(__pyx_t_9);
+      __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_10, __pyx_t_9);
+      __pyx_L74_try_end:;
     }
 
-    /* "pygrib.pyx":1677
+    /* "pygrib.pyx":1669
  *                 nx = self['Ni']
  *                 ny = self['Nj']
  *             dx = self['DxInMetres']             # <<<<<<<<<<<<<<
  *             dy = self['DyInMetres']
  *             pj = pyproj.Proj(self.projparams)
  */
-    __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__DxInMetres)); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1677; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __pyx_v_dx = __pyx_t_4;
-    __pyx_t_4 = 0;
+    __pyx_t_5 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_DxInMetres); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1669; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_v_dx = __pyx_t_5;
+    __pyx_t_5 = 0;
 
-    /* "pygrib.pyx":1678
+    /* "pygrib.pyx":1670
  *                 ny = self['Nj']
  *             dx = self['DxInMetres']
  *             dy = self['DyInMetres']             # <<<<<<<<<<<<<<
  *             pj = pyproj.Proj(self.projparams)
  *             llcrnrx, llcrnry = pj(lon1,lat1)
  */
-    __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__DyInMetres)); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __pyx_v_dy = __pyx_t_4;
-    __pyx_t_4 = 0;
+    __pyx_t_5 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_DyInMetres); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1670; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_v_dy = __pyx_t_5;
+    __pyx_t_5 = 0;
 
-    /* "pygrib.pyx":1679
+    /* "pygrib.pyx":1671
  *             dx = self['DxInMetres']
  *             dy = self['DyInMetres']
  *             pj = pyproj.Proj(self.projparams)             # <<<<<<<<<<<<<<
  *             llcrnrx, llcrnry = pj(lon1,lat1)
  *             x = llcrnrx+dx*np.arange(nx)
  */
-    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__pyproj); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__Proj); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_INCREF(__pyx_v_self->projparams);
-    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_self->projparams);
-    __Pyx_GIVEREF(__pyx_v_self->projparams);
-    __pyx_t_7 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyproj); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-    __pyx_v_pj = __pyx_t_7;
-    __pyx_t_7 = 0;
+    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_Proj); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __pyx_t_7 = NULL;
+    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
+      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
+      if (likely(__pyx_t_7)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+        __Pyx_INCREF(__pyx_t_7);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_4, function);
+      }
+    }
+    if (!__pyx_t_7) {
+      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_self->projparams); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_5);
+    } else {
+      __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = NULL;
+      __Pyx_INCREF(__pyx_v_self->projparams);
+      PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_v_self->projparams);
+      __Pyx_GIVEREF(__pyx_v_self->projparams);
+      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_5);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    }
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_v_pj = __pyx_t_5;
+    __pyx_t_5 = 0;
 
-    /* "pygrib.pyx":1680
+    /* "pygrib.pyx":1672
  *             dy = self['DyInMetres']
  *             pj = pyproj.Proj(self.projparams)
  *             llcrnrx, llcrnry = pj(lon1,lat1)             # <<<<<<<<<<<<<<
  *             x = llcrnrx+dx*np.arange(nx)
  *             y = llcrnry+dy*np.arange(ny)
  */
-    __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_INCREF(__pyx_v_pj);
+    __pyx_t_4 = __pyx_v_pj; __pyx_t_3 = NULL;
+    __pyx_t_6 = 0;
+    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
+      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
+      if (likely(__pyx_t_3)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+        __Pyx_INCREF(__pyx_t_3);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_4, function);
+        __pyx_t_6 = 1;
+      }
+    }
+    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1672; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_7);
+    if (__pyx_t_3) {
+      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
+    }
     __Pyx_INCREF(__pyx_v_lon1);
-    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_lon1);
+    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_lon1);
     __Pyx_GIVEREF(__pyx_v_lon1);
     __Pyx_INCREF(__pyx_v_lat1);
-    PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_lat1);
+    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_lat1);
     __Pyx_GIVEREF(__pyx_v_lat1);
-    __pyx_t_4 = PyObject_Call(__pyx_v_pj, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
-    if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
-      PyObject* sequence = __pyx_t_4;
+    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1672; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
+      PyObject* sequence = __pyx_t_5;
       #if CYTHON_COMPILING_IN_CPYTHON
       Py_ssize_t size = Py_SIZE(sequence);
       #else
@@ -19803,138 +21497,184 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_38latlons(struct __pyx_obj_6pygr
       if (unlikely(size != 2)) {
         if (size > 2) __Pyx_RaiseTooManyValuesError(2);
         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1672; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       }
       #if CYTHON_COMPILING_IN_CPYTHON
       if (likely(PyTuple_CheckExact(sequence))) {
-        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); 
-        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
+        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); 
+        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); 
       } else {
-        __pyx_t_7 = PyList_GET_ITEM(sequence, 0); 
-        __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
+        __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
+        __pyx_t_7 = PyList_GET_ITEM(sequence, 1); 
       }
+      __Pyx_INCREF(__pyx_t_4);
       __Pyx_INCREF(__pyx_t_7);
-      __Pyx_INCREF(__pyx_t_3);
       #else
-      __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1672; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1672; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_7);
-      __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
       #endif
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    } else
-    {
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    } else {
       Py_ssize_t index = -1;
-      __pyx_t_8 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
-      index = 0; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L65_unpacking_failed;
-      __Pyx_GOTREF(__pyx_t_7);
-      index = 1; __pyx_t_3 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_3)) goto __pyx_L65_unpacking_failed;
+      __pyx_t_3 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1672; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_3);
-      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_9 = NULL;
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      goto __pyx_L66_unpacking_done;
-      __pyx_L65_unpacking_failed:;
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      __pyx_t_9 = NULL;
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext;
+      index = 0; __pyx_t_4 = __pyx_t_8(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L77_unpacking_failed;
+      __Pyx_GOTREF(__pyx_t_4);
+      index = 1; __pyx_t_7 = __pyx_t_8(__pyx_t_3); if (unlikely(!__pyx_t_7)) goto __pyx_L77_unpacking_failed;
+      __Pyx_GOTREF(__pyx_t_7);
+      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1672; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_8 = NULL;
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      goto __pyx_L78_unpacking_done;
+      __pyx_L77_unpacking_failed:;
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __pyx_t_8 = NULL;
       if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_L66_unpacking_done:;
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1672; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_L78_unpacking_done:;
     }
-    __pyx_v_llcrnrx = __pyx_t_7;
+    __pyx_v_llcrnrx = __pyx_t_4;
+    __pyx_t_4 = 0;
+    __pyx_v_llcrnry = __pyx_t_7;
     __pyx_t_7 = 0;
-    __pyx_v_llcrnry = __pyx_t_3;
-    __pyx_t_3 = 0;
 
-    /* "pygrib.pyx":1681
+    /* "pygrib.pyx":1673
  *             pj = pyproj.Proj(self.projparams)
  *             llcrnrx, llcrnry = pj(lon1,lat1)
  *             x = llcrnrx+dx*np.arange(nx)             # <<<<<<<<<<<<<<
  *             y = llcrnry+dy*np.arange(ny)
  *             x, y = np.meshgrid(x, y)
  */
-    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__arange); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_INCREF(__pyx_v_nx);
-    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_nx);
-    __Pyx_GIVEREF(__pyx_v_nx);
-    __pyx_t_7 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-    __pyx_t_4 = PyNumber_Multiply(__pyx_v_dx, __pyx_t_7); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_arange); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __pyx_t_7 = PyNumber_Add(__pyx_v_llcrnrx, __pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
+    __pyx_t_7 = NULL;
+    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
+      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
+      if (likely(__pyx_t_7)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+        __Pyx_INCREF(__pyx_t_7);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_4, function);
+      }
+    }
+    if (!__pyx_t_7) {
+      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_nx); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_5);
+    } else {
+      __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = NULL;
+      __Pyx_INCREF(__pyx_v_nx);
+      PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_v_nx);
+      __Pyx_GIVEREF(__pyx_v_nx);
+      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_5);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    }
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_v_x = __pyx_t_7;
-    __pyx_t_7 = 0;
+    __pyx_t_4 = PyNumber_Multiply(__pyx_v_dx, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __pyx_t_5 = PyNumber_Add(__pyx_v_llcrnrx, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_v_x = __pyx_t_5;
+    __pyx_t_5 = 0;
 
-    /* "pygrib.pyx":1682
+    /* "pygrib.pyx":1674
  *             llcrnrx, llcrnry = pj(lon1,lat1)
  *             x = llcrnrx+dx*np.arange(nx)
  *             y = llcrnry+dy*np.arange(ny)             # <<<<<<<<<<<<<<
  *             x, y = np.meshgrid(x, y)
  *             lons, lats = pj(x, y, inverse=True)
  */
-    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s__arange); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_INCREF(__pyx_v_ny);
-    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_ny);
-    __Pyx_GIVEREF(__pyx_v_ny);
-    __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_arange); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
-    __pyx_t_7 = PyNumber_Multiply(__pyx_v_dy, __pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
+    __pyx_t_4 = NULL;
+    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
+      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+      if (likely(__pyx_t_4)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+        __Pyx_INCREF(__pyx_t_4);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_3, function);
+      }
+    }
+    if (!__pyx_t_4) {
+      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_ny); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_5);
+    } else {
+      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_7);
+      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
+      __Pyx_INCREF(__pyx_v_ny);
+      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_ny);
+      __Pyx_GIVEREF(__pyx_v_ny);
+      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_5);
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    }
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_3 = PyNumber_Add(__pyx_v_llcrnry, __pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = PyNumber_Multiply(__pyx_v_dy, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __pyx_v_y = __pyx_t_3;
-    __pyx_t_3 = 0;
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __pyx_t_5 = PyNumber_Add(__pyx_v_llcrnry, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_v_y = __pyx_t_5;
+    __pyx_t_5 = 0;
 
-    /* "pygrib.pyx":1683
+    /* "pygrib.pyx":1675
  *             x = llcrnrx+dx*np.arange(nx)
  *             y = llcrnry+dy*np.arange(ny)
  *             x, y = np.meshgrid(x, y)             # <<<<<<<<<<<<<<
  *             lons, lats = pj(x, y, inverse=True)
  *         elif self['gridType'] =='albers':
  */
-    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1683; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1675; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__meshgrid); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1683; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_meshgrid); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1675; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_7);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1683; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_3 = NULL;
+    __pyx_t_6 = 0;
+    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
+      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7);
+      if (likely(__pyx_t_3)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
+        __Pyx_INCREF(__pyx_t_3);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_7, function);
+        __pyx_t_6 = 1;
+      }
+    }
+    __pyx_t_4 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1675; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    if (__pyx_t_3) {
+      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
+    }
     __Pyx_INCREF(__pyx_v_x);
-    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_x);
+    PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_6, __pyx_v_x);
     __Pyx_GIVEREF(__pyx_v_x);
     __Pyx_INCREF(__pyx_v_y);
-    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_y);
+    PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_6, __pyx_v_y);
     __Pyx_GIVEREF(__pyx_v_y);
-    __pyx_t_4 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1683; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1675; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-    if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
-      PyObject* sequence = __pyx_t_4;
+    if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
+      PyObject* sequence = __pyx_t_5;
       #if CYTHON_COMPILING_IN_CPYTHON
       Py_ssize_t size = Py_SIZE(sequence);
       #else
@@ -19943,79 +21683,75 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_38latlons(struct __pyx_obj_6pygr
       if (unlikely(size != 2)) {
         if (size > 2) __Pyx_RaiseTooManyValuesError(2);
         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1683; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1675; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       }
       #if CYTHON_COMPILING_IN_CPYTHON
       if (likely(PyTuple_CheckExact(sequence))) {
-        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
-        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); 
+        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); 
+        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
       } else {
-        __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
-        __pyx_t_7 = PyList_GET_ITEM(sequence, 1); 
+        __pyx_t_7 = PyList_GET_ITEM(sequence, 0); 
+        __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
       }
-      __Pyx_INCREF(__pyx_t_3);
       __Pyx_INCREF(__pyx_t_7);
+      __Pyx_INCREF(__pyx_t_4);
       #else
-      __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1683; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1683; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1675; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_7);
+      __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1675; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
       #endif
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    } else
-    {
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    } else {
       Py_ssize_t index = -1;
-      __pyx_t_8 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1683; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
-      index = 0; __pyx_t_3 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_3)) goto __pyx_L67_unpacking_failed;
+      __pyx_t_3 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1675; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_3);
-      index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L67_unpacking_failed;
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext;
+      index = 0; __pyx_t_7 = __pyx_t_8(__pyx_t_3); if (unlikely(!__pyx_t_7)) goto __pyx_L79_unpacking_failed;
       __Pyx_GOTREF(__pyx_t_7);
-      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1683; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_9 = NULL;
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      goto __pyx_L68_unpacking_done;
-      __pyx_L67_unpacking_failed:;
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      __pyx_t_9 = NULL;
+      index = 1; __pyx_t_4 = __pyx_t_8(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L79_unpacking_failed;
+      __Pyx_GOTREF(__pyx_t_4);
+      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1675; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_8 = NULL;
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      goto __pyx_L80_unpacking_done;
+      __pyx_L79_unpacking_failed:;
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __pyx_t_8 = NULL;
       if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1683; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_L68_unpacking_done:;
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1675; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_L80_unpacking_done:;
     }
-    __Pyx_DECREF_SET(__pyx_v_x, __pyx_t_3);
-    __pyx_t_3 = 0;
-    __Pyx_DECREF_SET(__pyx_v_y, __pyx_t_7);
+    __Pyx_DECREF_SET(__pyx_v_x, __pyx_t_7);
     __pyx_t_7 = 0;
+    __Pyx_DECREF_SET(__pyx_v_y, __pyx_t_4);
+    __pyx_t_4 = 0;
 
-    /* "pygrib.pyx":1684
+    /* "pygrib.pyx":1676
  *             y = llcrnry+dy*np.arange(ny)
  *             x, y = np.meshgrid(x, y)
  *             lons, lats = pj(x, y, inverse=True)             # <<<<<<<<<<<<<<
  *         elif self['gridType'] =='albers':
  *             lat1 = self['latitudeOfFirstGridPointInDegrees']
  */
-    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1684; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
     __Pyx_INCREF(__pyx_v_x);
-    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_x);
+    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_x);
     __Pyx_GIVEREF(__pyx_v_x);
     __Pyx_INCREF(__pyx_v_y);
-    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_y);
+    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_y);
     __Pyx_GIVEREF(__pyx_v_y);
-    __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1684; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_7));
-    __pyx_t_3 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1684; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    if (PyDict_SetItem(__pyx_t_7, ((PyObject *)__pyx_n_s__inverse), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1684; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_3 = PyObject_Call(__pyx_v_pj, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_7)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1684; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
-    if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
-      PyObject* sequence = __pyx_t_3;
+    __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_inverse, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_v_pj, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_7);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    if ((likely(PyTuple_CheckExact(__pyx_t_7))) || (PyList_CheckExact(__pyx_t_7))) {
+      PyObject* sequence = __pyx_t_7;
       #if CYTHON_COMPILING_IN_CPYTHON
       Py_ssize_t size = Py_SIZE(sequence);
       #else
@@ -20024,94 +21760,91 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_38latlons(struct __pyx_obj_6pygr
       if (unlikely(size != 2)) {
         if (size > 2) __Pyx_RaiseTooManyValuesError(2);
         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1684; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       }
       #if CYTHON_COMPILING_IN_CPYTHON
       if (likely(PyTuple_CheckExact(sequence))) {
-        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); 
-        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
+        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); 
+        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
       } else {
-        __pyx_t_7 = PyList_GET_ITEM(sequence, 0); 
-        __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
+        __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
+        __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
       }
-      __Pyx_INCREF(__pyx_t_7);
       __Pyx_INCREF(__pyx_t_4);
+      __Pyx_INCREF(__pyx_t_5);
       #else
-      __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1684; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_7);
-      __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1684; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_5);
       #endif
-      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    } else
-    {
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    } else {
       Py_ssize_t index = -1;
-      __pyx_t_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1684; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
-      index = 0; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L69_unpacking_failed;
-      __Pyx_GOTREF(__pyx_t_7);
-      index = 1; __pyx_t_4 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_4)) goto __pyx_L69_unpacking_failed;
+      __pyx_t_3 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+      __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext;
+      index = 0; __pyx_t_4 = __pyx_t_8(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L81_unpacking_failed;
       __Pyx_GOTREF(__pyx_t_4);
-      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1684; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_9 = NULL;
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      goto __pyx_L70_unpacking_done;
-      __pyx_L69_unpacking_failed:;
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      __pyx_t_9 = NULL;
+      index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_3); if (unlikely(!__pyx_t_5)) goto __pyx_L81_unpacking_failed;
+      __Pyx_GOTREF(__pyx_t_5);
+      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_8 = NULL;
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      goto __pyx_L82_unpacking_done;
+      __pyx_L81_unpacking_failed:;
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __pyx_t_8 = NULL;
       if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1684; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_L70_unpacking_done:;
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_L82_unpacking_done:;
     }
-    __pyx_v_lons = __pyx_t_7;
-    __pyx_t_7 = 0;
-    __pyx_v_lats = __pyx_t_4;
+    __pyx_v_lons = __pyx_t_4;
     __pyx_t_4 = 0;
+    __pyx_v_lats = __pyx_t_5;
+    __pyx_t_5 = 0;
     goto __pyx_L4;
   }
 
-  /* "pygrib.pyx":1685
+  /* "pygrib.pyx":1677
  *             x, y = np.meshgrid(x, y)
  *             lons, lats = pj(x, y, inverse=True)
  *         elif self['gridType'] =='albers':             # <<<<<<<<<<<<<<
  *             lat1 = self['latitudeOfFirstGridPointInDegrees']
  *             lon1 = self['longitudeOfFirstGridPointInDegrees']
  */
-  __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__gridType)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, ((PyObject *)__pyx_n_s__albers), Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  if (__pyx_t_5) {
+  __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_gridType); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1677; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+  __Pyx_GOTREF(__pyx_t_7);
+  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_7, __pyx_n_s_albers, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1677; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  if (__pyx_t_1) {
 
-    /* "pygrib.pyx":1686
+    /* "pygrib.pyx":1678
  *             lons, lats = pj(x, y, inverse=True)
  *         elif self['gridType'] =='albers':
  *             lat1 = self['latitudeOfFirstGridPointInDegrees']             # <<<<<<<<<<<<<<
  *             lon1 = self['longitudeOfFirstGridPointInDegrees']
  *             try:
  */
-    __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s_171)); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __pyx_v_lat1 = __pyx_t_4;
-    __pyx_t_4 = 0;
+    __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_latitudeOfFirstGridPointInDegree); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1678; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_7);
+    __pyx_v_lat1 = __pyx_t_7;
+    __pyx_t_7 = 0;
 
-    /* "pygrib.pyx":1687
+    /* "pygrib.pyx":1679
  *         elif self['gridType'] =='albers':
  *             lat1 = self['latitudeOfFirstGridPointInDegrees']
  *             lon1 = self['longitudeOfFirstGridPointInDegrees']             # <<<<<<<<<<<<<<
  *             try:
  *                 nx = self['Nx']
  */
-    __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s_169)); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1687; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __pyx_v_lon1 = __pyx_t_4;
-    __pyx_t_4 = 0;
+    __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_longitudeOfFirstGridPointInDegre); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1679; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_7);
+    __pyx_v_lon1 = __pyx_t_7;
+    __pyx_t_7 = 0;
 
-    /* "pygrib.pyx":1688
+    /* "pygrib.pyx":1680
  *             lat1 = self['latitudeOfFirstGridPointInDegrees']
  *             lon1 = self['longitudeOfFirstGridPointInDegrees']
  *             try:             # <<<<<<<<<<<<<<
@@ -20119,47 +21852,47 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_38latlons(struct __pyx_obj_6pygr
  *                 ny = self['Ny']
  */
     {
-      __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
+      __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
+      __Pyx_XGOTREF(__pyx_t_9);
       __Pyx_XGOTREF(__pyx_t_10);
       __Pyx_XGOTREF(__pyx_t_11);
-      __Pyx_XGOTREF(__pyx_t_12);
       /*try:*/ {
 
-        /* "pygrib.pyx":1689
+        /* "pygrib.pyx":1681
  *             lon1 = self['longitudeOfFirstGridPointInDegrees']
  *             try:
  *                 nx = self['Nx']             # <<<<<<<<<<<<<<
  *                 ny = self['Ny']
  *             except:
  */
-        __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__Nx)); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1689; __pyx_clineno = __LINE__; goto __pyx_L71_error;}
-        __Pyx_GOTREF(__pyx_t_4);
-        __pyx_v_nx = __pyx_t_4;
-        __pyx_t_4 = 0;
+        __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_Nx); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1681; __pyx_clineno = __LINE__; goto __pyx_L83_error;};
+        __Pyx_GOTREF(__pyx_t_7);
+        __pyx_v_nx = __pyx_t_7;
+        __pyx_t_7 = 0;
 
-        /* "pygrib.pyx":1690
+        /* "pygrib.pyx":1682
  *             try:
  *                 nx = self['Nx']
  *                 ny = self['Ny']             # <<<<<<<<<<<<<<
  *             except:
  *                 nx = self['Ni']
  */
-        __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__Ny)); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1690; __pyx_clineno = __LINE__; goto __pyx_L71_error;}
-        __Pyx_GOTREF(__pyx_t_4);
-        __pyx_v_ny = __pyx_t_4;
-        __pyx_t_4 = 0;
-      }
+        __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_Ny); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1682; __pyx_clineno = __LINE__; goto __pyx_L83_error;};
+        __Pyx_GOTREF(__pyx_t_7);
+        __pyx_v_ny = __pyx_t_7;
+        __pyx_t_7 = 0;
+      }
+      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
       __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
       __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
-      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
-      goto __pyx_L78_try_end;
-      __pyx_L71_error:;
-      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
-      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+      goto __pyx_L90_try_end;
+      __pyx_L83_error:;
       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
       __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-      /* "pygrib.pyx":1691
+      /* "pygrib.pyx":1683
  *                 nx = self['Nx']
  *                 ny = self['Ny']
  *             except:             # <<<<<<<<<<<<<<
@@ -20168,149 +21901,176 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_38latlons(struct __pyx_obj_6pygr
  */
       /*except:*/ {
         __Pyx_AddTraceback("pygrib.gribmessage.latlons", __pyx_clineno, __pyx_lineno, __pyx_filename);
-        if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_3, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1691; __pyx_clineno = __LINE__; goto __pyx_L73_except_error;}
-        __Pyx_GOTREF(__pyx_t_4);
-        __Pyx_GOTREF(__pyx_t_3);
+        if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1683; __pyx_clineno = __LINE__; goto __pyx_L85_except_error;}
         __Pyx_GOTREF(__pyx_t_7);
+        __Pyx_GOTREF(__pyx_t_5);
+        __Pyx_GOTREF(__pyx_t_4);
 
-        /* "pygrib.pyx":1692
+        /* "pygrib.pyx":1684
  *                 ny = self['Ny']
  *             except:
  *                 nx = self['Ni']             # <<<<<<<<<<<<<<
  *                 ny = self['Nj']
  *             dx = self['Dx']/1000.
  */
-        __pyx_t_8 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__Ni)); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1692; __pyx_clineno = __LINE__; goto __pyx_L73_except_error;}
-        __Pyx_GOTREF(__pyx_t_8);
-        __Pyx_XDECREF_SET(__pyx_v_nx, __pyx_t_8);
-        __pyx_t_8 = 0;
+        __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_Ni); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1684; __pyx_clineno = __LINE__; goto __pyx_L85_except_error;};
+        __Pyx_GOTREF(__pyx_t_3);
+        __Pyx_XDECREF_SET(__pyx_v_nx, __pyx_t_3);
+        __pyx_t_3 = 0;
 
-        /* "pygrib.pyx":1693
+        /* "pygrib.pyx":1685
  *             except:
  *                 nx = self['Ni']
  *                 ny = self['Nj']             # <<<<<<<<<<<<<<
  *             dx = self['Dx']/1000.
  *             dy = self['Dy']/1000.
  */
-        __pyx_t_8 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__Nj)); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1693; __pyx_clineno = __LINE__; goto __pyx_L73_except_error;}
-        __Pyx_GOTREF(__pyx_t_8);
-        __Pyx_XDECREF_SET(__pyx_v_ny, __pyx_t_8);
-        __pyx_t_8 = 0;
-        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_Nj); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1685; __pyx_clineno = __LINE__; goto __pyx_L85_except_error;};
+        __Pyx_GOTREF(__pyx_t_3);
+        __Pyx_XDECREF_SET(__pyx_v_ny, __pyx_t_3);
+        __pyx_t_3 = 0;
         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-        goto __pyx_L72_exception_handled;
+        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+        goto __pyx_L84_exception_handled;
       }
-      __pyx_L73_except_error:;
+      __pyx_L85_except_error:;
+      __Pyx_XGIVEREF(__pyx_t_9);
       __Pyx_XGIVEREF(__pyx_t_10);
       __Pyx_XGIVEREF(__pyx_t_11);
-      __Pyx_XGIVEREF(__pyx_t_12);
-      __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
+      __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
       goto __pyx_L1_error;
-      __pyx_L72_exception_handled:;
+      __pyx_L84_exception_handled:;
+      __Pyx_XGIVEREF(__pyx_t_9);
       __Pyx_XGIVEREF(__pyx_t_10);
       __Pyx_XGIVEREF(__pyx_t_11);
-      __Pyx_XGIVEREF(__pyx_t_12);
-      __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
-      __pyx_L78_try_end:;
+      __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
+      __pyx_L90_try_end:;
     }
 
-    /* "pygrib.pyx":1694
+    /* "pygrib.pyx":1686
  *                 nx = self['Ni']
  *                 ny = self['Nj']
  *             dx = self['Dx']/1000.             # <<<<<<<<<<<<<<
  *             dy = self['Dy']/1000.
  *             scale = float(self['grib2divider'])
  */
-    __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__Dx)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __pyx_t_3 = PyFloat_FromDouble(1000.); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_Dx); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1686; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
     __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_v_dx = __pyx_t_4;
-    __pyx_t_4 = 0;
+    __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_float_1000_); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_v_dx = __pyx_t_5;
+    __pyx_t_5 = 0;
 
-    /* "pygrib.pyx":1695
+    /* "pygrib.pyx":1687
  *                 ny = self['Nj']
  *             dx = self['Dx']/1000.
  *             dy = self['Dy']/1000.             # <<<<<<<<<<<<<<
  *             scale = float(self['grib2divider'])
  *             pj = pyproj.Proj(self.projparams)
  */
-    __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__Dy)); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_5 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_Dy); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1687; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_t_5, __pyx_float_1000_); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1687; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_3 = PyFloat_FromDouble(1000.); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_v_dy = __pyx_t_7;
-    __pyx_t_7 = 0;
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __pyx_v_dy = __pyx_t_4;
+    __pyx_t_4 = 0;
 
-    /* "pygrib.pyx":1696
+    /* "pygrib.pyx":1688
  *             dx = self['Dx']/1000.
  *             dy = self['Dy']/1000.
  *             scale = float(self['grib2divider'])             # <<<<<<<<<<<<<<
  *             pj = pyproj.Proj(self.projparams)
  *             llcrnrx, llcrnry = pj(lon1,lat1)
  */
-    __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__grib2divider)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1696; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __pyx_t_13 = __Pyx_PyObject_AsDouble(__pyx_t_7); if (unlikely(__pyx_t_13 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1696; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __pyx_t_7 = PyFloat_FromDouble(__pyx_t_13); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1696; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __pyx_v_scale = __pyx_t_7;
-    __pyx_t_7 = 0;
+    __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_grib2divider); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1688; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_12 = __Pyx_PyObject_AsDouble(__pyx_t_4); if (unlikely(__pyx_t_12 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1688; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_4 = PyFloat_FromDouble(__pyx_t_12); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1688; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_v_scale = __pyx_t_4;
+    __pyx_t_4 = 0;
 
-    /* "pygrib.pyx":1697
+    /* "pygrib.pyx":1689
  *             dy = self['Dy']/1000.
  *             scale = float(self['grib2divider'])
  *             pj = pyproj.Proj(self.projparams)             # <<<<<<<<<<<<<<
  *             llcrnrx, llcrnry = pj(lon1,lat1)
  *             x = llcrnrx+dx*np.arange(nx)
  */
-    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s__pyproj); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1697; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyproj); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1689; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_Proj); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1689; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_7);
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s__Proj); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1697; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __pyx_t_5 = NULL;
+    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
+      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
+      if (likely(__pyx_t_5)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
+        __Pyx_INCREF(__pyx_t_5);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_7, function);
+      }
+    }
+    if (!__pyx_t_5) {
+      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_self->projparams); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1689; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+    } else {
+      __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1689; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
+      __Pyx_INCREF(__pyx_v_self->projparams);
+      PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_v_self->projparams);
+      __Pyx_GIVEREF(__pyx_v_self->projparams);
+      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1689; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    }
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1697; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_INCREF(__pyx_v_self->projparams);
-    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_self->projparams);
-    __Pyx_GIVEREF(__pyx_v_self->projparams);
-    __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1697; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
     __pyx_v_pj = __pyx_t_4;
     __pyx_t_4 = 0;
 
-    /* "pygrib.pyx":1698
+    /* "pygrib.pyx":1690
  *             scale = float(self['grib2divider'])
  *             pj = pyproj.Proj(self.projparams)
  *             llcrnrx, llcrnry = pj(lon1,lat1)             # <<<<<<<<<<<<<<
  *             x = llcrnrx+dx*np.arange(nx)
  *             y = llcrnry+dy*np.arange(ny)
  */
-    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_INCREF(__pyx_v_pj);
+    __pyx_t_7 = __pyx_v_pj; __pyx_t_3 = NULL;
+    __pyx_t_6 = 0;
+    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
+      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7);
+      if (likely(__pyx_t_3)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
+        __Pyx_INCREF(__pyx_t_3);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_7, function);
+        __pyx_t_6 = 1;
+      }
+    }
+    __pyx_t_5 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1690; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    if (__pyx_t_3) {
+      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
+    }
     __Pyx_INCREF(__pyx_v_lon1);
-    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_lon1);
+    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_6, __pyx_v_lon1);
     __Pyx_GIVEREF(__pyx_v_lon1);
     __Pyx_INCREF(__pyx_v_lat1);
-    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_lat1);
+    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_6, __pyx_v_lat1);
     __Pyx_GIVEREF(__pyx_v_lat1);
-    __pyx_t_7 = PyObject_Call(__pyx_v_pj, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-    if ((likely(PyTuple_CheckExact(__pyx_t_7))) || (PyList_CheckExact(__pyx_t_7))) {
-      PyObject* sequence = __pyx_t_7;
+    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1690; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
+      PyObject* sequence = __pyx_t_4;
       #if CYTHON_COMPILING_IN_CPYTHON
       Py_ssize_t size = Py_SIZE(sequence);
       #else
@@ -20319,138 +22079,184 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_38latlons(struct __pyx_obj_6pygr
       if (unlikely(size != 2)) {
         if (size > 2) __Pyx_RaiseTooManyValuesError(2);
         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1690; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       }
       #if CYTHON_COMPILING_IN_CPYTHON
       if (likely(PyTuple_CheckExact(sequence))) {
-        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); 
-        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
+        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); 
+        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
       } else {
-        __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
-        __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
+        __pyx_t_7 = PyList_GET_ITEM(sequence, 0); 
+        __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
       }
-      __Pyx_INCREF(__pyx_t_4);
-      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(__pyx_t_7);
+      __Pyx_INCREF(__pyx_t_5);
       #else
-      __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1690; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_7);
+      __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1690; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_5);
       #endif
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    } else
-    {
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    } else {
       Py_ssize_t index = -1;
-      __pyx_t_8 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
-      index = 0; __pyx_t_4 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_4)) goto __pyx_L81_unpacking_failed;
-      __Pyx_GOTREF(__pyx_t_4);
-      index = 1; __pyx_t_3 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_3)) goto __pyx_L81_unpacking_failed;
+      __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1690; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_3);
-      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_9 = NULL;
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      goto __pyx_L82_unpacking_done;
-      __pyx_L81_unpacking_failed:;
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      __pyx_t_9 = NULL;
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext;
+      index = 0; __pyx_t_7 = __pyx_t_8(__pyx_t_3); if (unlikely(!__pyx_t_7)) goto __pyx_L93_unpacking_failed;
+      __Pyx_GOTREF(__pyx_t_7);
+      index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_3); if (unlikely(!__pyx_t_5)) goto __pyx_L93_unpacking_failed;
+      __Pyx_GOTREF(__pyx_t_5);
+      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1690; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_8 = NULL;
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      goto __pyx_L94_unpacking_done;
+      __pyx_L93_unpacking_failed:;
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __pyx_t_8 = NULL;
       if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_L82_unpacking_done:;
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1690; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_L94_unpacking_done:;
     }
-    __pyx_v_llcrnrx = __pyx_t_4;
-    __pyx_t_4 = 0;
-    __pyx_v_llcrnry = __pyx_t_3;
-    __pyx_t_3 = 0;
+    __pyx_v_llcrnrx = __pyx_t_7;
+    __pyx_t_7 = 0;
+    __pyx_v_llcrnry = __pyx_t_5;
+    __pyx_t_5 = 0;
 
-    /* "pygrib.pyx":1699
+    /* "pygrib.pyx":1691
  *             pj = pyproj.Proj(self.projparams)
  *             llcrnrx, llcrnry = pj(lon1,lat1)
  *             x = llcrnrx+dx*np.arange(nx)             # <<<<<<<<<<<<<<
  *             y = llcrnry+dy*np.arange(ny)
  *             x, y = np.meshgrid(x, y)
  */
-    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_arange); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_7);
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s__arange); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __pyx_t_5 = NULL;
+    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
+      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
+      if (likely(__pyx_t_5)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
+        __Pyx_INCREF(__pyx_t_5);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_7, function);
+      }
+    }
+    if (!__pyx_t_5) {
+      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_nx); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+    } else {
+      __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
+      __Pyx_INCREF(__pyx_v_nx);
+      PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_v_nx);
+      __Pyx_GIVEREF(__pyx_v_nx);
+      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    }
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_INCREF(__pyx_v_nx);
-    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_nx);
-    __Pyx_GIVEREF(__pyx_v_nx);
-    __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
-    __pyx_t_7 = PyNumber_Multiply(__pyx_v_dx, __pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_7 = PyNumber_Multiply(__pyx_v_dx, __pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_7);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_t_4 = PyNumber_Add(__pyx_v_llcrnrx, __pyx_t_7); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = PyNumber_Add(__pyx_v_llcrnrx, __pyx_t_7); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
     __pyx_v_x = __pyx_t_4;
     __pyx_t_4 = 0;
 
-    /* "pygrib.pyx":1700
+    /* "pygrib.pyx":1692
  *             llcrnrx, llcrnry = pj(lon1,lat1)
  *             x = llcrnrx+dx*np.arange(nx)
  *             y = llcrnry+dy*np.arange(ny)             # <<<<<<<<<<<<<<
  *             x, y = np.meshgrid(x, y)
  *             lons, lats = pj(x, y, inverse=True)
  */
-    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__arange); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1692; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_INCREF(__pyx_v_ny);
-    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_ny);
-    __Pyx_GIVEREF(__pyx_v_ny);
-    __pyx_t_3 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_arange); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1692; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-    __pyx_t_4 = PyNumber_Multiply(__pyx_v_dy, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_7 = NULL;
+    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
+      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
+      if (likely(__pyx_t_7)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+        __Pyx_INCREF(__pyx_t_7);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_3, function);
+      }
+    }
+    if (!__pyx_t_7) {
+      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_ny); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1692; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+    } else {
+      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1692; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_5);
+      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = NULL;
+      __Pyx_INCREF(__pyx_v_ny);
+      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_ny);
+      __Pyx_GIVEREF(__pyx_v_ny);
+      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1692; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    }
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_3 = PyNumber_Add(__pyx_v_llcrnry, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = PyNumber_Multiply(__pyx_v_dy, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1692; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_v_y = __pyx_t_3;
-    __pyx_t_3 = 0;
+    __pyx_t_4 = PyNumber_Add(__pyx_v_llcrnry, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1692; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_v_y = __pyx_t_4;
+    __pyx_t_4 = 0;
 
-    /* "pygrib.pyx":1701
+    /* "pygrib.pyx":1693
  *             x = llcrnrx+dx*np.arange(nx)
  *             y = llcrnry+dy*np.arange(ny)
  *             x, y = np.meshgrid(x, y)             # <<<<<<<<<<<<<<
  *             lons, lats = pj(x, y, inverse=True)
  *         elif self['gridType'] == 'space_view':
  */
-    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__meshgrid); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_meshgrid); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_3 = NULL;
+    __pyx_t_6 = 0;
+    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
+      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
+      if (likely(__pyx_t_3)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+        __Pyx_INCREF(__pyx_t_3);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_5, function);
+        __pyx_t_6 = 1;
+      }
+    }
+    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_7);
+    if (__pyx_t_3) {
+      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
+    }
     __Pyx_INCREF(__pyx_v_x);
-    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_x);
+    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_x);
     __Pyx_GIVEREF(__pyx_v_x);
     __Pyx_INCREF(__pyx_v_y);
-    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_y);
+    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_y);
     __Pyx_GIVEREF(__pyx_v_y);
-    __pyx_t_7 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-    if ((likely(PyTuple_CheckExact(__pyx_t_7))) || (PyList_CheckExact(__pyx_t_7))) {
-      PyObject* sequence = __pyx_t_7;
+    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
+      PyObject* sequence = __pyx_t_4;
       #if CYTHON_COMPILING_IN_CPYTHON
       Py_ssize_t size = Py_SIZE(sequence);
       #else
@@ -20459,151 +22265,144 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_38latlons(struct __pyx_obj_6pygr
       if (unlikely(size != 2)) {
         if (size > 2) __Pyx_RaiseTooManyValuesError(2);
         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       }
       #if CYTHON_COMPILING_IN_CPYTHON
       if (likely(PyTuple_CheckExact(sequence))) {
-        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
-        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
+        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
+        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); 
       } else {
-        __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
-        __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
+        __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
+        __pyx_t_7 = PyList_GET_ITEM(sequence, 1); 
       }
-      __Pyx_INCREF(__pyx_t_3);
-      __Pyx_INCREF(__pyx_t_4);
+      __Pyx_INCREF(__pyx_t_5);
+      __Pyx_INCREF(__pyx_t_7);
       #else
-      __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_5);
+      __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_7);
       #endif
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    } else
-    {
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    } else {
       Py_ssize_t index = -1;
-      __pyx_t_8 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
-      index = 0; __pyx_t_3 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_3)) goto __pyx_L83_unpacking_failed;
+      __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_3);
-      index = 1; __pyx_t_4 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_4)) goto __pyx_L83_unpacking_failed;
-      __Pyx_GOTREF(__pyx_t_4);
-      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_9 = NULL;
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      goto __pyx_L84_unpacking_done;
-      __pyx_L83_unpacking_failed:;
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      __pyx_t_9 = NULL;
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext;
+      index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_3); if (unlikely(!__pyx_t_5)) goto __pyx_L95_unpacking_failed;
+      __Pyx_GOTREF(__pyx_t_5);
+      index = 1; __pyx_t_7 = __pyx_t_8(__pyx_t_3); if (unlikely(!__pyx_t_7)) goto __pyx_L95_unpacking_failed;
+      __Pyx_GOTREF(__pyx_t_7);
+      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_8 = NULL;
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      goto __pyx_L96_unpacking_done;
+      __pyx_L95_unpacking_failed:;
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __pyx_t_8 = NULL;
       if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_L84_unpacking_done:;
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_L96_unpacking_done:;
     }
-    __Pyx_DECREF_SET(__pyx_v_x, __pyx_t_3);
-    __pyx_t_3 = 0;
-    __Pyx_DECREF_SET(__pyx_v_y, __pyx_t_4);
-    __pyx_t_4 = 0;
+    __Pyx_DECREF_SET(__pyx_v_x, __pyx_t_5);
+    __pyx_t_5 = 0;
+    __Pyx_DECREF_SET(__pyx_v_y, __pyx_t_7);
+    __pyx_t_7 = 0;
 
-    /* "pygrib.pyx":1702
+    /* "pygrib.pyx":1694
  *             y = llcrnry+dy*np.arange(ny)
  *             x, y = np.meshgrid(x, y)
  *             lons, lats = pj(x, y, inverse=True)             # <<<<<<<<<<<<<<
  *         elif self['gridType'] == 'space_view':
  *             try:
  */
-    __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
+    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
     __Pyx_INCREF(__pyx_v_x);
-    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_x);
+    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_x);
     __Pyx_GIVEREF(__pyx_v_x);
     __Pyx_INCREF(__pyx_v_y);
-    PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_y);
+    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_y);
     __Pyx_GIVEREF(__pyx_v_y);
-    __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
-    __pyx_t_3 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__inverse), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_3 = PyObject_Call(__pyx_v_pj, ((PyObject *)__pyx_t_7), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-    if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
-      PyObject* sequence = __pyx_t_3;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      Py_ssize_t size = Py_SIZE(sequence);
-      #else
+    __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_7);
+    if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_inverse, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_pj, __pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
+      PyObject* sequence = __pyx_t_5;
+      #if CYTHON_COMPILING_IN_CPYTHON
+      Py_ssize_t size = Py_SIZE(sequence);
+      #else
       Py_ssize_t size = PySequence_Size(sequence);
       #endif
       if (unlikely(size != 2)) {
         if (size > 2) __Pyx_RaiseTooManyValuesError(2);
         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       }
       #if CYTHON_COMPILING_IN_CPYTHON
       if (likely(PyTuple_CheckExact(sequence))) {
-        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); 
-        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); 
+        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); 
+        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
       } else {
-        __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
-        __pyx_t_7 = PyList_GET_ITEM(sequence, 1); 
+        __pyx_t_7 = PyList_GET_ITEM(sequence, 0); 
+        __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
       }
-      __Pyx_INCREF(__pyx_t_4);
       __Pyx_INCREF(__pyx_t_7);
+      __Pyx_INCREF(__pyx_t_4);
       #else
-      __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_7);
+      __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
       #endif
-      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    } else
-    {
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    } else {
       Py_ssize_t index = -1;
-      __pyx_t_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
-      index = 0; __pyx_t_4 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_4)) goto __pyx_L85_unpacking_failed;
-      __Pyx_GOTREF(__pyx_t_4);
-      index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L85_unpacking_failed;
+      __pyx_t_3 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext;
+      index = 0; __pyx_t_7 = __pyx_t_8(__pyx_t_3); if (unlikely(!__pyx_t_7)) goto __pyx_L97_unpacking_failed;
       __Pyx_GOTREF(__pyx_t_7);
-      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_9 = NULL;
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      goto __pyx_L86_unpacking_done;
-      __pyx_L85_unpacking_failed:;
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      __pyx_t_9 = NULL;
+      index = 1; __pyx_t_4 = __pyx_t_8(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L97_unpacking_failed;
+      __Pyx_GOTREF(__pyx_t_4);
+      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_8 = NULL;
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      goto __pyx_L98_unpacking_done;
+      __pyx_L97_unpacking_failed:;
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __pyx_t_8 = NULL;
       if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_L86_unpacking_done:;
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_L98_unpacking_done:;
     }
-    __pyx_v_lons = __pyx_t_4;
-    __pyx_t_4 = 0;
-    __pyx_v_lats = __pyx_t_7;
+    __pyx_v_lons = __pyx_t_7;
     __pyx_t_7 = 0;
+    __pyx_v_lats = __pyx_t_4;
+    __pyx_t_4 = 0;
     goto __pyx_L4;
   }
 
-  /* "pygrib.pyx":1703
+  /* "pygrib.pyx":1695
  *             x, y = np.meshgrid(x, y)
  *             lons, lats = pj(x, y, inverse=True)
  *         elif self['gridType'] == 'space_view':             # <<<<<<<<<<<<<<
  *             try:
  *                 nx = self['Nx']
  */
-  __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__gridType)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_7 = PyObject_RichCompare(__pyx_t_3, ((PyObject *)__pyx_n_s__space_view), Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  if (__pyx_t_5) {
+  __pyx_t_5 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_gridType); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1695; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_5, __pyx_n_s_space_view, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  if (__pyx_t_1) {
 
-    /* "pygrib.pyx":1704
+    /* "pygrib.pyx":1696
  *             lons, lats = pj(x, y, inverse=True)
  *         elif self['gridType'] == 'space_view':
  *             try:             # <<<<<<<<<<<<<<
@@ -20611,47 +22410,47 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_38latlons(struct __pyx_obj_6pygr
  *                 ny = self['Ny']
  */
     {
-      __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
-      __Pyx_XGOTREF(__pyx_t_12);
+      __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
       __Pyx_XGOTREF(__pyx_t_11);
       __Pyx_XGOTREF(__pyx_t_10);
+      __Pyx_XGOTREF(__pyx_t_9);
       /*try:*/ {
 
-        /* "pygrib.pyx":1705
+        /* "pygrib.pyx":1697
  *         elif self['gridType'] == 'space_view':
  *             try:
  *                 nx = self['Nx']             # <<<<<<<<<<<<<<
  *                 ny = self['Ny']
  *             except:
  */
-        __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__Nx)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1705; __pyx_clineno = __LINE__; goto __pyx_L87_error;}
-        __Pyx_GOTREF(__pyx_t_7);
-        __pyx_v_nx = __pyx_t_7;
-        __pyx_t_7 = 0;
+        __pyx_t_5 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_Nx); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1697; __pyx_clineno = __LINE__; goto __pyx_L99_error;};
+        __Pyx_GOTREF(__pyx_t_5);
+        __pyx_v_nx = __pyx_t_5;
+        __pyx_t_5 = 0;
 
-        /* "pygrib.pyx":1706
+        /* "pygrib.pyx":1698
  *             try:
  *                 nx = self['Nx']
  *                 ny = self['Ny']             # <<<<<<<<<<<<<<
  *             except:
  *                 nx = self['Ni']
  */
-        __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__Ny)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1706; __pyx_clineno = __LINE__; goto __pyx_L87_error;}
-        __Pyx_GOTREF(__pyx_t_7);
-        __pyx_v_ny = __pyx_t_7;
-        __pyx_t_7 = 0;
+        __pyx_t_5 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_Ny); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1698; __pyx_clineno = __LINE__; goto __pyx_L99_error;};
+        __Pyx_GOTREF(__pyx_t_5);
+        __pyx_v_ny = __pyx_t_5;
+        __pyx_t_5 = 0;
       }
-      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
       __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
       __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
-      goto __pyx_L94_try_end;
-      __pyx_L87_error:;
-      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
-      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+      goto __pyx_L106_try_end;
+      __pyx_L99_error:;
       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
       __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-      /* "pygrib.pyx":1707
+      /* "pygrib.pyx":1699
  *                 nx = self['Nx']
  *                 ny = self['Ny']
  *             except:             # <<<<<<<<<<<<<<
@@ -20660,340 +22459,377 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_38latlons(struct __pyx_obj_6pygr
  */
       /*except:*/ {
         __Pyx_AddTraceback("pygrib.gribmessage.latlons", __pyx_clineno, __pyx_lineno, __pyx_filename);
-        if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_3, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1707; __pyx_clineno = __LINE__; goto __pyx_L89_except_error;}
-        __Pyx_GOTREF(__pyx_t_7);
-        __Pyx_GOTREF(__pyx_t_3);
+        if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; __pyx_clineno = __LINE__; goto __pyx_L101_except_error;}
+        __Pyx_GOTREF(__pyx_t_5);
         __Pyx_GOTREF(__pyx_t_4);
+        __Pyx_GOTREF(__pyx_t_7);
 
-        /* "pygrib.pyx":1708
+        /* "pygrib.pyx":1700
  *                 ny = self['Ny']
  *             except:
  *                 nx = self['Ni']             # <<<<<<<<<<<<<<
  *                 ny = self['Nj']
  *             # general case of 'near-side perspective projection' (untested)
  */
-        __pyx_t_8 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__Ni)); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1708; __pyx_clineno = __LINE__; goto __pyx_L89_except_error;}
-        __Pyx_GOTREF(__pyx_t_8);
-        __Pyx_XDECREF_SET(__pyx_v_nx, __pyx_t_8);
-        __pyx_t_8 = 0;
+        __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_Ni); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1700; __pyx_clineno = __LINE__; goto __pyx_L101_except_error;};
+        __Pyx_GOTREF(__pyx_t_3);
+        __Pyx_XDECREF_SET(__pyx_v_nx, __pyx_t_3);
+        __pyx_t_3 = 0;
 
-        /* "pygrib.pyx":1709
+        /* "pygrib.pyx":1701
  *             except:
  *                 nx = self['Ni']
  *                 ny = self['Nj']             # <<<<<<<<<<<<<<
  *             # general case of 'near-side perspective projection' (untested)
  *             if self.projparams['proj'] == 'nsper' and \
  */
-        __pyx_t_8 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__Nj)); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1709; __pyx_clineno = __LINE__; goto __pyx_L89_except_error;}
-        __Pyx_GOTREF(__pyx_t_8);
-        __Pyx_XDECREF_SET(__pyx_v_ny, __pyx_t_8);
-        __pyx_t_8 = 0;
-        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_Nj); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1701; __pyx_clineno = __LINE__; goto __pyx_L101_except_error;};
+        __Pyx_GOTREF(__pyx_t_3);
+        __Pyx_XDECREF_SET(__pyx_v_ny, __pyx_t_3);
+        __pyx_t_3 = 0;
+        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-        goto __pyx_L88_exception_handled;
+        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+        goto __pyx_L100_exception_handled;
       }
-      __pyx_L89_except_error:;
-      __Pyx_XGIVEREF(__pyx_t_12);
+      __pyx_L101_except_error:;
       __Pyx_XGIVEREF(__pyx_t_11);
       __Pyx_XGIVEREF(__pyx_t_10);
-      __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_11, __pyx_t_10);
+      __Pyx_XGIVEREF(__pyx_t_9);
+      __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_10, __pyx_t_9);
       goto __pyx_L1_error;
-      __pyx_L88_exception_handled:;
-      __Pyx_XGIVEREF(__pyx_t_12);
+      __pyx_L100_exception_handled:;
       __Pyx_XGIVEREF(__pyx_t_11);
       __Pyx_XGIVEREF(__pyx_t_10);
-      __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_11, __pyx_t_10);
-      __pyx_L94_try_end:;
+      __Pyx_XGIVEREF(__pyx_t_9);
+      __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_10, __pyx_t_9);
+      __pyx_L106_try_end:;
     }
 
-    /* "pygrib.pyx":1711
+    /* "pygrib.pyx":1703
  *                 ny = self['Nj']
  *             # general case of 'near-side perspective projection' (untested)
  *             if self.projparams['proj'] == 'nsper' and \             # <<<<<<<<<<<<<<
  *                self.projparams['a'] != self.projparams['b']:
  *                 raise ValueError('unsupported grid - earth not a perfect sphere')
  */
-    __pyx_t_4 = PyObject_GetItem(__pyx_v_self->projparams, ((PyObject *)__pyx_n_s__proj)); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, ((PyObject *)__pyx_n_s__nsper), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    if (__pyx_t_5) {
+    __pyx_t_7 = PyObject_GetItem(__pyx_v_self->projparams, __pyx_n_s_proj); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1703; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_7);
+    __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_7, __pyx_n_s_nsper, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    if (__pyx_t_2) {
+    } else {
+      __pyx_t_1 = __pyx_t_2;
+      goto __pyx_L110_bool_binop_done;
+    }
 
-      /* "pygrib.pyx":1712
+    /* "pygrib.pyx":1704
  *             # general case of 'near-side perspective projection' (untested)
  *             if self.projparams['proj'] == 'nsper' and \
  *                self.projparams['a'] != self.projparams['b']:             # <<<<<<<<<<<<<<
  *                 raise ValueError('unsupported grid - earth not a perfect sphere')
  *             scale = float(self['grib2divider'])
  */
-      __pyx_t_3 = PyObject_GetItem(__pyx_v_self->projparams, ((PyObject *)__pyx_n_s__a)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_4 = PyObject_GetItem(__pyx_v_self->projparams, ((PyObject *)__pyx_n_s__b)); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __pyx_t_7 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      __pyx_t_2 = __pyx_t_1;
-    } else {
-      __pyx_t_2 = __pyx_t_5;
-    }
-    if (__pyx_t_2) {
+    __pyx_t_7 = PyObject_GetItem(__pyx_v_self->projparams, __pyx_n_s_a); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1704; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_7);
+    __pyx_t_4 = PyObject_GetItem(__pyx_v_self->projparams, __pyx_n_s_b); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1704; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_5 = PyObject_RichCompare(__pyx_t_7, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __pyx_t_1 = __pyx_t_2;
+    __pyx_L110_bool_binop_done:;
+    if (__pyx_t_1) {
 
-      /* "pygrib.pyx":1713
+      /* "pygrib.pyx":1705
  *             if self.projparams['proj'] == 'nsper' and \
  *                self.projparams['a'] != self.projparams['b']:
  *                 raise ValueError('unsupported grid - earth not a perfect sphere')             # <<<<<<<<<<<<<<
  *             scale = float(self['grib2divider'])
  *             # latitude of horizon on central meridian
  */
-      __pyx_t_7 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_179), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_7);
-      __Pyx_Raise(__pyx_t_7, 0, 0, 0);
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      goto __pyx_L97;
+      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__95, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_5);
+      __Pyx_Raise(__pyx_t_5, 0, 0, 0);
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     }
-    __pyx_L97:;
 
-    /* "pygrib.pyx":1714
+    /* "pygrib.pyx":1706
  *                self.projparams['a'] != self.projparams['b']:
  *                 raise ValueError('unsupported grid - earth not a perfect sphere')
  *             scale = float(self['grib2divider'])             # <<<<<<<<<<<<<<
  *             # latitude of horizon on central meridian
  *             lon_0=self.projparams['lon_0']; lat_0=self.projparams['lat_0']
  */
-    __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__grib2divider)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __pyx_t_13 = __Pyx_PyObject_AsDouble(__pyx_t_7); if (unlikely(__pyx_t_13 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __pyx_t_7 = PyFloat_FromDouble(__pyx_t_13); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __pyx_v_scale = __pyx_t_7;
-    __pyx_t_7 = 0;
+    __pyx_t_5 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_grib2divider); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1706; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_12 = __Pyx_PyObject_AsDouble(__pyx_t_5); if (unlikely(__pyx_t_12 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1706; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __pyx_t_5 = PyFloat_FromDouble(__pyx_t_12); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1706; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_v_scale = __pyx_t_5;
+    __pyx_t_5 = 0;
 
-    /* "pygrib.pyx":1716
+    /* "pygrib.pyx":1708
  *             scale = float(self['grib2divider'])
  *             # latitude of horizon on central meridian
  *             lon_0=self.projparams['lon_0']; lat_0=self.projparams['lat_0']             # <<<<<<<<<<<<<<
  *             lonmax =\
  *             lon_0+90.-(180./np.pi)*np.arcsin(scale/self['Nr'])
  */
-    __pyx_t_7 = PyObject_GetItem(__pyx_v_self->projparams, ((PyObject *)__pyx_n_s__lon_0)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __pyx_v_lon_0 = __pyx_t_7;
-    __pyx_t_7 = 0;
-    __pyx_t_7 = PyObject_GetItem(__pyx_v_self->projparams, ((PyObject *)__pyx_n_s__lat_0)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __pyx_v_lat_0 = __pyx_t_7;
-    __pyx_t_7 = 0;
+    __pyx_t_5 = PyObject_GetItem(__pyx_v_self->projparams, __pyx_n_s_lon_0); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1708; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_v_lon_0 = __pyx_t_5;
+    __pyx_t_5 = 0;
+    __pyx_t_5 = PyObject_GetItem(__pyx_v_self->projparams, __pyx_n_s_lat_0); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1708; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_v_lat_0 = __pyx_t_5;
+    __pyx_t_5 = 0;
 
-    /* "pygrib.pyx":1718
+    /* "pygrib.pyx":1710
  *             lon_0=self.projparams['lon_0']; lat_0=self.projparams['lat_0']
  *             lonmax =\
  *             lon_0+90.-(180./np.pi)*np.arcsin(scale/self['Nr'])             # <<<<<<<<<<<<<<
  *             # longitude of horizon on equator
  *             latmax =\
  */
-    __pyx_t_7 = PyFloat_FromDouble(90.); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_5 = PyNumber_Add(__pyx_v_lon_0, __pyx_float_90_); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_pi); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_7);
-    __pyx_t_4 = PyNumber_Add(__pyx_v_lon_0, __pyx_t_7); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_float_180_, __pyx_t_7); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __pyx_t_7 = PyFloat_FromDouble(180.); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__pi); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
+    __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_arcsin); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_13);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_Nr); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1710; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
     __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-    __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s__arcsin); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-    __pyx_t_8 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__Nr)); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __pyx_t_14 = __Pyx_PyNumber_Divide(__pyx_v_scale, __pyx_t_8); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_14);
-    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-    __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_14);
-    __Pyx_GIVEREF(__pyx_t_14);
-    __pyx_t_14 = 0;
-    __pyx_t_14 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_14 = __Pyx_PyNumber_Divide(__pyx_v_scale, __pyx_t_3); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_14);
-    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
-    __pyx_t_8 = PyNumber_Multiply(__pyx_t_3, __pyx_t_14); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
-    __pyx_t_14 = PyNumber_Subtract(__pyx_t_4, __pyx_t_8); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_14);
+    __pyx_t_3 = NULL;
+    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_13))) {
+      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_13);
+      if (likely(__pyx_t_3)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
+        __Pyx_INCREF(__pyx_t_3);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_13, function);
+      }
+    }
+    if (!__pyx_t_3) {
+      __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_14); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+      __Pyx_GOTREF(__pyx_t_7);
+    } else {
+      __pyx_t_15 = PyTuple_New(1+1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_15);
+      PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
+      PyTuple_SET_ITEM(__pyx_t_15, 0+1, __pyx_t_14);
+      __Pyx_GIVEREF(__pyx_t_14);
+      __pyx_t_14 = 0;
+      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_15, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_7);
+      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+    }
+    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+    __pyx_t_13 = PyNumber_Multiply(__pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_13);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-    __pyx_v_lonmax = __pyx_t_14;
-    __pyx_t_14 = 0;
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __pyx_t_7 = PyNumber_Subtract(__pyx_t_5, __pyx_t_13); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_7);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+    __pyx_v_lonmax = __pyx_t_7;
+    __pyx_t_7 = 0;
 
-    /* "pygrib.pyx":1721
+    /* "pygrib.pyx":1713
  *             # longitude of horizon on equator
  *             latmax =\
  *             lat_0+90.-(180./np.pi)*np.arcsin(scale/self['Nr'])             # <<<<<<<<<<<<<<
  *             # truncate to nearest thousandth of a degree (to make sure
  *             # they aren't slightly over the horizon)
  */
-    __pyx_t_14 = PyFloat_FromDouble(90.); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_14);
-    __pyx_t_8 = PyNumber_Add(__pyx_v_lat_0, __pyx_t_14); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
-    __pyx_t_14 = PyFloat_FromDouble(180.); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_14);
-    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_7 = PyNumber_Add(__pyx_v_lat_0, __pyx_float_90_); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_7);
+    __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_13);
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_pi); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+    __pyx_t_13 = __Pyx_PyNumber_Divide(__pyx_float_180_, __pyx_t_5); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_13);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__pi); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_arcsin); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_15);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_t_14, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_Nr); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1713; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
     __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__arcsin); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_14 = __Pyx_PyNumber_Divide(__pyx_v_scale, __pyx_t_4); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_14);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__Nr)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_v_scale, __pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7);
-    __Pyx_GIVEREF(__pyx_t_7);
-    __pyx_t_7 = 0;
-    __pyx_t_7 = PyObject_Call(__pyx_t_14, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-    __pyx_t_3 = PyNumber_Multiply(__pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_4 = NULL;
+    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_15))) {
+      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_15);
+      if (likely(__pyx_t_4)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
+        __Pyx_INCREF(__pyx_t_4);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_15, function);
+      }
+    }
+    if (!__pyx_t_4) {
+      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_15, __pyx_t_14); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+      __Pyx_GOTREF(__pyx_t_5);
+    } else {
+      __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
+      PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_14);
+      __Pyx_GIVEREF(__pyx_t_14);
+      __pyx_t_14 = 0;
+      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_5);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    }
+    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+    __pyx_t_15 = PyNumber_Multiply(__pyx_t_13, __pyx_t_5); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_15);
+    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __pyx_t_5 = PyNumber_Subtract(__pyx_t_7, __pyx_t_15); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __pyx_t_7 = PyNumber_Subtract(__pyx_t_8, __pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_v_latmax = __pyx_t_7;
-    __pyx_t_7 = 0;
+    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+    __pyx_v_latmax = __pyx_t_5;
+    __pyx_t_5 = 0;
 
-    /* "pygrib.pyx":1724
+    /* "pygrib.pyx":1716
  *             # truncate to nearest thousandth of a degree (to make sure
  *             # they aren't slightly over the horizon)
  *             latmax = int(1000*latmax)/1000.             # <<<<<<<<<<<<<<
  *             lonmax = int(1000*lonmax)/1000.
  *             pj = pyproj.Proj(self.projparams)
  */
-    __pyx_t_7 = PyNumber_Multiply(__pyx_int_1000, __pyx_v_latmax); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7);
-    __Pyx_GIVEREF(__pyx_t_7);
-    __pyx_t_7 = 0;
-    __pyx_t_7 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-    __pyx_t_3 = PyFloat_FromDouble(1000.); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_8 = __Pyx_PyNumber_Divide(__pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __Pyx_DECREF_SET(__pyx_v_latmax, __pyx_t_8);
-    __pyx_t_8 = 0;
+    __pyx_t_5 = PyNumber_Multiply(__pyx_int_1000, __pyx_v_latmax); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_15 = PyNumber_Int(__pyx_t_5); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_15);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_t_15, __pyx_float_1000_); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+    __Pyx_DECREF_SET(__pyx_v_latmax, __pyx_t_5);
+    __pyx_t_5 = 0;
 
-    /* "pygrib.pyx":1725
+    /* "pygrib.pyx":1717
  *             # they aren't slightly over the horizon)
  *             latmax = int(1000*latmax)/1000.
  *             lonmax = int(1000*lonmax)/1000.             # <<<<<<<<<<<<<<
  *             pj = pyproj.Proj(self.projparams)
  *             x1,y1 = pj(lon_0,latmax); x2,y2 = pj(lonmax,lat_0)
  */
-    __pyx_t_8 = PyNumber_Multiply(__pyx_int_1000, __pyx_v_lonmax); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_8);
-    __Pyx_GIVEREF(__pyx_t_8);
-    __pyx_t_8 = 0;
-    __pyx_t_8 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-    __pyx_t_3 = PyFloat_FromDouble(1000.); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_t_8, __pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __Pyx_DECREF_SET(__pyx_v_lonmax, __pyx_t_7);
-    __pyx_t_7 = 0;
+    __pyx_t_5 = PyNumber_Multiply(__pyx_int_1000, __pyx_v_lonmax); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_15 = PyNumber_Int(__pyx_t_5); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_15);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_t_15, __pyx_float_1000_); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+    __Pyx_DECREF_SET(__pyx_v_lonmax, __pyx_t_5);
+    __pyx_t_5 = 0;
 
-    /* "pygrib.pyx":1726
+    /* "pygrib.pyx":1718
  *             latmax = int(1000*latmax)/1000.
  *             lonmax = int(1000*lonmax)/1000.
  *             pj = pyproj.Proj(self.projparams)             # <<<<<<<<<<<<<<
  *             x1,y1 = pj(lon_0,latmax); x2,y2 = pj(lonmax,lat_0)
  *             width = 2*x2; height = 2*y1
  */
-    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s__pyproj); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1726; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_15 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyproj); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_15);
+    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_Proj); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_7);
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s__Proj); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1726; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+    __pyx_t_15 = NULL;
+    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
+      __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_7);
+      if (likely(__pyx_t_15)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
+        __Pyx_INCREF(__pyx_t_15);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_7, function);
+      }
+    }
+    if (!__pyx_t_15) {
+      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_self->projparams); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_5);
+    } else {
+      __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_13);
+      PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_15); __Pyx_GIVEREF(__pyx_t_15); __pyx_t_15 = NULL;
+      __Pyx_INCREF(__pyx_v_self->projparams);
+      PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_v_self->projparams);
+      __Pyx_GIVEREF(__pyx_v_self->projparams);
+      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_13, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_5);
+      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+    }
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1726; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_INCREF(__pyx_v_self->projparams);
-    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_self->projparams);
-    __Pyx_GIVEREF(__pyx_v_self->projparams);
-    __pyx_t_8 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1726; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
-    __pyx_v_pj = __pyx_t_8;
-    __pyx_t_8 = 0;
+    __pyx_v_pj = __pyx_t_5;
+    __pyx_t_5 = 0;
 
-    /* "pygrib.pyx":1727
+    /* "pygrib.pyx":1719
  *             lonmax = int(1000*lonmax)/1000.
  *             pj = pyproj.Proj(self.projparams)
  *             x1,y1 = pj(lon_0,latmax); x2,y2 = pj(lonmax,lat_0)             # <<<<<<<<<<<<<<
  *             width = 2*x2; height = 2*y1
  *             dx = width/self['dx']
  */
-    __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
+    __Pyx_INCREF(__pyx_v_pj);
+    __pyx_t_7 = __pyx_v_pj; __pyx_t_13 = NULL;
+    __pyx_t_6 = 0;
+    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
+      __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_7);
+      if (likely(__pyx_t_13)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
+        __Pyx_INCREF(__pyx_t_13);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_7, function);
+        __pyx_t_6 = 1;
+      }
+    }
+    __pyx_t_15 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_15);
+    if (__pyx_t_13) {
+      PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_13); __Pyx_GIVEREF(__pyx_t_13); __pyx_t_13 = NULL;
+    }
     __Pyx_INCREF(__pyx_v_lon_0);
-    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_lon_0);
+    PyTuple_SET_ITEM(__pyx_t_15, 0+__pyx_t_6, __pyx_v_lon_0);
     __Pyx_GIVEREF(__pyx_v_lon_0);
     __Pyx_INCREF(__pyx_v_latmax);
-    PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_latmax);
+    PyTuple_SET_ITEM(__pyx_t_15, 1+__pyx_t_6, __pyx_v_latmax);
     __Pyx_GIVEREF(__pyx_v_latmax);
-    __pyx_t_7 = PyObject_Call(__pyx_v_pj, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
-    if ((likely(PyTuple_CheckExact(__pyx_t_7))) || (PyList_CheckExact(__pyx_t_7))) {
-      PyObject* sequence = __pyx_t_7;
+    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_15, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
+      PyObject* sequence = __pyx_t_5;
       #if CYTHON_COMPILING_IN_CPYTHON
       Py_ssize_t size = Py_SIZE(sequence);
       #else
@@ -21002,64 +22838,80 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_38latlons(struct __pyx_obj_6pygr
       if (unlikely(size != 2)) {
         if (size > 2) __Pyx_RaiseTooManyValuesError(2);
         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       }
       #if CYTHON_COMPILING_IN_CPYTHON
       if (likely(PyTuple_CheckExact(sequence))) {
-        __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); 
-        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
+        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); 
+        __pyx_t_15 = PyTuple_GET_ITEM(sequence, 1); 
       } else {
-        __pyx_t_8 = PyList_GET_ITEM(sequence, 0); 
-        __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
+        __pyx_t_7 = PyList_GET_ITEM(sequence, 0); 
+        __pyx_t_15 = PyList_GET_ITEM(sequence, 1); 
       }
-      __Pyx_INCREF(__pyx_t_8);
-      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(__pyx_t_7);
+      __Pyx_INCREF(__pyx_t_15);
       #else
-      __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-      __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_7);
+      __pyx_t_15 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_15);
       #endif
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    } else
-    {
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    } else {
       Py_ssize_t index = -1;
-      __pyx_t_4 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      __pyx_t_9 = Py_TYPE(__pyx_t_4)->tp_iternext;
-      index = 0; __pyx_t_8 = __pyx_t_9(__pyx_t_4); if (unlikely(!__pyx_t_8)) goto __pyx_L98_unpacking_failed;
-      __Pyx_GOTREF(__pyx_t_8);
-      index = 1; __pyx_t_3 = __pyx_t_9(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L98_unpacking_failed;
-      __Pyx_GOTREF(__pyx_t_3);
-      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_9 = NULL;
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      goto __pyx_L99_unpacking_done;
-      __pyx_L98_unpacking_failed:;
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __pyx_t_9 = NULL;
+      __pyx_t_13 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_13);
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __pyx_t_8 = Py_TYPE(__pyx_t_13)->tp_iternext;
+      index = 0; __pyx_t_7 = __pyx_t_8(__pyx_t_13); if (unlikely(!__pyx_t_7)) goto __pyx_L112_unpacking_failed;
+      __Pyx_GOTREF(__pyx_t_7);
+      index = 1; __pyx_t_15 = __pyx_t_8(__pyx_t_13); if (unlikely(!__pyx_t_15)) goto __pyx_L112_unpacking_failed;
+      __Pyx_GOTREF(__pyx_t_15);
+      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_13), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_8 = NULL;
+      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+      goto __pyx_L113_unpacking_done;
+      __pyx_L112_unpacking_failed:;
+      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+      __pyx_t_8 = NULL;
       if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_L99_unpacking_done:;
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_L113_unpacking_done:;
+    }
+    __pyx_v_x1 = __pyx_t_7;
+    __pyx_t_7 = 0;
+    __pyx_v_y1 = __pyx_t_15;
+    __pyx_t_15 = 0;
+    __Pyx_INCREF(__pyx_v_pj);
+    __pyx_t_15 = __pyx_v_pj; __pyx_t_7 = NULL;
+    __pyx_t_6 = 0;
+    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_15))) {
+      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_15);
+      if (likely(__pyx_t_7)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
+        __Pyx_INCREF(__pyx_t_7);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_15, function);
+        __pyx_t_6 = 1;
+      }
+    }
+    __pyx_t_13 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_13);
+    if (__pyx_t_7) {
+      PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = NULL;
     }
-    __pyx_v_x1 = __pyx_t_8;
-    __pyx_t_8 = 0;
-    __pyx_v_y1 = __pyx_t_3;
-    __pyx_t_3 = 0;
-    __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
     __Pyx_INCREF(__pyx_v_lonmax);
-    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_lonmax);
+    PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_6, __pyx_v_lonmax);
     __Pyx_GIVEREF(__pyx_v_lonmax);
     __Pyx_INCREF(__pyx_v_lat_0);
-    PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_lat_0);
+    PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_6, __pyx_v_lat_0);
     __Pyx_GIVEREF(__pyx_v_lat_0);
-    __pyx_t_3 = PyObject_Call(__pyx_v_pj, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
-    if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
-      PyObject* sequence = __pyx_t_3;
+    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_13, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+    if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
+      PyObject* sequence = __pyx_t_5;
       #if CYTHON_COMPILING_IN_CPYTHON
       Py_ssize_t size = Py_SIZE(sequence);
       #else
@@ -21068,226 +22920,258 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_38latlons(struct __pyx_obj_6pygr
       if (unlikely(size != 2)) {
         if (size > 2) __Pyx_RaiseTooManyValuesError(2);
         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       }
       #if CYTHON_COMPILING_IN_CPYTHON
       if (likely(PyTuple_CheckExact(sequence))) {
-        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); 
-        __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); 
+        __pyx_t_15 = PyTuple_GET_ITEM(sequence, 0); 
+        __pyx_t_13 = PyTuple_GET_ITEM(sequence, 1); 
       } else {
-        __pyx_t_7 = PyList_GET_ITEM(sequence, 0); 
-        __pyx_t_8 = PyList_GET_ITEM(sequence, 1); 
+        __pyx_t_15 = PyList_GET_ITEM(sequence, 0); 
+        __pyx_t_13 = PyList_GET_ITEM(sequence, 1); 
       }
-      __Pyx_INCREF(__pyx_t_7);
-      __Pyx_INCREF(__pyx_t_8);
+      __Pyx_INCREF(__pyx_t_15);
+      __Pyx_INCREF(__pyx_t_13);
       #else
-      __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_7);
-      __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
+      __pyx_t_15 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_15);
+      __pyx_t_13 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_13);
       #endif
-      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    } else
-    {
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    } else {
       Py_ssize_t index = -1;
-      __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_9 = Py_TYPE(__pyx_t_4)->tp_iternext;
-      index = 0; __pyx_t_7 = __pyx_t_9(__pyx_t_4); if (unlikely(!__pyx_t_7)) goto __pyx_L100_unpacking_failed;
+      __pyx_t_7 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_7);
-      index = 1; __pyx_t_8 = __pyx_t_9(__pyx_t_4); if (unlikely(!__pyx_t_8)) goto __pyx_L100_unpacking_failed;
-      __Pyx_GOTREF(__pyx_t_8);
-      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_9 = NULL;
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      goto __pyx_L101_unpacking_done;
-      __pyx_L100_unpacking_failed:;
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __pyx_t_9 = NULL;
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
+      index = 0; __pyx_t_15 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_15)) goto __pyx_L114_unpacking_failed;
+      __Pyx_GOTREF(__pyx_t_15);
+      index = 1; __pyx_t_13 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_13)) goto __pyx_L114_unpacking_failed;
+      __Pyx_GOTREF(__pyx_t_13);
+      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_8 = NULL;
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+      goto __pyx_L115_unpacking_done;
+      __pyx_L114_unpacking_failed:;
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+      __pyx_t_8 = NULL;
       if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_L101_unpacking_done:;
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_L115_unpacking_done:;
     }
-    __pyx_v_x2 = __pyx_t_7;
-    __pyx_t_7 = 0;
-    __pyx_v_y2 = __pyx_t_8;
-    __pyx_t_8 = 0;
+    __pyx_v_x2 = __pyx_t_15;
+    __pyx_t_15 = 0;
+    __pyx_v_y2 = __pyx_t_13;
+    __pyx_t_13 = 0;
 
-    /* "pygrib.pyx":1728
+    /* "pygrib.pyx":1720
  *             pj = pyproj.Proj(self.projparams)
  *             x1,y1 = pj(lon_0,latmax); x2,y2 = pj(lonmax,lat_0)
  *             width = 2*x2; height = 2*y1             # <<<<<<<<<<<<<<
  *             dx = width/self['dx']
  *             dy = height/self['dy']
  */
-    __pyx_t_3 = PyNumber_Multiply(__pyx_int_2, __pyx_v_x2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_v_width = __pyx_t_3;
-    __pyx_t_3 = 0;
-    __pyx_t_3 = PyNumber_Multiply(__pyx_int_2, __pyx_v_y1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_v_height = __pyx_t_3;
-    __pyx_t_3 = 0;
+    __pyx_t_5 = PyNumber_Multiply(__pyx_int_2, __pyx_v_x2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1720; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_v_width = __pyx_t_5;
+    __pyx_t_5 = 0;
+    __pyx_t_5 = PyNumber_Multiply(__pyx_int_2, __pyx_v_y1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1720; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_v_height = __pyx_t_5;
+    __pyx_t_5 = 0;
 
-    /* "pygrib.pyx":1729
+    /* "pygrib.pyx":1721
  *             x1,y1 = pj(lon_0,latmax); x2,y2 = pj(lonmax,lat_0)
  *             width = 2*x2; height = 2*y1
  *             dx = width/self['dx']             # <<<<<<<<<<<<<<
  *             dy = height/self['dy']
  *             xmax = dx*(nx-1); ymax = dy*(ny-1)
  */
-    __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__dx)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_8 = __Pyx_PyNumber_Divide(__pyx_v_width, __pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_v_dx = __pyx_t_8;
-    __pyx_t_8 = 0;
+    __pyx_t_5 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_dx); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1721; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_13 = __Pyx_PyNumber_Divide(__pyx_v_width, __pyx_t_5); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_13);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __pyx_v_dx = __pyx_t_13;
+    __pyx_t_13 = 0;
 
-    /* "pygrib.pyx":1730
+    /* "pygrib.pyx":1722
  *             width = 2*x2; height = 2*y1
  *             dx = width/self['dx']
  *             dy = height/self['dy']             # <<<<<<<<<<<<<<
  *             xmax = dx*(nx-1); ymax = dy*(ny-1)
  *             x = np.linspace(-0.5*xmax,0.5*xmax,nx)
  */
-    __pyx_t_8 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__dy)); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_v_height, __pyx_t_8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-    __pyx_v_dy = __pyx_t_3;
-    __pyx_t_3 = 0;
+    __pyx_t_13 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_dy); if (unlikely(__pyx_t_13 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1722; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_13);
+    __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_v_height, __pyx_t_13); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+    __pyx_v_dy = __pyx_t_5;
+    __pyx_t_5 = 0;
 
-    /* "pygrib.pyx":1731
+    /* "pygrib.pyx":1723
  *             dx = width/self['dx']
  *             dy = height/self['dy']
  *             xmax = dx*(nx-1); ymax = dy*(ny-1)             # <<<<<<<<<<<<<<
  *             x = np.linspace(-0.5*xmax,0.5*xmax,nx)
  *             y = np.linspace(-0.5*ymax,0.5*ymax,ny)
  */
-    __pyx_t_3 = PyNumber_Subtract(__pyx_v_nx, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_8 = PyNumber_Multiply(__pyx_v_dx, __pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_v_xmax = __pyx_t_8;
-    __pyx_t_8 = 0;
-    __pyx_t_8 = PyNumber_Subtract(__pyx_v_ny, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __pyx_t_3 = PyNumber_Multiply(__pyx_v_dy, __pyx_t_8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-    __pyx_v_ymax = __pyx_t_3;
-    __pyx_t_3 = 0;
+    __pyx_t_5 = PyNumber_Subtract(__pyx_v_nx, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_13 = PyNumber_Multiply(__pyx_v_dx, __pyx_t_5); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_13);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __pyx_v_xmax = __pyx_t_13;
+    __pyx_t_13 = 0;
+    __pyx_t_13 = PyNumber_Subtract(__pyx_v_ny, __pyx_int_1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_13);
+    __pyx_t_5 = PyNumber_Multiply(__pyx_v_dy, __pyx_t_13); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+    __pyx_v_ymax = __pyx_t_5;
+    __pyx_t_5 = 0;
 
-    /* "pygrib.pyx":1732
+    /* "pygrib.pyx":1724
  *             dy = height/self['dy']
  *             xmax = dx*(nx-1); ymax = dy*(ny-1)
  *             x = np.linspace(-0.5*xmax,0.5*xmax,nx)             # <<<<<<<<<<<<<<
  *             y = np.linspace(-0.5*ymax,0.5*ymax,ny)
  *             x, y = np.meshgrid(x, y)
  */
-    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__linspace); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_3 = PyFloat_FromDouble(-0.5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_7 = PyNumber_Multiply(__pyx_t_3, __pyx_v_xmax); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_13);
+    __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_linspace); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_15);
+    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+    __pyx_t_13 = PyNumber_Multiply(__pyx_float_neg_0_5, __pyx_v_xmax); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_13);
+    __pyx_t_7 = PyNumber_Multiply(__pyx_float_0_5, __pyx_v_xmax); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_3 = PyFloat_FromDouble(0.5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_4 = PyNumber_Multiply(__pyx_t_3, __pyx_v_xmax); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7);
+    __pyx_t_3 = NULL;
+    __pyx_t_6 = 0;
+    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_15))) {
+      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_15);
+      if (likely(__pyx_t_3)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
+        __Pyx_INCREF(__pyx_t_3);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_15, function);
+        __pyx_t_6 = 1;
+      }
+    }
+    __pyx_t_14 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_14);
+    if (__pyx_t_3) {
+      PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
+    }
+    PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_6, __pyx_t_13);
+    __Pyx_GIVEREF(__pyx_t_13);
+    PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_6, __pyx_t_7);
     __Pyx_GIVEREF(__pyx_t_7);
-    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
-    __Pyx_GIVEREF(__pyx_t_4);
     __Pyx_INCREF(__pyx_v_nx);
-    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_nx);
+    PyTuple_SET_ITEM(__pyx_t_14, 2+__pyx_t_6, __pyx_v_nx);
     __Pyx_GIVEREF(__pyx_v_nx);
+    __pyx_t_13 = 0;
     __pyx_t_7 = 0;
-    __pyx_t_4 = 0;
-    __pyx_t_4 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-    __pyx_v_x = __pyx_t_4;
-    __pyx_t_4 = 0;
+    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_14, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+    __pyx_v_x = __pyx_t_5;
+    __pyx_t_5 = 0;
 
-    /* "pygrib.pyx":1733
+    /* "pygrib.pyx":1725
  *             xmax = dx*(nx-1); ymax = dy*(ny-1)
  *             x = np.linspace(-0.5*xmax,0.5*xmax,nx)
  *             y = np.linspace(-0.5*ymax,0.5*ymax,ny)             # <<<<<<<<<<<<<<
  *             x, y = np.meshgrid(x, y)
  *             lons, lats = pj(x,y,inverse=True)
  */
-    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__linspace); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_t_4 = PyFloat_FromDouble(-0.5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_8 = PyNumber_Multiply(__pyx_t_4, __pyx_v_ymax); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_t_4 = PyFloat_FromDouble(0.5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_7 = PyNumber_Multiply(__pyx_t_4, __pyx_v_ymax); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_15 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_15);
+    __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_linspace); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_14);
+    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+    __pyx_t_15 = PyNumber_Multiply(__pyx_float_neg_0_5, __pyx_v_ymax); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_15);
+    __pyx_t_7 = PyNumber_Multiply(__pyx_float_0_5, __pyx_v_ymax); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8);
-    __Pyx_GIVEREF(__pyx_t_8);
-    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_7);
+    __pyx_t_13 = NULL;
+    __pyx_t_6 = 0;
+    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_14))) {
+      __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_14);
+      if (likely(__pyx_t_13)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
+        __Pyx_INCREF(__pyx_t_13);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_14, function);
+        __pyx_t_6 = 1;
+      }
+    }
+    __pyx_t_3 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    if (__pyx_t_13) {
+      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_13); __Pyx_GIVEREF(__pyx_t_13); __pyx_t_13 = NULL;
+    }
+    PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_6, __pyx_t_15);
+    __Pyx_GIVEREF(__pyx_t_15);
+    PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_6, __pyx_t_7);
     __Pyx_GIVEREF(__pyx_t_7);
     __Pyx_INCREF(__pyx_v_ny);
-    PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_ny);
+    PyTuple_SET_ITEM(__pyx_t_3, 2+__pyx_t_6, __pyx_v_ny);
     __Pyx_GIVEREF(__pyx_v_ny);
-    __pyx_t_8 = 0;
+    __pyx_t_15 = 0;
     __pyx_t_7 = 0;
-    __pyx_t_7 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
+    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-    __pyx_v_y = __pyx_t_7;
-    __pyx_t_7 = 0;
+    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+    __pyx_v_y = __pyx_t_5;
+    __pyx_t_5 = 0;
 
-    /* "pygrib.pyx":1734
+    /* "pygrib.pyx":1726
  *             x = np.linspace(-0.5*xmax,0.5*xmax,nx)
  *             y = np.linspace(-0.5*ymax,0.5*ymax,ny)
  *             x, y = np.meshgrid(x, y)             # <<<<<<<<<<<<<<
  *             lons, lats = pj(x,y,inverse=True)
  *             # set lons,lats to 1.e30 where undefined
  */
-    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s__meshgrid); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_14 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1726; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_14);
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_meshgrid); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1726; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+    __pyx_t_14 = NULL;
+    __pyx_t_6 = 0;
+    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
+      __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_3);
+      if (likely(__pyx_t_14)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+        __Pyx_INCREF(__pyx_t_14);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_3, function);
+        __pyx_t_6 = 1;
+      }
+    }
+    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1726; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_7);
+    if (__pyx_t_14) {
+      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_14); __Pyx_GIVEREF(__pyx_t_14); __pyx_t_14 = NULL;
+    }
     __Pyx_INCREF(__pyx_v_x);
-    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_x);
+    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_x);
     __Pyx_GIVEREF(__pyx_v_x);
     __Pyx_INCREF(__pyx_v_y);
-    PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_y);
+    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_y);
     __Pyx_GIVEREF(__pyx_v_y);
-    __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
-    if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
-      PyObject* sequence = __pyx_t_3;
+    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1726; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
+      PyObject* sequence = __pyx_t_5;
       #if CYTHON_COMPILING_IN_CPYTHON
       Py_ssize_t size = Py_SIZE(sequence);
       #else
@@ -21296,79 +23180,75 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_38latlons(struct __pyx_obj_6pygr
       if (unlikely(size != 2)) {
         if (size > 2) __Pyx_RaiseTooManyValuesError(2);
         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1726; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       }
       #if CYTHON_COMPILING_IN_CPYTHON
       if (likely(PyTuple_CheckExact(sequence))) {
-        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); 
-        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
+        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
+        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); 
       } else {
-        __pyx_t_7 = PyList_GET_ITEM(sequence, 0); 
-        __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
+        __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
+        __pyx_t_7 = PyList_GET_ITEM(sequence, 1); 
       }
+      __Pyx_INCREF(__pyx_t_3);
       __Pyx_INCREF(__pyx_t_7);
-      __Pyx_INCREF(__pyx_t_4);
       #else
-      __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1726; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1726; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_7);
-      __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
       #endif
-      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    } else
-    {
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    } else {
       Py_ssize_t index = -1;
-      __pyx_t_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
-      index = 0; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L102_unpacking_failed;
+      __pyx_t_14 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1726; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_14);
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __pyx_t_8 = Py_TYPE(__pyx_t_14)->tp_iternext;
+      index = 0; __pyx_t_3 = __pyx_t_8(__pyx_t_14); if (unlikely(!__pyx_t_3)) goto __pyx_L116_unpacking_failed;
+      __Pyx_GOTREF(__pyx_t_3);
+      index = 1; __pyx_t_7 = __pyx_t_8(__pyx_t_14); if (unlikely(!__pyx_t_7)) goto __pyx_L116_unpacking_failed;
       __Pyx_GOTREF(__pyx_t_7);
-      index = 1; __pyx_t_4 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_4)) goto __pyx_L102_unpacking_failed;
-      __Pyx_GOTREF(__pyx_t_4);
-      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_9 = NULL;
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      goto __pyx_L103_unpacking_done;
-      __pyx_L102_unpacking_failed:;
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      __pyx_t_9 = NULL;
+      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_14), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1726; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_8 = NULL;
+      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+      goto __pyx_L117_unpacking_done;
+      __pyx_L116_unpacking_failed:;
+      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+      __pyx_t_8 = NULL;
       if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_L103_unpacking_done:;
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1726; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_L117_unpacking_done:;
     }
-    __Pyx_DECREF_SET(__pyx_v_x, __pyx_t_7);
+    __Pyx_DECREF_SET(__pyx_v_x, __pyx_t_3);
+    __pyx_t_3 = 0;
+    __Pyx_DECREF_SET(__pyx_v_y, __pyx_t_7);
     __pyx_t_7 = 0;
-    __Pyx_DECREF_SET(__pyx_v_y, __pyx_t_4);
-    __pyx_t_4 = 0;
 
-    /* "pygrib.pyx":1735
+    /* "pygrib.pyx":1727
  *             y = np.linspace(-0.5*ymax,0.5*ymax,ny)
  *             x, y = np.meshgrid(x, y)
  *             lons, lats = pj(x,y,inverse=True)             # <<<<<<<<<<<<<<
  *             # set lons,lats to 1.e30 where undefined
  *             abslons = np.fabs(lons); abslats = np.fabs(lats)
  */
-    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
     __Pyx_INCREF(__pyx_v_x);
-    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_x);
+    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_x);
     __Pyx_GIVEREF(__pyx_v_x);
     __Pyx_INCREF(__pyx_v_y);
-    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_y);
+    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_y);
     __Pyx_GIVEREF(__pyx_v_y);
-    __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
-    __pyx_t_7 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_7);
-    if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__inverse), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_inverse, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_pj, __pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __pyx_t_7 = PyObject_Call(__pyx_v_pj, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-    if ((likely(PyTuple_CheckExact(__pyx_t_7))) || (PyList_CheckExact(__pyx_t_7))) {
-      PyObject* sequence = __pyx_t_7;
+    if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
+      PyObject* sequence = __pyx_t_3;
       #if CYTHON_COMPILING_IN_CPYTHON
       Py_ssize_t size = Py_SIZE(sequence);
       #else
@@ -21377,285 +23257,361 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_38latlons(struct __pyx_obj_6pygr
       if (unlikely(size != 2)) {
         if (size > 2) __Pyx_RaiseTooManyValuesError(2);
         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       }
       #if CYTHON_COMPILING_IN_CPYTHON
       if (likely(PyTuple_CheckExact(sequence))) {
-        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); 
-        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
+        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); 
+        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
       } else {
-        __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
-        __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
+        __pyx_t_7 = PyList_GET_ITEM(sequence, 0); 
+        __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
       }
-      __Pyx_INCREF(__pyx_t_4);
-      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(__pyx_t_7);
+      __Pyx_INCREF(__pyx_t_5);
       #else
-      __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      #endif
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    } else
-    {
+      __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_7);
+      __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_5);
+      #endif
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    } else {
       Py_ssize_t index = -1;
-      __pyx_t_8 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
-      index = 0; __pyx_t_4 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_4)) goto __pyx_L104_unpacking_failed;
-      __Pyx_GOTREF(__pyx_t_4);
-      index = 1; __pyx_t_3 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_3)) goto __pyx_L104_unpacking_failed;
-      __Pyx_GOTREF(__pyx_t_3);
-      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_9 = NULL;
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      goto __pyx_L105_unpacking_done;
-      __pyx_L104_unpacking_failed:;
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      __pyx_t_9 = NULL;
+      __pyx_t_14 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_14);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __pyx_t_8 = Py_TYPE(__pyx_t_14)->tp_iternext;
+      index = 0; __pyx_t_7 = __pyx_t_8(__pyx_t_14); if (unlikely(!__pyx_t_7)) goto __pyx_L118_unpacking_failed;
+      __Pyx_GOTREF(__pyx_t_7);
+      index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_14); if (unlikely(!__pyx_t_5)) goto __pyx_L118_unpacking_failed;
+      __Pyx_GOTREF(__pyx_t_5);
+      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_14), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_8 = NULL;
+      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+      goto __pyx_L119_unpacking_done;
+      __pyx_L118_unpacking_failed:;
+      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+      __pyx_t_8 = NULL;
       if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_L105_unpacking_done:;
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_L119_unpacking_done:;
     }
-    __pyx_v_lons = __pyx_t_4;
-    __pyx_t_4 = 0;
-    __pyx_v_lats = __pyx_t_3;
-    __pyx_t_3 = 0;
+    __pyx_v_lons = __pyx_t_7;
+    __pyx_t_7 = 0;
+    __pyx_v_lats = __pyx_t_5;
+    __pyx_t_5 = 0;
 
-    /* "pygrib.pyx":1737
+    /* "pygrib.pyx":1729
  *             lons, lats = pj(x,y,inverse=True)
  *             # set lons,lats to 1.e30 where undefined
  *             abslons = np.fabs(lons); abslats = np.fabs(lats)             # <<<<<<<<<<<<<<
  *             lons = np.where(abslons < 1.e20, lons, 1.e30)
  *             lats = np.where(abslats < 1.e20, lats, 1.e30)
  */
-    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_fabs); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_7);
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s__fabs); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __pyx_t_5 = NULL;
+    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
+      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
+      if (likely(__pyx_t_5)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
+        __Pyx_INCREF(__pyx_t_5);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_7, function);
+      }
+    }
+    if (!__pyx_t_5) {
+      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_lons); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+    } else {
+      __pyx_t_14 = PyTuple_New(1+1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_14);
+      PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
+      __Pyx_INCREF(__pyx_v_lons);
+      PyTuple_SET_ITEM(__pyx_t_14, 0+1, __pyx_v_lons);
+      __Pyx_GIVEREF(__pyx_v_lons);
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_14, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+    }
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_INCREF(__pyx_v_lons);
-    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_lons);
-    __Pyx_GIVEREF(__pyx_v_lons);
-    __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
-    __pyx_v_abslons = __pyx_t_4;
-    __pyx_t_4 = 0;
-    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__fabs); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_v_abslons = __pyx_t_3;
+    __pyx_t_3 = 0;
+    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_INCREF(__pyx_v_lats);
-    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_lats);
-    __Pyx_GIVEREF(__pyx_v_lats);
-    __pyx_t_3 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_fabs); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_14);
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
+    __pyx_t_7 = NULL;
+    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_14))) {
+      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_14);
+      if (likely(__pyx_t_7)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
+        __Pyx_INCREF(__pyx_t_7);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_14, function);
+      }
+    }
+    if (!__pyx_t_7) {
+      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_v_lats); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+    } else {
+      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_5);
+      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = NULL;
+      __Pyx_INCREF(__pyx_v_lats);
+      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_lats);
+      __Pyx_GIVEREF(__pyx_v_lats);
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    }
+    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
     __pyx_v_abslats = __pyx_t_3;
     __pyx_t_3 = 0;
 
-    /* "pygrib.pyx":1738
+    /* "pygrib.pyx":1730
  *             # set lons,lats to 1.e30 where undefined
  *             abslons = np.fabs(lons); abslats = np.fabs(lats)
  *             lons = np.where(abslons < 1.e20, lons, 1.e30)             # <<<<<<<<<<<<<<
  *             lats = np.where(abslats < 1.e20, lats, 1.e30)
  *         elif self['gridType'] == "equatorial_azimuthal_equidistant":
  */
-    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__where); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_3 = PyFloat_FromDouble(1.e20); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_7 = PyObject_RichCompare(__pyx_v_abslons, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_3 = PyFloat_FromDouble(1.e30); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7);
-    __Pyx_GIVEREF(__pyx_t_7);
+    __pyx_t_14 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_14);
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_where); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+    __pyx_t_14 = PyObject_RichCompare(__pyx_v_abslons, __pyx_float_1_e20, Py_LT); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_7 = NULL;
+    __pyx_t_6 = 0;
+    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
+      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
+      if (likely(__pyx_t_7)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+        __Pyx_INCREF(__pyx_t_7);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_5, function);
+        __pyx_t_6 = 1;
+      }
+    }
+    __pyx_t_15 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_15);
+    if (__pyx_t_7) {
+      PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = NULL;
+    }
+    PyTuple_SET_ITEM(__pyx_t_15, 0+__pyx_t_6, __pyx_t_14);
+    __Pyx_GIVEREF(__pyx_t_14);
     __Pyx_INCREF(__pyx_v_lons);
-    PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_lons);
+    PyTuple_SET_ITEM(__pyx_t_15, 1+__pyx_t_6, __pyx_v_lons);
     __Pyx_GIVEREF(__pyx_v_lons);
-    PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_3);
-    __Pyx_GIVEREF(__pyx_t_3);
-    __pyx_t_7 = 0;
-    __pyx_t_3 = 0;
-    __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_INCREF(__pyx_float_1_e30);
+    PyTuple_SET_ITEM(__pyx_t_15, 2+__pyx_t_6, __pyx_float_1_e30);
+    __Pyx_GIVEREF(__pyx_float_1_e30);
+    __pyx_t_14 = 0;
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_15, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
+    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     __Pyx_DECREF_SET(__pyx_v_lons, __pyx_t_3);
     __pyx_t_3 = 0;
 
-    /* "pygrib.pyx":1739
+    /* "pygrib.pyx":1731
  *             abslons = np.fabs(lons); abslats = np.fabs(lats)
  *             lons = np.where(abslons < 1.e20, lons, 1.e30)
  *             lats = np.where(abslats < 1.e20, lats, 1.e30)             # <<<<<<<<<<<<<<
  *         elif self['gridType'] == "equatorial_azimuthal_equidistant":
  *             dx = self['Dx']/1.e3
  */
-    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__where); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_3 = PyFloat_FromDouble(1.e20); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_4 = PyObject_RichCompare(__pyx_v_abslats, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_3 = PyFloat_FromDouble(1.e30); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_where); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_15);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __pyx_t_5 = PyObject_RichCompare(__pyx_v_abslats, __pyx_float_1_e20, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_14 = NULL;
+    __pyx_t_6 = 0;
+    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_15))) {
+      __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_15);
+      if (likely(__pyx_t_14)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
+        __Pyx_INCREF(__pyx_t_14);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_15, function);
+        __pyx_t_6 = 1;
+      }
+    }
+    __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_7);
-    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4);
-    __Pyx_GIVEREF(__pyx_t_4);
+    if (__pyx_t_14) {
+      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_14); __Pyx_GIVEREF(__pyx_t_14); __pyx_t_14 = NULL;
+    }
+    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_5);
+    __Pyx_GIVEREF(__pyx_t_5);
     __Pyx_INCREF(__pyx_v_lats);
-    PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_lats);
+    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_lats);
     __Pyx_GIVEREF(__pyx_v_lats);
-    PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_3);
-    __Pyx_GIVEREF(__pyx_t_3);
-    __pyx_t_4 = 0;
-    __pyx_t_3 = 0;
-    __pyx_t_3 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_INCREF(__pyx_float_1_e30);
+    PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_float_1_e30);
+    __Pyx_GIVEREF(__pyx_float_1_e30);
+    __pyx_t_5 = 0;
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
     __Pyx_DECREF_SET(__pyx_v_lats, __pyx_t_3);
     __pyx_t_3 = 0;
     goto __pyx_L4;
   }
 
-  /* "pygrib.pyx":1740
+  /* "pygrib.pyx":1732
  *             lons = np.where(abslons < 1.e20, lons, 1.e30)
  *             lats = np.where(abslats < 1.e20, lats, 1.e30)
  *         elif self['gridType'] == "equatorial_azimuthal_equidistant":             # <<<<<<<<<<<<<<
  *             dx = self['Dx']/1.e3
  *             dy = self['Dy']/1.e3
  */
-  __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__gridType)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1740; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_gridType); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
   __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_7 = PyObject_RichCompare(__pyx_t_3, ((PyObject *)__pyx_n_s_161), Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1740; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_equatorial_azimuthal_equidistant, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1740; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  if (__pyx_t_2) {
+  if (__pyx_t_1) {
 
-    /* "pygrib.pyx":1741
+    /* "pygrib.pyx":1733
  *             lats = np.where(abslats < 1.e20, lats, 1.e30)
  *         elif self['gridType'] == "equatorial_azimuthal_equidistant":
  *             dx = self['Dx']/1.e3             # <<<<<<<<<<<<<<
  *             dy = self['Dy']/1.e3
  *             lat1 = self['latitudeOfFirstGridPointInDegrees']
  */
-    __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__Dx)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __pyx_t_3 = PyFloat_FromDouble(1.e3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_Dx); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1733; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
     __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_8 = __Pyx_PyNumber_Divide(__pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __pyx_t_15 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_float_1_e3); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_15);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_v_dx = __pyx_t_8;
-    __pyx_t_8 = 0;
+    __pyx_v_dx = __pyx_t_15;
+    __pyx_t_15 = 0;
 
-    /* "pygrib.pyx":1742
+    /* "pygrib.pyx":1734
  *         elif self['gridType'] == "equatorial_azimuthal_equidistant":
  *             dx = self['Dx']/1.e3
  *             dy = self['Dy']/1.e3             # <<<<<<<<<<<<<<
  *             lat1 = self['latitudeOfFirstGridPointInDegrees']
  *             lon1 = self['longitudeOfFirstGridPointInDegrees']
  */
-    __pyx_t_8 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__Dy)); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __pyx_t_3 = PyFloat_FromDouble(1.e3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_15 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_Dy); if (unlikely(__pyx_t_15 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1734; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_15);
+    __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_15, __pyx_float_1_e3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_t_8, __pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_v_dy = __pyx_t_7;
-    __pyx_t_7 = 0;
+    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+    __pyx_v_dy = __pyx_t_3;
+    __pyx_t_3 = 0;
 
-    /* "pygrib.pyx":1743
+    /* "pygrib.pyx":1735
  *             dx = self['Dx']/1.e3
  *             dy = self['Dy']/1.e3
  *             lat1 = self['latitudeOfFirstGridPointInDegrees']             # <<<<<<<<<<<<<<
  *             lon1 = self['longitudeOfFirstGridPointInDegrees']
  *             pj = pyproj.Proj(self.projparams)
  */
-    __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s_171)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __pyx_v_lat1 = __pyx_t_7;
-    __pyx_t_7 = 0;
+    __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_latitudeOfFirstGridPointInDegree); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1735; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_v_lat1 = __pyx_t_3;
+    __pyx_t_3 = 0;
 
-    /* "pygrib.pyx":1744
+    /* "pygrib.pyx":1736
  *             dy = self['Dy']/1.e3
  *             lat1 = self['latitudeOfFirstGridPointInDegrees']
  *             lon1 = self['longitudeOfFirstGridPointInDegrees']             # <<<<<<<<<<<<<<
  *             pj = pyproj.Proj(self.projparams)
  *             llcrnrx, llcrnry = pj(lon1,lat1)
  */
-    __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s_169)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1744; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __pyx_v_lon1 = __pyx_t_7;
-    __pyx_t_7 = 0;
+    __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_longitudeOfFirstGridPointInDegre); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1736; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_v_lon1 = __pyx_t_3;
+    __pyx_t_3 = 0;
 
-    /* "pygrib.pyx":1745
+    /* "pygrib.pyx":1737
  *             lat1 = self['latitudeOfFirstGridPointInDegrees']
  *             lon1 = self['longitudeOfFirstGridPointInDegrees']
  *             pj = pyproj.Proj(self.projparams)             # <<<<<<<<<<<<<<
  *             llcrnrx, llcrnry = pj(lon1,lat1)
  *             try:
  */
-    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s__pyproj); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_15 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyproj); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_15);
+    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_Proj); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_7);
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s__Proj); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+    __pyx_t_15 = NULL;
+    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
+      __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_7);
+      if (likely(__pyx_t_15)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
+        __Pyx_INCREF(__pyx_t_15);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_7, function);
+      }
+    }
+    if (!__pyx_t_15) {
+      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_self->projparams); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+    } else {
+      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_5);
+      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_15); __Pyx_GIVEREF(__pyx_t_15); __pyx_t_15 = NULL;
+      __Pyx_INCREF(__pyx_v_self->projparams);
+      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_self->projparams);
+      __Pyx_GIVEREF(__pyx_v_self->projparams);
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    }
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_INCREF(__pyx_v_self->projparams);
-    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_self->projparams);
-    __Pyx_GIVEREF(__pyx_v_self->projparams);
-    __pyx_t_8 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
-    __pyx_v_pj = __pyx_t_8;
-    __pyx_t_8 = 0;
+    __pyx_v_pj = __pyx_t_3;
+    __pyx_t_3 = 0;
 
-    /* "pygrib.pyx":1746
+    /* "pygrib.pyx":1738
  *             lon1 = self['longitudeOfFirstGridPointInDegrees']
  *             pj = pyproj.Proj(self.projparams)
  *             llcrnrx, llcrnry = pj(lon1,lat1)             # <<<<<<<<<<<<<<
  *             try:
  *                 nx = self['Nx']
  */
-    __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
+    __Pyx_INCREF(__pyx_v_pj);
+    __pyx_t_7 = __pyx_v_pj; __pyx_t_5 = NULL;
+    __pyx_t_6 = 0;
+    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
+      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
+      if (likely(__pyx_t_5)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
+        __Pyx_INCREF(__pyx_t_5);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_7, function);
+        __pyx_t_6 = 1;
+      }
+    }
+    __pyx_t_15 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_15);
+    if (__pyx_t_5) {
+      PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
+    }
     __Pyx_INCREF(__pyx_v_lon1);
-    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_lon1);
+    PyTuple_SET_ITEM(__pyx_t_15, 0+__pyx_t_6, __pyx_v_lon1);
     __Pyx_GIVEREF(__pyx_v_lon1);
     __Pyx_INCREF(__pyx_v_lat1);
-    PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_lat1);
+    PyTuple_SET_ITEM(__pyx_t_15, 1+__pyx_t_6, __pyx_v_lat1);
     __Pyx_GIVEREF(__pyx_v_lat1);
-    __pyx_t_7 = PyObject_Call(__pyx_v_pj, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
-    if ((likely(PyTuple_CheckExact(__pyx_t_7))) || (PyList_CheckExact(__pyx_t_7))) {
-      PyObject* sequence = __pyx_t_7;
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_15, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
+      PyObject* sequence = __pyx_t_3;
       #if CYTHON_COMPILING_IN_CPYTHON
       Py_ssize_t size = Py_SIZE(sequence);
       #else
@@ -21664,53 +23620,52 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_38latlons(struct __pyx_obj_6pygr
       if (unlikely(size != 2)) {
         if (size > 2) __Pyx_RaiseTooManyValuesError(2);
         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       }
       #if CYTHON_COMPILING_IN_CPYTHON
       if (likely(PyTuple_CheckExact(sequence))) {
-        __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); 
-        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
+        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); 
+        __pyx_t_15 = PyTuple_GET_ITEM(sequence, 1); 
       } else {
-        __pyx_t_8 = PyList_GET_ITEM(sequence, 0); 
-        __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
+        __pyx_t_7 = PyList_GET_ITEM(sequence, 0); 
+        __pyx_t_15 = PyList_GET_ITEM(sequence, 1); 
       }
-      __Pyx_INCREF(__pyx_t_8);
-      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(__pyx_t_7);
+      __Pyx_INCREF(__pyx_t_15);
       #else
-      __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-      __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_7);
+      __pyx_t_15 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_15);
       #endif
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    } else
-    {
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    } else {
       Py_ssize_t index = -1;
-      __pyx_t_4 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      __pyx_t_9 = Py_TYPE(__pyx_t_4)->tp_iternext;
-      index = 0; __pyx_t_8 = __pyx_t_9(__pyx_t_4); if (unlikely(!__pyx_t_8)) goto __pyx_L106_unpacking_failed;
-      __Pyx_GOTREF(__pyx_t_8);
-      index = 1; __pyx_t_3 = __pyx_t_9(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L106_unpacking_failed;
-      __Pyx_GOTREF(__pyx_t_3);
-      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_9 = NULL;
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      goto __pyx_L107_unpacking_done;
-      __pyx_L106_unpacking_failed:;
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __pyx_t_9 = NULL;
+      __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_5);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __pyx_t_8 = Py_TYPE(__pyx_t_5)->tp_iternext;
+      index = 0; __pyx_t_7 = __pyx_t_8(__pyx_t_5); if (unlikely(!__pyx_t_7)) goto __pyx_L120_unpacking_failed;
+      __Pyx_GOTREF(__pyx_t_7);
+      index = 1; __pyx_t_15 = __pyx_t_8(__pyx_t_5); if (unlikely(!__pyx_t_15)) goto __pyx_L120_unpacking_failed;
+      __Pyx_GOTREF(__pyx_t_15);
+      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_5), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_8 = NULL;
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      goto __pyx_L121_unpacking_done;
+      __pyx_L120_unpacking_failed:;
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __pyx_t_8 = NULL;
       if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_L107_unpacking_done:;
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_L121_unpacking_done:;
     }
-    __pyx_v_llcrnrx = __pyx_t_8;
-    __pyx_t_8 = 0;
-    __pyx_v_llcrnry = __pyx_t_3;
-    __pyx_t_3 = 0;
+    __pyx_v_llcrnrx = __pyx_t_7;
+    __pyx_t_7 = 0;
+    __pyx_v_llcrnry = __pyx_t_15;
+    __pyx_t_15 = 0;
 
-    /* "pygrib.pyx":1747
+    /* "pygrib.pyx":1739
  *             pj = pyproj.Proj(self.projparams)
  *             llcrnrx, llcrnry = pj(lon1,lat1)
  *             try:             # <<<<<<<<<<<<<<
@@ -21718,48 +23673,50 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_38latlons(struct __pyx_obj_6pygr
  *                 ny = self['Ny']
  */
     {
-      __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
+      __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
+      __Pyx_XGOTREF(__pyx_t_9);
       __Pyx_XGOTREF(__pyx_t_10);
       __Pyx_XGOTREF(__pyx_t_11);
-      __Pyx_XGOTREF(__pyx_t_12);
       /*try:*/ {
 
-        /* "pygrib.pyx":1748
+        /* "pygrib.pyx":1740
  *             llcrnrx, llcrnry = pj(lon1,lat1)
  *             try:
  *                 nx = self['Nx']             # <<<<<<<<<<<<<<
  *                 ny = self['Ny']
  *             except:
  */
-        __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__Nx)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1748; __pyx_clineno = __LINE__; goto __pyx_L108_error;}
-        __Pyx_GOTREF(__pyx_t_7);
-        __pyx_v_nx = __pyx_t_7;
-        __pyx_t_7 = 0;
+        __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_Nx); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1740; __pyx_clineno = __LINE__; goto __pyx_L122_error;};
+        __Pyx_GOTREF(__pyx_t_3);
+        __pyx_v_nx = __pyx_t_3;
+        __pyx_t_3 = 0;
 
-        /* "pygrib.pyx":1749
+        /* "pygrib.pyx":1741
  *             try:
  *                 nx = self['Nx']
  *                 ny = self['Ny']             # <<<<<<<<<<<<<<
  *             except:
  *                 nx = self['Ni']
  */
-        __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__Ny)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1749; __pyx_clineno = __LINE__; goto __pyx_L108_error;}
-        __Pyx_GOTREF(__pyx_t_7);
-        __pyx_v_ny = __pyx_t_7;
-        __pyx_t_7 = 0;
+        __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_Ny); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1741; __pyx_clineno = __LINE__; goto __pyx_L122_error;};
+        __Pyx_GOTREF(__pyx_t_3);
+        __pyx_v_ny = __pyx_t_3;
+        __pyx_t_3 = 0;
       }
+      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
       __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
       __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
-      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
-      goto __pyx_L115_try_end;
-      __pyx_L108_error:;
-      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
+      goto __pyx_L129_try_end;
+      __pyx_L122_error:;
       __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
-      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
+      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
       __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+      __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
 
-      /* "pygrib.pyx":1750
+      /* "pygrib.pyx":1742
  *                 nx = self['Nx']
  *                 ny = self['Ny']
  *             except:             # <<<<<<<<<<<<<<
@@ -21768,139 +23725,186 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_38latlons(struct __pyx_obj_6pygr
  */
       /*except:*/ {
         __Pyx_AddTraceback("pygrib.gribmessage.latlons", __pyx_clineno, __pyx_lineno, __pyx_filename);
-        if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_3, &__pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1750; __pyx_clineno = __LINE__; goto __pyx_L110_except_error;}
-        __Pyx_GOTREF(__pyx_t_7);
+        if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_15, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1742; __pyx_clineno = __LINE__; goto __pyx_L124_except_error;}
         __Pyx_GOTREF(__pyx_t_3);
-        __Pyx_GOTREF(__pyx_t_8);
+        __Pyx_GOTREF(__pyx_t_15);
+        __Pyx_GOTREF(__pyx_t_7);
 
-        /* "pygrib.pyx":1751
+        /* "pygrib.pyx":1743
  *                 ny = self['Ny']
  *             except:
  *                 nx = self['Ni']             # <<<<<<<<<<<<<<
  *                 ny = self['Nj']
  *             x = llcrnrx+dx*np.arange(nx)
  */
-        __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__Ni)); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1751; __pyx_clineno = __LINE__; goto __pyx_L110_except_error;}
-        __Pyx_GOTREF(__pyx_t_4);
-        __Pyx_XDECREF_SET(__pyx_v_nx, __pyx_t_4);
-        __pyx_t_4 = 0;
+        __pyx_t_5 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_Ni); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1743; __pyx_clineno = __LINE__; goto __pyx_L124_except_error;};
+        __Pyx_GOTREF(__pyx_t_5);
+        __Pyx_XDECREF_SET(__pyx_v_nx, __pyx_t_5);
+        __pyx_t_5 = 0;
 
-        /* "pygrib.pyx":1752
+        /* "pygrib.pyx":1744
  *             except:
  *                 nx = self['Ni']
  *                 ny = self['Nj']             # <<<<<<<<<<<<<<
  *             x = llcrnrx+dx*np.arange(nx)
  *             y = llcrnry+dy*np.arange(ny)
  */
-        __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__Nj)); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1752; __pyx_clineno = __LINE__; goto __pyx_L110_except_error;}
-        __Pyx_GOTREF(__pyx_t_4);
-        __Pyx_XDECREF_SET(__pyx_v_ny, __pyx_t_4);
-        __pyx_t_4 = 0;
-        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+        __pyx_t_5 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_Nj); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1744; __pyx_clineno = __LINE__; goto __pyx_L124_except_error;};
+        __Pyx_GOTREF(__pyx_t_5);
+        __Pyx_XDECREF_SET(__pyx_v_ny, __pyx_t_5);
+        __pyx_t_5 = 0;
         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-        goto __pyx_L109_exception_handled;
+        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+        goto __pyx_L123_exception_handled;
       }
-      __pyx_L110_except_error:;
+      __pyx_L124_except_error:;
+      __Pyx_XGIVEREF(__pyx_t_9);
       __Pyx_XGIVEREF(__pyx_t_10);
       __Pyx_XGIVEREF(__pyx_t_11);
-      __Pyx_XGIVEREF(__pyx_t_12);
-      __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
+      __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
       goto __pyx_L1_error;
-      __pyx_L109_exception_handled:;
+      __pyx_L123_exception_handled:;
+      __Pyx_XGIVEREF(__pyx_t_9);
       __Pyx_XGIVEREF(__pyx_t_10);
       __Pyx_XGIVEREF(__pyx_t_11);
-      __Pyx_XGIVEREF(__pyx_t_12);
-      __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
-      __pyx_L115_try_end:;
+      __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
+      __pyx_L129_try_end:;
     }
 
-    /* "pygrib.pyx":1753
+    /* "pygrib.pyx":1745
  *                 nx = self['Ni']
  *                 ny = self['Nj']
  *             x = llcrnrx+dx*np.arange(nx)             # <<<<<<<<<<<<<<
  *             y = llcrnry+dy*np.arange(ny)
  *             x, y = np.meshgrid(x, y)
  */
-    __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s__arange); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_15 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_15);
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_arange); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-    __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __Pyx_INCREF(__pyx_v_nx);
-    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_nx);
-    __Pyx_GIVEREF(__pyx_v_nx);
-    __pyx_t_7 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
+    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+    __pyx_t_15 = NULL;
+    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
+      __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_3);
+      if (likely(__pyx_t_15)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+        __Pyx_INCREF(__pyx_t_15);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_3, function);
+      }
+    }
+    if (!__pyx_t_15) {
+      __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_nx); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_7);
+    } else {
+      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_5);
+      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_15); __Pyx_GIVEREF(__pyx_t_15); __pyx_t_15 = NULL;
+      __Pyx_INCREF(__pyx_v_nx);
+      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_nx);
+      __Pyx_GIVEREF(__pyx_v_nx);
+      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_7);
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    }
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
-    __pyx_t_8 = PyNumber_Multiply(__pyx_v_dx, __pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
+    __pyx_t_3 = PyNumber_Multiply(__pyx_v_dx, __pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __pyx_t_7 = PyNumber_Add(__pyx_v_llcrnrx, __pyx_t_8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_7 = PyNumber_Add(__pyx_v_llcrnrx, __pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __pyx_v_x = __pyx_t_7;
     __pyx_t_7 = 0;
 
-    /* "pygrib.pyx":1754
+    /* "pygrib.pyx":1746
  *                 ny = self['Nj']
  *             x = llcrnrx+dx*np.arange(nx)
  *             y = llcrnry+dy*np.arange(ny)             # <<<<<<<<<<<<<<
  *             x, y = np.meshgrid(x, y)
  *             lons, lats = pj(x, y, inverse=True)
  */
-    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s__arange); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_INCREF(__pyx_v_ny);
-    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_ny);
-    __Pyx_GIVEREF(__pyx_v_ny);
-    __pyx_t_3 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
-    __pyx_t_7 = PyNumber_Multiply(__pyx_v_dy, __pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_arange); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_3 = PyNumber_Add(__pyx_v_llcrnry, __pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_3 = NULL;
+    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
+      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
+      if (likely(__pyx_t_3)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+        __Pyx_INCREF(__pyx_t_3);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_5, function);
+      }
+    }
+    if (!__pyx_t_3) {
+      __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_ny); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_7);
+    } else {
+      __pyx_t_15 = PyTuple_New(1+1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_15);
+      PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
+      __Pyx_INCREF(__pyx_v_ny);
+      PyTuple_SET_ITEM(__pyx_t_15, 0+1, __pyx_v_ny);
+      __Pyx_GIVEREF(__pyx_v_ny);
+      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_15, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_7);
+      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+    }
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __pyx_t_5 = PyNumber_Multiply(__pyx_v_dy, __pyx_t_7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __pyx_v_y = __pyx_t_3;
-    __pyx_t_3 = 0;
+    __pyx_t_7 = PyNumber_Add(__pyx_v_llcrnry, __pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_7);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __pyx_v_y = __pyx_t_7;
+    __pyx_t_7 = 0;
 
-    /* "pygrib.pyx":1755
+    /* "pygrib.pyx":1747
  *             x = llcrnrx+dx*np.arange(nx)
  *             y = llcrnry+dy*np.arange(ny)
  *             x, y = np.meshgrid(x, y)             # <<<<<<<<<<<<<<
  *             lons, lats = pj(x, y, inverse=True)
  *         elif self['gridType'] == "lambert_azimuthal_equal_area":
  */
-    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__meshgrid); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_meshgrid); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_15);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __pyx_t_5 = NULL;
+    __pyx_t_6 = 0;
+    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_15))) {
+      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_15);
+      if (likely(__pyx_t_5)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
+        __Pyx_INCREF(__pyx_t_5);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_15, function);
+        __pyx_t_6 = 1;
+      }
+    }
+    __pyx_t_3 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
+    if (__pyx_t_5) {
+      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
+    }
     __Pyx_INCREF(__pyx_v_x);
-    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_x);
+    PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_6, __pyx_v_x);
     __Pyx_GIVEREF(__pyx_v_x);
     __Pyx_INCREF(__pyx_v_y);
-    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_y);
+    PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_6, __pyx_v_y);
     __Pyx_GIVEREF(__pyx_v_y);
-    __pyx_t_8 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-    if ((likely(PyTuple_CheckExact(__pyx_t_8))) || (PyList_CheckExact(__pyx_t_8))) {
-      PyObject* sequence = __pyx_t_8;
+    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_3, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_7);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+    if ((likely(PyTuple_CheckExact(__pyx_t_7))) || (PyList_CheckExact(__pyx_t_7))) {
+      PyObject* sequence = __pyx_t_7;
       #if CYTHON_COMPILING_IN_CPYTHON
       Py_ssize_t size = Py_SIZE(sequence);
       #else
@@ -21909,79 +23913,75 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_38latlons(struct __pyx_obj_6pygr
       if (unlikely(size != 2)) {
         if (size > 2) __Pyx_RaiseTooManyValuesError(2);
         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       }
       #if CYTHON_COMPILING_IN_CPYTHON
       if (likely(PyTuple_CheckExact(sequence))) {
-        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
-        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); 
+        __pyx_t_15 = PyTuple_GET_ITEM(sequence, 0); 
+        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
       } else {
-        __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
-        __pyx_t_7 = PyList_GET_ITEM(sequence, 1); 
+        __pyx_t_15 = PyList_GET_ITEM(sequence, 0); 
+        __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
       }
+      __Pyx_INCREF(__pyx_t_15);
       __Pyx_INCREF(__pyx_t_3);
-      __Pyx_INCREF(__pyx_t_7);
       #else
-      __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_15 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_15);
+      __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_7);
       #endif
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-    } else
-    {
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    } else {
       Py_ssize_t index = -1;
-      __pyx_t_4 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      __pyx_t_9 = Py_TYPE(__pyx_t_4)->tp_iternext;
-      index = 0; __pyx_t_3 = __pyx_t_9(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L118_unpacking_failed;
+      __pyx_t_5 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_5);
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+      __pyx_t_8 = Py_TYPE(__pyx_t_5)->tp_iternext;
+      index = 0; __pyx_t_15 = __pyx_t_8(__pyx_t_5); if (unlikely(!__pyx_t_15)) goto __pyx_L132_unpacking_failed;
+      __Pyx_GOTREF(__pyx_t_15);
+      index = 1; __pyx_t_3 = __pyx_t_8(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L132_unpacking_failed;
       __Pyx_GOTREF(__pyx_t_3);
-      index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_4); if (unlikely(!__pyx_t_7)) goto __pyx_L118_unpacking_failed;
-      __Pyx_GOTREF(__pyx_t_7);
-      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_9 = NULL;
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      goto __pyx_L119_unpacking_done;
-      __pyx_L118_unpacking_failed:;
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __pyx_t_9 = NULL;
+      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_5), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_8 = NULL;
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      goto __pyx_L133_unpacking_done;
+      __pyx_L132_unpacking_failed:;
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __pyx_t_8 = NULL;
       if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_L119_unpacking_done:;
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_L133_unpacking_done:;
     }
-    __Pyx_DECREF_SET(__pyx_v_x, __pyx_t_3);
+    __Pyx_DECREF_SET(__pyx_v_x, __pyx_t_15);
+    __pyx_t_15 = 0;
+    __Pyx_DECREF_SET(__pyx_v_y, __pyx_t_3);
     __pyx_t_3 = 0;
-    __Pyx_DECREF_SET(__pyx_v_y, __pyx_t_7);
-    __pyx_t_7 = 0;
 
-    /* "pygrib.pyx":1756
+    /* "pygrib.pyx":1748
  *             y = llcrnry+dy*np.arange(ny)
  *             x, y = np.meshgrid(x, y)
  *             lons, lats = pj(x, y, inverse=True)             # <<<<<<<<<<<<<<
  *         elif self['gridType'] == "lambert_azimuthal_equal_area":
  *             dx = self['Dx']/1.e3
  */
-    __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
+    __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_7);
     __Pyx_INCREF(__pyx_v_x);
-    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_x);
+    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_x);
     __Pyx_GIVEREF(__pyx_v_x);
     __Pyx_INCREF(__pyx_v_y);
-    PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_y);
+    PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_y);
     __Pyx_GIVEREF(__pyx_v_y);
-    __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_7));
-    __pyx_t_3 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
-    if (PyDict_SetItem(__pyx_t_7, ((PyObject *)__pyx_n_s__inverse), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_inverse, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_15 = __Pyx_PyObject_Call(__pyx_v_pj, __pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_15);
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_3 = PyObject_Call(__pyx_v_pj, ((PyObject *)__pyx_t_8), ((PyObject *)__pyx_t_7)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
-    if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
-      PyObject* sequence = __pyx_t_3;
+    if ((likely(PyTuple_CheckExact(__pyx_t_15))) || (PyList_CheckExact(__pyx_t_15))) {
+      PyObject* sequence = __pyx_t_15;
       #if CYTHON_COMPILING_IN_CPYTHON
       Py_ssize_t size = Py_SIZE(sequence);
       #else
@@ -21990,173 +23990,197 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_38latlons(struct __pyx_obj_6pygr
       if (unlikely(size != 2)) {
         if (size > 2) __Pyx_RaiseTooManyValuesError(2);
         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       }
       #if CYTHON_COMPILING_IN_CPYTHON
       if (likely(PyTuple_CheckExact(sequence))) {
-        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); 
-        __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); 
+        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
+        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); 
       } else {
-        __pyx_t_7 = PyList_GET_ITEM(sequence, 0); 
-        __pyx_t_8 = PyList_GET_ITEM(sequence, 1); 
+        __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
+        __pyx_t_7 = PyList_GET_ITEM(sequence, 1); 
       }
+      __Pyx_INCREF(__pyx_t_3);
       __Pyx_INCREF(__pyx_t_7);
-      __Pyx_INCREF(__pyx_t_8);
       #else
-      __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_7);
-      __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
       #endif
-      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    } else
-    {
+      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+    } else {
       Py_ssize_t index = -1;
-      __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_9 = Py_TYPE(__pyx_t_4)->tp_iternext;
-      index = 0; __pyx_t_7 = __pyx_t_9(__pyx_t_4); if (unlikely(!__pyx_t_7)) goto __pyx_L120_unpacking_failed;
+      __pyx_t_5 = PyObject_GetIter(__pyx_t_15); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_5);
+      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+      __pyx_t_8 = Py_TYPE(__pyx_t_5)->tp_iternext;
+      index = 0; __pyx_t_3 = __pyx_t_8(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L134_unpacking_failed;
+      __Pyx_GOTREF(__pyx_t_3);
+      index = 1; __pyx_t_7 = __pyx_t_8(__pyx_t_5); if (unlikely(!__pyx_t_7)) goto __pyx_L134_unpacking_failed;
       __Pyx_GOTREF(__pyx_t_7);
-      index = 1; __pyx_t_8 = __pyx_t_9(__pyx_t_4); if (unlikely(!__pyx_t_8)) goto __pyx_L120_unpacking_failed;
-      __Pyx_GOTREF(__pyx_t_8);
-      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_9 = NULL;
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      goto __pyx_L121_unpacking_done;
-      __pyx_L120_unpacking_failed:;
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __pyx_t_9 = NULL;
+      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_5), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_8 = NULL;
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      goto __pyx_L135_unpacking_done;
+      __pyx_L134_unpacking_failed:;
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __pyx_t_8 = NULL;
       if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_L121_unpacking_done:;
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_L135_unpacking_done:;
     }
-    __pyx_v_lons = __pyx_t_7;
+    __pyx_v_lons = __pyx_t_3;
+    __pyx_t_3 = 0;
+    __pyx_v_lats = __pyx_t_7;
     __pyx_t_7 = 0;
-    __pyx_v_lats = __pyx_t_8;
-    __pyx_t_8 = 0;
     goto __pyx_L4;
   }
 
-  /* "pygrib.pyx":1757
+  /* "pygrib.pyx":1749
  *             x, y = np.meshgrid(x, y)
  *             lons, lats = pj(x, y, inverse=True)
  *         elif self['gridType'] == "lambert_azimuthal_equal_area":             # <<<<<<<<<<<<<<
  *             dx = self['Dx']/1.e3
  *             dy = self['Dy']/1.e3
  */
-  __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__gridType)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_8 = PyObject_RichCompare(__pyx_t_3, ((PyObject *)__pyx_n_s_162), Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-  if (__pyx_t_2) {
+  __pyx_t_15 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_gridType); if (unlikely(__pyx_t_15 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1749; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+  __Pyx_GOTREF(__pyx_t_15);
+  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_15, __pyx_n_s_lambert_azimuthal_equal_area, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+  if (__pyx_t_1) {
 
-    /* "pygrib.pyx":1758
+    /* "pygrib.pyx":1750
  *             lons, lats = pj(x, y, inverse=True)
  *         elif self['gridType'] == "lambert_azimuthal_equal_area":
  *             dx = self['Dx']/1.e3             # <<<<<<<<<<<<<<
  *             dy = self['Dy']/1.e3
  *             lat1 = self['latitudeOfFirstGridPointInDegrees']
  */
-    __pyx_t_8 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__Dx)); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __pyx_t_3 = PyFloat_FromDouble(1.e3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_t_8, __pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_15 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_Dx); if (unlikely(__pyx_t_15 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1750; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_15);
+    __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_t_15, __pyx_float_1_e3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
     __pyx_v_dx = __pyx_t_7;
     __pyx_t_7 = 0;
 
-    /* "pygrib.pyx":1759
+    /* "pygrib.pyx":1751
  *         elif self['gridType'] == "lambert_azimuthal_equal_area":
  *             dx = self['Dx']/1.e3
  *             dy = self['Dy']/1.e3             # <<<<<<<<<<<<<<
  *             lat1 = self['latitudeOfFirstGridPointInDegrees']
  *             lon1 = self['longitudeOfFirstGridPointInDegrees']
  */
-    __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__Dy)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_Dy); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1751; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
     __Pyx_GOTREF(__pyx_t_7);
-    __pyx_t_3 = PyFloat_FromDouble(1.e3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_8 = __Pyx_PyNumber_Divide(__pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
+    __pyx_t_15 = __Pyx_PyNumber_Divide(__pyx_t_7, __pyx_float_1_e3); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1751; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_15);
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_v_dy = __pyx_t_8;
-    __pyx_t_8 = 0;
+    __pyx_v_dy = __pyx_t_15;
+    __pyx_t_15 = 0;
 
-    /* "pygrib.pyx":1760
+    /* "pygrib.pyx":1752
  *             dx = self['Dx']/1.e3
  *             dy = self['Dy']/1.e3
  *             lat1 = self['latitudeOfFirstGridPointInDegrees']             # <<<<<<<<<<<<<<
  *             lon1 = self['longitudeOfFirstGridPointInDegrees']
  *             pj = pyproj.Proj(self.projparams)
  */
-    __pyx_t_8 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s_171)); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1760; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __pyx_v_lat1 = __pyx_t_8;
-    __pyx_t_8 = 0;
+    __pyx_t_15 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_latitudeOfFirstGridPointInDegree); if (unlikely(__pyx_t_15 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1752; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_15);
+    __pyx_v_lat1 = __pyx_t_15;
+    __pyx_t_15 = 0;
 
-    /* "pygrib.pyx":1761
+    /* "pygrib.pyx":1753
  *             dy = self['Dy']/1.e3
  *             lat1 = self['latitudeOfFirstGridPointInDegrees']
  *             lon1 = self['longitudeOfFirstGridPointInDegrees']             # <<<<<<<<<<<<<<
  *             pj = pyproj.Proj(self.projparams)
  *             llcrnrx, llcrnry = pj(lon1,lat1)
  */
-    __pyx_t_8 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s_169)); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __pyx_v_lon1 = __pyx_t_8;
-    __pyx_t_8 = 0;
+    __pyx_t_15 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_longitudeOfFirstGridPointInDegre); if (unlikely(__pyx_t_15 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1753; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_15);
+    __pyx_v_lon1 = __pyx_t_15;
+    __pyx_t_15 = 0;
 
-    /* "pygrib.pyx":1762
+    /* "pygrib.pyx":1754
  *             lat1 = self['latitudeOfFirstGridPointInDegrees']
  *             lon1 = self['longitudeOfFirstGridPointInDegrees']
  *             pj = pyproj.Proj(self.projparams)             # <<<<<<<<<<<<<<
  *             llcrnrx, llcrnry = pj(lon1,lat1)
  *             try:
  */
-    __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s__pyproj); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s__Proj); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-    __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __Pyx_INCREF(__pyx_v_self->projparams);
-    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_self->projparams);
-    __Pyx_GIVEREF(__pyx_v_self->projparams);
-    __pyx_t_7 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyproj); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_7);
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_Proj); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __pyx_t_7 = NULL;
+    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
+      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
+      if (likely(__pyx_t_7)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+        __Pyx_INCREF(__pyx_t_7);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_3, function);
+      }
+    }
+    if (!__pyx_t_7) {
+      __pyx_t_15 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_self->projparams); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_15);
+    } else {
+      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_5);
+      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = NULL;
+      __Pyx_INCREF(__pyx_v_self->projparams);
+      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_self->projparams);
+      __Pyx_GIVEREF(__pyx_v_self->projparams);
+      __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_15);
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    }
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
-    __pyx_v_pj = __pyx_t_7;
-    __pyx_t_7 = 0;
+    __pyx_v_pj = __pyx_t_15;
+    __pyx_t_15 = 0;
 
-    /* "pygrib.pyx":1763
+    /* "pygrib.pyx":1755
  *             lon1 = self['longitudeOfFirstGridPointInDegrees']
  *             pj = pyproj.Proj(self.projparams)
  *             llcrnrx, llcrnry = pj(lon1,lat1)             # <<<<<<<<<<<<<<
  *             try:
  *                 nx = self['Nx']
  */
-    __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1763; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_INCREF(__pyx_v_pj);
+    __pyx_t_3 = __pyx_v_pj; __pyx_t_5 = NULL;
+    __pyx_t_6 = 0;
+    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
+      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
+      if (likely(__pyx_t_5)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+        __Pyx_INCREF(__pyx_t_5);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_3, function);
+        __pyx_t_6 = 1;
+      }
+    }
+    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_7);
+    if (__pyx_t_5) {
+      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
+    }
     __Pyx_INCREF(__pyx_v_lon1);
-    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_lon1);
+    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_lon1);
     __Pyx_GIVEREF(__pyx_v_lon1);
     __Pyx_INCREF(__pyx_v_lat1);
-    PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_lat1);
+    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_lat1);
     __Pyx_GIVEREF(__pyx_v_lat1);
-    __pyx_t_8 = PyObject_Call(__pyx_v_pj, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1763; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
-    if ((likely(PyTuple_CheckExact(__pyx_t_8))) || (PyList_CheckExact(__pyx_t_8))) {
-      PyObject* sequence = __pyx_t_8;
+    __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_15);
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    if ((likely(PyTuple_CheckExact(__pyx_t_15))) || (PyList_CheckExact(__pyx_t_15))) {
+      PyObject* sequence = __pyx_t_15;
       #if CYTHON_COMPILING_IN_CPYTHON
       Py_ssize_t size = Py_SIZE(sequence);
       #else
@@ -22165,53 +24189,52 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_38latlons(struct __pyx_obj_6pygr
       if (unlikely(size != 2)) {
         if (size > 2) __Pyx_RaiseTooManyValuesError(2);
         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1763; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       }
       #if CYTHON_COMPILING_IN_CPYTHON
       if (likely(PyTuple_CheckExact(sequence))) {
-        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); 
-        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
+        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
+        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); 
       } else {
-        __pyx_t_7 = PyList_GET_ITEM(sequence, 0); 
-        __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
+        __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
+        __pyx_t_7 = PyList_GET_ITEM(sequence, 1); 
       }
-      __Pyx_INCREF(__pyx_t_7);
       __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(__pyx_t_7);
       #else
-      __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1763; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_7);
-      __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1763; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_7);
       #endif
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-    } else
-    {
+      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+    } else {
       Py_ssize_t index = -1;
-      __pyx_t_4 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1763; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      __pyx_t_9 = Py_TYPE(__pyx_t_4)->tp_iternext;
-      index = 0; __pyx_t_7 = __pyx_t_9(__pyx_t_4); if (unlikely(!__pyx_t_7)) goto __pyx_L122_unpacking_failed;
-      __Pyx_GOTREF(__pyx_t_7);
-      index = 1; __pyx_t_3 = __pyx_t_9(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L122_unpacking_failed;
+      __pyx_t_5 = PyObject_GetIter(__pyx_t_15); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_5);
+      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+      __pyx_t_8 = Py_TYPE(__pyx_t_5)->tp_iternext;
+      index = 0; __pyx_t_3 = __pyx_t_8(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L136_unpacking_failed;
       __Pyx_GOTREF(__pyx_t_3);
-      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1763; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_9 = NULL;
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      goto __pyx_L123_unpacking_done;
-      __pyx_L122_unpacking_failed:;
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __pyx_t_9 = NULL;
+      index = 1; __pyx_t_7 = __pyx_t_8(__pyx_t_5); if (unlikely(!__pyx_t_7)) goto __pyx_L136_unpacking_failed;
+      __Pyx_GOTREF(__pyx_t_7);
+      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_5), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_8 = NULL;
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      goto __pyx_L137_unpacking_done;
+      __pyx_L136_unpacking_failed:;
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __pyx_t_8 = NULL;
       if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1763; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_L123_unpacking_done:;
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_L137_unpacking_done:;
     }
-    __pyx_v_llcrnrx = __pyx_t_7;
-    __pyx_t_7 = 0;
-    __pyx_v_llcrnry = __pyx_t_3;
+    __pyx_v_llcrnrx = __pyx_t_3;
     __pyx_t_3 = 0;
+    __pyx_v_llcrnry = __pyx_t_7;
+    __pyx_t_7 = 0;
 
-    /* "pygrib.pyx":1764
+    /* "pygrib.pyx":1756
  *             pj = pyproj.Proj(self.projparams)
  *             llcrnrx, llcrnry = pj(lon1,lat1)
  *             try:             # <<<<<<<<<<<<<<
@@ -22219,48 +24242,50 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_38latlons(struct __pyx_obj_6pygr
  *                 ny = self['Ny']
  */
     {
-      __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
-      __Pyx_XGOTREF(__pyx_t_12);
+      __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
       __Pyx_XGOTREF(__pyx_t_11);
       __Pyx_XGOTREF(__pyx_t_10);
+      __Pyx_XGOTREF(__pyx_t_9);
       /*try:*/ {
 
-        /* "pygrib.pyx":1765
+        /* "pygrib.pyx":1757
  *             llcrnrx, llcrnry = pj(lon1,lat1)
  *             try:
  *                 nx = self['Nx']             # <<<<<<<<<<<<<<
  *                 ny = self['Ny']
  *             except:
  */
-        __pyx_t_8 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__Nx)); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1765; __pyx_clineno = __LINE__; goto __pyx_L124_error;}
-        __Pyx_GOTREF(__pyx_t_8);
-        __pyx_v_nx = __pyx_t_8;
-        __pyx_t_8 = 0;
+        __pyx_t_15 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_Nx); if (unlikely(__pyx_t_15 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1757; __pyx_clineno = __LINE__; goto __pyx_L138_error;};
+        __Pyx_GOTREF(__pyx_t_15);
+        __pyx_v_nx = __pyx_t_15;
+        __pyx_t_15 = 0;
 
-        /* "pygrib.pyx":1766
+        /* "pygrib.pyx":1758
  *             try:
  *                 nx = self['Nx']
  *                 ny = self['Ny']             # <<<<<<<<<<<<<<
  *             except:
  *                 nx = self['Ni']
  */
-        __pyx_t_8 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__Ny)); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1766; __pyx_clineno = __LINE__; goto __pyx_L124_error;}
-        __Pyx_GOTREF(__pyx_t_8);
-        __pyx_v_ny = __pyx_t_8;
-        __pyx_t_8 = 0;
+        __pyx_t_15 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_Ny); if (unlikely(__pyx_t_15 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1758; __pyx_clineno = __LINE__; goto __pyx_L138_error;};
+        __Pyx_GOTREF(__pyx_t_15);
+        __pyx_v_ny = __pyx_t_15;
+        __pyx_t_15 = 0;
       }
-      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
       __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
       __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
-      goto __pyx_L131_try_end;
-      __pyx_L124_error:;
-      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
+      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+      goto __pyx_L145_try_end;
+      __pyx_L138_error:;
       __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
+      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+      __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
 
-      /* "pygrib.pyx":1767
+      /* "pygrib.pyx":1759
  *                 nx = self['Nx']
  *                 ny = self['Ny']
  *             except:             # <<<<<<<<<<<<<<
@@ -22269,139 +24294,186 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_38latlons(struct __pyx_obj_6pygr
  */
       /*except:*/ {
         __Pyx_AddTraceback("pygrib.gribmessage.latlons", __pyx_clineno, __pyx_lineno, __pyx_filename);
-        if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_3, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1767; __pyx_clineno = __LINE__; goto __pyx_L126_except_error;}
-        __Pyx_GOTREF(__pyx_t_8);
-        __Pyx_GOTREF(__pyx_t_3);
+        if (__Pyx_GetException(&__pyx_t_15, &__pyx_t_7, &__pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1759; __pyx_clineno = __LINE__; goto __pyx_L140_except_error;}
+        __Pyx_GOTREF(__pyx_t_15);
         __Pyx_GOTREF(__pyx_t_7);
+        __Pyx_GOTREF(__pyx_t_3);
 
-        /* "pygrib.pyx":1768
+        /* "pygrib.pyx":1760
  *                 ny = self['Ny']
  *             except:
  *                 nx = self['Ni']             # <<<<<<<<<<<<<<
  *                 ny = self['Nj']
  *             x = llcrnrx+dx*np.arange(nx)
  */
-        __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__Ni)); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1768; __pyx_clineno = __LINE__; goto __pyx_L126_except_error;}
-        __Pyx_GOTREF(__pyx_t_4);
-        __Pyx_XDECREF_SET(__pyx_v_nx, __pyx_t_4);
-        __pyx_t_4 = 0;
+        __pyx_t_5 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_Ni); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1760; __pyx_clineno = __LINE__; goto __pyx_L140_except_error;};
+        __Pyx_GOTREF(__pyx_t_5);
+        __Pyx_XDECREF_SET(__pyx_v_nx, __pyx_t_5);
+        __pyx_t_5 = 0;
 
-        /* "pygrib.pyx":1769
+        /* "pygrib.pyx":1761
  *             except:
  *                 nx = self['Ni']
  *                 ny = self['Nj']             # <<<<<<<<<<<<<<
  *             x = llcrnrx+dx*np.arange(nx)
  *             y = llcrnry+dy*np.arange(ny)
  */
-        __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__Nj)); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1769; __pyx_clineno = __LINE__; goto __pyx_L126_except_error;}
-        __Pyx_GOTREF(__pyx_t_4);
-        __Pyx_XDECREF_SET(__pyx_v_ny, __pyx_t_4);
-        __pyx_t_4 = 0;
-        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_t_5 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_Nj); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1761; __pyx_clineno = __LINE__; goto __pyx_L140_except_error;};
+        __Pyx_GOTREF(__pyx_t_5);
+        __Pyx_XDECREF_SET(__pyx_v_ny, __pyx_t_5);
+        __pyx_t_5 = 0;
+        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-        goto __pyx_L125_exception_handled;
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        goto __pyx_L139_exception_handled;
       }
-      __pyx_L126_except_error:;
-      __Pyx_XGIVEREF(__pyx_t_12);
+      __pyx_L140_except_error:;
       __Pyx_XGIVEREF(__pyx_t_11);
       __Pyx_XGIVEREF(__pyx_t_10);
-      __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_11, __pyx_t_10);
+      __Pyx_XGIVEREF(__pyx_t_9);
+      __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_10, __pyx_t_9);
       goto __pyx_L1_error;
-      __pyx_L125_exception_handled:;
-      __Pyx_XGIVEREF(__pyx_t_12);
+      __pyx_L139_exception_handled:;
       __Pyx_XGIVEREF(__pyx_t_11);
       __Pyx_XGIVEREF(__pyx_t_10);
-      __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_11, __pyx_t_10);
-      __pyx_L131_try_end:;
+      __Pyx_XGIVEREF(__pyx_t_9);
+      __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_10, __pyx_t_9);
+      __pyx_L145_try_end:;
     }
 
-    /* "pygrib.pyx":1770
+    /* "pygrib.pyx":1762
  *                 nx = self['Ni']
  *                 ny = self['Nj']
  *             x = llcrnrx+dx*np.arange(nx)             # <<<<<<<<<<<<<<
  *             y = llcrnry+dy*np.arange(ny)
  *             x, y = np.meshgrid(x, y)
  */
-    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_7);
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s__arange); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_arange); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_15);
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_INCREF(__pyx_v_nx);
-    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_nx);
-    __Pyx_GIVEREF(__pyx_v_nx);
-    __pyx_t_8 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
+    __pyx_t_7 = NULL;
+    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_15))) {
+      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_15);
+      if (likely(__pyx_t_7)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
+        __Pyx_INCREF(__pyx_t_7);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_15, function);
+      }
+    }
+    if (!__pyx_t_7) {
+      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_15, __pyx_v_nx); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+    } else {
+      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_5);
+      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = NULL;
+      __Pyx_INCREF(__pyx_v_nx);
+      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_nx);
+      __Pyx_GIVEREF(__pyx_v_nx);
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    }
+    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+    __pyx_t_15 = PyNumber_Multiply(__pyx_v_dx, __pyx_t_3); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_15);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
-    __pyx_t_7 = PyNumber_Multiply(__pyx_v_dx, __pyx_t_8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-    __pyx_t_8 = PyNumber_Add(__pyx_v_llcrnrx, __pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __pyx_v_x = __pyx_t_8;
-    __pyx_t_8 = 0;
+    __pyx_t_3 = PyNumber_Add(__pyx_v_llcrnrx, __pyx_t_15); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+    __pyx_v_x = __pyx_t_3;
+    __pyx_t_3 = 0;
 
-    /* "pygrib.pyx":1771
+    /* "pygrib.pyx":1763
  *                 ny = self['Nj']
  *             x = llcrnrx+dx*np.arange(nx)
  *             y = llcrnry+dy*np.arange(ny)             # <<<<<<<<<<<<<<
  *             x, y = np.meshgrid(x, y)
  *             lons, lats = pj(x, y, inverse=True)
  */
-    __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s__arange); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-    __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __Pyx_INCREF(__pyx_v_ny);
-    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_ny);
-    __Pyx_GIVEREF(__pyx_v_ny);
-    __pyx_t_3 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
-    __pyx_t_8 = PyNumber_Multiply(__pyx_v_dy, __pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
+    __pyx_t_15 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1763; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_15);
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_arange); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1763; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+    __pyx_t_15 = NULL;
+    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
+      __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_5);
+      if (likely(__pyx_t_15)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+        __Pyx_INCREF(__pyx_t_15);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_5, function);
+      }
+    }
+    if (!__pyx_t_15) {
+      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_ny); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1763; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+    } else {
+      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1763; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_7);
+      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_15); __Pyx_GIVEREF(__pyx_t_15); __pyx_t_15 = NULL;
+      __Pyx_INCREF(__pyx_v_ny);
+      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_ny);
+      __Pyx_GIVEREF(__pyx_v_ny);
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1763; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    }
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __pyx_t_5 = PyNumber_Multiply(__pyx_v_dy, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1763; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_3 = PyNumber_Add(__pyx_v_llcrnry, __pyx_t_8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = PyNumber_Add(__pyx_v_llcrnry, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1763; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     __pyx_v_y = __pyx_t_3;
     __pyx_t_3 = 0;
 
-    /* "pygrib.pyx":1772
+    /* "pygrib.pyx":1764
  *             x = llcrnrx+dx*np.arange(nx)
  *             y = llcrnry+dy*np.arange(ny)
  *             x, y = np.meshgrid(x, y)             # <<<<<<<<<<<<<<
  *             lons, lats = pj(x, y, inverse=True)
  *         elif self['gridType'] == 'mercator':
  */
-    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__meshgrid); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_meshgrid); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_7);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __pyx_t_5 = NULL;
+    __pyx_t_6 = 0;
+    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
+      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
+      if (likely(__pyx_t_5)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
+        __Pyx_INCREF(__pyx_t_5);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_7, function);
+        __pyx_t_6 = 1;
+      }
+    }
+    __pyx_t_15 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_15);
+    if (__pyx_t_5) {
+      PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
+    }
     __Pyx_INCREF(__pyx_v_x);
-    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_x);
+    PyTuple_SET_ITEM(__pyx_t_15, 0+__pyx_t_6, __pyx_v_x);
     __Pyx_GIVEREF(__pyx_v_x);
     __Pyx_INCREF(__pyx_v_y);
-    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_y);
+    PyTuple_SET_ITEM(__pyx_t_15, 1+__pyx_t_6, __pyx_v_y);
     __Pyx_GIVEREF(__pyx_v_y);
-    __pyx_t_7 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-    if ((likely(PyTuple_CheckExact(__pyx_t_7))) || (PyList_CheckExact(__pyx_t_7))) {
-      PyObject* sequence = __pyx_t_7;
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_15, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
+      PyObject* sequence = __pyx_t_3;
       #if CYTHON_COMPILING_IN_CPYTHON
       Py_ssize_t size = Py_SIZE(sequence);
       #else
@@ -22410,79 +24482,75 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_38latlons(struct __pyx_obj_6pygr
       if (unlikely(size != 2)) {
         if (size > 2) __Pyx_RaiseTooManyValuesError(2);
         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       }
       #if CYTHON_COMPILING_IN_CPYTHON
       if (likely(PyTuple_CheckExact(sequence))) {
-        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
-        __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); 
+        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); 
+        __pyx_t_15 = PyTuple_GET_ITEM(sequence, 1); 
       } else {
-        __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
-        __pyx_t_8 = PyList_GET_ITEM(sequence, 1); 
+        __pyx_t_7 = PyList_GET_ITEM(sequence, 0); 
+        __pyx_t_15 = PyList_GET_ITEM(sequence, 1); 
       }
-      __Pyx_INCREF(__pyx_t_3);
-      __Pyx_INCREF(__pyx_t_8);
+      __Pyx_INCREF(__pyx_t_7);
+      __Pyx_INCREF(__pyx_t_15);
       #else
-      __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
+      __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_7);
+      __pyx_t_15 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_15);
       #endif
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    } else
-    {
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    } else {
       Py_ssize_t index = -1;
-      __pyx_t_4 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      __pyx_t_9 = Py_TYPE(__pyx_t_4)->tp_iternext;
-      index = 0; __pyx_t_3 = __pyx_t_9(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L134_unpacking_failed;
-      __Pyx_GOTREF(__pyx_t_3);
-      index = 1; __pyx_t_8 = __pyx_t_9(__pyx_t_4); if (unlikely(!__pyx_t_8)) goto __pyx_L134_unpacking_failed;
-      __Pyx_GOTREF(__pyx_t_8);
-      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_9 = NULL;
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      goto __pyx_L135_unpacking_done;
-      __pyx_L134_unpacking_failed:;
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __pyx_t_9 = NULL;
+      __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_5);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __pyx_t_8 = Py_TYPE(__pyx_t_5)->tp_iternext;
+      index = 0; __pyx_t_7 = __pyx_t_8(__pyx_t_5); if (unlikely(!__pyx_t_7)) goto __pyx_L148_unpacking_failed;
+      __Pyx_GOTREF(__pyx_t_7);
+      index = 1; __pyx_t_15 = __pyx_t_8(__pyx_t_5); if (unlikely(!__pyx_t_15)) goto __pyx_L148_unpacking_failed;
+      __Pyx_GOTREF(__pyx_t_15);
+      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_5), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_8 = NULL;
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      goto __pyx_L149_unpacking_done;
+      __pyx_L148_unpacking_failed:;
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __pyx_t_8 = NULL;
       if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_L135_unpacking_done:;
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_L149_unpacking_done:;
     }
-    __Pyx_DECREF_SET(__pyx_v_x, __pyx_t_3);
-    __pyx_t_3 = 0;
-    __Pyx_DECREF_SET(__pyx_v_y, __pyx_t_8);
-    __pyx_t_8 = 0;
+    __Pyx_DECREF_SET(__pyx_v_x, __pyx_t_7);
+    __pyx_t_7 = 0;
+    __Pyx_DECREF_SET(__pyx_v_y, __pyx_t_15);
+    __pyx_t_15 = 0;
 
-    /* "pygrib.pyx":1773
+    /* "pygrib.pyx":1765
  *             y = llcrnry+dy*np.arange(ny)
  *             x, y = np.meshgrid(x, y)
  *             lons, lats = pj(x, y, inverse=True)             # <<<<<<<<<<<<<<
  *         elif self['gridType'] == 'mercator':
  *             scale = self._get_key('grib2divider',False)
  */
-    __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
+    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1765; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
     __Pyx_INCREF(__pyx_v_x);
-    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_x);
+    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_x);
     __Pyx_GIVEREF(__pyx_v_x);
     __Pyx_INCREF(__pyx_v_y);
-    PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_y);
+    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_y);
     __Pyx_GIVEREF(__pyx_v_y);
-    __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_8));
-    __pyx_t_3 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    if (PyDict_SetItem(__pyx_t_8, ((PyObject *)__pyx_n_s__inverse), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_15 = PyDict_New(); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1765; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_15);
+    if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_inverse, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1765; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_v_pj, __pyx_t_3, __pyx_t_15); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1765; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_7);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_3 = PyObject_Call(__pyx_v_pj, ((PyObject *)__pyx_t_7), ((PyObject *)__pyx_t_8)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
-    if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
-      PyObject* sequence = __pyx_t_3;
+    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+    if ((likely(PyTuple_CheckExact(__pyx_t_7))) || (PyList_CheckExact(__pyx_t_7))) {
+      PyObject* sequence = __pyx_t_7;
       #if CYTHON_COMPILING_IN_CPYTHON
       Py_ssize_t size = Py_SIZE(sequence);
       #else
@@ -22491,371 +24559,342 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_38latlons(struct __pyx_obj_6pygr
       if (unlikely(size != 2)) {
         if (size > 2) __Pyx_RaiseTooManyValuesError(2);
         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1765; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       }
       #if CYTHON_COMPILING_IN_CPYTHON
       if (likely(PyTuple_CheckExact(sequence))) {
-        __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); 
-        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); 
+        __pyx_t_15 = PyTuple_GET_ITEM(sequence, 0); 
+        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
       } else {
-        __pyx_t_8 = PyList_GET_ITEM(sequence, 0); 
-        __pyx_t_7 = PyList_GET_ITEM(sequence, 1); 
+        __pyx_t_15 = PyList_GET_ITEM(sequence, 0); 
+        __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
       }
-      __Pyx_INCREF(__pyx_t_8);
-      __Pyx_INCREF(__pyx_t_7);
+      __Pyx_INCREF(__pyx_t_15);
+      __Pyx_INCREF(__pyx_t_3);
       #else
-      __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-      __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_7);
+      __pyx_t_15 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1765; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_15);
+      __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1765; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
       #endif
-      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    } else
-    {
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    } else {
       Py_ssize_t index = -1;
-      __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_9 = Py_TYPE(__pyx_t_4)->tp_iternext;
-      index = 0; __pyx_t_8 = __pyx_t_9(__pyx_t_4); if (unlikely(!__pyx_t_8)) goto __pyx_L136_unpacking_failed;
-      __Pyx_GOTREF(__pyx_t_8);
-      index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_4); if (unlikely(!__pyx_t_7)) goto __pyx_L136_unpacking_failed;
-      __Pyx_GOTREF(__pyx_t_7);
-      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_9 = NULL;
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      goto __pyx_L137_unpacking_done;
-      __pyx_L136_unpacking_failed:;
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __pyx_t_9 = NULL;
+      __pyx_t_5 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1765; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_5);
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+      __pyx_t_8 = Py_TYPE(__pyx_t_5)->tp_iternext;
+      index = 0; __pyx_t_15 = __pyx_t_8(__pyx_t_5); if (unlikely(!__pyx_t_15)) goto __pyx_L150_unpacking_failed;
+      __Pyx_GOTREF(__pyx_t_15);
+      index = 1; __pyx_t_3 = __pyx_t_8(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L150_unpacking_failed;
+      __Pyx_GOTREF(__pyx_t_3);
+      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_5), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1765; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_8 = NULL;
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      goto __pyx_L151_unpacking_done;
+      __pyx_L150_unpacking_failed:;
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __pyx_t_8 = NULL;
       if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_L137_unpacking_done:;
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1765; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_L151_unpacking_done:;
     }
-    __pyx_v_lons = __pyx_t_8;
-    __pyx_t_8 = 0;
-    __pyx_v_lats = __pyx_t_7;
-    __pyx_t_7 = 0;
+    __pyx_v_lons = __pyx_t_15;
+    __pyx_t_15 = 0;
+    __pyx_v_lats = __pyx_t_3;
+    __pyx_t_3 = 0;
     goto __pyx_L4;
   }
 
-  /* "pygrib.pyx":1774
+  /* "pygrib.pyx":1766
  *             x, y = np.meshgrid(x, y)
  *             lons, lats = pj(x, y, inverse=True)
  *         elif self['gridType'] == 'mercator':             # <<<<<<<<<<<<<<
  *             scale = self._get_key('grib2divider',False)
  *             if scale:
  */
-  __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__gridType)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_7 = PyObject_RichCompare(__pyx_t_3, ((PyObject *)__pyx_n_s__mercator), Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_gridType); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1766; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+  __Pyx_GOTREF(__pyx_t_7);
+  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_7, __pyx_n_s_mercator, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  if (__pyx_t_2) {
+  if (__pyx_t_1) {
 
-    /* "pygrib.pyx":1775
+    /* "pygrib.pyx":1767
  *             lons, lats = pj(x, y, inverse=True)
  *         elif self['gridType'] == 'mercator':
  *             scale = self._get_key('grib2divider',False)             # <<<<<<<<<<<<<<
  *             if scale:
  *                 scale = float(scale)
  */
-    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s___get_key); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_key); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_7);
-    __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __Pyx_INCREF(((PyObject *)__pyx_n_s__grib2divider));
-    PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_n_s__grib2divider));
-    __Pyx_GIVEREF(((PyObject *)__pyx_n_s__grib2divider));
-    PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_3);
-    __Pyx_GIVEREF(__pyx_t_3);
-    __pyx_t_3 = 0;
-    __pyx_t_3 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__96, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
     __pyx_v_scale = __pyx_t_3;
     __pyx_t_3 = 0;
 
-    /* "pygrib.pyx":1776
+    /* "pygrib.pyx":1768
  *         elif self['gridType'] == 'mercator':
  *             scale = self._get_key('grib2divider',False)
  *             if scale:             # <<<<<<<<<<<<<<
  *                 scale = float(scale)
  *             else:
  */
-    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_scale); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    if (__pyx_t_2) {
+    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_scale); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (__pyx_t_1) {
 
-      /* "pygrib.pyx":1777
+      /* "pygrib.pyx":1769
  *             scale = self._get_key('grib2divider',False)
  *             if scale:
  *                 scale = float(scale)             # <<<<<<<<<<<<<<
  *             else:
  *                 scale = 1000.
  */
-      __pyx_t_13 = __Pyx_PyObject_AsDouble(__pyx_v_scale); if (unlikely(__pyx_t_13 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_3 = PyFloat_FromDouble(__pyx_t_13); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_12 = __Pyx_PyObject_AsDouble(__pyx_v_scale); if (unlikely(__pyx_t_12 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyFloat_FromDouble(__pyx_t_12); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_DECREF_SET(__pyx_v_scale, __pyx_t_3);
       __pyx_t_3 = 0;
-      goto __pyx_L138;
+      goto __pyx_L152;
     }
     /*else*/ {
 
-      /* "pygrib.pyx":1779
+      /* "pygrib.pyx":1771
  *                 scale = float(scale)
  *             else:
  *                 scale = 1000.             # <<<<<<<<<<<<<<
  *             lon1 = self['longitudeOfFirstGridPoint']/scale
  *             lon2 = self['longitudeOfLastGridPoint']/scale
  */
-      __pyx_t_3 = PyFloat_FromDouble(1000.); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __Pyx_DECREF_SET(__pyx_v_scale, __pyx_t_3);
-      __pyx_t_3 = 0;
+      __Pyx_INCREF(__pyx_float_1000_);
+      __Pyx_DECREF_SET(__pyx_v_scale, __pyx_float_1000_);
     }
-    __pyx_L138:;
+    __pyx_L152:;
 
-    /* "pygrib.pyx":1780
+    /* "pygrib.pyx":1772
  *             else:
  *                 scale = 1000.
  *             lon1 = self['longitudeOfFirstGridPoint']/scale             # <<<<<<<<<<<<<<
  *             lon2 = self['longitudeOfLastGridPoint']/scale
  *             if self._get_key('truncateDegrees',False):
  */
-    __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s_163)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_longitudeOfFirstGridPoint); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1772; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
     __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_8 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_v_scale); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
+    __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_v_scale); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_7);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_v_lon1 = __pyx_t_8;
-    __pyx_t_8 = 0;
+    __pyx_v_lon1 = __pyx_t_7;
+    __pyx_t_7 = 0;
 
-    /* "pygrib.pyx":1781
+    /* "pygrib.pyx":1773
  *                 scale = 1000.
  *             lon1 = self['longitudeOfFirstGridPoint']/scale
  *             lon2 = self['longitudeOfLastGridPoint']/scale             # <<<<<<<<<<<<<<
  *             if self._get_key('truncateDegrees',False):
  *                 lon1 = int(lon1)
  */
-    __pyx_t_8 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s_164)); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_8, __pyx_v_scale); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_longitudeOfLastGridPoint); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1773; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_7);
+    __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_7, __pyx_v_scale); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
     __pyx_v_lon2 = __pyx_t_3;
     __pyx_t_3 = 0;
 
-    /* "pygrib.pyx":1782
+    /* "pygrib.pyx":1774
  *             lon1 = self['longitudeOfFirstGridPoint']/scale
  *             lon2 = self['longitudeOfLastGridPoint']/scale
  *             if self._get_key('truncateDegrees',False):             # <<<<<<<<<<<<<<
  *                 lon1 = int(lon1)
  *                 lon2 = int(lon2)
  */
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s___get_key); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_key); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_8 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__97, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_INCREF(((PyObject *)__pyx_n_s__truncateDegrees));
-    PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_n_s__truncateDegrees));
-    __Pyx_GIVEREF(((PyObject *)__pyx_n_s__truncateDegrees));
-    PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_8);
-    __Pyx_GIVEREF(__pyx_t_8);
-    __pyx_t_8 = 0;
-    __pyx_t_8 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
-    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-    if (__pyx_t_2) {
+    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    if (__pyx_t_1) {
 
-      /* "pygrib.pyx":1783
+      /* "pygrib.pyx":1775
  *             lon2 = self['longitudeOfLastGridPoint']/scale
  *             if self._get_key('truncateDegrees',False):
  *                 lon1 = int(lon1)             # <<<<<<<<<<<<<<
  *                 lon2 = int(lon2)
  *             lat1 = self['latitudeOfFirstGridPoint']/scale
  */
-      __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-      __Pyx_INCREF(__pyx_v_lon1);
-      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_lon1);
-      __Pyx_GIVEREF(__pyx_v_lon1);
-      __pyx_t_7 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_7 = PyNumber_Int(__pyx_v_lon1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_7);
-      __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
       __Pyx_DECREF_SET(__pyx_v_lon1, __pyx_t_7);
       __pyx_t_7 = 0;
 
-      /* "pygrib.pyx":1784
+      /* "pygrib.pyx":1776
  *             if self._get_key('truncateDegrees',False):
  *                 lon1 = int(lon1)
  *                 lon2 = int(lon2)             # <<<<<<<<<<<<<<
  *             lat1 = self['latitudeOfFirstGridPoint']/scale
  *             lat2 = self['latitudeOfLastGridPoint']/scale
  */
-      __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_7 = PyNumber_Int(__pyx_v_lon2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_7);
-      __Pyx_INCREF(__pyx_v_lon2);
-      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_lon2);
-      __Pyx_GIVEREF(__pyx_v_lon2);
-      __pyx_t_8 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-      __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
-      __Pyx_DECREF_SET(__pyx_v_lon2, __pyx_t_8);
-      __pyx_t_8 = 0;
-      goto __pyx_L139;
+      __Pyx_DECREF_SET(__pyx_v_lon2, __pyx_t_7);
+      __pyx_t_7 = 0;
+      goto __pyx_L153;
     }
-    __pyx_L139:;
+    __pyx_L153:;
 
-    /* "pygrib.pyx":1785
+    /* "pygrib.pyx":1777
  *                 lon1 = int(lon1)
  *                 lon2 = int(lon2)
  *             lat1 = self['latitudeOfFirstGridPoint']/scale             # <<<<<<<<<<<<<<
  *             lat2 = self['latitudeOfLastGridPoint']/scale
  *             if self._get_key('truncateDegrees',False):
  */
-    __pyx_t_8 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s_180)); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_t_8, __pyx_v_scale); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_latitudeOfFirstGridPoint); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1777; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
     __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-    __pyx_v_lat1 = __pyx_t_7;
-    __pyx_t_7 = 0;
+    __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_7, __pyx_v_scale); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __pyx_v_lat1 = __pyx_t_3;
+    __pyx_t_3 = 0;
 
-    /* "pygrib.pyx":1786
+    /* "pygrib.pyx":1778
  *                 lon2 = int(lon2)
  *             lat1 = self['latitudeOfFirstGridPoint']/scale
  *             lat2 = self['latitudeOfLastGridPoint']/scale             # <<<<<<<<<<<<<<
  *             if self._get_key('truncateDegrees',False):
  *                 lat1 = int(lat1)
  */
-    __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s_181)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1786; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_latitudeOfLastGridPoint); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1778; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_v_scale); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_7);
-    __pyx_t_8 = __Pyx_PyNumber_Divide(__pyx_t_7, __pyx_v_scale); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1786; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __pyx_v_lat2 = __pyx_t_8;
-    __pyx_t_8 = 0;
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_v_lat2 = __pyx_t_7;
+    __pyx_t_7 = 0;
 
-    /* "pygrib.pyx":1787
+    /* "pygrib.pyx":1779
  *             lat1 = self['latitudeOfFirstGridPoint']/scale
  *             lat2 = self['latitudeOfLastGridPoint']/scale
  *             if self._get_key('truncateDegrees',False):             # <<<<<<<<<<<<<<
  *                 lat1 = int(lat1)
  *                 lat2 = int(lat2)
  */
-    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s___get_key); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __pyx_t_7 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_key); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_7);
-    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__98, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_INCREF(((PyObject *)__pyx_n_s__truncateDegrees));
-    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_n_s__truncateDegrees));
-    __Pyx_GIVEREF(((PyObject *)__pyx_n_s__truncateDegrees));
-    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_7);
-    __Pyx_GIVEREF(__pyx_t_7);
-    __pyx_t_7 = 0;
-    __pyx_t_7 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    if (__pyx_t_2) {
+    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    if (__pyx_t_1) {
 
-      /* "pygrib.pyx":1788
+      /* "pygrib.pyx":1780
  *             lat2 = self['latitudeOfLastGridPoint']/scale
  *             if self._get_key('truncateDegrees',False):
  *                 lat1 = int(lat1)             # <<<<<<<<<<<<<<
  *                 lat2 = int(lat2)
  *             pj = pyproj.Proj(self.projparams)
  */
-      __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_7);
-      __Pyx_INCREF(__pyx_v_lat1);
-      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_lat1);
-      __Pyx_GIVEREF(__pyx_v_lat1);
-      __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyNumber_Int(__pyx_v_lat1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_3);
-      __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
       __Pyx_DECREF_SET(__pyx_v_lat1, __pyx_t_3);
       __pyx_t_3 = 0;
 
-      /* "pygrib.pyx":1789
+      /* "pygrib.pyx":1781
  *             if self._get_key('truncateDegrees',False):
  *                 lat1 = int(lat1)
  *                 lat2 = int(lat2)             # <<<<<<<<<<<<<<
  *             pj = pyproj.Proj(self.projparams)
  *             llcrnrx, llcrnry = pj(lon1,lat1)
  */
-      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyNumber_Int(__pyx_v_lat2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_3);
-      __Pyx_INCREF(__pyx_v_lat2);
-      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_lat2);
-      __Pyx_GIVEREF(__pyx_v_lat2);
-      __pyx_t_7 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_7);
-      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-      __Pyx_DECREF_SET(__pyx_v_lat2, __pyx_t_7);
-      __pyx_t_7 = 0;
-      goto __pyx_L140;
+      __Pyx_DECREF_SET(__pyx_v_lat2, __pyx_t_3);
+      __pyx_t_3 = 0;
+      goto __pyx_L154;
     }
-    __pyx_L140:;
+    __pyx_L154:;
 
-    /* "pygrib.pyx":1790
+    /* "pygrib.pyx":1782
  *                 lat1 = int(lat1)
  *                 lat2 = int(lat2)
  *             pj = pyproj.Proj(self.projparams)             # <<<<<<<<<<<<<<
  *             llcrnrx, llcrnry = pj(lon1,lat1)
  *             urcrnrx, urcrnry = pj(lon2,lat2)
  */
-    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s__pyproj); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyproj); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_7);
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s__Proj); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_Proj); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_15);
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_INCREF(__pyx_v_self->projparams);
-    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_self->projparams);
-    __Pyx_GIVEREF(__pyx_v_self->projparams);
-    __pyx_t_8 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
-    __pyx_v_pj = __pyx_t_8;
-    __pyx_t_8 = 0;
+    __pyx_t_7 = NULL;
+    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_15))) {
+      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_15);
+      if (likely(__pyx_t_7)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
+        __Pyx_INCREF(__pyx_t_7);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_15, function);
+      }
+    }
+    if (!__pyx_t_7) {
+      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_15, __pyx_v_self->projparams); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+    } else {
+      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_5);
+      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = NULL;
+      __Pyx_INCREF(__pyx_v_self->projparams);
+      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_self->projparams);
+      __Pyx_GIVEREF(__pyx_v_self->projparams);
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    }
+    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+    __pyx_v_pj = __pyx_t_3;
+    __pyx_t_3 = 0;
 
-    /* "pygrib.pyx":1791
+    /* "pygrib.pyx":1783
  *                 lat2 = int(lat2)
  *             pj = pyproj.Proj(self.projparams)
  *             llcrnrx, llcrnry = pj(lon1,lat1)             # <<<<<<<<<<<<<<
  *             urcrnrx, urcrnry = pj(lon2,lat2)
  *             try:
  */
-    __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
+    __Pyx_INCREF(__pyx_v_pj);
+    __pyx_t_15 = __pyx_v_pj; __pyx_t_5 = NULL;
+    __pyx_t_6 = 0;
+    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_15))) {
+      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_15);
+      if (likely(__pyx_t_5)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
+        __Pyx_INCREF(__pyx_t_5);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_15, function);
+        __pyx_t_6 = 1;
+      }
+    }
+    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_7);
+    if (__pyx_t_5) {
+      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
+    }
     __Pyx_INCREF(__pyx_v_lon1);
-    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_lon1);
+    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_lon1);
     __Pyx_GIVEREF(__pyx_v_lon1);
     __Pyx_INCREF(__pyx_v_lat1);
-    PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_lat1);
+    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_lat1);
     __Pyx_GIVEREF(__pyx_v_lat1);
-    __pyx_t_7 = PyObject_Call(__pyx_v_pj, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
-    if ((likely(PyTuple_CheckExact(__pyx_t_7))) || (PyList_CheckExact(__pyx_t_7))) {
-      PyObject* sequence = __pyx_t_7;
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+    if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
+      PyObject* sequence = __pyx_t_3;
       #if CYTHON_COMPILING_IN_CPYTHON
       Py_ssize_t size = Py_SIZE(sequence);
       #else
@@ -22864,70 +24903,86 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_38latlons(struct __pyx_obj_6pygr
       if (unlikely(size != 2)) {
         if (size > 2) __Pyx_RaiseTooManyValuesError(2);
         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       }
       #if CYTHON_COMPILING_IN_CPYTHON
       if (likely(PyTuple_CheckExact(sequence))) {
-        __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); 
-        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
+        __pyx_t_15 = PyTuple_GET_ITEM(sequence, 0); 
+        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); 
       } else {
-        __pyx_t_8 = PyList_GET_ITEM(sequence, 0); 
-        __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
+        __pyx_t_15 = PyList_GET_ITEM(sequence, 0); 
+        __pyx_t_7 = PyList_GET_ITEM(sequence, 1); 
       }
-      __Pyx_INCREF(__pyx_t_8);
-      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(__pyx_t_15);
+      __Pyx_INCREF(__pyx_t_7);
       #else
-      __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-      __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_15 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_15);
+      __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_7);
       #endif
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    } else
-    {
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    } else {
       Py_ssize_t index = -1;
-      __pyx_t_4 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      __pyx_t_9 = Py_TYPE(__pyx_t_4)->tp_iternext;
-      index = 0; __pyx_t_8 = __pyx_t_9(__pyx_t_4); if (unlikely(!__pyx_t_8)) goto __pyx_L141_unpacking_failed;
-      __Pyx_GOTREF(__pyx_t_8);
-      index = 1; __pyx_t_3 = __pyx_t_9(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L141_unpacking_failed;
-      __Pyx_GOTREF(__pyx_t_3);
-      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_9 = NULL;
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      goto __pyx_L142_unpacking_done;
-      __pyx_L141_unpacking_failed:;
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __pyx_t_9 = NULL;
+      __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_5);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __pyx_t_8 = Py_TYPE(__pyx_t_5)->tp_iternext;
+      index = 0; __pyx_t_15 = __pyx_t_8(__pyx_t_5); if (unlikely(!__pyx_t_15)) goto __pyx_L155_unpacking_failed;
+      __Pyx_GOTREF(__pyx_t_15);
+      index = 1; __pyx_t_7 = __pyx_t_8(__pyx_t_5); if (unlikely(!__pyx_t_7)) goto __pyx_L155_unpacking_failed;
+      __Pyx_GOTREF(__pyx_t_7);
+      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_5), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_8 = NULL;
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      goto __pyx_L156_unpacking_done;
+      __pyx_L155_unpacking_failed:;
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __pyx_t_8 = NULL;
       if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_L142_unpacking_done:;
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_L156_unpacking_done:;
     }
-    __pyx_v_llcrnrx = __pyx_t_8;
-    __pyx_t_8 = 0;
-    __pyx_v_llcrnry = __pyx_t_3;
-    __pyx_t_3 = 0;
+    __pyx_v_llcrnrx = __pyx_t_15;
+    __pyx_t_15 = 0;
+    __pyx_v_llcrnry = __pyx_t_7;
+    __pyx_t_7 = 0;
 
-    /* "pygrib.pyx":1792
+    /* "pygrib.pyx":1784
  *             pj = pyproj.Proj(self.projparams)
  *             llcrnrx, llcrnry = pj(lon1,lat1)
  *             urcrnrx, urcrnry = pj(lon2,lat2)             # <<<<<<<<<<<<<<
  *             try:
  *                 nx = self['Nx']
  */
-    __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
+    __Pyx_INCREF(__pyx_v_pj);
+    __pyx_t_7 = __pyx_v_pj; __pyx_t_15 = NULL;
+    __pyx_t_6 = 0;
+    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
+      __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_7);
+      if (likely(__pyx_t_15)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
+        __Pyx_INCREF(__pyx_t_15);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_7, function);
+        __pyx_t_6 = 1;
+      }
+    }
+    __pyx_t_5 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    if (__pyx_t_15) {
+      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_15); __Pyx_GIVEREF(__pyx_t_15); __pyx_t_15 = NULL;
+    }
     __Pyx_INCREF(__pyx_v_lon2);
-    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_lon2);
+    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_6, __pyx_v_lon2);
     __Pyx_GIVEREF(__pyx_v_lon2);
     __Pyx_INCREF(__pyx_v_lat2);
-    PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_lat2);
+    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_6, __pyx_v_lat2);
     __Pyx_GIVEREF(__pyx_v_lat2);
-    __pyx_t_3 = PyObject_Call(__pyx_v_pj, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
     if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
       PyObject* sequence = __pyx_t_3;
       #if CYTHON_COMPILING_IN_CPYTHON
@@ -22938,53 +24993,52 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_38latlons(struct __pyx_obj_6pygr
       if (unlikely(size != 2)) {
         if (size > 2) __Pyx_RaiseTooManyValuesError(2);
         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       }
       #if CYTHON_COMPILING_IN_CPYTHON
       if (likely(PyTuple_CheckExact(sequence))) {
         __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); 
-        __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); 
+        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
       } else {
         __pyx_t_7 = PyList_GET_ITEM(sequence, 0); 
-        __pyx_t_8 = PyList_GET_ITEM(sequence, 1); 
+        __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
       }
       __Pyx_INCREF(__pyx_t_7);
-      __Pyx_INCREF(__pyx_t_8);
+      __Pyx_INCREF(__pyx_t_5);
       #else
-      __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_7);
-      __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
+      __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_5);
       #endif
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    } else
-    {
+    } else {
       Py_ssize_t index = -1;
-      __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_15 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_15);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_9 = Py_TYPE(__pyx_t_4)->tp_iternext;
-      index = 0; __pyx_t_7 = __pyx_t_9(__pyx_t_4); if (unlikely(!__pyx_t_7)) goto __pyx_L143_unpacking_failed;
+      __pyx_t_8 = Py_TYPE(__pyx_t_15)->tp_iternext;
+      index = 0; __pyx_t_7 = __pyx_t_8(__pyx_t_15); if (unlikely(!__pyx_t_7)) goto __pyx_L157_unpacking_failed;
       __Pyx_GOTREF(__pyx_t_7);
-      index = 1; __pyx_t_8 = __pyx_t_9(__pyx_t_4); if (unlikely(!__pyx_t_8)) goto __pyx_L143_unpacking_failed;
-      __Pyx_GOTREF(__pyx_t_8);
-      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_9 = NULL;
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      goto __pyx_L144_unpacking_done;
-      __pyx_L143_unpacking_failed:;
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __pyx_t_9 = NULL;
+      index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_15); if (unlikely(!__pyx_t_5)) goto __pyx_L157_unpacking_failed;
+      __Pyx_GOTREF(__pyx_t_5);
+      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_15), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_8 = NULL;
+      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+      goto __pyx_L158_unpacking_done;
+      __pyx_L157_unpacking_failed:;
+      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+      __pyx_t_8 = NULL;
       if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_L144_unpacking_done:;
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_L158_unpacking_done:;
     }
     __pyx_v_urcrnrx = __pyx_t_7;
     __pyx_t_7 = 0;
-    __pyx_v_urcrnry = __pyx_t_8;
-    __pyx_t_8 = 0;
+    __pyx_v_urcrnry = __pyx_t_5;
+    __pyx_t_5 = 0;
 
-    /* "pygrib.pyx":1793
+    /* "pygrib.pyx":1785
  *             llcrnrx, llcrnry = pj(lon1,lat1)
  *             urcrnrx, urcrnry = pj(lon2,lat2)
  *             try:             # <<<<<<<<<<<<<<
@@ -22992,48 +25046,50 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_38latlons(struct __pyx_obj_6pygr
  *                 ny = self['Ny']
  */
     {
-      __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
+      __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
+      __Pyx_XGOTREF(__pyx_t_9);
       __Pyx_XGOTREF(__pyx_t_10);
       __Pyx_XGOTREF(__pyx_t_11);
-      __Pyx_XGOTREF(__pyx_t_12);
       /*try:*/ {
 
-        /* "pygrib.pyx":1794
+        /* "pygrib.pyx":1786
  *             urcrnrx, urcrnry = pj(lon2,lat2)
  *             try:
  *                 nx = self['Nx']             # <<<<<<<<<<<<<<
  *                 ny = self['Ny']
  *             except:
  */
-        __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__Nx)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1794; __pyx_clineno = __LINE__; goto __pyx_L145_error;}
+        __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_Nx); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1786; __pyx_clineno = __LINE__; goto __pyx_L159_error;};
         __Pyx_GOTREF(__pyx_t_3);
         __pyx_v_nx = __pyx_t_3;
         __pyx_t_3 = 0;
 
-        /* "pygrib.pyx":1795
+        /* "pygrib.pyx":1787
  *             try:
  *                 nx = self['Nx']
  *                 ny = self['Ny']             # <<<<<<<<<<<<<<
  *             except:
  *                 nx = self['Ni']
  */
-        __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__Ny)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1795; __pyx_clineno = __LINE__; goto __pyx_L145_error;}
+        __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_Ny); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1787; __pyx_clineno = __LINE__; goto __pyx_L159_error;};
         __Pyx_GOTREF(__pyx_t_3);
         __pyx_v_ny = __pyx_t_3;
         __pyx_t_3 = 0;
       }
+      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
       __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
       __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
-      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
-      goto __pyx_L152_try_end;
-      __pyx_L145_error:;
-      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
+      goto __pyx_L166_try_end;
+      __pyx_L159_error:;
       __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
+      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
+      __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
       __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
-      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
 
-      /* "pygrib.pyx":1796
+      /* "pygrib.pyx":1788
  *                 nx = self['Nx']
  *                 ny = self['Ny']
  *             except:             # <<<<<<<<<<<<<<
@@ -23042,173 +25098,220 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_38latlons(struct __pyx_obj_6pygr
  */
       /*except:*/ {
         __Pyx_AddTraceback("pygrib.gribmessage.latlons", __pyx_clineno, __pyx_lineno, __pyx_filename);
-        if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_8, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1796; __pyx_clineno = __LINE__; goto __pyx_L147_except_error;}
+        if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_5, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1788; __pyx_clineno = __LINE__; goto __pyx_L161_except_error;}
         __Pyx_GOTREF(__pyx_t_3);
-        __Pyx_GOTREF(__pyx_t_8);
+        __Pyx_GOTREF(__pyx_t_5);
         __Pyx_GOTREF(__pyx_t_7);
 
-        /* "pygrib.pyx":1797
+        /* "pygrib.pyx":1789
  *                 ny = self['Ny']
  *             except:
  *                 nx = self['Ni']             # <<<<<<<<<<<<<<
  *                 ny = self['Nj']
  *             dx = (urcrnrx-llcrnrx)/(nx-1)
  */
-        __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__Ni)); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __pyx_L147_except_error;}
-        __Pyx_GOTREF(__pyx_t_4);
-        __Pyx_XDECREF_SET(__pyx_v_nx, __pyx_t_4);
-        __pyx_t_4 = 0;
+        __pyx_t_15 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_Ni); if (unlikely(__pyx_t_15 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1789; __pyx_clineno = __LINE__; goto __pyx_L161_except_error;};
+        __Pyx_GOTREF(__pyx_t_15);
+        __Pyx_XDECREF_SET(__pyx_v_nx, __pyx_t_15);
+        __pyx_t_15 = 0;
 
-        /* "pygrib.pyx":1798
+        /* "pygrib.pyx":1790
  *             except:
  *                 nx = self['Ni']
  *                 ny = self['Nj']             # <<<<<<<<<<<<<<
  *             dx = (urcrnrx-llcrnrx)/(nx-1)
  *             dy = (urcrnry-llcrnry)/(ny-1)
  */
-        __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__Nj)); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1798; __pyx_clineno = __LINE__; goto __pyx_L147_except_error;}
-        __Pyx_GOTREF(__pyx_t_4);
-        __Pyx_XDECREF_SET(__pyx_v_ny, __pyx_t_4);
-        __pyx_t_4 = 0;
+        __pyx_t_15 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_Nj); if (unlikely(__pyx_t_15 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1790; __pyx_clineno = __LINE__; goto __pyx_L161_except_error;};
+        __Pyx_GOTREF(__pyx_t_15);
+        __Pyx_XDECREF_SET(__pyx_v_ny, __pyx_t_15);
+        __pyx_t_15 = 0;
         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-        goto __pyx_L146_exception_handled;
+        goto __pyx_L160_exception_handled;
       }
-      __pyx_L147_except_error:;
+      __pyx_L161_except_error:;
+      __Pyx_XGIVEREF(__pyx_t_9);
       __Pyx_XGIVEREF(__pyx_t_10);
       __Pyx_XGIVEREF(__pyx_t_11);
-      __Pyx_XGIVEREF(__pyx_t_12);
-      __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
+      __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
       goto __pyx_L1_error;
-      __pyx_L146_exception_handled:;
+      __pyx_L160_exception_handled:;
+      __Pyx_XGIVEREF(__pyx_t_9);
       __Pyx_XGIVEREF(__pyx_t_10);
       __Pyx_XGIVEREF(__pyx_t_11);
-      __Pyx_XGIVEREF(__pyx_t_12);
-      __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
-      __pyx_L152_try_end:;
+      __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
+      __pyx_L166_try_end:;
     }
 
-    /* "pygrib.pyx":1799
+    /* "pygrib.pyx":1791
  *                 nx = self['Ni']
  *                 ny = self['Nj']
  *             dx = (urcrnrx-llcrnrx)/(nx-1)             # <<<<<<<<<<<<<<
  *             dy = (urcrnry-llcrnry)/(ny-1)
  *             x = llcrnrx+dx*np.arange(nx)
  */
-    __pyx_t_7 = PyNumber_Subtract(__pyx_v_urcrnrx, __pyx_v_llcrnrx); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_7 = PyNumber_Subtract(__pyx_v_urcrnrx, __pyx_v_llcrnrx); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_7);
-    __pyx_t_8 = PyNumber_Subtract(__pyx_v_nx, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_5 = PyNumber_Subtract(__pyx_v_nx, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     __pyx_v_dx = __pyx_t_3;
     __pyx_t_3 = 0;
 
-    /* "pygrib.pyx":1800
+    /* "pygrib.pyx":1792
  *                 ny = self['Nj']
  *             dx = (urcrnrx-llcrnrx)/(nx-1)
  *             dy = (urcrnry-llcrnry)/(ny-1)             # <<<<<<<<<<<<<<
  *             x = llcrnrx+dx*np.arange(nx)
  *             y = llcrnry+dy*np.arange(ny)
  */
-    __pyx_t_3 = PyNumber_Subtract(__pyx_v_urcrnry, __pyx_v_llcrnry); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = PyNumber_Subtract(__pyx_v_urcrnry, __pyx_v_llcrnry); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_8 = PyNumber_Subtract(__pyx_v_ny, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_5 = PyNumber_Subtract(__pyx_v_ny, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_7);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     __pyx_v_dy = __pyx_t_7;
     __pyx_t_7 = 0;
 
-    /* "pygrib.pyx":1801
+    /* "pygrib.pyx":1793
  *             dx = (urcrnrx-llcrnrx)/(nx-1)
  *             dy = (urcrnry-llcrnry)/(ny-1)
  *             x = llcrnrx+dx*np.arange(nx)             # <<<<<<<<<<<<<<
  *             y = llcrnry+dy*np.arange(ny)
  *             x, y = np.meshgrid(x, y)
  */
-    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s__arange); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_INCREF(__pyx_v_nx);
-    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_nx);
-    __Pyx_GIVEREF(__pyx_v_nx);
-    __pyx_t_3 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_arange); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
-    __pyx_t_7 = PyNumber_Multiply(__pyx_v_dx, __pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __pyx_t_5 = NULL;
+    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
+      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
+      if (likely(__pyx_t_5)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+        __Pyx_INCREF(__pyx_t_5);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_3, function);
+      }
+    }
+    if (!__pyx_t_5) {
+      __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_nx); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_7);
+    } else {
+      __pyx_t_15 = PyTuple_New(1+1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_15);
+      PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
+      __Pyx_INCREF(__pyx_v_nx);
+      PyTuple_SET_ITEM(__pyx_t_15, 0+1, __pyx_v_nx);
+      __Pyx_GIVEREF(__pyx_v_nx);
+      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_15, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_7);
+      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+    }
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_3 = PyNumber_Add(__pyx_v_llcrnrx, __pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = PyNumber_Multiply(__pyx_v_dx, __pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __pyx_v_x = __pyx_t_3;
-    __pyx_t_3 = 0;
+    __pyx_t_7 = PyNumber_Add(__pyx_v_llcrnrx, __pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_7);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_v_x = __pyx_t_7;
+    __pyx_t_7 = 0;
 
-    /* "pygrib.pyx":1802
+    /* "pygrib.pyx":1794
  *             dy = (urcrnry-llcrnry)/(ny-1)
  *             x = llcrnrx+dx*np.arange(nx)
  *             y = llcrnry+dy*np.arange(ny)             # <<<<<<<<<<<<<<
  *             x, y = np.meshgrid(x, y)
  *             lons, lats = pj(x, y, inverse=True)
  */
-    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__arange); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
+    __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_arange); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_15);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_INCREF(__pyx_v_ny);
-    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_ny);
-    __Pyx_GIVEREF(__pyx_v_ny);
-    __pyx_t_8 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
+    __pyx_t_3 = NULL;
+    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_15))) {
+      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_15);
+      if (likely(__pyx_t_3)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
+        __Pyx_INCREF(__pyx_t_3);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_15, function);
+      }
+    }
+    if (!__pyx_t_3) {
+      __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_15, __pyx_v_ny); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_7);
+    } else {
+      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_5);
+      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
+      __Pyx_INCREF(__pyx_v_ny);
+      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_ny);
+      __Pyx_GIVEREF(__pyx_v_ny);
+      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_5, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_7);
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    }
+    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+    __pyx_t_15 = PyNumber_Multiply(__pyx_v_dy, __pyx_t_7); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_15);
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-    __pyx_t_3 = PyNumber_Multiply(__pyx_v_dy, __pyx_t_8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-    __pyx_t_8 = PyNumber_Add(__pyx_v_llcrnry, __pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_v_y = __pyx_t_8;
-    __pyx_t_8 = 0;
+    __pyx_t_7 = PyNumber_Add(__pyx_v_llcrnry, __pyx_t_15); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_7);
+    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+    __pyx_v_y = __pyx_t_7;
+    __pyx_t_7 = 0;
 
-    /* "pygrib.pyx":1803
+    /* "pygrib.pyx":1795
  *             x = llcrnrx+dx*np.arange(nx)
  *             y = llcrnry+dy*np.arange(ny)
  *             x, y = np.meshgrid(x, y)             # <<<<<<<<<<<<<<
  *             lons, lats = pj(x, y, inverse=True)
  *         elif self['gridType'] in ['rotated_ll','rotated_gg']:
  */
-    __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s__meshgrid); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_15 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_15);
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_meshgrid); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+    __pyx_t_15 = NULL;
+    __pyx_t_6 = 0;
+    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
+      __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_5);
+      if (likely(__pyx_t_15)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+        __Pyx_INCREF(__pyx_t_15);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_5, function);
+        __pyx_t_6 = 1;
+      }
+    }
+    __pyx_t_3 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-    __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
+    if (__pyx_t_15) {
+      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_15); __Pyx_GIVEREF(__pyx_t_15); __pyx_t_15 = NULL;
+    }
     __Pyx_INCREF(__pyx_v_x);
-    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_x);
+    PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_6, __pyx_v_x);
     __Pyx_GIVEREF(__pyx_v_x);
     __Pyx_INCREF(__pyx_v_y);
-    PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_y);
+    PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_6, __pyx_v_y);
     __Pyx_GIVEREF(__pyx_v_y);
-    __pyx_t_7 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_7);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     if ((likely(PyTuple_CheckExact(__pyx_t_7))) || (PyList_CheckExact(__pyx_t_7))) {
       PyObject* sequence = __pyx_t_7;
       #if CYTHON_COMPILING_IN_CPYTHON
@@ -23219,60 +25322,59 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_38latlons(struct __pyx_obj_6pygr
       if (unlikely(size != 2)) {
         if (size > 2) __Pyx_RaiseTooManyValuesError(2);
         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       }
       #if CYTHON_COMPILING_IN_CPYTHON
       if (likely(PyTuple_CheckExact(sequence))) {
-        __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); 
+        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
         __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
       } else {
-        __pyx_t_8 = PyList_GET_ITEM(sequence, 0); 
+        __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
         __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
       }
-      __Pyx_INCREF(__pyx_t_8);
+      __Pyx_INCREF(__pyx_t_5);
       __Pyx_INCREF(__pyx_t_3);
       #else
-      __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-      __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_5);
+      __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_3);
       #endif
       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    } else
-    {
+    } else {
       Py_ssize_t index = -1;
-      __pyx_t_4 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_15 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_15);
       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      __pyx_t_9 = Py_TYPE(__pyx_t_4)->tp_iternext;
-      index = 0; __pyx_t_8 = __pyx_t_9(__pyx_t_4); if (unlikely(!__pyx_t_8)) goto __pyx_L155_unpacking_failed;
-      __Pyx_GOTREF(__pyx_t_8);
-      index = 1; __pyx_t_3 = __pyx_t_9(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L155_unpacking_failed;
+      __pyx_t_8 = Py_TYPE(__pyx_t_15)->tp_iternext;
+      index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_15); if (unlikely(!__pyx_t_5)) goto __pyx_L169_unpacking_failed;
+      __Pyx_GOTREF(__pyx_t_5);
+      index = 1; __pyx_t_3 = __pyx_t_8(__pyx_t_15); if (unlikely(!__pyx_t_3)) goto __pyx_L169_unpacking_failed;
       __Pyx_GOTREF(__pyx_t_3);
-      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_9 = NULL;
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      goto __pyx_L156_unpacking_done;
-      __pyx_L155_unpacking_failed:;
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __pyx_t_9 = NULL;
+      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_15), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_8 = NULL;
+      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+      goto __pyx_L170_unpacking_done;
+      __pyx_L169_unpacking_failed:;
+      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+      __pyx_t_8 = NULL;
       if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_L156_unpacking_done:;
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_L170_unpacking_done:;
     }
-    __Pyx_DECREF_SET(__pyx_v_x, __pyx_t_8);
-    __pyx_t_8 = 0;
+    __Pyx_DECREF_SET(__pyx_v_x, __pyx_t_5);
+    __pyx_t_5 = 0;
     __Pyx_DECREF_SET(__pyx_v_y, __pyx_t_3);
     __pyx_t_3 = 0;
 
-    /* "pygrib.pyx":1804
+    /* "pygrib.pyx":1796
  *             y = llcrnry+dy*np.arange(ny)
  *             x, y = np.meshgrid(x, y)
  *             lons, lats = pj(x, y, inverse=True)             # <<<<<<<<<<<<<<
  *         elif self['gridType'] in ['rotated_ll','rotated_gg']:
  *             rotatedlats = self['distinctLatitudes']
  */
-    __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_7);
     __Pyx_INCREF(__pyx_v_x);
     PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_x);
@@ -23280,18 +25382,15 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_38latlons(struct __pyx_obj_6pygr
     __Pyx_INCREF(__pyx_v_y);
     PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_y);
     __Pyx_GIVEREF(__pyx_v_y);
-    __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
-    __pyx_t_8 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__inverse), __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-    __pyx_t_8 = PyObject_Call(__pyx_v_pj, ((PyObject *)__pyx_t_7), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-    if ((likely(PyTuple_CheckExact(__pyx_t_8))) || (PyList_CheckExact(__pyx_t_8))) {
-      PyObject* sequence = __pyx_t_8;
+    __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_inverse, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_pj, __pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
+      PyObject* sequence = __pyx_t_5;
       #if CYTHON_COMPILING_IN_CPYTHON
       Py_ssize_t size = Py_SIZE(sequence);
       #else
@@ -23300,7 +25399,7 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_38latlons(struct __pyx_obj_6pygr
       if (unlikely(size != 2)) {
         if (size > 2) __Pyx_RaiseTooManyValuesError(2);
         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       }
       #if CYTHON_COMPILING_IN_CPYTHON
       if (likely(PyTuple_CheckExact(sequence))) {
@@ -23313,33 +25412,32 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_38latlons(struct __pyx_obj_6pygr
       __Pyx_INCREF(__pyx_t_3);
       __Pyx_INCREF(__pyx_t_7);
       #else
-      __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_7);
       #endif
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-    } else
-    {
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    } else {
       Py_ssize_t index = -1;
-      __pyx_t_4 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      __pyx_t_9 = Py_TYPE(__pyx_t_4)->tp_iternext;
-      index = 0; __pyx_t_3 = __pyx_t_9(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L157_unpacking_failed;
+      __pyx_t_15 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_15);
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __pyx_t_8 = Py_TYPE(__pyx_t_15)->tp_iternext;
+      index = 0; __pyx_t_3 = __pyx_t_8(__pyx_t_15); if (unlikely(!__pyx_t_3)) goto __pyx_L171_unpacking_failed;
       __Pyx_GOTREF(__pyx_t_3);
-      index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_4); if (unlikely(!__pyx_t_7)) goto __pyx_L157_unpacking_failed;
+      index = 1; __pyx_t_7 = __pyx_t_8(__pyx_t_15); if (unlikely(!__pyx_t_7)) goto __pyx_L171_unpacking_failed;
       __Pyx_GOTREF(__pyx_t_7);
-      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_9 = NULL;
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      goto __pyx_L158_unpacking_done;
-      __pyx_L157_unpacking_failed:;
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __pyx_t_9 = NULL;
+      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_15), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_8 = NULL;
+      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+      goto __pyx_L172_unpacking_done;
+      __pyx_L171_unpacking_failed:;
+      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+      __pyx_t_8 = NULL;
       if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_L158_unpacking_done:;
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_L172_unpacking_done:;
     }
     __pyx_v_lons = __pyx_t_3;
     __pyx_t_3 = 0;
@@ -23348,105 +25446,115 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_38latlons(struct __pyx_obj_6pygr
     goto __pyx_L4;
   }
 
-  /* "pygrib.pyx":1805
+  /* "pygrib.pyx":1797
  *             x, y = np.meshgrid(x, y)
  *             lons, lats = pj(x, y, inverse=True)
  *         elif self['gridType'] in ['rotated_ll','rotated_gg']:             # <<<<<<<<<<<<<<
  *             rotatedlats = self['distinctLatitudes']
  *             rotatedlons = self['distinctLongitudes']
  */
-  __pyx_t_8 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__gridType)); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1805; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_8);
-  __pyx_t_7 = PyObject_RichCompare(__pyx_t_8, ((PyObject *)__pyx_n_s__rotated_ll), Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1805; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1805; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  if (!((int)__pyx_t_2)) {
-    __pyx_t_7 = PyObject_RichCompare(__pyx_t_8, ((PyObject *)__pyx_n_s__rotated_gg), Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1805; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1805; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __pyx_t_1 = ((int)__pyx_t_5);
+  __pyx_t_5 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_gridType); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_5, __pyx_n_s_rotated_ll, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (!__pyx_t_2) {
   } else {
-    __pyx_t_1 = ((int)__pyx_t_2);
+    __pyx_t_1 = __pyx_t_2;
+    goto __pyx_L173_bool_binop_done;
   }
-  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+  __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_5, __pyx_n_s_rotated_gg, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __pyx_t_2;
+  __pyx_L173_bool_binop_done:;
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   __pyx_t_2 = (__pyx_t_1 != 0);
   if (__pyx_t_2) {
 
-    /* "pygrib.pyx":1806
+    /* "pygrib.pyx":1798
  *             lons, lats = pj(x, y, inverse=True)
  *         elif self['gridType'] in ['rotated_ll','rotated_gg']:
  *             rotatedlats = self['distinctLatitudes']             # <<<<<<<<<<<<<<
  *             rotatedlons = self['distinctLongitudes']
  *             d2r = np.pi/180.
  */
-    __pyx_t_8 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__distinctLatitudes)); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __pyx_v_rotatedlats = __pyx_t_8;
-    __pyx_t_8 = 0;
+    __pyx_t_5 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_distinctLatitudes); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1798; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_v_rotatedlats = __pyx_t_5;
+    __pyx_t_5 = 0;
 
-    /* "pygrib.pyx":1807
+    /* "pygrib.pyx":1799
  *         elif self['gridType'] in ['rotated_ll','rotated_gg']:
  *             rotatedlats = self['distinctLatitudes']
  *             rotatedlons = self['distinctLongitudes']             # <<<<<<<<<<<<<<
  *             d2r = np.pi/180.
  *             lonsr, latsr = np.meshgrid(rotatedlons*d2r, rotatedlats*d2r)
  */
-    __pyx_t_8 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__distinctLongitudes)); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __pyx_v_rotatedlons = __pyx_t_8;
-    __pyx_t_8 = 0;
+    __pyx_t_5 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_distinctLongitudes); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1799; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_v_rotatedlons = __pyx_t_5;
+    __pyx_t_5 = 0;
 
-    /* "pygrib.pyx":1808
+    /* "pygrib.pyx":1800
  *             rotatedlats = self['distinctLatitudes']
  *             rotatedlons = self['distinctLongitudes']
  *             d2r = np.pi/180.             # <<<<<<<<<<<<<<
  *             lonsr, latsr = np.meshgrid(rotatedlons*d2r, rotatedlats*d2r)
  *             pj = pyproj.Proj(self.projparams)
  */
-    __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s__pi); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_pi); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-    __pyx_t_8 = PyFloat_FromDouble(180.); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_t_7, __pyx_float_180_); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-    __pyx_v_d2r = __pyx_t_3;
-    __pyx_t_3 = 0;
+    __pyx_v_d2r = __pyx_t_5;
+    __pyx_t_5 = 0;
 
-    /* "pygrib.pyx":1809
+    /* "pygrib.pyx":1801
  *             rotatedlons = self['distinctLongitudes']
  *             d2r = np.pi/180.
  *             lonsr, latsr = np.meshgrid(rotatedlons*d2r, rotatedlats*d2r)             # <<<<<<<<<<<<<<
  *             pj = pyproj.Proj(self.projparams)
  *             lons,lats = pj(lonsr,latsr,inverse=True)
  */
-    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__meshgrid); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_3 = PyNumber_Multiply(__pyx_v_rotatedlons, __pyx_v_d2r); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_7);
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_meshgrid); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_7 = PyNumber_Multiply(__pyx_v_rotatedlats, __pyx_v_d2r); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __pyx_t_7 = PyNumber_Multiply(__pyx_v_rotatedlons, __pyx_v_d2r); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_7);
-    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
-    __Pyx_GIVEREF(__pyx_t_3);
-    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_7);
+    __pyx_t_15 = PyNumber_Multiply(__pyx_v_rotatedlats, __pyx_v_d2r); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_15);
+    __pyx_t_14 = NULL;
+    __pyx_t_6 = 0;
+    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
+      __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_3);
+      if (likely(__pyx_t_14)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+        __Pyx_INCREF(__pyx_t_14);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_3, function);
+        __pyx_t_6 = 1;
+      }
+    }
+    __pyx_t_13 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_13);
+    if (__pyx_t_14) {
+      PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_14); __Pyx_GIVEREF(__pyx_t_14); __pyx_t_14 = NULL;
+    }
+    PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_6, __pyx_t_7);
     __Pyx_GIVEREF(__pyx_t_7);
-    __pyx_t_3 = 0;
+    PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_6, __pyx_t_15);
+    __Pyx_GIVEREF(__pyx_t_15);
     __pyx_t_7 = 0;
-    __pyx_t_7 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-    if ((likely(PyTuple_CheckExact(__pyx_t_7))) || (PyList_CheckExact(__pyx_t_7))) {
-      PyObject* sequence = __pyx_t_7;
+    __pyx_t_15 = 0;
+    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_13, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
+      PyObject* sequence = __pyx_t_5;
       #if CYTHON_COMPILING_IN_CPYTHON
       Py_ssize_t size = Py_SIZE(sequence);
       #else
@@ -23455,103 +25563,115 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_38latlons(struct __pyx_obj_6pygr
       if (unlikely(size != 2)) {
         if (size > 2) __Pyx_RaiseTooManyValuesError(2);
         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       }
       #if CYTHON_COMPILING_IN_CPYTHON
       if (likely(PyTuple_CheckExact(sequence))) {
-        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); 
-        __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); 
+        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
+        __pyx_t_13 = PyTuple_GET_ITEM(sequence, 1); 
       } else {
-        __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
-        __pyx_t_8 = PyList_GET_ITEM(sequence, 1); 
+        __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
+        __pyx_t_13 = PyList_GET_ITEM(sequence, 1); 
       }
-      __Pyx_INCREF(__pyx_t_4);
-      __Pyx_INCREF(__pyx_t_8);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(__pyx_t_13);
       #else
-      __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
+      __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_13 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_13);
       #endif
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    } else
-    {
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    } else {
       Py_ssize_t index = -1;
-      __pyx_t_3 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_15 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_15);
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __pyx_t_8 = Py_TYPE(__pyx_t_15)->tp_iternext;
+      index = 0; __pyx_t_3 = __pyx_t_8(__pyx_t_15); if (unlikely(!__pyx_t_3)) goto __pyx_L175_unpacking_failed;
       __Pyx_GOTREF(__pyx_t_3);
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      __pyx_t_9 = Py_TYPE(__pyx_t_3)->tp_iternext;
-      index = 0; __pyx_t_4 = __pyx_t_9(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L159_unpacking_failed;
-      __Pyx_GOTREF(__pyx_t_4);
-      index = 1; __pyx_t_8 = __pyx_t_9(__pyx_t_3); if (unlikely(!__pyx_t_8)) goto __pyx_L159_unpacking_failed;
-      __Pyx_GOTREF(__pyx_t_8);
-      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_9 = NULL;
-      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      goto __pyx_L160_unpacking_done;
-      __pyx_L159_unpacking_failed:;
-      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_9 = NULL;
+      index = 1; __pyx_t_13 = __pyx_t_8(__pyx_t_15); if (unlikely(!__pyx_t_13)) goto __pyx_L175_unpacking_failed;
+      __Pyx_GOTREF(__pyx_t_13);
+      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_15), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_8 = NULL;
+      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+      goto __pyx_L176_unpacking_done;
+      __pyx_L175_unpacking_failed:;
+      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+      __pyx_t_8 = NULL;
       if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_L160_unpacking_done:;
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_L176_unpacking_done:;
     }
-    __pyx_v_lonsr = __pyx_t_4;
-    __pyx_t_4 = 0;
-    __pyx_v_latsr = __pyx_t_8;
-    __pyx_t_8 = 0;
+    __pyx_v_lonsr = __pyx_t_3;
+    __pyx_t_3 = 0;
+    __pyx_v_latsr = __pyx_t_13;
+    __pyx_t_13 = 0;
 
-    /* "pygrib.pyx":1810
+    /* "pygrib.pyx":1802
  *             d2r = np.pi/180.
  *             lonsr, latsr = np.meshgrid(rotatedlons*d2r, rotatedlats*d2r)
  *             pj = pyproj.Proj(self.projparams)             # <<<<<<<<<<<<<<
  *             lons,lats = pj(lonsr,latsr,inverse=True)
  *         else:
  */
-    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s__pyproj); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s__Proj); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_INCREF(__pyx_v_self->projparams);
-    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_self->projparams);
-    __Pyx_GIVEREF(__pyx_v_self->projparams);
-    __pyx_t_4 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
-    __pyx_v_pj = __pyx_t_4;
-    __pyx_t_4 = 0;
+    __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyproj); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_13);
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_Proj); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+    __pyx_t_13 = NULL;
+    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
+      __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_3);
+      if (likely(__pyx_t_13)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+        __Pyx_INCREF(__pyx_t_13);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_3, function);
+      }
+    }
+    if (!__pyx_t_13) {
+      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_self->projparams); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_5);
+    } else {
+      __pyx_t_15 = PyTuple_New(1+1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_15);
+      PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_13); __Pyx_GIVEREF(__pyx_t_13); __pyx_t_13 = NULL;
+      __Pyx_INCREF(__pyx_v_self->projparams);
+      PyTuple_SET_ITEM(__pyx_t_15, 0+1, __pyx_v_self->projparams);
+      __Pyx_GIVEREF(__pyx_v_self->projparams);
+      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_15, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_5);
+      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+    }
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_v_pj = __pyx_t_5;
+    __pyx_t_5 = 0;
 
-    /* "pygrib.pyx":1811
+    /* "pygrib.pyx":1803
  *             lonsr, latsr = np.meshgrid(rotatedlons*d2r, rotatedlats*d2r)
  *             pj = pyproj.Proj(self.projparams)
  *             lons,lats = pj(lonsr,latsr,inverse=True)             # <<<<<<<<<<<<<<
  *         else:
  *             raise ValueError('unsupported grid %s' % self['gridType'])
  */
-    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1811; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
     __Pyx_INCREF(__pyx_v_lonsr);
-    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_lonsr);
+    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_lonsr);
     __Pyx_GIVEREF(__pyx_v_lonsr);
     __Pyx_INCREF(__pyx_v_latsr);
-    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_latsr);
+    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_latsr);
     __Pyx_GIVEREF(__pyx_v_latsr);
-    __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1811; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_7));
-    __pyx_t_8 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1811; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    if (PyDict_SetItem(__pyx_t_7, ((PyObject *)__pyx_n_s__inverse), __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1811; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-    __pyx_t_8 = PyObject_Call(__pyx_v_pj, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_7)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1811; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
-    if ((likely(PyTuple_CheckExact(__pyx_t_8))) || (PyList_CheckExact(__pyx_t_8))) {
-      PyObject* sequence = __pyx_t_8;
+    __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_inverse, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_15 = __Pyx_PyObject_Call(__pyx_v_pj, __pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_15);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    if ((likely(PyTuple_CheckExact(__pyx_t_15))) || (PyList_CheckExact(__pyx_t_15))) {
+      PyObject* sequence = __pyx_t_15;
       #if CYTHON_COMPILING_IN_CPYTHON
       Py_ssize_t size = Py_SIZE(sequence);
       #else
@@ -23560,82 +25680,81 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_38latlons(struct __pyx_obj_6pygr
       if (unlikely(size != 2)) {
         if (size > 2) __Pyx_RaiseTooManyValuesError(2);
         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1811; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       }
       #if CYTHON_COMPILING_IN_CPYTHON
       if (likely(PyTuple_CheckExact(sequence))) {
-        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); 
-        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
+        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
+        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
       } else {
-        __pyx_t_7 = PyList_GET_ITEM(sequence, 0); 
-        __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
+        __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
+        __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
       }
-      __Pyx_INCREF(__pyx_t_7);
-      __Pyx_INCREF(__pyx_t_4);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(__pyx_t_5);
       #else
-      __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1811; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_7);
-      __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1811; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_5);
       #endif
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-    } else
-    {
+      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+    } else {
       Py_ssize_t index = -1;
-      __pyx_t_3 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1811; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_13 = PyObject_GetIter(__pyx_t_15); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_13);
+      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+      __pyx_t_8 = Py_TYPE(__pyx_t_13)->tp_iternext;
+      index = 0; __pyx_t_3 = __pyx_t_8(__pyx_t_13); if (unlikely(!__pyx_t_3)) goto __pyx_L177_unpacking_failed;
       __Pyx_GOTREF(__pyx_t_3);
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      __pyx_t_9 = Py_TYPE(__pyx_t_3)->tp_iternext;
-      index = 0; __pyx_t_7 = __pyx_t_9(__pyx_t_3); if (unlikely(!__pyx_t_7)) goto __pyx_L161_unpacking_failed;
-      __Pyx_GOTREF(__pyx_t_7);
-      index = 1; __pyx_t_4 = __pyx_t_9(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L161_unpacking_failed;
-      __Pyx_GOTREF(__pyx_t_4);
-      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1811; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_9 = NULL;
-      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      goto __pyx_L162_unpacking_done;
-      __pyx_L161_unpacking_failed:;
-      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_9 = NULL;
+      index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_13); if (unlikely(!__pyx_t_5)) goto __pyx_L177_unpacking_failed;
+      __Pyx_GOTREF(__pyx_t_5);
+      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_13), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_8 = NULL;
+      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+      goto __pyx_L178_unpacking_done;
+      __pyx_L177_unpacking_failed:;
+      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+      __pyx_t_8 = NULL;
       if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1811; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_L162_unpacking_done:;
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_L178_unpacking_done:;
     }
-    __pyx_v_lons = __pyx_t_7;
-    __pyx_t_7 = 0;
-    __pyx_v_lats = __pyx_t_4;
-    __pyx_t_4 = 0;
+    __pyx_v_lons = __pyx_t_3;
+    __pyx_t_3 = 0;
+    __pyx_v_lats = __pyx_t_5;
+    __pyx_t_5 = 0;
     goto __pyx_L4;
   }
   /*else*/ {
 
-    /* "pygrib.pyx":1813
+    /* "pygrib.pyx":1805
  *             lons,lats = pj(lonsr,latsr,inverse=True)
  *         else:
  *             raise ValueError('unsupported grid %s' % self['gridType'])             # <<<<<<<<<<<<<<
  *         return lats, lons
  * 
  */
-    __pyx_t_8 = PyObject_GetItem(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s__gridType)); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_168), __pyx_t_8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
-    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-    __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_t_4));
-    __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
-    __pyx_t_4 = 0;
-    __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
-    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_15 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_n_s_gridType); if (unlikely(__pyx_t_15 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1805; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    __Pyx_GOTREF(__pyx_t_15);
+    __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_unsupported_grid_s, __pyx_t_15); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1805; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+    __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1805; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_15);
+    PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_5);
+    __Pyx_GIVEREF(__pyx_t_5);
+    __pyx_t_5 = 0;
+    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_15, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1805; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1805; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
   __pyx_L4:;
 
-  /* "pygrib.pyx":1814
+  /* "pygrib.pyx":1806
  *         else:
  *             raise ValueError('unsupported grid %s' % self['gridType'])
  *         return lats, lons             # <<<<<<<<<<<<<<
@@ -23643,26 +25762,35 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_38latlons(struct __pyx_obj_6pygr
  * cdef class index(object):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1814; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
   __Pyx_INCREF(__pyx_v_lats);
-  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_lats);
+  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_lats);
   __Pyx_GIVEREF(__pyx_v_lats);
   __Pyx_INCREF(__pyx_v_lons);
-  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_lons);
+  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_lons);
   __Pyx_GIVEREF(__pyx_v_lons);
-  __pyx_r = ((PyObject *)__pyx_t_4);
-  __pyx_t_4 = 0;
+  __pyx_r = __pyx_t_5;
+  __pyx_t_5 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "pygrib.pyx":1560
+ *         self.projparams = projparams
+ * 
+ *     def latlons(self):             # <<<<<<<<<<<<<<
+ *         """
+ *         latlons()
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_3);
   __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
   __Pyx_XDECREF(__pyx_t_7);
-  __Pyx_XDECREF(__pyx_t_8);
+  __Pyx_XDECREF(__pyx_t_13);
   __Pyx_XDECREF(__pyx_t_14);
+  __Pyx_XDECREF(__pyx_t_15);
   __Pyx_AddTraceback("pygrib.gribmessage.latlons", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_r = NULL;
   __pyx_L0:;
@@ -23708,6 +25836,14 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_38latlons(struct __pyx_obj_6pygr
   return __pyx_r;
 }
 
+/* "pygrib.pyx":831
+ *     is a range, then C{validDate} corresponds to the end of the range."""
+ *     cdef grib_handle *_gh
+ *     cdef public messagenumber, projparams, validDate, analDate,\             # <<<<<<<<<<<<<<
+ *     expand_reduced, _ro_keys, _all_keys, fcstimeunits
+ *     def __init__(self):
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_6pygrib_11gribmessage_13messagenumber_1__get__(PyObject *__pyx_v_self); /*proto*/
 static PyObject *__pyx_pw_6pygrib_11gribmessage_13messagenumber_1__get__(PyObject *__pyx_v_self) {
@@ -23715,18 +25851,12 @@ static PyObject *__pyx_pw_6pygrib_11gribmessage_13messagenumber_1__get__(PyObjec
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_11gribmessage_13messagenumber___get__(((struct __pyx_obj_6pygrib_gribmessage *)__pyx_v_self));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "pygrib.pyx":837
- *     is a range, then C{validDate} corresponds to the end of the range."""
- *     cdef grib_handle *_gh
- *     cdef public messagenumber, projparams, validDate, analDate,\             # <<<<<<<<<<<<<<
- *     expand_reduced, _ro_keys, _all_keys, fcstimeunits
- *     def __init__(self):
- */
-
 static PyObject *__pyx_pf_6pygrib_11gribmessage_13messagenumber___get__(struct __pyx_obj_6pygrib_gribmessage *__pyx_v_self) {
   PyObject *__pyx_r = NULL;
   __Pyx_RefNannyDeclarations
@@ -23736,7 +25866,7 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_13messagenumber___get__(struct _
   __pyx_r = __pyx_v_self->messagenumber;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  /* function exit code */
   __pyx_L0:;
   __Pyx_XGIVEREF(__pyx_r);
   __Pyx_RefNannyFinishContext();
@@ -23750,6 +25880,8 @@ static int __pyx_pw_6pygrib_11gribmessage_13messagenumber_3__set__(PyObject *__p
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_11gribmessage_13messagenumber_2__set__(((struct __pyx_obj_6pygrib_gribmessage *)__pyx_v_self), ((PyObject *)__pyx_v_value));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
@@ -23764,6 +25896,7 @@ static int __pyx_pf_6pygrib_11gribmessage_13messagenumber_2__set__(struct __pyx_
   __Pyx_DECREF(__pyx_v_self->messagenumber);
   __pyx_v_self->messagenumber = __pyx_v_value;
 
+  /* function exit code */
   __pyx_r = 0;
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
@@ -23776,6 +25909,8 @@ static int __pyx_pw_6pygrib_11gribmessage_13messagenumber_5__del__(PyObject *__p
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_11gribmessage_13messagenumber_4__del__(((struct __pyx_obj_6pygrib_gribmessage *)__pyx_v_self));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
@@ -23790,6 +25925,7 @@ static int __pyx_pf_6pygrib_11gribmessage_13messagenumber_4__del__(struct __pyx_
   __Pyx_DECREF(__pyx_v_self->messagenumber);
   __pyx_v_self->messagenumber = Py_None;
 
+  /* function exit code */
   __pyx_r = 0;
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
@@ -23802,6 +25938,8 @@ static PyObject *__pyx_pw_6pygrib_11gribmessage_10projparams_1__get__(PyObject *
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_11gribmessage_10projparams___get__(((struct __pyx_obj_6pygrib_gribmessage *)__pyx_v_self));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
@@ -23815,7 +25953,7 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_10projparams___get__(struct __py
   __pyx_r = __pyx_v_self->projparams;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  /* function exit code */
   __pyx_L0:;
   __Pyx_XGIVEREF(__pyx_r);
   __Pyx_RefNannyFinishContext();
@@ -23829,6 +25967,8 @@ static int __pyx_pw_6pygrib_11gribmessage_10projparams_3__set__(PyObject *__pyx_
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_11gribmessage_10projparams_2__set__(((struct __pyx_obj_6pygrib_gribmessage *)__pyx_v_self), ((PyObject *)__pyx_v_value));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
@@ -23843,6 +25983,7 @@ static int __pyx_pf_6pygrib_11gribmessage_10projparams_2__set__(struct __pyx_obj
   __Pyx_DECREF(__pyx_v_self->projparams);
   __pyx_v_self->projparams = __pyx_v_value;
 
+  /* function exit code */
   __pyx_r = 0;
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
@@ -23855,6 +25996,8 @@ static int __pyx_pw_6pygrib_11gribmessage_10projparams_5__del__(PyObject *__pyx_
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_11gribmessage_10projparams_4__del__(((struct __pyx_obj_6pygrib_gribmessage *)__pyx_v_self));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
@@ -23869,6 +26012,7 @@ static int __pyx_pf_6pygrib_11gribmessage_10projparams_4__del__(struct __pyx_obj
   __Pyx_DECREF(__pyx_v_self->projparams);
   __pyx_v_self->projparams = Py_None;
 
+  /* function exit code */
   __pyx_r = 0;
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
@@ -23881,6 +26025,8 @@ static PyObject *__pyx_pw_6pygrib_11gribmessage_9validDate_1__get__(PyObject *__
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_11gribmessage_9validDate___get__(((struct __pyx_obj_6pygrib_gribmessage *)__pyx_v_self));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
@@ -23894,7 +26040,7 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_9validDate___get__(struct __pyx_
   __pyx_r = __pyx_v_self->validDate;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  /* function exit code */
   __pyx_L0:;
   __Pyx_XGIVEREF(__pyx_r);
   __Pyx_RefNannyFinishContext();
@@ -23908,6 +26054,8 @@ static int __pyx_pw_6pygrib_11gribmessage_9validDate_3__set__(PyObject *__pyx_v_
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_11gribmessage_9validDate_2__set__(((struct __pyx_obj_6pygrib_gribmessage *)__pyx_v_self), ((PyObject *)__pyx_v_value));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
@@ -23922,6 +26070,7 @@ static int __pyx_pf_6pygrib_11gribmessage_9validDate_2__set__(struct __pyx_obj_6
   __Pyx_DECREF(__pyx_v_self->validDate);
   __pyx_v_self->validDate = __pyx_v_value;
 
+  /* function exit code */
   __pyx_r = 0;
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
@@ -23934,6 +26083,8 @@ static int __pyx_pw_6pygrib_11gribmessage_9validDate_5__del__(PyObject *__pyx_v_
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_11gribmessage_9validDate_4__del__(((struct __pyx_obj_6pygrib_gribmessage *)__pyx_v_self));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
@@ -23948,6 +26099,7 @@ static int __pyx_pf_6pygrib_11gribmessage_9validDate_4__del__(struct __pyx_obj_6
   __Pyx_DECREF(__pyx_v_self->validDate);
   __pyx_v_self->validDate = Py_None;
 
+  /* function exit code */
   __pyx_r = 0;
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
@@ -23960,6 +26112,8 @@ static PyObject *__pyx_pw_6pygrib_11gribmessage_8analDate_1__get__(PyObject *__p
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_11gribmessage_8analDate___get__(((struct __pyx_obj_6pygrib_gribmessage *)__pyx_v_self));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
@@ -23973,7 +26127,7 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_8analDate___get__(struct __pyx_o
   __pyx_r = __pyx_v_self->analDate;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  /* function exit code */
   __pyx_L0:;
   __Pyx_XGIVEREF(__pyx_r);
   __Pyx_RefNannyFinishContext();
@@ -23987,6 +26141,8 @@ static int __pyx_pw_6pygrib_11gribmessage_8analDate_3__set__(PyObject *__pyx_v_s
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_11gribmessage_8analDate_2__set__(((struct __pyx_obj_6pygrib_gribmessage *)__pyx_v_self), ((PyObject *)__pyx_v_value));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
@@ -24001,6 +26157,7 @@ static int __pyx_pf_6pygrib_11gribmessage_8analDate_2__set__(struct __pyx_obj_6p
   __Pyx_DECREF(__pyx_v_self->analDate);
   __pyx_v_self->analDate = __pyx_v_value;
 
+  /* function exit code */
   __pyx_r = 0;
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
@@ -24013,6 +26170,8 @@ static int __pyx_pw_6pygrib_11gribmessage_8analDate_5__del__(PyObject *__pyx_v_s
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_11gribmessage_8analDate_4__del__(((struct __pyx_obj_6pygrib_gribmessage *)__pyx_v_self));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
@@ -24027,11 +26186,20 @@ static int __pyx_pf_6pygrib_11gribmessage_8analDate_4__del__(struct __pyx_obj_6p
   __Pyx_DECREF(__pyx_v_self->analDate);
   __pyx_v_self->analDate = Py_None;
 
+  /* function exit code */
   __pyx_r = 0;
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
+/* "pygrib.pyx":832
+ *     cdef grib_handle *_gh
+ *     cdef public messagenumber, projparams, validDate, analDate,\
+ *     expand_reduced, _ro_keys, _all_keys, fcstimeunits             # <<<<<<<<<<<<<<
+ *     def __init__(self):
+ *         # calling "__new__()" will not call "__init__()" !
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_6pygrib_11gribmessage_14expand_reduced_1__get__(PyObject *__pyx_v_self); /*proto*/
 static PyObject *__pyx_pw_6pygrib_11gribmessage_14expand_reduced_1__get__(PyObject *__pyx_v_self) {
@@ -24039,18 +26207,12 @@ static PyObject *__pyx_pw_6pygrib_11gribmessage_14expand_reduced_1__get__(PyObje
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_11gribmessage_14expand_reduced___get__(((struct __pyx_obj_6pygrib_gribmessage *)__pyx_v_self));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "pygrib.pyx":838
- *     cdef grib_handle *_gh
- *     cdef public messagenumber, projparams, validDate, analDate,\
- *     expand_reduced, _ro_keys, _all_keys, fcstimeunits             # <<<<<<<<<<<<<<
- *     def __init__(self):
- *         # calling "__new__()" will not call "__init__()" !
- */
-
 static PyObject *__pyx_pf_6pygrib_11gribmessage_14expand_reduced___get__(struct __pyx_obj_6pygrib_gribmessage *__pyx_v_self) {
   PyObject *__pyx_r = NULL;
   __Pyx_RefNannyDeclarations
@@ -24060,7 +26222,7 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_14expand_reduced___get__(struct
   __pyx_r = __pyx_v_self->expand_reduced;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  /* function exit code */
   __pyx_L0:;
   __Pyx_XGIVEREF(__pyx_r);
   __Pyx_RefNannyFinishContext();
@@ -24074,6 +26236,8 @@ static int __pyx_pw_6pygrib_11gribmessage_14expand_reduced_3__set__(PyObject *__
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_11gribmessage_14expand_reduced_2__set__(((struct __pyx_obj_6pygrib_gribmessage *)__pyx_v_self), ((PyObject *)__pyx_v_value));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
@@ -24088,6 +26252,7 @@ static int __pyx_pf_6pygrib_11gribmessage_14expand_reduced_2__set__(struct __pyx
   __Pyx_DECREF(__pyx_v_self->expand_reduced);
   __pyx_v_self->expand_reduced = __pyx_v_value;
 
+  /* function exit code */
   __pyx_r = 0;
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
@@ -24100,6 +26265,8 @@ static int __pyx_pw_6pygrib_11gribmessage_14expand_reduced_5__del__(PyObject *__
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_11gribmessage_14expand_reduced_4__del__(((struct __pyx_obj_6pygrib_gribmessage *)__pyx_v_self));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
@@ -24114,6 +26281,7 @@ static int __pyx_pf_6pygrib_11gribmessage_14expand_reduced_4__del__(struct __pyx
   __Pyx_DECREF(__pyx_v_self->expand_reduced);
   __pyx_v_self->expand_reduced = Py_None;
 
+  /* function exit code */
   __pyx_r = 0;
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
@@ -24126,6 +26294,8 @@ static PyObject *__pyx_pw_6pygrib_11gribmessage_8_ro_keys_1__get__(PyObject *__p
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_11gribmessage_8_ro_keys___get__(((struct __pyx_obj_6pygrib_gribmessage *)__pyx_v_self));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
@@ -24139,7 +26309,7 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_8_ro_keys___get__(struct __pyx_o
   __pyx_r = __pyx_v_self->_ro_keys;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  /* function exit code */
   __pyx_L0:;
   __Pyx_XGIVEREF(__pyx_r);
   __Pyx_RefNannyFinishContext();
@@ -24153,6 +26323,8 @@ static int __pyx_pw_6pygrib_11gribmessage_8_ro_keys_3__set__(PyObject *__pyx_v_s
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_11gribmessage_8_ro_keys_2__set__(((struct __pyx_obj_6pygrib_gribmessage *)__pyx_v_self), ((PyObject *)__pyx_v_value));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
@@ -24167,6 +26339,7 @@ static int __pyx_pf_6pygrib_11gribmessage_8_ro_keys_2__set__(struct __pyx_obj_6p
   __Pyx_DECREF(__pyx_v_self->_ro_keys);
   __pyx_v_self->_ro_keys = __pyx_v_value;
 
+  /* function exit code */
   __pyx_r = 0;
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
@@ -24179,6 +26352,8 @@ static int __pyx_pw_6pygrib_11gribmessage_8_ro_keys_5__del__(PyObject *__pyx_v_s
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_11gribmessage_8_ro_keys_4__del__(((struct __pyx_obj_6pygrib_gribmessage *)__pyx_v_self));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
@@ -24193,6 +26368,7 @@ static int __pyx_pf_6pygrib_11gribmessage_8_ro_keys_4__del__(struct __pyx_obj_6p
   __Pyx_DECREF(__pyx_v_self->_ro_keys);
   __pyx_v_self->_ro_keys = Py_None;
 
+  /* function exit code */
   __pyx_r = 0;
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
@@ -24205,6 +26381,8 @@ static PyObject *__pyx_pw_6pygrib_11gribmessage_9_all_keys_1__get__(PyObject *__
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_11gribmessage_9_all_keys___get__(((struct __pyx_obj_6pygrib_gribmessage *)__pyx_v_self));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
@@ -24218,7 +26396,7 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_9_all_keys___get__(struct __pyx_
   __pyx_r = __pyx_v_self->_all_keys;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  /* function exit code */
   __pyx_L0:;
   __Pyx_XGIVEREF(__pyx_r);
   __Pyx_RefNannyFinishContext();
@@ -24232,6 +26410,8 @@ static int __pyx_pw_6pygrib_11gribmessage_9_all_keys_3__set__(PyObject *__pyx_v_
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_11gribmessage_9_all_keys_2__set__(((struct __pyx_obj_6pygrib_gribmessage *)__pyx_v_self), ((PyObject *)__pyx_v_value));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
@@ -24246,6 +26426,7 @@ static int __pyx_pf_6pygrib_11gribmessage_9_all_keys_2__set__(struct __pyx_obj_6
   __Pyx_DECREF(__pyx_v_self->_all_keys);
   __pyx_v_self->_all_keys = __pyx_v_value;
 
+  /* function exit code */
   __pyx_r = 0;
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
@@ -24258,6 +26439,8 @@ static int __pyx_pw_6pygrib_11gribmessage_9_all_keys_5__del__(PyObject *__pyx_v_
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_11gribmessage_9_all_keys_4__del__(((struct __pyx_obj_6pygrib_gribmessage *)__pyx_v_self));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
@@ -24272,6 +26455,7 @@ static int __pyx_pf_6pygrib_11gribmessage_9_all_keys_4__del__(struct __pyx_obj_6
   __Pyx_DECREF(__pyx_v_self->_all_keys);
   __pyx_v_self->_all_keys = Py_None;
 
+  /* function exit code */
   __pyx_r = 0;
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
@@ -24284,6 +26468,8 @@ static PyObject *__pyx_pw_6pygrib_11gribmessage_12fcstimeunits_1__get__(PyObject
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_11gribmessage_12fcstimeunits___get__(((struct __pyx_obj_6pygrib_gribmessage *)__pyx_v_self));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
@@ -24297,7 +26483,7 @@ static PyObject *__pyx_pf_6pygrib_11gribmessage_12fcstimeunits___get__(struct __
   __pyx_r = __pyx_v_self->fcstimeunits;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  /* function exit code */
   __pyx_L0:;
   __Pyx_XGIVEREF(__pyx_r);
   __Pyx_RefNannyFinishContext();
@@ -24311,6 +26497,8 @@ static int __pyx_pw_6pygrib_11gribmessage_12fcstimeunits_3__set__(PyObject *__py
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_11gribmessage_12fcstimeunits_2__set__(((struct __pyx_obj_6pygrib_gribmessage *)__pyx_v_self), ((PyObject *)__pyx_v_value));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
@@ -24325,6 +26513,7 @@ static int __pyx_pf_6pygrib_11gribmessage_12fcstimeunits_2__set__(struct __pyx_o
   __Pyx_DECREF(__pyx_v_self->fcstimeunits);
   __pyx_v_self->fcstimeunits = __pyx_v_value;
 
+  /* function exit code */
   __pyx_r = 0;
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
@@ -24337,6 +26526,8 @@ static int __pyx_pw_6pygrib_11gribmessage_12fcstimeunits_5__del__(PyObject *__py
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_11gribmessage_12fcstimeunits_4__del__(((struct __pyx_obj_6pygrib_gribmessage *)__pyx_v_self));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
@@ -24351,11 +26542,20 @@ static int __pyx_pf_6pygrib_11gribmessage_12fcstimeunits_4__del__(struct __pyx_o
   __Pyx_DECREF(__pyx_v_self->fcstimeunits);
   __pyx_v_self->fcstimeunits = Py_None;
 
+  /* function exit code */
   __pyx_r = 0;
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
+/* "pygrib.pyx":1863
+ *     cdef grib_index *_gi
+ *     cdef public object keys, types, name
+ *     def __cinit__(self, filename, *args):             # <<<<<<<<<<<<<<
+ *         # initialize C level objects.
+ *         cdef grib_index *gi
+ */
+
 /* Python wrapper */
 static int __pyx_pw_6pygrib_5index_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static int __pyx_pw_6pygrib_5index_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
@@ -24378,7 +26578,7 @@ static int __pyx_pw_6pygrib_5index_1__cinit__(PyObject *__pyx_v_self, PyObject *
     __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
   }
   {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__filename,0};
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filename,0};
     PyObject* values[1] = {0};
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
@@ -24391,12 +26591,12 @@ static int __pyx_pw_6pygrib_5index_1__cinit__(PyObject *__pyx_v_self, PyObject *
       kw_args = PyDict_Size(__pyx_kwds);
       switch (pos_args) {
         case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__filename)) != 0)) kw_args--;
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_filename)) != 0)) kw_args--;
         else goto __pyx_L5_argtuple_error;
       }
       if (unlikely(kw_args > 0)) {
         const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1865; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1863; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
       goto __pyx_L5_argtuple_error;
@@ -24407,7 +26607,7 @@ static int __pyx_pw_6pygrib_5index_1__cinit__(PyObject *__pyx_v_self, PyObject *
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1865; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1863; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
   __pyx_L3_error:;
   __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
   __Pyx_AddTraceback("pygrib.index.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
@@ -24415,19 +26615,13 @@ static int __pyx_pw_6pygrib_5index_1__cinit__(PyObject *__pyx_v_self, PyObject *
   return -1;
   __pyx_L4_argument_unpacking_done:;
   __pyx_r = __pyx_pf_6pygrib_5index___cinit__(((struct __pyx_obj_6pygrib_index *)__pyx_v_self), __pyx_v_filename, __pyx_v_args);
+
+  /* function exit code */
   __Pyx_XDECREF(__pyx_v_args);
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "pygrib.pyx":1865
- *     cdef grib_index *_gi
- *     cdef public object keys, types, name
- *     def __cinit__(self, filename, *args):             # <<<<<<<<<<<<<<
- *         # initialize C level objects.
- *         cdef grib_index *gi
- */
-
 static int __pyx_pf_6pygrib_5index___cinit__(struct __pyx_obj_6pygrib_index *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_args) {
   int __pyx_v_err;
   char *__pyx_v_filenamec;
@@ -24442,46 +26636,47 @@ static int __pyx_pf_6pygrib_5index___cinit__(struct __pyx_obj_6pygrib_index *__p
   int __pyx_t_3;
   PyObject *__pyx_t_4 = NULL;
   PyObject *__pyx_t_5 = NULL;
+  PyObject *__pyx_t_6 = NULL;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("__cinit__", 0);
 
-  /* "pygrib.pyx":1870
- *         cdef int err
- *         cdef char *filenamec, *keys
+  /* "pygrib.pyx":1869
+ *         cdef char *filenamec
+ *         cdef char *keys
  *         bytestr = _strencode(filename)             # <<<<<<<<<<<<<<
  *         filenamec = bytestr
  *         if args == ():
  */
-  __pyx_t_1 = __pyx_f_6pygrib__strencode(__pyx_v_filename, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __pyx_f_6pygrib__strencode(__pyx_v_filename, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1869; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_v_bytestr = __pyx_t_1;
   __pyx_t_1 = 0;
 
-  /* "pygrib.pyx":1871
- *         cdef char *filenamec, *keys
+  /* "pygrib.pyx":1870
+ *         cdef char *keys
  *         bytestr = _strencode(filename)
  *         filenamec = bytestr             # <<<<<<<<<<<<<<
  *         if args == ():
  *             #raise ValueError('no keys specified for index')
  */
-  __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_v_bytestr); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_v_bytestr); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_v_filenamec = __pyx_t_2;
 
-  /* "pygrib.pyx":1872
+  /* "pygrib.pyx":1871
  *         bytestr = _strencode(filename)
  *         filenamec = bytestr
  *         if args == ():             # <<<<<<<<<<<<<<
  *             #raise ValueError('no keys specified for index')
  *             # assume filename is a saved index.
  */
-  __pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_v_args), ((PyObject *)__pyx_empty_tuple), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyObject_RichCompare(__pyx_v_args, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (__pyx_t_3) {
 
-    /* "pygrib.pyx":1875
+    /* "pygrib.pyx":1874
  *             #raise ValueError('no keys specified for index')
  *             # assume filename is a saved index.
  *             self._gi = grib_index_read(NULL, filenamec, &err)             # <<<<<<<<<<<<<<
@@ -24490,7 +26685,7 @@ static int __pyx_pf_6pygrib_5index___cinit__(struct __pyx_obj_6pygrib_index *__p
  */
     __pyx_v_self->_gi = grib_index_read(NULL, __pyx_v_filenamec, (&__pyx_v_err));
 
-    /* "pygrib.pyx":1876
+    /* "pygrib.pyx":1875
  *             # assume filename is a saved index.
  *             self._gi = grib_index_read(NULL, filenamec, &err)
  *             if err:             # <<<<<<<<<<<<<<
@@ -24500,68 +26695,57 @@ static int __pyx_pf_6pygrib_5index___cinit__(struct __pyx_obj_6pygrib_index *__p
     __pyx_t_3 = (__pyx_v_err != 0);
     if (__pyx_t_3) {
 
-      /* "pygrib.pyx":1877
+      /* "pygrib.pyx":1876
  *             self._gi = grib_index_read(NULL, filenamec, &err)
  *             if err:
  *                 raise RuntimeError(grib_get_error_message(err))             # <<<<<<<<<<<<<<
  *         else:
  *             bytestr = _strencode(','.join(args))
  */
-      __pyx_t_1 = __Pyx_PyBytes_FromString(grib_get_error_message(__pyx_v_err)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(((PyObject *)__pyx_t_1));
-      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_1 = __Pyx_PyBytes_FromString(grib_get_error_message(__pyx_v_err)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_1);
+      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_4);
-      PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_1));
-      __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
+      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
+      __Pyx_GIVEREF(__pyx_t_1);
       __pyx_t_1 = 0;
-      __pyx_t_1 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_1);
-      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       __Pyx_Raise(__pyx_t_1, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      goto __pyx_L4;
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     }
-    __pyx_L4:;
     goto __pyx_L3;
   }
   /*else*/ {
 
-    /* "pygrib.pyx":1879
+    /* "pygrib.pyx":1878
  *                 raise RuntimeError(grib_get_error_message(err))
  *         else:
  *             bytestr = _strencode(','.join(args))             # <<<<<<<<<<<<<<
  *             keys = bytestr
  *             self._gi = grib_index_new_from_file (NULL, filenamec, keys, &err)
  */
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_kp_s_182), __pyx_n_s__join); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = __Pyx_PyString_Join(__pyx_kp_s__99, __pyx_v_args); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = __pyx_f_6pygrib__strencode(__pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_INCREF(((PyObject *)__pyx_v_args));
-    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_args));
-    __Pyx_GIVEREF(((PyObject *)__pyx_v_args));
-    __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-    __pyx_t_4 = __pyx_f_6pygrib__strencode(__pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     __Pyx_DECREF_SET(__pyx_v_bytestr, __pyx_t_4);
     __pyx_t_4 = 0;
 
-    /* "pygrib.pyx":1880
+    /* "pygrib.pyx":1879
  *         else:
  *             bytestr = _strencode(','.join(args))
  *             keys = bytestr             # <<<<<<<<<<<<<<
  *             self._gi = grib_index_new_from_file (NULL, filenamec, keys, &err)
  *             if err:
  */
-    __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_v_bytestr); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_v_bytestr); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __pyx_v_keys = __pyx_t_2;
 
-    /* "pygrib.pyx":1881
+    /* "pygrib.pyx":1880
  *             bytestr = _strencode(','.join(args))
  *             keys = bytestr
  *             self._gi = grib_index_new_from_file (NULL, filenamec, keys, &err)             # <<<<<<<<<<<<<<
@@ -24570,7 +26754,7 @@ static int __pyx_pf_6pygrib_5index___cinit__(struct __pyx_obj_6pygrib_index *__p
  */
     __pyx_v_self->_gi = grib_index_new_from_file(NULL, __pyx_v_filenamec, __pyx_v_keys, (&__pyx_v_err));
 
-    /* "pygrib.pyx":1882
+    /* "pygrib.pyx":1881
  *             keys = bytestr
  *             self._gi = grib_index_new_from_file (NULL, filenamec, keys, &err)
  *             if err:             # <<<<<<<<<<<<<<
@@ -24580,118 +26764,157 @@ static int __pyx_pf_6pygrib_5index___cinit__(struct __pyx_obj_6pygrib_index *__p
     __pyx_t_3 = (__pyx_v_err != 0);
     if (__pyx_t_3) {
 
-      /* "pygrib.pyx":1883
+      /* "pygrib.pyx":1882
  *             self._gi = grib_index_new_from_file (NULL, filenamec, keys, &err)
  *             if err:
  *                 raise RuntimeError(grib_get_error_message(err))             # <<<<<<<<<<<<<<
  *             grbs = open(filename)
  *             if grbs.has_multi_field_msgs:
  */
-      __pyx_t_4 = __Pyx_PyBytes_FromString(grib_get_error_message(__pyx_v_err)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1883; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(((PyObject *)__pyx_t_4));
-      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1883; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_4));
-      __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
+      __pyx_t_4 = __Pyx_PyBytes_FromString(grib_get_error_message(__pyx_v_err)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_1);
+      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
+      __Pyx_GIVEREF(__pyx_t_4);
       __pyx_t_4 = 0;
-      __pyx_t_4 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1883; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_4);
-      __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
       __Pyx_Raise(__pyx_t_4, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1883; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      goto __pyx_L5;
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     }
-    __pyx_L5:;
 
-    /* "pygrib.pyx":1884
+    /* "pygrib.pyx":1883
  *             if err:
  *                 raise RuntimeError(grib_get_error_message(err))
  *             grbs = open(filename)             # <<<<<<<<<<<<<<
  *             if grbs.has_multi_field_msgs:
  *                 msg="""
  */
-    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1883; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_INCREF(__pyx_v_filename);
     PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_filename);
     __Pyx_GIVEREF(__pyx_v_filename);
-    __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pygrib_open)), ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-    __pyx_v_grbs = ((struct __pyx_obj_6pygrib_open *)__pyx_t_5);
-    __pyx_t_5 = 0;
+    __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pygrib_open)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1883; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_v_grbs = ((struct __pyx_obj_6pygrib_open *)__pyx_t_1);
+    __pyx_t_1 = 0;
 
-    /* "pygrib.pyx":1885
+    /* "pygrib.pyx":1884
  *                 raise RuntimeError(grib_get_error_message(err))
  *             grbs = open(filename)
  *             if grbs.has_multi_field_msgs:             # <<<<<<<<<<<<<<
  *                 msg="""
  * file %s has multi-field messages, keys inside multi-field
  */
-    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_grbs->has_multi_field_msgs); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_grbs->has_multi_field_msgs); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     if (__pyx_t_3) {
 
-      /* "pygrib.pyx":1888
+      /* "pygrib.pyx":1887
  *                 msg="""
  * file %s has multi-field messages, keys inside multi-field
  * messages will not be indexed correctly""" % filename             # <<<<<<<<<<<<<<
  *                 warnings.warn(msg)
  *             grbs.close()
  */
-      __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_183), __pyx_v_filename); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(((PyObject *)__pyx_t_5));
-      __pyx_v_msg = ((PyObject *)__pyx_t_5);
-      __pyx_t_5 = 0;
+      __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_file_s_has_multi_field_messages, __pyx_v_filename); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_1);
+      __pyx_v_msg = ((PyObject*)__pyx_t_1);
+      __pyx_t_1 = 0;
 
-      /* "pygrib.pyx":1889
+      /* "pygrib.pyx":1888
  * file %s has multi-field messages, keys inside multi-field
  * messages will not be indexed correctly""" % filename
  *                 warnings.warn(msg)             # <<<<<<<<<<<<<<
  *             grbs.close()
  *     def __init__(self, filename, *args):
  */
-      __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s__warnings); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s__warn); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_warnings); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_4);
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_warn); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_5);
-      __Pyx_INCREF(__pyx_v_msg);
-      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_msg);
-      __Pyx_GIVEREF(__pyx_v_msg);
-      __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
+      __pyx_t_4 = NULL;
+      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
+        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
+        if (likely(__pyx_t_4)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+          __Pyx_INCREF(__pyx_t_4);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_5, function);
+        }
+      }
+      if (!__pyx_t_4) {
+        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_msg); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_1);
+      } else {
+        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_6);
+        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
+        __Pyx_INCREF(__pyx_v_msg);
+        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_msg);
+        __Pyx_GIVEREF(__pyx_v_msg);
+        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_1);
+        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+      }
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
       goto __pyx_L6;
     }
     __pyx_L6:;
 
-    /* "pygrib.pyx":1890
+    /* "pygrib.pyx":1889
  * messages will not be indexed correctly""" % filename
  *                 warnings.warn(msg)
  *             grbs.close()             # <<<<<<<<<<<<<<
  *     def __init__(self, filename, *args):
  *         # initalize Python level objects
  */
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_grbs), __pyx_n_s__close); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_grbs), __pyx_n_s_close); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_t_6 = NULL;
+    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
+      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
+      if (likely(__pyx_t_6)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+        __Pyx_INCREF(__pyx_t_6);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_5, function);
+      }
+    }
+    if (__pyx_t_6) {
+      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    } else {
+      __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    }
+    __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   }
   __pyx_L3:;
 
+  /* "pygrib.pyx":1863
+ *     cdef grib_index *_gi
+ *     cdef public object keys, types, name
+ *     def __cinit__(self, filename, *args):             # <<<<<<<<<<<<<<
+ *         # initialize C level objects.
+ *         cdef grib_index *gi
+ */
+
+  /* function exit code */
   __pyx_r = 0;
   goto __pyx_L0;
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_XDECREF(__pyx_t_4);
   __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
   __Pyx_AddTraceback("pygrib.index.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_r = -1;
   __pyx_L0:;
@@ -24702,6 +26925,14 @@ static int __pyx_pf_6pygrib_5index___cinit__(struct __pyx_obj_6pygrib_index *__p
   return __pyx_r;
 }
 
+/* "pygrib.pyx":1890
+ *                 warnings.warn(msg)
+ *             grbs.close()
+ *     def __init__(self, filename, *args):             # <<<<<<<<<<<<<<
+ *         # initalize Python level objects
+ *         self.name = filename
+ */
+
 /* Python wrapper */
 static int __pyx_pw_6pygrib_5index_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static int __pyx_pw_6pygrib_5index_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
@@ -24724,7 +26955,7 @@ static int __pyx_pw_6pygrib_5index_3__init__(PyObject *__pyx_v_self, PyObject *_
     __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
   }
   {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__filename,0};
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filename,0};
     PyObject* values[1] = {0};
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
@@ -24737,12 +26968,12 @@ static int __pyx_pw_6pygrib_5index_3__init__(PyObject *__pyx_v_self, PyObject *_
       kw_args = PyDict_Size(__pyx_kwds);
       switch (pos_args) {
         case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__filename)) != 0)) kw_args--;
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_filename)) != 0)) kw_args--;
         else goto __pyx_L5_argtuple_error;
       }
       if (unlikely(kw_args > 0)) {
         const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1891; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1890; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
       goto __pyx_L5_argtuple_error;
@@ -24753,7 +26984,7 @@ static int __pyx_pw_6pygrib_5index_3__init__(PyObject *__pyx_v_self, PyObject *_
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1891; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1890; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
   __pyx_L3_error:;
   __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
   __Pyx_AddTraceback("pygrib.index.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
@@ -24761,19 +26992,13 @@ static int __pyx_pw_6pygrib_5index_3__init__(PyObject *__pyx_v_self, PyObject *_
   return -1;
   __pyx_L4_argument_unpacking_done:;
   __pyx_r = __pyx_pf_6pygrib_5index_2__init__(((struct __pyx_obj_6pygrib_index *)__pyx_v_self), __pyx_v_filename, __pyx_v_args);
+
+  /* function exit code */
   __Pyx_XDECREF(__pyx_v_args);
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "pygrib.pyx":1891
- *                 warnings.warn(msg)
- *             grbs.close()
- *     def __init__(self, filename, *args):             # <<<<<<<<<<<<<<
- *         # initalize Python level objects
- *         self.name = filename
- */
-
 static int __pyx_pf_6pygrib_5index_2__init__(struct __pyx_obj_6pygrib_index *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_args) {
   PyObject *__pyx_v_keys = NULL;
   PyObject *__pyx_v_types = NULL;
@@ -24797,7 +27022,7 @@ static int __pyx_pf_6pygrib_5index_2__init__(struct __pyx_obj_6pygrib_index *__p
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("__init__", 0);
 
-  /* "pygrib.pyx":1893
+  /* "pygrib.pyx":1892
  *     def __init__(self, filename, *args):
  *         # initalize Python level objects
  *         self.name = filename             # <<<<<<<<<<<<<<
@@ -24810,7 +27035,7 @@ static int __pyx_pf_6pygrib_5index_2__init__(struct __pyx_obj_6pygrib_index *__p
   __Pyx_DECREF(__pyx_v_self->name);
   __pyx_v_self->name = __pyx_v_filename;
 
-  /* "pygrib.pyx":1894
+  /* "pygrib.pyx":1893
  *         # initalize Python level objects
  *         self.name = filename
  *         self.keys = None             # <<<<<<<<<<<<<<
@@ -24823,7 +27048,7 @@ static int __pyx_pf_6pygrib_5index_2__init__(struct __pyx_obj_6pygrib_index *__p
   __Pyx_DECREF(__pyx_v_self->keys);
   __pyx_v_self->keys = Py_None;
 
-  /* "pygrib.pyx":1895
+  /* "pygrib.pyx":1894
  *         self.name = filename
  *         self.keys = None
  *         self.types = None             # <<<<<<<<<<<<<<
@@ -24836,83 +27061,83 @@ static int __pyx_pf_6pygrib_5index_2__init__(struct __pyx_obj_6pygrib_index *__p
   __Pyx_DECREF(__pyx_v_self->types);
   __pyx_v_self->types = Py_None;
 
-  /* "pygrib.pyx":1896
+  /* "pygrib.pyx":1895
  *         self.keys = None
  *         self.types = None
  *         if args != ():             # <<<<<<<<<<<<<<
  *             # is type is specified, strip it off.
  *             keys = [arg.split(':')[0] for arg in args]
  */
-  __pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_v_args), ((PyObject *)__pyx_empty_tuple), Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyObject_RichCompare(__pyx_v_args, __pyx_empty_tuple, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (__pyx_t_2) {
 
-    /* "pygrib.pyx":1898
+    /* "pygrib.pyx":1897
  *         if args != ():
  *             # is type is specified, strip it off.
  *             keys = [arg.split(':')[0] for arg in args]             # <<<<<<<<<<<<<<
  *             # if type is declared, save it (None if not declared)
  *             types = []
  */
-    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_3 = ((PyObject *)__pyx_v_args); __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
+    __pyx_t_3 = __pyx_v_args; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
     for (;;) {
       if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
       #if CYTHON_COMPILING_IN_CPYTHON
-      __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_5); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_5); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       #else
-      __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       #endif
       __Pyx_XDECREF_SET(__pyx_v_arg, __pyx_t_5);
       __pyx_t_5 = 0;
-      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s__split); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_split); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_184), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__100, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_6);
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_6, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_6, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
       __Pyx_GOTREF(__pyx_t_5);
       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     }
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __pyx_v_keys = ((PyObject*)__pyx_t_1);
     __pyx_t_1 = 0;
 
-    /* "pygrib.pyx":1900
+    /* "pygrib.pyx":1899
  *             keys = [arg.split(':')[0] for arg in args]
  *             # if type is declared, save it (None if not declared)
  *             types = []             # <<<<<<<<<<<<<<
  *             for arg in args:
  *                 try:
  */
-    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_1);
     __pyx_v_types = ((PyObject*)__pyx_t_1);
     __pyx_t_1 = 0;
 
-    /* "pygrib.pyx":1901
+    /* "pygrib.pyx":1900
  *             # if type is declared, save it (None if not declared)
  *             types = []
  *             for arg in args:             # <<<<<<<<<<<<<<
  *                 try:
  *                     type = arg.split(':')[1]
  */
-    __pyx_t_1 = ((PyObject *)__pyx_v_args); __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
+    __pyx_t_1 = __pyx_v_args; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
     for (;;) {
       if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
       #if CYTHON_COMPILING_IN_CPYTHON
-      __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       #else
-      __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       #endif
       __Pyx_XDECREF_SET(__pyx_v_arg, __pyx_t_3);
       __pyx_t_3 = 0;
 
-      /* "pygrib.pyx":1902
+      /* "pygrib.pyx":1901
  *             types = []
  *             for arg in args:
  *                 try:             # <<<<<<<<<<<<<<
@@ -24926,19 +27151,19 @@ static int __pyx_pf_6pygrib_5index_2__init__(struct __pyx_obj_6pygrib_index *__p
         __Pyx_XGOTREF(__pyx_t_9);
         /*try:*/ {
 
-          /* "pygrib.pyx":1903
+          /* "pygrib.pyx":1902
  *             for arg in args:
  *                 try:
  *                     type = arg.split(':')[1]             # <<<<<<<<<<<<<<
  *                 except IndexError:
  *                     type = None
  */
-          __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s__split); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1903; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
+          __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_split); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
           __Pyx_GOTREF(__pyx_t_3);
-          __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_185), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1903; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
+          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__101, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
           __Pyx_GOTREF(__pyx_t_5);
           __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-          __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_5, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1903; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
+          __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_5, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L8_error;};
           __Pyx_GOTREF(__pyx_t_3);
           __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
           __Pyx_XDECREF_SET(__pyx_v_type, __pyx_t_3);
@@ -24953,7 +27178,7 @@ static int __pyx_pf_6pygrib_5index_2__init__(struct __pyx_obj_6pygrib_index *__p
         __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
         __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
 
-        /* "pygrib.pyx":1904
+        /* "pygrib.pyx":1903
  *                 try:
  *                     type = arg.split(':')[1]
  *                 except IndexError:             # <<<<<<<<<<<<<<
@@ -24963,12 +27188,12 @@ static int __pyx_pf_6pygrib_5index_2__init__(struct __pyx_obj_6pygrib_index *__p
         __pyx_t_10 = PyErr_ExceptionMatches(__pyx_builtin_IndexError);
         if (__pyx_t_10) {
           __Pyx_AddTraceback("pygrib.index.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-          if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_5, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1904; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
+          if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_5, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1903; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
           __Pyx_GOTREF(__pyx_t_3);
           __Pyx_GOTREF(__pyx_t_5);
           __Pyx_GOTREF(__pyx_t_6);
 
-          /* "pygrib.pyx":1905
+          /* "pygrib.pyx":1904
  *                     type = arg.split(':')[1]
  *                 except IndexError:
  *                     type = None             # <<<<<<<<<<<<<<
@@ -24982,6 +27207,7 @@ static int __pyx_pf_6pygrib_5index_2__init__(struct __pyx_obj_6pygrib_index *__p
           __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
           goto __pyx_L9_exception_handled;
         }
+        goto __pyx_L10_except_error;
         __pyx_L10_except_error:;
         __Pyx_XGIVEREF(__pyx_t_7);
         __Pyx_XGIVEREF(__pyx_t_8);
@@ -24996,46 +27222,63 @@ static int __pyx_pf_6pygrib_5index_2__init__(struct __pyx_obj_6pygrib_index *__p
         __pyx_L15_try_end:;
       }
 
-      /* "pygrib.pyx":1906
+      /* "pygrib.pyx":1905
  *                 except IndexError:
  *                     type = None
  *                 types.append(type)             # <<<<<<<<<<<<<<
  *             self.keys = keys
  *             self.types = types
  */
-      __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_types, __pyx_v_type); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_types, __pyx_v_type); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+      /* "pygrib.pyx":1900
+ *             # if type is declared, save it (None if not declared)
+ *             types = []
+ *             for arg in args:             # <<<<<<<<<<<<<<
+ *                 try:
+ *                     type = arg.split(':')[1]
+ */
     }
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-    /* "pygrib.pyx":1907
+    /* "pygrib.pyx":1906
  *                     type = None
  *                 types.append(type)
  *             self.keys = keys             # <<<<<<<<<<<<<<
  *             self.types = types
  *     def __call__(self, **kwargs):
  */
-    __Pyx_INCREF(((PyObject *)__pyx_v_keys));
-    __Pyx_GIVEREF(((PyObject *)__pyx_v_keys));
+    __Pyx_INCREF(__pyx_v_keys);
+    __Pyx_GIVEREF(__pyx_v_keys);
     __Pyx_GOTREF(__pyx_v_self->keys);
     __Pyx_DECREF(__pyx_v_self->keys);
-    __pyx_v_self->keys = ((PyObject *)__pyx_v_keys);
+    __pyx_v_self->keys = __pyx_v_keys;
 
-    /* "pygrib.pyx":1908
+    /* "pygrib.pyx":1907
  *                 types.append(type)
  *             self.keys = keys
  *             self.types = types             # <<<<<<<<<<<<<<
  *     def __call__(self, **kwargs):
  *         """same as L{select}"""
  */
-    __Pyx_INCREF(((PyObject *)__pyx_v_types));
-    __Pyx_GIVEREF(((PyObject *)__pyx_v_types));
+    __Pyx_INCREF(__pyx_v_types);
+    __Pyx_GIVEREF(__pyx_v_types);
     __Pyx_GOTREF(__pyx_v_self->types);
     __Pyx_DECREF(__pyx_v_self->types);
-    __pyx_v_self->types = ((PyObject *)__pyx_v_types);
+    __pyx_v_self->types = __pyx_v_types;
     goto __pyx_L3;
   }
   __pyx_L3:;
 
+  /* "pygrib.pyx":1890
+ *                 warnings.warn(msg)
+ *             grbs.close()
+ *     def __init__(self, filename, *args):             # <<<<<<<<<<<<<<
+ *         # initalize Python level objects
+ *         self.name = filename
+ */
+
+  /* function exit code */
   __pyx_r = 0;
   goto __pyx_L0;
   __pyx_L1_error:;
@@ -25054,6 +27297,14 @@ static int __pyx_pf_6pygrib_5index_2__init__(struct __pyx_obj_6pygrib_index *__p
   return __pyx_r;
 }
 
+/* "pygrib.pyx":1908
+ *             self.keys = keys
+ *             self.types = types
+ *     def __call__(self, **kwargs):             # <<<<<<<<<<<<<<
+ *         """same as L{select}"""
+ *         return self.select(**kwargs)
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_6pygrib_5index_5__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static char __pyx_doc_6pygrib_5index_4__call__[] = "same as L{select}";
@@ -25072,19 +27323,13 @@ static PyObject *__pyx_pw_6pygrib_5index_5__call__(PyObject *__pyx_v_self, PyObj
   if (unlikely(!__pyx_v_kwargs)) return NULL;
   __Pyx_GOTREF(__pyx_v_kwargs);
   __pyx_r = __pyx_pf_6pygrib_5index_4__call__(((struct __pyx_obj_6pygrib_index *)__pyx_v_self), __pyx_v_kwargs);
+
+  /* function exit code */
   __Pyx_XDECREF(__pyx_v_kwargs);
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "pygrib.pyx":1909
- *             self.keys = keys
- *             self.types = types
- *     def __call__(self, **kwargs):             # <<<<<<<<<<<<<<
- *         """same as L{select}"""
- *         return self.select(**kwargs)
- */
-
 static PyObject *__pyx_pf_6pygrib_5index_4__call__(struct __pyx_obj_6pygrib_index *__pyx_v_self, PyObject *__pyx_v_kwargs) {
   PyObject *__pyx_r = NULL;
   __Pyx_RefNannyDeclarations
@@ -25096,7 +27341,7 @@ static PyObject *__pyx_pf_6pygrib_5index_4__call__(struct __pyx_obj_6pygrib_inde
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("__call__", 0);
 
-  /* "pygrib.pyx":1911
+  /* "pygrib.pyx":1910
  *     def __call__(self, **kwargs):
  *         """same as L{select}"""
  *         return self.select(**kwargs)             # <<<<<<<<<<<<<<
@@ -25104,20 +27349,27 @@ static PyObject *__pyx_pf_6pygrib_5index_4__call__(struct __pyx_obj_6pygrib_inde
  *         """
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__select); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_select); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = ((PyObject *)__pyx_v_kwargs);
+  __pyx_t_2 = __pyx_v_kwargs;
   __Pyx_INCREF(__pyx_t_2);
-  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __pyx_r = __pyx_t_3;
   __pyx_t_3 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "pygrib.pyx":1908
+ *             self.keys = keys
+ *             self.types = types
+ *     def __call__(self, **kwargs):             # <<<<<<<<<<<<<<
+ *         """same as L{select}"""
+ *         return self.select(**kwargs)
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_XDECREF(__pyx_t_2);
@@ -25130,6 +27382,14 @@ static PyObject *__pyx_pf_6pygrib_5index_4__call__(struct __pyx_obj_6pygrib_inde
   return __pyx_r;
 }
 
+/* "pygrib.pyx":1911
+ *         """same as L{select}"""
+ *         return self.select(**kwargs)
+ *     def select(self, **kwargs):             # <<<<<<<<<<<<<<
+ *         """
+ * select(**kwargs)
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_6pygrib_5index_7select(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static char __pyx_doc_6pygrib_5index_6select[] = "\nselect(**kwargs)\n\nreturn a list of L{gribmessage} instances from grib index object \ncorresponding to specific values of indexed keys (given by kwargs).\nUnlike L{open.select}, containers or callables cannot be used to \nselect multiple key values.\nHowever, using L{index.select} is much faster than L{open.select}.\n\nExample usage:\n\n>>> import pygrib\n>>> grbindx=pygrib.index('sampledata/gfs.grb','shortName','typeOfLevel','level')\ [...]
@@ -25145,19 +27405,13 @@ static PyObject *__pyx_pw_6pygrib_5index_7select(PyObject *__pyx_v_self, PyObjec
   if (unlikely(!__pyx_v_kwargs)) return NULL;
   __Pyx_GOTREF(__pyx_v_kwargs);
   __pyx_r = __pyx_pf_6pygrib_5index_6select(((struct __pyx_obj_6pygrib_index *)__pyx_v_self), __pyx_v_kwargs);
+
+  /* function exit code */
   __Pyx_XDECREF(__pyx_v_kwargs);
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "pygrib.pyx":1912
- *         """same as L{select}"""
- *         return self.select(**kwargs)
- *     def select(self, **kwargs):             # <<<<<<<<<<<<<<
- *         """
- * select(**kwargs)
- */
-
 static PyObject *__pyx_pf_6pygrib_5index_6select(struct __pyx_obj_6pygrib_index *__pyx_v_self, PyObject *__pyx_v_kwargs) {
   grib_handle *__pyx_v_gh;
   int __pyx_v_err;
@@ -25187,10 +27441,9 @@ static PyObject *__pyx_pf_6pygrib_5index_6select(struct __pyx_obj_6pygrib_index
   int __pyx_t_10;
   int __pyx_t_11;
   char *__pyx_t_12;
-  int __pyx_t_13;
-  long __pyx_t_14;
-  double __pyx_t_15;
-  int __pyx_t_16;
+  long __pyx_t_13;
+  double __pyx_t_14;
+  int __pyx_t_15;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
@@ -25215,35 +27468,38 @@ static PyObject *__pyx_pf_6pygrib_5index_6select(struct __pyx_obj_6pygrib_index
  */
   __pyx_t_1 = __Pyx_PyDict_Items(__pyx_v_kwargs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
+  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
     __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
     __pyx_t_4 = NULL;
   } else {
     __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
+    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   for (;;) {
-    if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_2)) {
-      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #else
-      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #endif
-    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) {
-      if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #else
-      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #endif
+    if (likely(!__pyx_t_4)) {
+      if (likely(PyList_CheckExact(__pyx_t_2))) {
+        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
+        #if CYTHON_COMPILING_IN_CPYTHON
+        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        #else
+        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        #endif
+      } else {
+        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
+        #if CYTHON_COMPILING_IN_CPYTHON
+        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        #else
+        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        #endif
+      }
     } else {
       __pyx_t_1 = __pyx_t_4(__pyx_t_2);
       if (unlikely(!__pyx_t_1)) {
-        if (PyErr_Occurred()) {
-          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
+        PyObject* exc_type = PyErr_Occurred();
+        if (exc_type) {
+          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
           else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         }
         break;
@@ -25279,8 +27535,7 @@ static PyObject *__pyx_pf_6pygrib_5index_6select(struct __pyx_obj_6pygrib_index
       __Pyx_GOTREF(__pyx_t_6);
       #endif
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    } else
-    {
+    } else {
       Py_ssize_t index = -1;
       __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_7);
@@ -25313,14 +27568,18 @@ static PyObject *__pyx_pf_6pygrib_5index_6select(struct __pyx_obj_6pygrib_index
  *                 raise KeyError('key not part of grib index')
  *             if self.types is not None:
  */
-    __pyx_t_9 = (__pyx_v_self->keys != Py_None);
-    if ((__pyx_t_9 != 0)) {
-      __pyx_t_10 = (__Pyx_PySequence_Contains(__pyx_v_k, __pyx_v_self->keys, Py_NE)); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_11 = (__pyx_t_10 != 0);
+    __pyx_t_10 = (__pyx_v_self->keys != Py_None);
+    __pyx_t_11 = (__pyx_t_10 != 0);
+    if (__pyx_t_11) {
     } else {
-      __pyx_t_11 = (__pyx_t_9 != 0);
+      __pyx_t_9 = __pyx_t_11;
+      goto __pyx_L8_bool_binop_done;
     }
-    if (__pyx_t_11) {
+    __pyx_t_11 = (__Pyx_PySequence_Contains(__pyx_v_k, __pyx_v_self->keys, Py_NE)); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_10 = (__pyx_t_11 != 0);
+    __pyx_t_9 = __pyx_t_10;
+    __pyx_L8_bool_binop_done:;
+    if (__pyx_t_9) {
 
       /* "pygrib.pyx":1948
  *         for k,v in kwargs.items():
@@ -25329,14 +27588,12 @@ static PyObject *__pyx_pf_6pygrib_5index_6select(struct __pyx_obj_6pygrib_index
  *             if self.types is not None:
  *                 typ = self.types[self.keys.index(k)]
  */
-      __pyx_t_1 = PyObject_Call(__pyx_builtin_KeyError, ((PyObject *)__pyx_k_tuple_187), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_tuple__102, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_Raise(__pyx_t_1, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
       {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      goto __pyx_L7;
     }
-    __pyx_L7:;
 
     /* "pygrib.pyx":1949
  *             if self.keys is not None and k not in self.keys:
@@ -25345,9 +27602,9 @@ static PyObject *__pyx_pf_6pygrib_5index_6select(struct __pyx_obj_6pygrib_index
  *                 typ = self.types[self.keys.index(k)]
  *             else:
  */
-    __pyx_t_11 = (__pyx_v_self->types != Py_None);
-    __pyx_t_9 = (__pyx_t_11 != 0);
-    if (__pyx_t_9) {
+    __pyx_t_9 = (__pyx_v_self->types != Py_None);
+    __pyx_t_10 = (__pyx_t_9 != 0);
+    if (__pyx_t_10) {
 
       /* "pygrib.pyx":1950
  *                 raise KeyError('key not part of grib index')
@@ -25356,23 +27613,39 @@ static PyObject *__pyx_pf_6pygrib_5index_6select(struct __pyx_obj_6pygrib_index
  *             else:
  *                 typ = None
  */
-      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->keys, __pyx_n_s__index); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->keys, __pyx_n_s_index); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_6);
-      __Pyx_INCREF(__pyx_v_k);
-      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_k);
-      __Pyx_GIVEREF(__pyx_v_k);
-      __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
-      __pyx_t_6 = PyObject_GetItem(__pyx_v_self->types, __pyx_t_5); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_5 = NULL;
+      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) {
+        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
+        if (likely(__pyx_t_5)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
+          __Pyx_INCREF(__pyx_t_5);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_6, function);
+        }
+      }
+      if (!__pyx_t_5) {
+        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_k); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_1);
+      } else {
+        __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_7);
+        PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
+        __Pyx_INCREF(__pyx_v_k);
+        PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_k);
+        __Pyx_GIVEREF(__pyx_v_k);
+        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_1);
+        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+      }
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __pyx_t_6 = PyObject_GetItem(__pyx_v_self->types, __pyx_t_1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
       __Pyx_GOTREF(__pyx_t_6);
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
       __Pyx_XDECREF_SET(__pyx_v_typ, __pyx_t_6);
       __pyx_t_6 = 0;
-      goto __pyx_L8;
+      goto __pyx_L10;
     }
     /*else*/ {
 
@@ -25386,7 +27659,7 @@ static PyObject *__pyx_pf_6pygrib_5index_6select(struct __pyx_obj_6pygrib_index
       __Pyx_INCREF(Py_None);
       __Pyx_XDECREF_SET(__pyx_v_typ, Py_None);
     }
-    __pyx_L8:;
+    __pyx_L10:;
 
     /* "pygrib.pyx":1953
  *             else:
@@ -25426,8 +27699,8 @@ static PyObject *__pyx_pf_6pygrib_5index_6select(struct __pyx_obj_6pygrib_index
  *                 raise RuntimeError(grib_get_error_message(err))
  *             sizetot = sizetot + size
  */
-    __pyx_t_9 = (__pyx_v_err != 0);
-    if (__pyx_t_9) {
+    __pyx_t_10 = (__pyx_v_err != 0);
+    if (__pyx_t_10) {
 
       /* "pygrib.pyx":1957
  *             err = grib_index_get_size(self._gi, key, &size)
@@ -25437,21 +27710,19 @@ static PyObject *__pyx_pf_6pygrib_5index_6select(struct __pyx_obj_6pygrib_index
  *             # if there are no matches for this key, just skip it
  */
       __pyx_t_6 = __Pyx_PyBytes_FromString(grib_get_error_message(__pyx_v_err)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(((PyObject *)__pyx_t_6));
-      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_6));
-      __Pyx_GIVEREF(((PyObject *)__pyx_t_6));
+      __Pyx_GOTREF(__pyx_t_6);
+      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_1);
+      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6);
+      __Pyx_GIVEREF(__pyx_t_6);
       __pyx_t_6 = 0;
-      __pyx_t_6 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_6);
-      __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
       __Pyx_Raise(__pyx_t_6, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
       {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      goto __pyx_L9;
     }
-    __pyx_L9:;
 
     /* "pygrib.pyx":1958
  *             if err:
@@ -25462,11 +27733,11 @@ static PyObject *__pyx_pf_6pygrib_5index_6select(struct __pyx_obj_6pygrib_index
  */
     __pyx_t_6 = __Pyx_PyInt_FromSize_t(__pyx_v_size); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_6);
-    __pyx_t_5 = PyNumber_Add(__pyx_v_sizetot, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_1 = PyNumber_Add(__pyx_v_sizetot, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    __Pyx_DECREF_SET(__pyx_v_sizetot, __pyx_t_5);
-    __pyx_t_5 = 0;
+    __Pyx_DECREF_SET(__pyx_v_sizetot, __pyx_t_1);
+    __pyx_t_1 = 0;
 
     /* "pygrib.pyx":1960
  *             sizetot = sizetot + size
@@ -25475,8 +27746,8 @@ static PyObject *__pyx_pf_6pygrib_5index_6select(struct __pyx_obj_6pygrib_index
  *                 continue
  *             if typ == 'l' or (type(v) == int or type(v) == long):
  */
-    __pyx_t_9 = ((!(__pyx_v_size != 0)) != 0);
-    if (__pyx_t_9) {
+    __pyx_t_10 = ((!(__pyx_v_size != 0)) != 0);
+    if (__pyx_t_10) {
 
       /* "pygrib.pyx":1961
  *             # if there are no matches for this key, just skip it
@@ -25486,9 +27757,7 @@ static PyObject *__pyx_pf_6pygrib_5index_6select(struct __pyx_obj_6pygrib_index
  *                 longval = long(v)
  */
       goto __pyx_L3_continue;
-      goto __pyx_L10;
     }
-    __pyx_L10:;
 
     /* "pygrib.pyx":1962
  *             if not size:
@@ -25497,26 +27766,26 @@ static PyObject *__pyx_pf_6pygrib_5index_6select(struct __pyx_obj_6pygrib_index
  *                 longval = long(v)
  *                 err = grib_index_select_long(self._gi, key, longval)
  */
-    __pyx_t_5 = PyObject_RichCompare(__pyx_v_typ, ((PyObject *)__pyx_n_s__l), Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1962; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1962; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __pyx_t_9 = (__Pyx_PyString_Equals(__pyx_v_typ, __pyx_n_s_l, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1962; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     if (!__pyx_t_9) {
-      __pyx_t_5 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_v)), ((PyObject *)((PyObject*)(&PyInt_Type))), Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1962; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1962; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (!__pyx_t_11) {
-        __pyx_t_5 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_v)), ((PyObject *)((PyObject*)(&PyLong_Type))), Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1962; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1962; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-        __pyx_t_13 = __pyx_t_10;
-      } else {
-        __pyx_t_13 = __pyx_t_11;
-      }
-      __pyx_t_11 = __pyx_t_13;
     } else {
-      __pyx_t_11 = __pyx_t_9;
+      __pyx_t_10 = __pyx_t_9;
+      goto __pyx_L14_bool_binop_done;
     }
-    if (__pyx_t_11) {
+    __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_v)), ((PyObject *)((PyObject*)(&PyInt_Type))), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1962; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1962; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    if (!__pyx_t_9) {
+    } else {
+      __pyx_t_10 = __pyx_t_9;
+      goto __pyx_L14_bool_binop_done;
+    }
+    __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_v)), ((PyObject *)((PyObject*)(&PyLong_Type))), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1962; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1962; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_t_10 = __pyx_t_9;
+    __pyx_L14_bool_binop_done:;
+    if (__pyx_t_10) {
 
       /* "pygrib.pyx":1963
  *                 continue
@@ -25525,17 +27794,17 @@ static PyObject *__pyx_pf_6pygrib_5index_6select(struct __pyx_obj_6pygrib_index
  *                 err = grib_index_select_long(self._gi, key, longval)
  *                 if err:
  */
-      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
+      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_1);
       __Pyx_INCREF(__pyx_v_v);
-      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_v);
+      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_v);
       __Pyx_GIVEREF(__pyx_v_v);
-      __pyx_t_6 = PyObject_Call(((PyObject *)((PyObject*)(&PyLong_Type))), ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyLong_Type))), __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_6);
-      __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
-      __pyx_t_14 = __Pyx_PyInt_AsLong(__pyx_t_6); if (unlikely((__pyx_t_14 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __pyx_t_13 = __Pyx_PyInt_As_long(__pyx_t_6); if (unlikely((__pyx_t_13 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-      __pyx_v_longval = __pyx_t_14;
+      __pyx_v_longval = __pyx_t_13;
 
       /* "pygrib.pyx":1964
  *             if typ == 'l' or (type(v) == int or type(v) == long):
@@ -25553,8 +27822,8 @@ static PyObject *__pyx_pf_6pygrib_5index_6select(struct __pyx_obj_6pygrib_index
  *                     raise RuntimeError(grib_get_error_message(err))
  *             elif typ == 'd' or type(v) == float:
  */
-      __pyx_t_11 = (__pyx_v_err != 0);
-      if (__pyx_t_11) {
+      __pyx_t_10 = (__pyx_v_err != 0);
+      if (__pyx_t_10) {
 
         /* "pygrib.pyx":1966
  *                 err = grib_index_select_long(self._gi, key, longval)
@@ -25564,22 +27833,20 @@ static PyObject *__pyx_pf_6pygrib_5index_6select(struct __pyx_obj_6pygrib_index
  *                 doubval = float(v)
  */
         __pyx_t_6 = __Pyx_PyBytes_FromString(grib_get_error_message(__pyx_v_err)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(((PyObject *)__pyx_t_6));
-        __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_5);
-        PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_6));
-        __Pyx_GIVEREF(((PyObject *)__pyx_t_6));
+        __Pyx_GOTREF(__pyx_t_6);
+        __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_1);
+        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6);
+        __Pyx_GIVEREF(__pyx_t_6);
         __pyx_t_6 = 0;
-        __pyx_t_6 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         __Pyx_GOTREF(__pyx_t_6);
-        __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
         __Pyx_Raise(__pyx_t_6, 0, 0, 0);
         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
         {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        goto __pyx_L12;
       }
-      __pyx_L12:;
-      goto __pyx_L11;
+      goto __pyx_L13;
     }
 
     /* "pygrib.pyx":1967
@@ -25589,18 +27856,18 @@ static PyObject *__pyx_pf_6pygrib_5index_6select(struct __pyx_obj_6pygrib_index
  *                 doubval = float(v)
  *                 err = grib_index_select_double(self._gi, key, doubval)
  */
-    __pyx_t_6 = PyObject_RichCompare(__pyx_v_typ, ((PyObject *)__pyx_n_s__d), Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    if (!__pyx_t_11) {
-      __pyx_t_6 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_v)), ((PyObject *)((PyObject*)(&PyFloat_Type))), Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-      __pyx_t_13 = __pyx_t_9;
+    __pyx_t_9 = (__Pyx_PyString_Equals(__pyx_v_typ, __pyx_n_s_d, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (!__pyx_t_9) {
     } else {
-      __pyx_t_13 = __pyx_t_11;
+      __pyx_t_10 = __pyx_t_9;
+      goto __pyx_L18_bool_binop_done;
     }
-    if (__pyx_t_13) {
+    __pyx_t_6 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_v)), ((PyObject *)((PyObject*)(&PyFloat_Type))), Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __pyx_t_10 = __pyx_t_9;
+    __pyx_L18_bool_binop_done:;
+    if (__pyx_t_10) {
 
       /* "pygrib.pyx":1968
  *                     raise RuntimeError(grib_get_error_message(err))
@@ -25609,8 +27876,8 @@ static PyObject *__pyx_pf_6pygrib_5index_6select(struct __pyx_obj_6pygrib_index
  *                 err = grib_index_select_double(self._gi, key, doubval)
  *                 if err:
  */
-      __pyx_t_15 = __Pyx_PyObject_AsDouble(__pyx_v_v); if (unlikely(__pyx_t_15 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_v_doubval = __pyx_t_15;
+      __pyx_t_14 = __Pyx_PyObject_AsDouble(__pyx_v_v); if (unlikely(__pyx_t_14 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_v_doubval = __pyx_t_14;
 
       /* "pygrib.pyx":1969
  *             elif typ == 'd' or type(v) == float:
@@ -25628,8 +27895,8 @@ static PyObject *__pyx_pf_6pygrib_5index_6select(struct __pyx_obj_6pygrib_index
  *                     raise RuntimeError(grib_get_error_message(err))
  *             elif typ == 's' or _is_stringlike(v):
  */
-      __pyx_t_13 = (__pyx_v_err != 0);
-      if (__pyx_t_13) {
+      __pyx_t_10 = (__pyx_v_err != 0);
+      if (__pyx_t_10) {
 
         /* "pygrib.pyx":1971
  *                 err = grib_index_select_double(self._gi, key, doubval)
@@ -25639,22 +27906,20 @@ static PyObject *__pyx_pf_6pygrib_5index_6select(struct __pyx_obj_6pygrib_index
  *                 bytestr = _strencode(v)
  */
         __pyx_t_6 = __Pyx_PyBytes_FromString(grib_get_error_message(__pyx_v_err)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(((PyObject *)__pyx_t_6));
-        __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_5);
-        PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_6));
-        __Pyx_GIVEREF(((PyObject *)__pyx_t_6));
+        __Pyx_GOTREF(__pyx_t_6);
+        __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_1);
+        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6);
+        __Pyx_GIVEREF(__pyx_t_6);
         __pyx_t_6 = 0;
-        __pyx_t_6 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         __Pyx_GOTREF(__pyx_t_6);
-        __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
         __Pyx_Raise(__pyx_t_6, 0, 0, 0);
         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
         {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        goto __pyx_L13;
       }
-      __pyx_L13:;
-      goto __pyx_L11;
+      goto __pyx_L13;
     }
 
     /* "pygrib.pyx":1972
@@ -25664,28 +27929,44 @@ static PyObject *__pyx_pf_6pygrib_5index_6select(struct __pyx_obj_6pygrib_index
  *                 bytestr = _strencode(v)
  *                 strval = bytestr
  */
-    __pyx_t_6 = PyObject_RichCompare(__pyx_v_typ, ((PyObject *)__pyx_n_s__s), Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    if (!__pyx_t_13) {
-      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s___is_stringlike); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_9 = (__Pyx_PyString_Equals(__pyx_v_typ, __pyx_n_s_s_4, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (!__pyx_t_9) {
+    } else {
+      __pyx_t_10 = __pyx_t_9;
+      goto __pyx_L21_bool_binop_done;
+    }
+    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_is_stringlike); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_7 = NULL;
+    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
+      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1);
+      if (likely(__pyx_t_7)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
+        __Pyx_INCREF(__pyx_t_7);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_1, function);
+      }
+    }
+    if (!__pyx_t_7) {
+      __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_v); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_6);
-      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    } else {
+      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_5);
+      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = NULL;
       __Pyx_INCREF(__pyx_v_v);
-      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_v);
+      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_v);
       __Pyx_GIVEREF(__pyx_v_v);
-      __pyx_t_1 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-      __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
-      __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __pyx_t_9 = __pyx_t_11;
-    } else {
-      __pyx_t_9 = __pyx_t_13;
+      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_6);
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     }
-    if (__pyx_t_9) {
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __pyx_t_10 = __pyx_t_9;
+    __pyx_L21_bool_binop_done:;
+    if (__pyx_t_10) {
 
       /* "pygrib.pyx":1973
  *                     raise RuntimeError(grib_get_error_message(err))
@@ -25694,11 +27975,11 @@ static PyObject *__pyx_pf_6pygrib_5index_6select(struct __pyx_obj_6pygrib_index
  *                 strval = bytestr
  *                 err = grib_index_select_string(self._gi, key, strval)
  */
-      __pyx_t_1 = __pyx_f_6pygrib__strencode(__pyx_v_v, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __Pyx_DECREF_SET(__pyx_v_bytestr, __pyx_t_1);
-      __pyx_t_1 = 0;
-
+      __pyx_t_6 = __pyx_f_6pygrib__strencode(__pyx_v_v, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_6);
+      __Pyx_DECREF_SET(__pyx_v_bytestr, __pyx_t_6);
+      __pyx_t_6 = 0;
+
       /* "pygrib.pyx":1974
  *             elif typ == 's' or _is_stringlike(v):
  *                 bytestr = _strencode(v)
@@ -25725,8 +28006,8 @@ static PyObject *__pyx_pf_6pygrib_5index_6select(struct __pyx_obj_6pygrib_index
  *                     raise RuntimeError(grib_get_error_message(err))
  *             else:
  */
-      __pyx_t_9 = (__pyx_v_err != 0);
-      if (__pyx_t_9) {
+      __pyx_t_10 = (__pyx_v_err != 0);
+      if (__pyx_t_10) {
 
         /* "pygrib.pyx":1977
  *                 err = grib_index_select_string(self._gi, key, strval)
@@ -25735,23 +28016,21 @@ static PyObject *__pyx_pf_6pygrib_5index_6select(struct __pyx_obj_6pygrib_index
  *             else:
  *                 raise TypeError('value must be float, int or string')
  */
-        __pyx_t_1 = __Pyx_PyBytes_FromString(grib_get_error_message(__pyx_v_err)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(((PyObject *)__pyx_t_1));
-        __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_5);
-        PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_1));
-        __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
-        __pyx_t_1 = 0;
-        __pyx_t_1 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_t_6 = __Pyx_PyBytes_FromString(grib_get_error_message(__pyx_v_err)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_6);
+        __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         __Pyx_GOTREF(__pyx_t_1);
-        __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
-        __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6);
+        __Pyx_GIVEREF(__pyx_t_6);
+        __pyx_t_6 = 0;
+        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_6);
         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        __Pyx_Raise(__pyx_t_6, 0, 0, 0);
+        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
         {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        goto __pyx_L14;
       }
-      __pyx_L14:;
-      goto __pyx_L11;
+      goto __pyx_L13;
     }
     /*else*/ {
 
@@ -25762,13 +28041,21 @@ static PyObject *__pyx_pf_6pygrib_5index_6select(struct __pyx_obj_6pygrib_index
  *         # if no matches found, raise an error.
  *         if sizetot == 0:
  */
-      __pyx_t_1 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_189), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__103, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_6);
+      __Pyx_Raise(__pyx_t_6, 0, 0, 0);
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
       {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     }
-    __pyx_L11:;
+    __pyx_L13:;
+
+    /* "pygrib.pyx":1946
+ *         # used declared type if available, other infer from type of value.
+ *         sizetot = 0
+ *         for k,v in kwargs.items():             # <<<<<<<<<<<<<<
+ *             if self.keys is not None and k not in self.keys:
+ *                 raise KeyError('key not part of grib index')
+ */
     __pyx_L3_continue:;
   }
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
@@ -25781,9 +28068,9 @@ static PyObject *__pyx_pf_6pygrib_5index_6select(struct __pyx_obj_6pygrib_index
  *         # create a list of grib messages corresponding to selection.
  */
   __pyx_t_2 = PyObject_RichCompare(__pyx_v_sizetot, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (__pyx_t_9) {
+  if (__pyx_t_10) {
 
     /* "pygrib.pyx":1982
  *         # if no matches found, raise an error.
@@ -25792,14 +28079,12 @@ static PyObject *__pyx_pf_6pygrib_5index_6select(struct __pyx_obj_6pygrib_index
  *         # create a list of grib messages corresponding to selection.
  *         messagenumber = 0; grbs = []
  */
-    __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_190), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__104, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L15;
   }
-  __pyx_L15:;
 
   /* "pygrib.pyx":1984
  *             raise ValueError('no matches found')
@@ -25823,7 +28108,6 @@ static PyObject *__pyx_pf_6pygrib_5index_6select(struct __pyx_obj_6pygrib_index
  *             if err or gh == NULL:
  */
   while (1) {
-    if (!1) break;
 
     /* "pygrib.pyx":1986
  *         messagenumber = 0; grbs = []
@@ -25841,13 +28125,16 @@ static PyObject *__pyx_pf_6pygrib_5index_6select(struct __pyx_obj_6pygrib_index
  *                 break
  *             else:
  */
-    if (!(__pyx_v_err != 0)) {
-      __pyx_t_9 = (__pyx_v_gh == NULL);
-      __pyx_t_13 = __pyx_t_9;
+    __pyx_t_9 = (__pyx_v_err != 0);
+    if (!__pyx_t_9) {
     } else {
-      __pyx_t_13 = (__pyx_v_err != 0);
+      __pyx_t_10 = __pyx_t_9;
+      goto __pyx_L28_bool_binop_done;
     }
-    if (__pyx_t_13) {
+    __pyx_t_9 = ((__pyx_v_gh == NULL) != 0);
+    __pyx_t_10 = __pyx_t_9;
+    __pyx_L28_bool_binop_done:;
+    if (__pyx_t_10) {
 
       /* "pygrib.pyx":1988
  *             gh = grib_handle_new_from_index(self._gi, &err)
@@ -25856,8 +28143,7 @@ static PyObject *__pyx_pf_6pygrib_5index_6select(struct __pyx_obj_6pygrib_index
  *             else:
  *                 messagenumber = messagenumber + 1
  */
-      goto __pyx_L17_break;
-      goto __pyx_L18;
+      goto __pyx_L26_break;
     }
     /*else*/ {
 
@@ -25873,7 +28159,6 @@ static PyObject *__pyx_pf_6pygrib_5index_6select(struct __pyx_obj_6pygrib_index
       __Pyx_DECREF_SET(__pyx_v_messagenumber, __pyx_t_2);
       __pyx_t_2 = 0;
     }
-    __pyx_L18:;
 
     /* "pygrib.pyx":1991
  *             else:
@@ -25884,7 +28169,7 @@ static PyObject *__pyx_pf_6pygrib_5index_6select(struct __pyx_obj_6pygrib_index
  */
     __pyx_t_2 = __pyx_f_6pygrib__create_gribmessage(__pyx_v_gh, __pyx_v_messagenumber); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_16 = __Pyx_PyList_Append(__pyx_v_grbs, __pyx_t_2); if (unlikely(__pyx_t_16 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_15 = __Pyx_PyList_Append(__pyx_v_grbs, __pyx_t_2); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
     /* "pygrib.pyx":1992
@@ -25903,8 +28188,8 @@ static PyObject *__pyx_pf_6pygrib_5index_6select(struct __pyx_obj_6pygrib_index
  *                 raise RuntimeError(grib_get_error_message(err))
  *         if not grbs:
  */
-    __pyx_t_13 = (__pyx_v_err != 0);
-    if (__pyx_t_13) {
+    __pyx_t_10 = (__pyx_v_err != 0);
+    if (__pyx_t_10) {
 
       /* "pygrib.pyx":1994
  *             err = grib_handle_delete(gh)
@@ -25914,23 +28199,21 @@ static PyObject *__pyx_pf_6pygrib_5index_6select(struct __pyx_obj_6pygrib_index
  *             raise ValueError('no matches found')
  */
       __pyx_t_2 = __Pyx_PyBytes_FromString(grib_get_error_message(__pyx_v_err)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
-      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_2));
-      __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
+      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_6);
+      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
+      __Pyx_GIVEREF(__pyx_t_2);
       __pyx_t_2 = 0;
-      __pyx_t_2 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_2);
-      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
       __Pyx_Raise(__pyx_t_2, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
       {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      goto __pyx_L19;
     }
-    __pyx_L19:;
   }
-  __pyx_L17_break:;
+  __pyx_L26_break:;
 
   /* "pygrib.pyx":1995
  *             if err:
@@ -25939,8 +28222,8 @@ static PyObject *__pyx_pf_6pygrib_5index_6select(struct __pyx_obj_6pygrib_index
  *             raise ValueError('no matches found')
  *         # return the list of grib messages.
  */
-  __pyx_t_13 = (((PyObject *)__pyx_v_grbs) != Py_None) && (PyList_GET_SIZE(((PyObject *)__pyx_v_grbs)) != 0);
-  __pyx_t_9 = ((!__pyx_t_13) != 0);
+  __pyx_t_10 = (__pyx_v_grbs != Py_None) && (PyList_GET_SIZE(__pyx_v_grbs) != 0);
+  __pyx_t_9 = ((!__pyx_t_10) != 0);
   if (__pyx_t_9) {
 
     /* "pygrib.pyx":1996
@@ -25950,14 +28233,12 @@ static PyObject *__pyx_pf_6pygrib_5index_6select(struct __pyx_obj_6pygrib_index
  *         # return the list of grib messages.
  *         return grbs
  */
-    __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_191), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__105, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L20;
   }
-  __pyx_L20:;
 
   /* "pygrib.pyx":1998
  *             raise ValueError('no matches found')
@@ -25967,12 +28248,19 @@ static PyObject *__pyx_pf_6pygrib_5index_6select(struct __pyx_obj_6pygrib_index
  *         """
  */
   __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(((PyObject *)__pyx_v_grbs));
-  __pyx_r = ((PyObject *)__pyx_v_grbs);
+  __Pyx_INCREF(__pyx_v_grbs);
+  __pyx_r = __pyx_v_grbs;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "pygrib.pyx":1911
+ *         """same as L{select}"""
+ *         return self.select(**kwargs)
+ *     def select(self, **kwargs):             # <<<<<<<<<<<<<<
+ *         """
+ * select(**kwargs)
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_XDECREF(__pyx_t_2);
@@ -25994,6 +28282,14 @@ static PyObject *__pyx_pf_6pygrib_5index_6select(struct __pyx_obj_6pygrib_index
   return __pyx_r;
 }
 
+/* "pygrib.pyx":1999
+ *         # return the list of grib messages.
+ *         return grbs
+ *     def write(self,filename):             # <<<<<<<<<<<<<<
+ *         """
+ *         write(filename)
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_6pygrib_5index_9write(PyObject *__pyx_v_self, PyObject *__pyx_v_filename); /*proto*/
 static char __pyx_doc_6pygrib_5index_8write[] = "\n        write(filename)\n\n        save grib index to file";
@@ -26002,18 +28298,12 @@ static PyObject *__pyx_pw_6pygrib_5index_9write(PyObject *__pyx_v_self, PyObject
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("write (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_5index_8write(((struct __pyx_obj_6pygrib_index *)__pyx_v_self), ((PyObject *)__pyx_v_filename));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "pygrib.pyx":1999
- *         # return the list of grib messages.
- *         return grbs
- *     def write(self,filename):             # <<<<<<<<<<<<<<
- *         """
- *         write(filename)
- */
-
 static PyObject *__pyx_pf_6pygrib_5index_8write(struct __pyx_obj_6pygrib_index *__pyx_v_self, PyObject *__pyx_v_filename) {
   char *__pyx_v_filenamec;
   PyObject *__pyx_v_bytestr = NULL;
@@ -26078,22 +28368,29 @@ static PyObject *__pyx_pf_6pygrib_5index_8write(struct __pyx_obj_6pygrib_index *
  *         """
  */
     __pyx_t_1 = __Pyx_PyBytes_FromString(grib_get_error_message(__pyx_v_err)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
+    __Pyx_GOTREF(__pyx_t_1);
     __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
-    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_1));
-    __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
+    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
+    __Pyx_GIVEREF(__pyx_t_1);
     __pyx_t_1 = 0;
-    __pyx_t_1 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_Raise(__pyx_t_1, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L3;
   }
-  __pyx_L3:;
 
+  /* "pygrib.pyx":1999
+ *         # return the list of grib messages.
+ *         return grbs
+ *     def write(self,filename):             # <<<<<<<<<<<<<<
+ *         """
+ *         write(filename)
+ */
+
+  /* function exit code */
   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
   goto __pyx_L0;
   __pyx_L1_error:;
@@ -26108,6 +28405,14 @@ static PyObject *__pyx_pf_6pygrib_5index_8write(struct __pyx_obj_6pygrib_index *
   return __pyx_r;
 }
 
+/* "pygrib.pyx":2010
+ *         if err:
+ *             raise RuntimeError(grib_get_error_message(err))
+ *     def close(self):             # <<<<<<<<<<<<<<
+ *         """
+ *         close()
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_6pygrib_5index_11close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
 static char __pyx_doc_6pygrib_5index_10close[] = "\n        close()\n\n        deallocate C structures associated with class instance";
@@ -26116,18 +28421,12 @@ static PyObject *__pyx_pw_6pygrib_5index_11close(PyObject *__pyx_v_self, CYTHON_
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("close (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_5index_10close(((struct __pyx_obj_6pygrib_index *)__pyx_v_self));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "pygrib.pyx":2010
- *         if err:
- *             raise RuntimeError(grib_get_error_message(err))
- *     def close(self):             # <<<<<<<<<<<<<<
- *         """
- *         close()
- */
-
 static PyObject *__pyx_pf_6pygrib_5index_10close(struct __pyx_obj_6pygrib_index *__pyx_v_self) {
   PyObject *__pyx_r = NULL;
   __Pyx_RefNannyDeclarations
@@ -26151,29 +28450,40 @@ static PyObject *__pyx_pf_6pygrib_5index_10close(struct __pyx_obj_6pygrib_index
  */
   __pyx_v_self->_gi = NULL;
 
+  /* "pygrib.pyx":2010
+ *         if err:
+ *             raise RuntimeError(grib_get_error_message(err))
+ *     def close(self):             # <<<<<<<<<<<<<<
+ *         """
+ *         close()
+ */
+
+  /* function exit code */
   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
   __Pyx_XGIVEREF(__pyx_r);
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
+/* "pygrib.pyx":2018
+ *         self._gi = NULL
+ * 
+ *     def __dealloc__(self):             # <<<<<<<<<<<<<<
+ *         # deallocate storage when there are no more references
+ *         # to the object.
+ */
+
 /* Python wrapper */
 static void __pyx_pw_6pygrib_5index_13__dealloc__(PyObject *__pyx_v_self); /*proto*/
 static void __pyx_pw_6pygrib_5index_13__dealloc__(PyObject *__pyx_v_self) {
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
   __pyx_pf_6pygrib_5index_12__dealloc__(((struct __pyx_obj_6pygrib_index *)__pyx_v_self));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
 }
 
-/* "pygrib.pyx":2018
- *         self._gi = NULL
- * 
- *     def __dealloc__(self):             # <<<<<<<<<<<<<<
- *         # deallocate storage when there are no more references
- *         # to the object.
- */
-
 static void __pyx_pf_6pygrib_5index_12__dealloc__(struct __pyx_obj_6pygrib_index *__pyx_v_self) {
   __Pyx_RefNannyDeclarations
   int __pyx_t_1;
@@ -26201,9 +28511,26 @@ static void __pyx_pf_6pygrib_5index_12__dealloc__(struct __pyx_obj_6pygrib_index
   }
   __pyx_L3:;
 
+  /* "pygrib.pyx":2018
+ *         self._gi = NULL
+ * 
+ *     def __dealloc__(self):             # <<<<<<<<<<<<<<
+ *         # deallocate storage when there are no more references
+ *         # to the object.
+ */
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
 }
 
+/* "pygrib.pyx":1862
+ * """
+ *     cdef grib_index *_gi
+ *     cdef public object keys, types, name             # <<<<<<<<<<<<<<
+ *     def __cinit__(self, filename, *args):
+ *         # initialize C level objects.
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_6pygrib_5index_4keys_1__get__(PyObject *__pyx_v_self); /*proto*/
 static PyObject *__pyx_pw_6pygrib_5index_4keys_1__get__(PyObject *__pyx_v_self) {
@@ -26211,18 +28538,12 @@ static PyObject *__pyx_pw_6pygrib_5index_4keys_1__get__(PyObject *__pyx_v_self)
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_5index_4keys___get__(((struct __pyx_obj_6pygrib_index *)__pyx_v_self));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "pygrib.pyx":1864
- * """
- *     cdef grib_index *_gi
- *     cdef public object keys, types, name             # <<<<<<<<<<<<<<
- *     def __cinit__(self, filename, *args):
- *         # initialize C level objects.
- */
-
 static PyObject *__pyx_pf_6pygrib_5index_4keys___get__(struct __pyx_obj_6pygrib_index *__pyx_v_self) {
   PyObject *__pyx_r = NULL;
   __Pyx_RefNannyDeclarations
@@ -26232,7 +28553,7 @@ static PyObject *__pyx_pf_6pygrib_5index_4keys___get__(struct __pyx_obj_6pygrib_
   __pyx_r = __pyx_v_self->keys;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  /* function exit code */
   __pyx_L0:;
   __Pyx_XGIVEREF(__pyx_r);
   __Pyx_RefNannyFinishContext();
@@ -26246,6 +28567,8 @@ static int __pyx_pw_6pygrib_5index_4keys_3__set__(PyObject *__pyx_v_self, PyObje
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_5index_4keys_2__set__(((struct __pyx_obj_6pygrib_index *)__pyx_v_self), ((PyObject *)__pyx_v_value));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
@@ -26260,6 +28583,7 @@ static int __pyx_pf_6pygrib_5index_4keys_2__set__(struct __pyx_obj_6pygrib_index
   __Pyx_DECREF(__pyx_v_self->keys);
   __pyx_v_self->keys = __pyx_v_value;
 
+  /* function exit code */
   __pyx_r = 0;
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
@@ -26272,6 +28596,8 @@ static int __pyx_pw_6pygrib_5index_4keys_5__del__(PyObject *__pyx_v_self) {
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_5index_4keys_4__del__(((struct __pyx_obj_6pygrib_index *)__pyx_v_self));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
@@ -26286,6 +28612,7 @@ static int __pyx_pf_6pygrib_5index_4keys_4__del__(struct __pyx_obj_6pygrib_index
   __Pyx_DECREF(__pyx_v_self->keys);
   __pyx_v_self->keys = Py_None;
 
+  /* function exit code */
   __pyx_r = 0;
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
@@ -26298,6 +28625,8 @@ static PyObject *__pyx_pw_6pygrib_5index_5types_1__get__(PyObject *__pyx_v_self)
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_5index_5types___get__(((struct __pyx_obj_6pygrib_index *)__pyx_v_self));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
@@ -26311,7 +28640,7 @@ static PyObject *__pyx_pf_6pygrib_5index_5types___get__(struct __pyx_obj_6pygrib
   __pyx_r = __pyx_v_self->types;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  /* function exit code */
   __pyx_L0:;
   __Pyx_XGIVEREF(__pyx_r);
   __Pyx_RefNannyFinishContext();
@@ -26325,6 +28654,8 @@ static int __pyx_pw_6pygrib_5index_5types_3__set__(PyObject *__pyx_v_self, PyObj
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_5index_5types_2__set__(((struct __pyx_obj_6pygrib_index *)__pyx_v_self), ((PyObject *)__pyx_v_value));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
@@ -26339,6 +28670,7 @@ static int __pyx_pf_6pygrib_5index_5types_2__set__(struct __pyx_obj_6pygrib_inde
   __Pyx_DECREF(__pyx_v_self->types);
   __pyx_v_self->types = __pyx_v_value;
 
+  /* function exit code */
   __pyx_r = 0;
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
@@ -26351,6 +28683,8 @@ static int __pyx_pw_6pygrib_5index_5types_5__del__(PyObject *__pyx_v_self) {
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_5index_5types_4__del__(((struct __pyx_obj_6pygrib_index *)__pyx_v_self));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
@@ -26365,6 +28699,7 @@ static int __pyx_pf_6pygrib_5index_5types_4__del__(struct __pyx_obj_6pygrib_inde
   __Pyx_DECREF(__pyx_v_self->types);
   __pyx_v_self->types = Py_None;
 
+  /* function exit code */
   __pyx_r = 0;
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
@@ -26377,6 +28712,8 @@ static PyObject *__pyx_pw_6pygrib_5index_4name_1__get__(PyObject *__pyx_v_self)
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_5index_4name___get__(((struct __pyx_obj_6pygrib_index *)__pyx_v_self));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
@@ -26390,7 +28727,7 @@ static PyObject *__pyx_pf_6pygrib_5index_4name___get__(struct __pyx_obj_6pygrib_
   __pyx_r = __pyx_v_self->name;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  /* function exit code */
   __pyx_L0:;
   __Pyx_XGIVEREF(__pyx_r);
   __Pyx_RefNannyFinishContext();
@@ -26404,6 +28741,8 @@ static int __pyx_pw_6pygrib_5index_4name_3__set__(PyObject *__pyx_v_self, PyObje
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_5index_4name_2__set__(((struct __pyx_obj_6pygrib_index *)__pyx_v_self), ((PyObject *)__pyx_v_value));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
@@ -26418,6 +28757,7 @@ static int __pyx_pf_6pygrib_5index_4name_2__set__(struct __pyx_obj_6pygrib_index
   __Pyx_DECREF(__pyx_v_self->name);
   __pyx_v_self->name = __pyx_v_value;
 
+  /* function exit code */
   __pyx_r = 0;
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
@@ -26430,6 +28770,8 @@ static int __pyx_pw_6pygrib_5index_4name_5__del__(PyObject *__pyx_v_self) {
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_5index_4name_4__del__(((struct __pyx_obj_6pygrib_index *)__pyx_v_self));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
@@ -26444,39 +28786,40 @@ static int __pyx_pf_6pygrib_5index_4name_4__del__(struct __pyx_obj_6pygrib_index
   __Pyx_DECREF(__pyx_v_self->name);
   __pyx_v_self->name = Py_None;
 
+  /* function exit code */
   __pyx_r = 0;
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
+/* "pygrib.pyx":2024
+ *             grib_index_delete(self._gi)
+ * 
+ * def _is_stringlike(a):             # <<<<<<<<<<<<<<
+ *     if type(a) == str or type(a) == bytes or type(a) == unicode:
+ *         return True
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_6pygrib_23_is_stringlike(PyObject *__pyx_self, PyObject *__pyx_v_a); /*proto*/
-static PyMethodDef __pyx_mdef_6pygrib_23_is_stringlike = {__Pyx_NAMESTR("_is_stringlike"), (PyCFunction)__pyx_pw_6pygrib_23_is_stringlike, METH_O, __Pyx_DOCSTR(0)};
+static PyMethodDef __pyx_mdef_6pygrib_23_is_stringlike = {"_is_stringlike", (PyCFunction)__pyx_pw_6pygrib_23_is_stringlike, METH_O, 0};
 static PyObject *__pyx_pw_6pygrib_23_is_stringlike(PyObject *__pyx_self, PyObject *__pyx_v_a) {
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("_is_stringlike (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_22_is_stringlike(__pyx_self, ((PyObject *)__pyx_v_a));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "pygrib.pyx":2024
- *             grib_index_delete(self._gi)
- * 
- * def _is_stringlike(a):             # <<<<<<<<<<<<<<
- *     if type(a) == str or type(a) == bytes or type(a) == unicode:
- *         return True
- */
-
 static PyObject *__pyx_pf_6pygrib_22_is_stringlike(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_a) {
   PyObject *__pyx_r = NULL;
   __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  int __pyx_t_2;
+  int __pyx_t_1;
+  PyObject *__pyx_t_2 = NULL;
   int __pyx_t_3;
-  int __pyx_t_4;
-  int __pyx_t_5;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
@@ -26489,26 +28832,28 @@ static PyObject *__pyx_pf_6pygrib_22_is_stringlike(CYTHON_UNUSED PyObject *__pyx
  *         return True
  *     else:
  */
-  __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_a)), ((PyObject *)((PyObject*)(&PyString_Type))), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  if (!__pyx_t_2) {
-    __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_a)), ((PyObject *)((PyObject*)(&PyBytes_Type))), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    if (!__pyx_t_3) {
-      __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_a)), ((PyObject *)((PyObject*)(&PyUnicode_Type))), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __pyx_t_5 = __pyx_t_4;
-    } else {
-      __pyx_t_5 = __pyx_t_3;
-    }
-    __pyx_t_3 = __pyx_t_5;
+  __pyx_t_2 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_a)), ((PyObject *)((PyObject*)(&PyString_Type))), Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  if (!__pyx_t_3) {
   } else {
-    __pyx_t_3 = __pyx_t_2;
+    __pyx_t_1 = __pyx_t_3;
+    goto __pyx_L4_bool_binop_done;
   }
-  if (__pyx_t_3) {
+  __pyx_t_2 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_a)), ((PyObject *)((PyObject*)(&PyBytes_Type))), Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  if (!__pyx_t_3) {
+  } else {
+    __pyx_t_1 = __pyx_t_3;
+    goto __pyx_L4_bool_binop_done;
+  }
+  __pyx_t_2 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_a)), ((PyObject *)((PyObject*)(&PyUnicode_Type))), Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_1 = __pyx_t_3;
+  __pyx_L4_bool_binop_done:;
+  if (__pyx_t_1) {
 
     /* "pygrib.pyx":2026
  * def _is_stringlike(a):
@@ -26518,12 +28863,9 @@ static PyObject *__pyx_pf_6pygrib_22_is_stringlike(CYTHON_UNUSED PyObject *__pyx
  *         return False
  */
     __Pyx_XDECREF(__pyx_r);
-    __pyx_t_1 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_r = __pyx_t_1;
-    __pyx_t_1 = 0;
+    __Pyx_INCREF(Py_True);
+    __pyx_r = Py_True;
     goto __pyx_L0;
-    goto __pyx_L3;
   }
   /*else*/ {
 
@@ -26535,18 +28877,22 @@ static PyObject *__pyx_pf_6pygrib_22_is_stringlike(CYTHON_UNUSED PyObject *__pyx
  * def _is_container(a):
  */
     __Pyx_XDECREF(__pyx_r);
-    __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_r = __pyx_t_1;
-    __pyx_t_1 = 0;
+    __Pyx_INCREF(Py_False);
+    __pyx_r = Py_False;
     goto __pyx_L0;
   }
-  __pyx_L3:;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "pygrib.pyx":2024
+ *             grib_index_delete(self._gi)
+ * 
+ * def _is_stringlike(a):             # <<<<<<<<<<<<<<
+ *     if type(a) == str or type(a) == bytes or type(a) == unicode:
+ *         return True
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
   __Pyx_AddTraceback("pygrib._is_stringlike", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_r = NULL;
   __pyx_L0:;
@@ -26555,26 +28901,28 @@ static PyObject *__pyx_pf_6pygrib_22_is_stringlike(CYTHON_UNUSED PyObject *__pyx
   return __pyx_r;
 }
 
+/* "pygrib.pyx":2030
+ *         return False
+ * 
+ * def _is_container(a):             # <<<<<<<<<<<<<<
+ *     # is object container-like?  (can test for
+ *     # membership with "is in", but not a string)
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_6pygrib_25_is_container(PyObject *__pyx_self, PyObject *__pyx_v_a); /*proto*/
-static PyMethodDef __pyx_mdef_6pygrib_25_is_container = {__Pyx_NAMESTR("_is_container"), (PyCFunction)__pyx_pw_6pygrib_25_is_container, METH_O, __Pyx_DOCSTR(0)};
+static PyMethodDef __pyx_mdef_6pygrib_25_is_container = {"_is_container", (PyCFunction)__pyx_pw_6pygrib_25_is_container, METH_O, 0};
 static PyObject *__pyx_pw_6pygrib_25_is_container(PyObject *__pyx_self, PyObject *__pyx_v_a) {
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("_is_container (wrapper)", 0);
   __pyx_r = __pyx_pf_6pygrib_24_is_container(__pyx_self, ((PyObject *)__pyx_v_a));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "pygrib.pyx":2030
- *         return False
- * 
- * def _is_container(a):             # <<<<<<<<<<<<<<
- *     # is object container-like?  (can test for
- *     # membership with "is in", but not a string)
- */
-
 static PyObject *__pyx_pf_6pygrib_24_is_container(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_a) {
   PyObject *__pyx_r = NULL;
   __Pyx_RefNannyDeclarations
@@ -26626,18 +28974,12 @@ static PyObject *__pyx_pf_6pygrib_24_is_container(CYTHON_UNUSED PyObject *__pyx_
       __Pyx_GOTREF(__pyx_t_6);
       __Pyx_GOTREF(__pyx_t_7);
       __Pyx_XDECREF(__pyx_r);
-      __pyx_t_8 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2034; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-      __pyx_r = __pyx_t_8;
-      __pyx_t_8 = 0;
+      __Pyx_INCREF(Py_False);
+      __pyx_r = Py_False;
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
       goto __pyx_L6_except_return;
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      goto __pyx_L4_exception_handled;
     }
     __pyx_L5_except_error:;
     __Pyx_XGIVEREF(__pyx_t_1);
@@ -26651,11 +28993,6 @@ static PyObject *__pyx_pf_6pygrib_24_is_container(CYTHON_UNUSED PyObject *__pyx_
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
     goto __pyx_L0;
-    __pyx_L4_exception_handled:;
-    __Pyx_XGIVEREF(__pyx_t_1);
-    __Pyx_XGIVEREF(__pyx_t_2);
-    __Pyx_XGIVEREF(__pyx_t_3);
-    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
     __pyx_L10_try_end:;
   }
 
@@ -26666,29 +29003,41 @@ static PyObject *__pyx_pf_6pygrib_24_is_container(CYTHON_UNUSED PyObject *__pyx_
  *     return True
  * 
  */
-  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s___is_stringlike); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_is_stringlike); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
-  __Pyx_INCREF(__pyx_v_a);
-  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_a);
-  __Pyx_GIVEREF(__pyx_v_a);
-  __pyx_t_5 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
-  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  if (__pyx_t_4) {
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_5 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __pyx_r = __pyx_t_5;
-    __pyx_t_5 = 0;
+  __pyx_t_5 = NULL;
+  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
+    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
+    if (likely(__pyx_t_5)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
+      __Pyx_INCREF(__pyx_t_5);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_6, function);
+    }
+  }
+  if (!__pyx_t_5) {
+    __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_a); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_7);
+  } else {
+    __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_8);
+    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
+    __Pyx_INCREF(__pyx_v_a);
+    PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_v_a);
+    __Pyx_GIVEREF(__pyx_v_a);
+    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_7);
+    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+  }
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  if (__pyx_t_4) {
+    __Pyx_XDECREF(__pyx_r);
+    __Pyx_INCREF(Py_False);
+    __pyx_r = Py_False;
     goto __pyx_L0;
-    goto __pyx_L13;
   }
-  __pyx_L13:;
 
   /* "pygrib.pyx":2036
  *     except: return False
@@ -26698,14 +29047,19 @@ static PyObject *__pyx_pf_6pygrib_24_is_container(CYTHON_UNUSED PyObject *__pyx_
  * def _find(grb, **kwargs):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_5 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2036; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  __pyx_r = __pyx_t_5;
-  __pyx_t_5 = 0;
+  __Pyx_INCREF(Py_True);
+  __pyx_r = Py_True;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "pygrib.pyx":2030
+ *         return False
+ * 
+ * def _is_container(a):             # <<<<<<<<<<<<<<
+ *     # is object container-like?  (can test for
+ *     # membership with "is in", but not a string)
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_5);
   __Pyx_XDECREF(__pyx_t_6);
@@ -26719,9 +29073,17 @@ static PyObject *__pyx_pf_6pygrib_24_is_container(CYTHON_UNUSED PyObject *__pyx_
   return __pyx_r;
 }
 
+/* "pygrib.pyx":2038
+ *     return True
+ * 
+ * def _find(grb, **kwargs):             # <<<<<<<<<<<<<<
+ *     # search for key/value matches in grib message.
+ *     # If value is a container-like object, search for matches to any element.
+ */
+
 /* Python wrapper */
 static PyObject *__pyx_pw_6pygrib_27_find(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_mdef_6pygrib_27_find = {__Pyx_NAMESTR("_find"), (PyCFunction)__pyx_pw_6pygrib_27_find, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
+static PyMethodDef __pyx_mdef_6pygrib_27_find = {"_find", (PyCFunction)__pyx_pw_6pygrib_27_find, METH_VARARGS|METH_KEYWORDS, 0};
 static PyObject *__pyx_pw_6pygrib_27_find(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyObject *__pyx_v_grb = 0;
   PyObject *__pyx_v_kwargs = 0;
@@ -26734,7 +29096,7 @@ static PyObject *__pyx_pw_6pygrib_27_find(PyObject *__pyx_self, PyObject *__pyx_
   __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
   __Pyx_GOTREF(__pyx_v_kwargs);
   {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__grb,0};
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_grb,0};
     PyObject* values[1] = {0};
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
@@ -26747,7 +29109,7 @@ static PyObject *__pyx_pw_6pygrib_27_find(PyObject *__pyx_self, PyObject *__pyx_
       kw_args = PyDict_Size(__pyx_kwds);
       switch (pos_args) {
         case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__grb)) != 0)) kw_args--;
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_grb)) != 0)) kw_args--;
         else goto __pyx_L5_argtuple_error;
       }
       if (unlikely(kw_args > 0)) {
@@ -26770,24 +29132,18 @@ static PyObject *__pyx_pw_6pygrib_27_find(PyObject *__pyx_self, PyObject *__pyx_
   return NULL;
   __pyx_L4_argument_unpacking_done:;
   __pyx_r = __pyx_pf_6pygrib_26_find(__pyx_self, __pyx_v_grb, __pyx_v_kwargs);
+
+  /* function exit code */
   __Pyx_XDECREF(__pyx_v_kwargs);
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "pygrib.pyx":2038
- *     return True
- * 
- * def _find(grb, **kwargs):             # <<<<<<<<<<<<<<
- *     # search for key/value matches in grib message.
- *     # If value is a container-like object, search for matches to any element.
- */
-
 static PyObject *__pyx_pf_6pygrib_26_find(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_grb, PyObject *__pyx_v_kwargs) {
   PyObject *__pyx_v_k = NULL;
   PyObject *__pyx_v_v = NULL;
   PyObject *__pyx_v_iscontainer = NULL;
-  PyObject *__pyx_v_iscallable = NULL;
+  int __pyx_v_iscallable;
   PyObject *__pyx_r = NULL;
   __Pyx_RefNannyDeclarations
   PyObject *__pyx_t_1 = NULL;
@@ -26801,7 +29157,7 @@ static PyObject *__pyx_pf_6pygrib_26_find(CYTHON_UNUSED PyObject *__pyx_self, Py
   int __pyx_t_9;
   int __pyx_t_10;
   int __pyx_t_11;
-  int __pyx_t_12;
+  PyObject *__pyx_t_12 = NULL;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
@@ -26816,35 +29172,38 @@ static PyObject *__pyx_pf_6pygrib_26_find(CYTHON_UNUSED PyObject *__pyx_self, Py
  */
   __pyx_t_1 = __Pyx_PyDict_Items(__pyx_v_kwargs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
+  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
     __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
     __pyx_t_4 = NULL;
   } else {
     __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
+    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   for (;;) {
-    if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_2)) {
-      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #else
-      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #endif
-    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) {
-      if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #else
-      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #endif
+    if (likely(!__pyx_t_4)) {
+      if (likely(PyList_CheckExact(__pyx_t_2))) {
+        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
+        #if CYTHON_COMPILING_IN_CPYTHON
+        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        #else
+        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        #endif
+      } else {
+        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
+        #if CYTHON_COMPILING_IN_CPYTHON
+        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        #else
+        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        #endif
+      }
     } else {
       __pyx_t_1 = __pyx_t_4(__pyx_t_2);
       if (unlikely(!__pyx_t_1)) {
-        if (PyErr_Occurred()) {
-          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
+        PyObject* exc_type = PyErr_Occurred();
+        if (exc_type) {
+          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
           else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         }
         break;
@@ -26880,8 +29239,7 @@ static PyObject *__pyx_pf_6pygrib_26_find(CYTHON_UNUSED PyObject *__pyx_self, Py
       __Pyx_GOTREF(__pyx_t_6);
       #endif
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    } else
-    {
+    } else {
       Py_ssize_t index = -1;
       __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_7);
@@ -26914,31 +29272,43 @@ static PyObject *__pyx_pf_6pygrib_26_find(CYTHON_UNUSED PyObject *__pyx_self, Py
  *         # is v a "container-like" non-string object?
  *         iscontainer = _is_container(v)
  */
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_grb, __pyx_n_s__has_key); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_grb, __pyx_n_s_has_key); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_6);
-    __Pyx_INCREF(__pyx_v_k);
-    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_k);
-    __Pyx_GIVEREF(__pyx_v_k);
-    __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_5 = NULL;
+    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) {
+      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
+      if (likely(__pyx_t_5)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
+        __Pyx_INCREF(__pyx_t_5);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_6, function);
+      }
+    }
+    if (!__pyx_t_5) {
+      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_k); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_1);
+    } else {
+      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_7);
+      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
+      __Pyx_INCREF(__pyx_v_k);
+      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_k);
+      __Pyx_GIVEREF(__pyx_v_k);
+      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    }
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
-    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     __pyx_t_10 = ((!__pyx_t_9) != 0);
     if (__pyx_t_10) {
       __Pyx_XDECREF(__pyx_r);
-      __pyx_t_5 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_r = __pyx_t_5;
-      __pyx_t_5 = 0;
+      __Pyx_INCREF(Py_False);
+      __pyx_r = Py_False;
       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
       goto __pyx_L0;
-      goto __pyx_L7;
     }
-    __pyx_L7:;
 
     /* "pygrib.pyx":2046
  *         if not grb.has_key(k): return False
@@ -26947,17 +29317,33 @@ static PyObject *__pyx_pf_6pygrib_26_find(CYTHON_UNUSED PyObject *__pyx_self, Py
  *         # is v callable?
  *         iscallable = hasattr(v, '__call__')
  */
-    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s___is_container); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_is_container); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_6);
-    __Pyx_INCREF(__pyx_v_v);
-    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_v);
-    __Pyx_GIVEREF(__pyx_v_v);
-    __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
+    __pyx_t_7 = NULL;
+    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
+      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
+      if (likely(__pyx_t_7)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
+        __Pyx_INCREF(__pyx_t_7);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_6, function);
+      }
+    }
+    if (!__pyx_t_7) {
+      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_v); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_1);
+    } else {
+      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_5);
+      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = NULL;
+      __Pyx_INCREF(__pyx_v_v);
+      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_v);
+      __Pyx_GIVEREF(__pyx_v_v);
+      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    }
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_XDECREF_SET(__pyx_v_iscontainer, __pyx_t_1);
     __pyx_t_1 = 0;
 
@@ -26968,11 +29354,8 @@ static PyObject *__pyx_pf_6pygrib_26_find(CYTHON_UNUSED PyObject *__pyx_self, Py
  *         # if v is callable and container-like, treat it as a container.
  *         # v not a container or a function.
  */
-    __pyx_t_10 = PyObject_HasAttr(__pyx_v_v, ((PyObject *)__pyx_n_s____call__)); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_10); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_XDECREF_SET(__pyx_v_iscallable, __pyx_t_1);
-    __pyx_t_1 = 0;
+    __pyx_t_10 = PyObject_HasAttr(__pyx_v_v, __pyx_n_s_call); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_v_iscallable = __pyx_t_10;
 
     /* "pygrib.pyx":2051
  *         # if v is callable and container-like, treat it as a container.
@@ -26981,27 +29364,28 @@ static PyObject *__pyx_pf_6pygrib_26_find(CYTHON_UNUSED PyObject *__pyx_self, Py
  *             continue
  *         elif iscontainer and getattr(grb,k) in v: # v a container.
  */
-    __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_iscontainer); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_9 = (!__pyx_t_10);
-    if (__pyx_t_9) {
-      __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_iscallable); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_11 = (!__pyx_t_10);
-      if (__pyx_t_11) {
-        __pyx_t_1 = __Pyx_GetAttr(__pyx_v_grb, __pyx_v_k); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_1);
-        __pyx_t_6 = PyObject_RichCompare(__pyx_t_1, __pyx_v_v, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-        __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-        __pyx_t_12 = __pyx_t_10;
-      } else {
-        __pyx_t_12 = __pyx_t_11;
-      }
-      __pyx_t_11 = __pyx_t_12;
+    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_iscontainer); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_11 = ((!__pyx_t_9) != 0);
+    if (__pyx_t_11) {
     } else {
-      __pyx_t_11 = __pyx_t_9;
+      __pyx_t_10 = __pyx_t_11;
+      goto __pyx_L9_bool_binop_done;
     }
+    __pyx_t_11 = ((!(__pyx_v_iscallable != 0)) != 0);
     if (__pyx_t_11) {
+    } else {
+      __pyx_t_10 = __pyx_t_11;
+      goto __pyx_L9_bool_binop_done;
+    }
+    __pyx_t_1 = __Pyx_GetAttr(__pyx_v_grb, __pyx_v_k); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_6 = PyObject_RichCompare(__pyx_t_1, __pyx_v_v, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __pyx_t_10 = __pyx_t_11;
+    __pyx_L9_bool_binop_done:;
+    if (__pyx_t_10) {
 
       /* "pygrib.pyx":2052
  *         # v not a container or a function.
@@ -27011,7 +29395,6 @@ static PyObject *__pyx_pf_6pygrib_26_find(CYTHON_UNUSED PyObject *__pyx_self, Py
  *             continue
  */
       goto __pyx_L3_continue;
-      goto __pyx_L8;
     }
 
     /* "pygrib.pyx":2053
@@ -27023,15 +29406,18 @@ static PyObject *__pyx_pf_6pygrib_26_find(CYTHON_UNUSED PyObject *__pyx_self, Py
  */
     __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_iscontainer); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     if (__pyx_t_11) {
-      __pyx_t_6 = __Pyx_GetAttr(__pyx_v_grb, __pyx_v_k); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_6);
-      __pyx_t_9 = (__Pyx_PySequence_Contains(__pyx_t_6, __pyx_v_v, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-      __pyx_t_12 = __pyx_t_9;
     } else {
-      __pyx_t_12 = __pyx_t_11;
+      __pyx_t_10 = __pyx_t_11;
+      goto __pyx_L12_bool_binop_done;
     }
-    if (__pyx_t_12) {
+    __pyx_t_6 = __Pyx_GetAttr(__pyx_v_grb, __pyx_v_k); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_6);
+    __pyx_t_11 = (__Pyx_PySequence_Contains(__pyx_t_6, __pyx_v_v, Py_EQ)); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __pyx_t_9 = (__pyx_t_11 != 0);
+    __pyx_t_10 = __pyx_t_9;
+    __pyx_L12_bool_binop_done:;
+    if (__pyx_t_10) {
 
       /* "pygrib.pyx":2054
  *             continue
@@ -27041,7 +29427,6 @@ static PyObject *__pyx_pf_6pygrib_26_find(CYTHON_UNUSED PyObject *__pyx_self, Py
  *             continue
  */
       goto __pyx_L3_continue;
-      goto __pyx_L8;
     }
 
     /* "pygrib.pyx":2055
@@ -27051,25 +29436,46 @@ static PyObject *__pyx_pf_6pygrib_26_find(CYTHON_UNUSED PyObject *__pyx_self, Py
  *             continue
  *         else:
  */
-    __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_iscallable); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    if (__pyx_t_12) {
-      __pyx_t_6 = __Pyx_GetAttr(__pyx_v_grb, __pyx_v_k); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_6);
-      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6);
-      __Pyx_GIVEREF(__pyx_t_6);
-      __pyx_t_6 = 0;
-      __pyx_t_6 = PyObject_Call(__pyx_v_v, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_9 = (__pyx_v_iscallable != 0);
+    if (__pyx_t_9) {
+    } else {
+      __pyx_t_10 = __pyx_t_9;
+      goto __pyx_L14_bool_binop_done;
+    }
+    __pyx_t_1 = __Pyx_GetAttr(__pyx_v_grb, __pyx_v_k); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_INCREF(__pyx_v_v);
+    __pyx_t_5 = __pyx_v_v; __pyx_t_7 = NULL;
+    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
+      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
+      if (likely(__pyx_t_7)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+        __Pyx_INCREF(__pyx_t_7);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_5, function);
+      }
+    }
+    if (!__pyx_t_7) {
+      __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
       __Pyx_GOTREF(__pyx_t_6);
-      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
-      __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-      __pyx_t_9 = __pyx_t_11;
     } else {
-      __pyx_t_9 = __pyx_t_12;
+      __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_12);
+      PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = NULL;
+      PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_1);
+      __Pyx_GIVEREF(__pyx_t_1);
+      __pyx_t_1 = 0;
+      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_12, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_6);
+      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
     }
-    if (__pyx_t_9) {
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __pyx_t_10 = __pyx_t_9;
+    __pyx_L14_bool_binop_done:;
+    if (__pyx_t_10) {
 
       /* "pygrib.pyx":2056
  *             continue
@@ -27079,7 +29485,6 @@ static PyObject *__pyx_pf_6pygrib_26_find(CYTHON_UNUSED PyObject *__pyx_self, Py
  *             return False
  */
       goto __pyx_L3_continue;
-      goto __pyx_L8;
     }
     /*else*/ {
 
@@ -27091,14 +29496,19 @@ static PyObject *__pyx_pf_6pygrib_26_find(CYTHON_UNUSED PyObject *__pyx_self, Py
  * 
  */
       __Pyx_XDECREF(__pyx_r);
-      __pyx_t_6 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_6);
-      __pyx_r = __pyx_t_6;
-      __pyx_t_6 = 0;
+      __Pyx_INCREF(Py_False);
+      __pyx_r = Py_False;
       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
       goto __pyx_L0;
     }
-    __pyx_L8:;
+
+    /* "pygrib.pyx":2043
+ *     # If value is a function, call that function with key value to determine
+ *     # whether it is a match.
+ *     for k,v in kwargs.items():             # <<<<<<<<<<<<<<
+ *         if not grb.has_key(k): return False
+ *         # is v a "container-like" non-string object?
+ */
     __pyx_L3_continue:;
   }
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
@@ -27111,27 +29521,32 @@ static PyObject *__pyx_pf_6pygrib_26_find(CYTHON_UNUSED PyObject *__pyx_self, Py
  * cdef _strencode(pystr,encoding=None):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_r = __pyx_t_2;
-  __pyx_t_2 = 0;
+  __Pyx_INCREF(Py_True);
+  __pyx_r = Py_True;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "pygrib.pyx":2038
+ *     return True
+ * 
+ * def _find(grb, **kwargs):             # <<<<<<<<<<<<<<
+ *     # search for key/value matches in grib message.
+ *     # If value is a container-like object, search for matches to any element.
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_XDECREF(__pyx_t_2);
   __Pyx_XDECREF(__pyx_t_5);
   __Pyx_XDECREF(__pyx_t_6);
   __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_XDECREF(__pyx_t_12);
   __Pyx_AddTraceback("pygrib._find", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_r = NULL;
   __pyx_L0:;
   __Pyx_XDECREF(__pyx_v_k);
   __Pyx_XDECREF(__pyx_v_v);
   __Pyx_XDECREF(__pyx_v_iscontainer);
-  __Pyx_XDECREF(__pyx_v_iscallable);
   __Pyx_XGIVEREF(__pyx_r);
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
@@ -27157,7 +29572,8 @@ static PyObject *__pyx_f_6pygrib__strencode(PyObject *__pyx_v_pystr, struct __py
   PyObject *__pyx_t_6 = NULL;
   PyObject *__pyx_t_7 = NULL;
   PyObject *__pyx_t_8 = NULL;
-  int __pyx_t_9;
+  PyObject *__pyx_t_9 = NULL;
+  int __pyx_t_10;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
@@ -27187,7 +29603,7 @@ static PyObject *__pyx_f_6pygrib__strencode(PyObject *__pyx_v_pystr, struct __py
  *     try:
  *         return pystr.encode(encoding)
  */
-    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__default_encoding); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_default_encoding); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF_SET(__pyx_v_encoding, __pyx_t_3);
     __pyx_t_3 = 0;
@@ -27217,35 +29633,42 @@ static PyObject *__pyx_f_6pygrib__strencode(PyObject *__pyx_v_pystr, struct __py
  *         return pystr # already bytes?
  */
       __Pyx_XDECREF(__pyx_r);
-      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_pystr, __pyx_n_s__encode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2067; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2067; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
+      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_pystr, __pyx_n_s_encode); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2067; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
       __Pyx_GOTREF(__pyx_t_7);
-      __Pyx_INCREF(__pyx_v_encoding);
-      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_encoding);
-      __Pyx_GIVEREF(__pyx_v_encoding);
-      __pyx_t_8 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2067; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
-      __pyx_r = __pyx_t_8;
-      __pyx_t_8 = 0;
+      __pyx_t_8 = NULL;
+      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) {
+        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
+        if (likely(__pyx_t_8)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
+          __Pyx_INCREF(__pyx_t_8);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_7, function);
+        }
+      }
+      if (!__pyx_t_8) {
+        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_encoding); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2067; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
+        __Pyx_GOTREF(__pyx_t_3);
+      } else {
+        __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2067; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
+        __Pyx_GOTREF(__pyx_t_9);
+        PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_8 = NULL;
+        __Pyx_INCREF(__pyx_v_encoding);
+        PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_encoding);
+        __Pyx_GIVEREF(__pyx_v_encoding);
+        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2067; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
+        __Pyx_GOTREF(__pyx_t_3);
+        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+      }
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+      __pyx_r = __pyx_t_3;
+      __pyx_t_3 = 0;
       goto __pyx_L8_try_return;
     }
-    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
-    goto __pyx_L11_try_end;
-    __pyx_L8_try_return:;
-    __Pyx_XGIVEREF(__pyx_t_4);
-    __Pyx_XGIVEREF(__pyx_t_5);
-    __Pyx_XGIVEREF(__pyx_t_6);
-    __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
-    goto __pyx_L0;
     __pyx_L4_error:;
-    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
 
     /* "pygrib.pyx":2068
  *     try:
@@ -27253,13 +29676,13 @@ static PyObject *__pyx_f_6pygrib__strencode(PyObject *__pyx_v_pystr, struct __py
  *     except AttributeError:             # <<<<<<<<<<<<<<
  *         return pystr # already bytes?
  */
-    __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
-    if (__pyx_t_9) {
+    __pyx_t_10 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
+    if (__pyx_t_10) {
       __Pyx_AddTraceback("pygrib._strencode", __pyx_clineno, __pyx_lineno, __pyx_filename);
-      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-      __Pyx_GOTREF(__pyx_t_7);
+      if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_7, &__pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
       __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_GOTREF(__pyx_t_7);
+      __Pyx_GOTREF(__pyx_t_9);
 
       /* "pygrib.pyx":2069
  *         return pystr.encode(encoding)
@@ -27271,39 +29694,44 @@ static PyObject *__pyx_f_6pygrib__strencode(PyObject *__pyx_v_pystr, struct __py
       __pyx_r = __pyx_v_pystr;
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
       goto __pyx_L7_except_return;
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      goto __pyx_L5_exception_handled;
     }
+    goto __pyx_L6_except_error;
     __pyx_L6_except_error:;
     __Pyx_XGIVEREF(__pyx_t_4);
     __Pyx_XGIVEREF(__pyx_t_5);
     __Pyx_XGIVEREF(__pyx_t_6);
     __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
     goto __pyx_L1_error;
-    __pyx_L7_except_return:;
+    __pyx_L8_try_return:;
     __Pyx_XGIVEREF(__pyx_t_4);
     __Pyx_XGIVEREF(__pyx_t_5);
     __Pyx_XGIVEREF(__pyx_t_6);
     __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
     goto __pyx_L0;
-    __pyx_L5_exception_handled:;
+    __pyx_L7_except_return:;
     __Pyx_XGIVEREF(__pyx_t_4);
     __Pyx_XGIVEREF(__pyx_t_5);
     __Pyx_XGIVEREF(__pyx_t_6);
     __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
-    __pyx_L11_try_end:;
+    goto __pyx_L0;
   }
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "pygrib.pyx":2061
+ *     return True
+ * 
+ * cdef _strencode(pystr,encoding=None):             # <<<<<<<<<<<<<<
+ *     # encode a string into bytes.  If already bytes, do nothing.
+ *     # uses default_encoding module variable for default encoding.
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_3);
   __Pyx_XDECREF(__pyx_t_7);
   __Pyx_XDECREF(__pyx_t_8);
+  __Pyx_XDECREF(__pyx_t_9);
   __Pyx_AddTraceback("pygrib._strencode", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_r = 0;
   __pyx_L0:;
@@ -27313,32 +29741,300 @@ static PyObject *__pyx_f_6pygrib__strencode(PyObject *__pyx_v_pystr, struct __py
   return __pyx_r;
 }
 
-static PyObject *__pyx_tp_new_6pygrib_gribmessage(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
-  struct __pyx_obj_6pygrib_gribmessage *p;
+static PyObject *__pyx_tp_new_6pygrib_open(PyTypeObject *t, PyObject *a, PyObject *k) {
+  struct __pyx_obj_6pygrib_open *p;
   PyObject *o;
-  o = (*t->tp_alloc)(t, 0);
+  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
+    o = (*t->tp_alloc)(t, 0);
+  } else {
+    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
+  }
   if (unlikely(!o)) return 0;
-  p = ((struct __pyx_obj_6pygrib_gribmessage *)o);
+  p = ((struct __pyx_obj_6pygrib_open *)o);
+  p->name = Py_None; Py_INCREF(Py_None);
   p->messagenumber = Py_None; Py_INCREF(Py_None);
-  p->projparams = Py_None; Py_INCREF(Py_None);
-  p->validDate = Py_None; Py_INCREF(Py_None);
-  p->analDate = Py_None; Py_INCREF(Py_None);
-  p->expand_reduced = Py_None; Py_INCREF(Py_None);
-  p->_ro_keys = Py_None; Py_INCREF(Py_None);
-  p->_all_keys = Py_None; Py_INCREF(Py_None);
-  p->fcstimeunits = Py_None; Py_INCREF(Py_None);
-  return o;
-}
-
-static void __pyx_tp_dealloc_6pygrib_gribmessage(PyObject *o) {
-  struct __pyx_obj_6pygrib_gribmessage *p = (struct __pyx_obj_6pygrib_gribmessage *)o;
+  p->messages = Py_None; Py_INCREF(Py_None);
+  p->closed = Py_None; Py_INCREF(Py_None);
+  p->has_multi_field_msgs = Py_None; Py_INCREF(Py_None);
+  if (unlikely(__pyx_pw_6pygrib_4open_1__cinit__(o, a, k) < 0)) {
+    Py_DECREF(o); o = 0;
+  }
+  return o;
+}
+
+static void __pyx_tp_dealloc_6pygrib_open(PyObject *o) {
+  struct __pyx_obj_6pygrib_open *p = (struct __pyx_obj_6pygrib_open *)o;
+  #if PY_VERSION_HEX >= 0x030400a1
+  if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
+    if (PyObject_CallFinalizerFromDealloc(o)) return;
+  }
+  #endif
+  PyObject_GC_UnTrack(o);
+  {
+    PyObject *etype, *eval, *etb;
+    PyErr_Fetch(&etype, &eval, &etb);
+    ++Py_REFCNT(o);
+    __pyx_pw_6pygrib_4open_27__dealloc__(o);
+    --Py_REFCNT(o);
+    PyErr_Restore(etype, eval, etb);
+  }
+  Py_CLEAR(p->name);
+  Py_CLEAR(p->messagenumber);
+  Py_CLEAR(p->messages);
+  Py_CLEAR(p->closed);
+  Py_CLEAR(p->has_multi_field_msgs);
+  (*Py_TYPE(o)->tp_free)(o);
+}
+
+static int __pyx_tp_traverse_6pygrib_open(PyObject *o, visitproc v, void *a) {
+  int e;
+  struct __pyx_obj_6pygrib_open *p = (struct __pyx_obj_6pygrib_open *)o;
+  if (p->name) {
+    e = (*v)(p->name, a); if (e) return e;
+  }
+  if (p->messagenumber) {
+    e = (*v)(p->messagenumber, a); if (e) return e;
+  }
+  if (p->messages) {
+    e = (*v)(p->messages, a); if (e) return e;
+  }
+  if (p->closed) {
+    e = (*v)(p->closed, a); if (e) return e;
+  }
+  if (p->has_multi_field_msgs) {
+    e = (*v)(p->has_multi_field_msgs, a); if (e) return e;
+  }
+  return 0;
+}
+
+static int __pyx_tp_clear_6pygrib_open(PyObject *o) {
+  PyObject* tmp;
+  struct __pyx_obj_6pygrib_open *p = (struct __pyx_obj_6pygrib_open *)o;
+  tmp = ((PyObject*)p->name);
+  p->name = Py_None; Py_INCREF(Py_None);
+  Py_XDECREF(tmp);
+  tmp = ((PyObject*)p->messagenumber);
+  p->messagenumber = Py_None; Py_INCREF(Py_None);
+  Py_XDECREF(tmp);
+  tmp = ((PyObject*)p->messages);
+  p->messages = Py_None; Py_INCREF(Py_None);
+  Py_XDECREF(tmp);
+  tmp = ((PyObject*)p->closed);
+  p->closed = Py_None; Py_INCREF(Py_None);
+  Py_XDECREF(tmp);
+  tmp = ((PyObject*)p->has_multi_field_msgs);
+  p->has_multi_field_msgs = Py_None; Py_INCREF(Py_None);
+  Py_XDECREF(tmp);
+  return 0;
+}
+static PyObject *__pyx_sq_item_6pygrib_open(PyObject *o, Py_ssize_t i) {
+  PyObject *r;
+  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
+  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
+  Py_DECREF(x);
+  return r;
+}
+
+static PyObject *__pyx_getprop_6pygrib_4open_name(PyObject *o, CYTHON_UNUSED void *x) {
+  return __pyx_pw_6pygrib_4open_4name_1__get__(o);
+}
+
+static int __pyx_setprop_6pygrib_4open_name(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
+  if (v) {
+    return __pyx_pw_6pygrib_4open_4name_3__set__(o, v);
+  }
+  else {
+    return __pyx_pw_6pygrib_4open_4name_5__del__(o);
+  }
+}
+
+static PyObject *__pyx_getprop_6pygrib_4open_messagenumber(PyObject *o, CYTHON_UNUSED void *x) {
+  return __pyx_pw_6pygrib_4open_13messagenumber_1__get__(o);
+}
+
+static int __pyx_setprop_6pygrib_4open_messagenumber(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
+  if (v) {
+    return __pyx_pw_6pygrib_4open_13messagenumber_3__set__(o, v);
+  }
+  else {
+    return __pyx_pw_6pygrib_4open_13messagenumber_5__del__(o);
+  }
+}
+
+static PyObject *__pyx_getprop_6pygrib_4open_messages(PyObject *o, CYTHON_UNUSED void *x) {
+  return __pyx_pw_6pygrib_4open_8messages_1__get__(o);
+}
+
+static int __pyx_setprop_6pygrib_4open_messages(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
+  if (v) {
+    return __pyx_pw_6pygrib_4open_8messages_3__set__(o, v);
+  }
+  else {
+    return __pyx_pw_6pygrib_4open_8messages_5__del__(o);
+  }
+}
+
+static PyObject *__pyx_getprop_6pygrib_4open_closed(PyObject *o, CYTHON_UNUSED void *x) {
+  return __pyx_pw_6pygrib_4open_6closed_1__get__(o);
+}
+
+static int __pyx_setprop_6pygrib_4open_closed(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
+  if (v) {
+    return __pyx_pw_6pygrib_4open_6closed_3__set__(o, v);
+  }
+  else {
+    return __pyx_pw_6pygrib_4open_6closed_5__del__(o);
+  }
+}
+
+static PyObject *__pyx_getprop_6pygrib_4open_has_multi_field_msgs(PyObject *o, CYTHON_UNUSED void *x) {
+  return __pyx_pw_6pygrib_4open_20has_multi_field_msgs_1__get__(o);
+}
+
+static int __pyx_setprop_6pygrib_4open_has_multi_field_msgs(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
+  if (v) {
+    return __pyx_pw_6pygrib_4open_20has_multi_field_msgs_3__set__(o, v);
+  }
+  else {
+    return __pyx_pw_6pygrib_4open_20has_multi_field_msgs_5__del__(o);
+  }
+}
+
+static PyMethodDef __pyx_methods_6pygrib_open[] = {
+  {"__next__", (PyCFunction)__pyx_pw_6pygrib_4open_7__next__, METH_NOARGS|METH_COEXIST, 0},
+  {"__enter__", (PyCFunction)__pyx_pw_6pygrib_4open_13__enter__, METH_NOARGS, 0},
+  {"__exit__", (PyCFunction)__pyx_pw_6pygrib_4open_15__exit__, METH_VARARGS|METH_KEYWORDS, 0},
+  {"tell", (PyCFunction)__pyx_pw_6pygrib_4open_17tell, METH_NOARGS, __pyx_doc_6pygrib_4open_16tell},
+  {"seek", (PyCFunction)__pyx_pw_6pygrib_4open_19seek, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pygrib_4open_18seek},
+  {"readline", (PyCFunction)__pyx_pw_6pygrib_4open_21readline, METH_NOARGS, __pyx_doc_6pygrib_4open_20readline},
+  {"read", (PyCFunction)__pyx_pw_6pygrib_4open_23read, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pygrib_4open_22read},
+  {"close", (PyCFunction)__pyx_pw_6pygrib_4open_25close, METH_NOARGS, __pyx_doc_6pygrib_4open_24close},
+  {"rewind", (PyCFunction)__pyx_pw_6pygrib_4open_29rewind, METH_NOARGS, __pyx_doc_6pygrib_4open_28rewind},
+  {"message", (PyCFunction)__pyx_pw_6pygrib_4open_31message, METH_O, __pyx_doc_6pygrib_4open_30message},
+  {"select", (PyCFunction)__pyx_pw_6pygrib_4open_33select, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pygrib_4open_32select},
+  {"_advance", (PyCFunction)__pyx_pw_6pygrib_4open_35_advance, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pygrib_4open_34_advance},
+  {0, 0, 0, 0}
+};
+
+static struct PyGetSetDef __pyx_getsets_6pygrib_open[] = {
+  {(char *)"name", __pyx_getprop_6pygrib_4open_name, __pyx_setprop_6pygrib_4open_name, 0, 0},
+  {(char *)"messagenumber", __pyx_getprop_6pygrib_4open_messagenumber, __pyx_setprop_6pygrib_4open_messagenumber, 0, 0},
+  {(char *)"messages", __pyx_getprop_6pygrib_4open_messages, __pyx_setprop_6pygrib_4open_messages, 0, 0},
+  {(char *)"closed", __pyx_getprop_6pygrib_4open_closed, __pyx_setprop_6pygrib_4open_closed, 0, 0},
+  {(char *)"has_multi_field_msgs", __pyx_getprop_6pygrib_4open_has_multi_field_msgs, __pyx_setprop_6pygrib_4open_has_multi_field_msgs, 0, 0},
+  {0, 0, 0, 0, 0}
+};
+
+static PySequenceMethods __pyx_tp_as_sequence_open = {
+  0, /*sq_length*/
+  0, /*sq_concat*/
+  0, /*sq_repeat*/
+  __pyx_sq_item_6pygrib_open, /*sq_item*/
+  0, /*sq_slice*/
+  0, /*sq_ass_item*/
+  0, /*sq_ass_slice*/
+  0, /*sq_contains*/
+  0, /*sq_inplace_concat*/
+  0, /*sq_inplace_repeat*/
+};
+
+static PyMappingMethods __pyx_tp_as_mapping_open = {
+  0, /*mp_length*/
+  __pyx_pw_6pygrib_4open_9__getitem__, /*mp_subscript*/
+  0, /*mp_ass_subscript*/
+};
+
+static PyTypeObject __pyx_type_6pygrib_open = {
+  PyVarObject_HEAD_INIT(0, 0)
+  "pygrib.open", /*tp_name*/
+  sizeof(struct __pyx_obj_6pygrib_open), /*tp_basicsize*/
+  0, /*tp_itemsize*/
+  __pyx_tp_dealloc_6pygrib_open, /*tp_dealloc*/
+  0, /*tp_print*/
+  0, /*tp_getattr*/
+  0, /*tp_setattr*/
+  #if PY_MAJOR_VERSION < 3
+  0, /*tp_compare*/
+  #else
+  0, /*reserved*/
+  #endif
+  0, /*tp_repr*/
+  0, /*tp_as_number*/
+  &__pyx_tp_as_sequence_open, /*tp_as_sequence*/
+  &__pyx_tp_as_mapping_open, /*tp_as_mapping*/
+  0, /*tp_hash*/
+  __pyx_pw_6pygrib_4open_11__call__, /*tp_call*/
+  0, /*tp_str*/
+  0, /*tp_getattro*/
+  0, /*tp_setattro*/
+  0, /*tp_as_buffer*/
+  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
+  " \n    open(filename)\n    \n    returns GRIB file iterator object given GRIB filename. When iterated, returns\n    instances of the L{gribmessage} class. Behaves much like a python file\n    object, with L{seek}, L{tell}, L{read} and L{close} methods, \n    except that offsets are measured in grib messages instead of bytes.\n    Additional methods include L{rewind} (like C{seek(0)}), L{message}\n    (like C{seek(N-1)}; followed by C{readline()}), and L{select} (filters\n    messages  [...]
+  __pyx_tp_traverse_6pygrib_open, /*tp_traverse*/
+  __pyx_tp_clear_6pygrib_open, /*tp_clear*/
+  0, /*tp_richcompare*/
+  0, /*tp_weaklistoffset*/
+  __pyx_pw_6pygrib_4open_5__iter__, /*tp_iter*/
+  __pyx_pw_6pygrib_4open_7__next__, /*tp_iternext*/
+  __pyx_methods_6pygrib_open, /*tp_methods*/
+  0, /*tp_members*/
+  __pyx_getsets_6pygrib_open, /*tp_getset*/
+  0, /*tp_base*/
+  0, /*tp_dict*/
+  0, /*tp_descr_get*/
+  0, /*tp_descr_set*/
+  0, /*tp_dictoffset*/
+  __pyx_pw_6pygrib_4open_3__init__, /*tp_init*/
+  0, /*tp_alloc*/
+  __pyx_tp_new_6pygrib_open, /*tp_new*/
+  0, /*tp_free*/
+  0, /*tp_is_gc*/
+  0, /*tp_bases*/
+  0, /*tp_mro*/
+  0, /*tp_cache*/
+  0, /*tp_subclasses*/
+  0, /*tp_weaklist*/
+  0, /*tp_del*/
+  0, /*tp_version_tag*/
+  #if PY_VERSION_HEX >= 0x030400a1
+  0, /*tp_finalize*/
+  #endif
+};
+
+static PyObject *__pyx_tp_new_6pygrib_gribmessage(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
+  struct __pyx_obj_6pygrib_gribmessage *p;
+  PyObject *o;
+  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
+    o = (*t->tp_alloc)(t, 0);
+  } else {
+    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
+  }
+  if (unlikely(!o)) return 0;
+  p = ((struct __pyx_obj_6pygrib_gribmessage *)o);
+  p->messagenumber = Py_None; Py_INCREF(Py_None);
+  p->projparams = Py_None; Py_INCREF(Py_None);
+  p->validDate = Py_None; Py_INCREF(Py_None);
+  p->analDate = Py_None; Py_INCREF(Py_None);
+  p->expand_reduced = Py_None; Py_INCREF(Py_None);
+  p->_ro_keys = Py_None; Py_INCREF(Py_None);
+  p->_all_keys = Py_None; Py_INCREF(Py_None);
+  p->fcstimeunits = Py_None; Py_INCREF(Py_None);
+  return o;
+}
+
+static void __pyx_tp_dealloc_6pygrib_gribmessage(PyObject *o) {
+  struct __pyx_obj_6pygrib_gribmessage *p = (struct __pyx_obj_6pygrib_gribmessage *)o;
+  #if PY_VERSION_HEX >= 0x030400a1
+  if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
+    if (PyObject_CallFinalizerFromDealloc(o)) return;
+  }
+  #endif
   PyObject_GC_UnTrack(o);
   {
     PyObject *etype, *eval, *etb;
     PyErr_Fetch(&etype, &eval, &etb);
     ++Py_REFCNT(o);
     __pyx_pw_6pygrib_11gribmessage_3__dealloc__(o);
-    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
     --Py_REFCNT(o);
     PyErr_Restore(etype, eval, etb);
   }
@@ -27384,8 +30080,8 @@ static int __pyx_tp_traverse_6pygrib_gribmessage(PyObject *o, visitproc v, void
 }
 
 static int __pyx_tp_clear_6pygrib_gribmessage(PyObject *o) {
-  struct __pyx_obj_6pygrib_gribmessage *p = (struct __pyx_obj_6pygrib_gribmessage *)o;
   PyObject* tmp;
+  struct __pyx_obj_6pygrib_gribmessage *p = (struct __pyx_obj_6pygrib_gribmessage *)o;
   tmp = ((PyObject*)p->messagenumber);
   p->messagenumber = Py_None; Py_INCREF(Py_None);
   Py_XDECREF(tmp);
@@ -27426,7 +30122,7 @@ static int __pyx_mp_ass_subscript_6pygrib_gribmessage(PyObject *o, PyObject *i,
   }
   else {
     PyErr_Format(PyExc_NotImplementedError,
-      "Subscript deletion not supported by %s", Py_TYPE(o)->tp_name);
+      "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
     return -1;
   }
 }
@@ -27554,20 +30250,20 @@ static int __pyx_setprop_6pygrib_11gribmessage_fcstimeunits(PyObject *o, PyObjec
 }
 
 static PyMethodDef __pyx_methods_6pygrib_gribmessage[] = {
-  {__Pyx_NAMESTR("__getattr__"), (PyCFunction)__pyx_pw_6pygrib_11gribmessage_5__getattr__, METH_O|METH_COEXIST, __Pyx_DOCSTR(0)},
-  {__Pyx_NAMESTR("_get_key"), (PyCFunction)__pyx_pw_6pygrib_11gribmessage_11_get_key, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pygrib_11gribmessage_10_get_key)},
-  {__Pyx_NAMESTR("expand_grid"), (PyCFunction)__pyx_pw_6pygrib_11gribmessage_13expand_grid, METH_O, __Pyx_DOCSTR(__pyx_doc_6pygrib_11gribmessage_12expand_grid)},
-  {__Pyx_NAMESTR("is_missing"), (PyCFunction)__pyx_pw_6pygrib_11gribmessage_15is_missing, METH_O, __Pyx_DOCSTR(__pyx_doc_6pygrib_11gribmessage_14is_missing)},
-  {__Pyx_NAMESTR("keys"), (PyCFunction)__pyx_pw_6pygrib_11gribmessage_17keys, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6pygrib_11gribmessage_16keys)},
-  {__Pyx_NAMESTR("_read_only_keys"), (PyCFunction)__pyx_pw_6pygrib_11gribmessage_19_read_only_keys, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6pygrib_11gribmessage_18_read_only_keys)},
-  {__Pyx_NAMESTR("data"), (PyCFunction)__pyx_pw_6pygrib_11gribmessage_21data, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pygrib_11gribmessage_20data)},
-  {__Pyx_NAMESTR("has_key"), (PyCFunction)__pyx_pw_6pygrib_11gribmessage_27has_key, METH_O, __Pyx_DOCSTR(__pyx_doc_6pygrib_11gribmessage_26has_key)},
-  {__Pyx_NAMESTR("valid_key"), (PyCFunction)__pyx_pw_6pygrib_11gribmessage_29valid_key, METH_O, __Pyx_DOCSTR(__pyx_doc_6pygrib_11gribmessage_28valid_key)},
-  {__Pyx_NAMESTR("tostring"), (PyCFunction)__pyx_pw_6pygrib_11gribmessage_31tostring, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6pygrib_11gribmessage_30tostring)},
-  {__Pyx_NAMESTR("_unshape_mask"), (PyCFunction)__pyx_pw_6pygrib_11gribmessage_33_unshape_mask, METH_O, __Pyx_DOCSTR(__pyx_doc_6pygrib_11gribmessage_32_unshape_mask)},
-  {__Pyx_NAMESTR("_reshape_mask"), (PyCFunction)__pyx_pw_6pygrib_11gribmessage_35_reshape_mask, METH_O, __Pyx_DOCSTR(__pyx_doc_6pygrib_11gribmessage_34_reshape_mask)},
-  {__Pyx_NAMESTR("_set_projparams"), (PyCFunction)__pyx_pw_6pygrib_11gribmessage_37_set_projparams, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6pygrib_11gribmessage_36_set_projparams)},
-  {__Pyx_NAMESTR("latlons"), (PyCFunction)__pyx_pw_6pygrib_11gribmessage_39latlons, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6pygrib_11gribmessage_38latlons)},
+  {"__getattr__", (PyCFunction)__pyx_pw_6pygrib_11gribmessage_5__getattr__, METH_O|METH_COEXIST, 0},
+  {"_get_key", (PyCFunction)__pyx_pw_6pygrib_11gribmessage_11_get_key, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pygrib_11gribmessage_10_get_key},
+  {"expand_grid", (PyCFunction)__pyx_pw_6pygrib_11gribmessage_13expand_grid, METH_O, __pyx_doc_6pygrib_11gribmessage_12expand_grid},
+  {"is_missing", (PyCFunction)__pyx_pw_6pygrib_11gribmessage_15is_missing, METH_O, __pyx_doc_6pygrib_11gribmessage_14is_missing},
+  {"keys", (PyCFunction)__pyx_pw_6pygrib_11gribmessage_17keys, METH_NOARGS, __pyx_doc_6pygrib_11gribmessage_16keys},
+  {"_read_only_keys", (PyCFunction)__pyx_pw_6pygrib_11gribmessage_19_read_only_keys, METH_NOARGS, __pyx_doc_6pygrib_11gribmessage_18_read_only_keys},
+  {"data", (PyCFunction)__pyx_pw_6pygrib_11gribmessage_21data, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pygrib_11gribmessage_20data},
+  {"has_key", (PyCFunction)__pyx_pw_6pygrib_11gribmessage_27has_key, METH_O, __pyx_doc_6pygrib_11gribmessage_26has_key},
+  {"valid_key", (PyCFunction)__pyx_pw_6pygrib_11gribmessage_29valid_key, METH_O, __pyx_doc_6pygrib_11gribmessage_28valid_key},
+  {"tostring", (PyCFunction)__pyx_pw_6pygrib_11gribmessage_31tostring, METH_NOARGS, __pyx_doc_6pygrib_11gribmessage_30tostring},
+  {"_unshape_mask", (PyCFunction)__pyx_pw_6pygrib_11gribmessage_33_unshape_mask, METH_O, __pyx_doc_6pygrib_11gribmessage_32_unshape_mask},
+  {"_reshape_mask", (PyCFunction)__pyx_pw_6pygrib_11gribmessage_35_reshape_mask, METH_O, __pyx_doc_6pygrib_11gribmessage_34_reshape_mask},
+  {"_set_projparams", (PyCFunction)__pyx_pw_6pygrib_11gribmessage_37_set_projparams, METH_NOARGS, __pyx_doc_6pygrib_11gribmessage_36_set_projparams},
+  {"latlons", (PyCFunction)__pyx_pw_6pygrib_11gribmessage_39latlons, METH_NOARGS, __pyx_doc_6pygrib_11gribmessage_38latlons},
   {0, 0, 0, 0}
 };
 
@@ -27604,7 +30300,7 @@ static PyMappingMethods __pyx_tp_as_mapping_gribmessage = {
 
 static PyTypeObject __pyx_type_6pygrib_gribmessage = {
   PyVarObject_HEAD_INIT(0, 0)
-  __Pyx_NAMESTR("pygrib.gribmessage"), /*tp_name*/
+  "pygrib.gribmessage", /*tp_name*/
   sizeof(struct __pyx_obj_6pygrib_gribmessage), /*tp_basicsize*/
   0, /*tp_itemsize*/
   __pyx_tp_dealloc_6pygrib_gribmessage, /*tp_dealloc*/
@@ -27627,7 +30323,7 @@ static PyTypeObject __pyx_type_6pygrib_gribmessage = {
   __pyx_tp_setattro_6pygrib_gribmessage, /*tp_setattro*/
   0, /*tp_as_buffer*/
   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
-  __Pyx_DOCSTR("\n    Grib message object.\n\n    Each grib message has attributes corresponding to grib message\n    keys for \n    U{GRIB1 <http://www.ecmwf.int/publications/manuals/d/gribapi/fm92/grib1>}\n    and\n    U{GRIB2 <http://www.ecmwf.int/publications/manuals/d/gribapi/fm92/grib2/>}.\n    Parameter names are\n    are given by the C{name}, C{shortName} and C{paramID}\n    U{keys <http://www.ecmwf.int/publications/manuals/d/gribapi/param/>}.\n    pygrib also defines some specia [...]
+  "\n    Grib message object.\n\n    Each grib message has attributes corresponding to grib message\n    keys for \n    U{GRIB1 <http://www.ecmwf.int/publications/manuals/d/gribapi/fm92/grib1>}\n    and\n    U{GRIB2 <http://www.ecmwf.int/publications/manuals/d/gribapi/fm92/grib2/>}.\n    Parameter names are\n    are given by the C{name}, C{shortName} and C{paramID}\n    U{keys <http://www.ecmwf.int/publications/manuals/d/gribapi/param/>}.\n    pygrib also defines some special attributes  [...]
   __pyx_tp_traverse_6pygrib_gribmessage, /*tp_traverse*/
   __pyx_tp_clear_6pygrib_gribmessage, /*tp_clear*/
   0, /*tp_richcompare*/
@@ -27653,264 +30349,8 @@ static PyTypeObject __pyx_type_6pygrib_gribmessage = {
   0, /*tp_subclasses*/
   0, /*tp_weaklist*/
   0, /*tp_del*/
-  #if PY_VERSION_HEX >= 0x02060000
   0, /*tp_version_tag*/
-  #endif
-  #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE)
-  0, /*tp_finalize*/
-  #endif
-};
-
-static PyObject *__pyx_tp_new_6pygrib_open(PyTypeObject *t, PyObject *a, PyObject *k) {
-  struct __pyx_obj_6pygrib_open *p;
-  PyObject *o;
-  o = (*t->tp_alloc)(t, 0);
-  if (unlikely(!o)) return 0;
-  p = ((struct __pyx_obj_6pygrib_open *)o);
-  p->name = Py_None; Py_INCREF(Py_None);
-  p->messagenumber = Py_None; Py_INCREF(Py_None);
-  p->messages = Py_None; Py_INCREF(Py_None);
-  p->closed = Py_None; Py_INCREF(Py_None);
-  p->has_multi_field_msgs = Py_None; Py_INCREF(Py_None);
-  if (unlikely(__pyx_pw_6pygrib_4open_1__cinit__(o, a, k) < 0)) {
-    Py_DECREF(o); o = 0;
-  }
-  return o;
-}
-
-static void __pyx_tp_dealloc_6pygrib_open(PyObject *o) {
-  struct __pyx_obj_6pygrib_open *p = (struct __pyx_obj_6pygrib_open *)o;
-  PyObject_GC_UnTrack(o);
-  {
-    PyObject *etype, *eval, *etb;
-    PyErr_Fetch(&etype, &eval, &etb);
-    ++Py_REFCNT(o);
-    __pyx_pw_6pygrib_4open_27__dealloc__(o);
-    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
-    --Py_REFCNT(o);
-    PyErr_Restore(etype, eval, etb);
-  }
-  Py_CLEAR(p->name);
-  Py_CLEAR(p->messagenumber);
-  Py_CLEAR(p->messages);
-  Py_CLEAR(p->closed);
-  Py_CLEAR(p->has_multi_field_msgs);
-  (*Py_TYPE(o)->tp_free)(o);
-}
-
-static int __pyx_tp_traverse_6pygrib_open(PyObject *o, visitproc v, void *a) {
-  int e;
-  struct __pyx_obj_6pygrib_open *p = (struct __pyx_obj_6pygrib_open *)o;
-  if (p->name) {
-    e = (*v)(p->name, a); if (e) return e;
-  }
-  if (p->messagenumber) {
-    e = (*v)(p->messagenumber, a); if (e) return e;
-  }
-  if (p->messages) {
-    e = (*v)(p->messages, a); if (e) return e;
-  }
-  if (p->closed) {
-    e = (*v)(p->closed, a); if (e) return e;
-  }
-  if (p->has_multi_field_msgs) {
-    e = (*v)(p->has_multi_field_msgs, a); if (e) return e;
-  }
-  return 0;
-}
-
-static int __pyx_tp_clear_6pygrib_open(PyObject *o) {
-  struct __pyx_obj_6pygrib_open *p = (struct __pyx_obj_6pygrib_open *)o;
-  PyObject* tmp;
-  tmp = ((PyObject*)p->name);
-  p->name = Py_None; Py_INCREF(Py_None);
-  Py_XDECREF(tmp);
-  tmp = ((PyObject*)p->messagenumber);
-  p->messagenumber = Py_None; Py_INCREF(Py_None);
-  Py_XDECREF(tmp);
-  tmp = ((PyObject*)p->messages);
-  p->messages = Py_None; Py_INCREF(Py_None);
-  Py_XDECREF(tmp);
-  tmp = ((PyObject*)p->closed);
-  p->closed = Py_None; Py_INCREF(Py_None);
-  Py_XDECREF(tmp);
-  tmp = ((PyObject*)p->has_multi_field_msgs);
-  p->has_multi_field_msgs = Py_None; Py_INCREF(Py_None);
-  Py_XDECREF(tmp);
-  return 0;
-}
-static PyObject *__pyx_sq_item_6pygrib_open(PyObject *o, Py_ssize_t i) {
-  PyObject *r;
-  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
-  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
-  Py_DECREF(x);
-  return r;
-}
-
-static PyObject *__pyx_getprop_6pygrib_4open_name(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_6pygrib_4open_4name_1__get__(o);
-}
-
-static int __pyx_setprop_6pygrib_4open_name(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
-  if (v) {
-    return __pyx_pw_6pygrib_4open_4name_3__set__(o, v);
-  }
-  else {
-    return __pyx_pw_6pygrib_4open_4name_5__del__(o);
-  }
-}
-
-static PyObject *__pyx_getprop_6pygrib_4open_messagenumber(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_6pygrib_4open_13messagenumber_1__get__(o);
-}
-
-static int __pyx_setprop_6pygrib_4open_messagenumber(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
-  if (v) {
-    return __pyx_pw_6pygrib_4open_13messagenumber_3__set__(o, v);
-  }
-  else {
-    return __pyx_pw_6pygrib_4open_13messagenumber_5__del__(o);
-  }
-}
-
-static PyObject *__pyx_getprop_6pygrib_4open_messages(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_6pygrib_4open_8messages_1__get__(o);
-}
-
-static int __pyx_setprop_6pygrib_4open_messages(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
-  if (v) {
-    return __pyx_pw_6pygrib_4open_8messages_3__set__(o, v);
-  }
-  else {
-    return __pyx_pw_6pygrib_4open_8messages_5__del__(o);
-  }
-}
-
-static PyObject *__pyx_getprop_6pygrib_4open_closed(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_6pygrib_4open_6closed_1__get__(o);
-}
-
-static int __pyx_setprop_6pygrib_4open_closed(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
-  if (v) {
-    return __pyx_pw_6pygrib_4open_6closed_3__set__(o, v);
-  }
-  else {
-    return __pyx_pw_6pygrib_4open_6closed_5__del__(o);
-  }
-}
-
-static PyObject *__pyx_getprop_6pygrib_4open_has_multi_field_msgs(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_6pygrib_4open_20has_multi_field_msgs_1__get__(o);
-}
-
-static int __pyx_setprop_6pygrib_4open_has_multi_field_msgs(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
-  if (v) {
-    return __pyx_pw_6pygrib_4open_20has_multi_field_msgs_3__set__(o, v);
-  }
-  else {
-    return __pyx_pw_6pygrib_4open_20has_multi_field_msgs_5__del__(o);
-  }
-}
-
-static PyMethodDef __pyx_methods_6pygrib_open[] = {
-  {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pw_6pygrib_4open_7__next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
-  {__Pyx_NAMESTR("__enter__"), (PyCFunction)__pyx_pw_6pygrib_4open_13__enter__, METH_NOARGS, __Pyx_DOCSTR(0)},
-  {__Pyx_NAMESTR("__exit__"), (PyCFunction)__pyx_pw_6pygrib_4open_15__exit__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
-  {__Pyx_NAMESTR("tell"), (PyCFunction)__pyx_pw_6pygrib_4open_17tell, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6pygrib_4open_16tell)},
-  {__Pyx_NAMESTR("seek"), (PyCFunction)__pyx_pw_6pygrib_4open_19seek, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pygrib_4open_18seek)},
-  {__Pyx_NAMESTR("readline"), (PyCFunction)__pyx_pw_6pygrib_4open_21readline, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6pygrib_4open_20readline)},
-  {__Pyx_NAMESTR("read"), (PyCFunction)__pyx_pw_6pygrib_4open_23read, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pygrib_4open_22read)},
-  {__Pyx_NAMESTR("close"), (PyCFunction)__pyx_pw_6pygrib_4open_25close, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6pygrib_4open_24close)},
-  {__Pyx_NAMESTR("rewind"), (PyCFunction)__pyx_pw_6pygrib_4open_29rewind, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6pygrib_4open_28rewind)},
-  {__Pyx_NAMESTR("message"), (PyCFunction)__pyx_pw_6pygrib_4open_31message, METH_O, __Pyx_DOCSTR(__pyx_doc_6pygrib_4open_30message)},
-  {__Pyx_NAMESTR("select"), (PyCFunction)__pyx_pw_6pygrib_4open_33select, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pygrib_4open_32select)},
-  {__Pyx_NAMESTR("_advance"), (PyCFunction)__pyx_pw_6pygrib_4open_35_advance, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pygrib_4open_34_advance)},
-  {0, 0, 0, 0}
-};
-
-static struct PyGetSetDef __pyx_getsets_6pygrib_open[] = {
-  {(char *)"name", __pyx_getprop_6pygrib_4open_name, __pyx_setprop_6pygrib_4open_name, 0, 0},
-  {(char *)"messagenumber", __pyx_getprop_6pygrib_4open_messagenumber, __pyx_setprop_6pygrib_4open_messagenumber, 0, 0},
-  {(char *)"messages", __pyx_getprop_6pygrib_4open_messages, __pyx_setprop_6pygrib_4open_messages, 0, 0},
-  {(char *)"closed", __pyx_getprop_6pygrib_4open_closed, __pyx_setprop_6pygrib_4open_closed, 0, 0},
-  {(char *)"has_multi_field_msgs", __pyx_getprop_6pygrib_4open_has_multi_field_msgs, __pyx_setprop_6pygrib_4open_has_multi_field_msgs, 0, 0},
-  {0, 0, 0, 0, 0}
-};
-
-static PySequenceMethods __pyx_tp_as_sequence_open = {
-  0, /*sq_length*/
-  0, /*sq_concat*/
-  0, /*sq_repeat*/
-  __pyx_sq_item_6pygrib_open, /*sq_item*/
-  0, /*sq_slice*/
-  0, /*sq_ass_item*/
-  0, /*sq_ass_slice*/
-  0, /*sq_contains*/
-  0, /*sq_inplace_concat*/
-  0, /*sq_inplace_repeat*/
-};
-
-static PyMappingMethods __pyx_tp_as_mapping_open = {
-  0, /*mp_length*/
-  __pyx_pw_6pygrib_4open_9__getitem__, /*mp_subscript*/
-  0, /*mp_ass_subscript*/
-};
-
-static PyTypeObject __pyx_type_6pygrib_open = {
-  PyVarObject_HEAD_INIT(0, 0)
-  __Pyx_NAMESTR("pygrib.open"), /*tp_name*/
-  sizeof(struct __pyx_obj_6pygrib_open), /*tp_basicsize*/
-  0, /*tp_itemsize*/
-  __pyx_tp_dealloc_6pygrib_open, /*tp_dealloc*/
-  0, /*tp_print*/
-  0, /*tp_getattr*/
-  0, /*tp_setattr*/
-  #if PY_MAJOR_VERSION < 3
-  0, /*tp_compare*/
-  #else
-  0, /*reserved*/
-  #endif
-  0, /*tp_repr*/
-  0, /*tp_as_number*/
-  &__pyx_tp_as_sequence_open, /*tp_as_sequence*/
-  &__pyx_tp_as_mapping_open, /*tp_as_mapping*/
-  0, /*tp_hash*/
-  __pyx_pw_6pygrib_4open_11__call__, /*tp_call*/
-  0, /*tp_str*/
-  0, /*tp_getattro*/
-  0, /*tp_setattro*/
-  0, /*tp_as_buffer*/
-  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
-  __Pyx_DOCSTR(" \n    open(filename)\n    \n    returns GRIB file iterator object given GRIB filename. When iterated, returns\n    instances of the L{gribmessage} class. Behaves much like a python file\n    object, with L{seek}, L{tell}, L{read} and L{close} methods, \n    except that offsets are measured in grib messages instead of bytes.\n    Additional methods include L{rewind} (like C{seek(0)}), L{message}\n    (like C{seek(N-1)}; followed by C{readline()}), and L{select} (filters\n [...]
-  __pyx_tp_traverse_6pygrib_open, /*tp_traverse*/
-  __pyx_tp_clear_6pygrib_open, /*tp_clear*/
-  0, /*tp_richcompare*/
-  0, /*tp_weaklistoffset*/
-  __pyx_pw_6pygrib_4open_5__iter__, /*tp_iter*/
-  __pyx_pw_6pygrib_4open_7__next__, /*tp_iternext*/
-  __pyx_methods_6pygrib_open, /*tp_methods*/
-  0, /*tp_members*/
-  __pyx_getsets_6pygrib_open, /*tp_getset*/
-  0, /*tp_base*/
-  0, /*tp_dict*/
-  0, /*tp_descr_get*/
-  0, /*tp_descr_set*/
-  0, /*tp_dictoffset*/
-  __pyx_pw_6pygrib_4open_3__init__, /*tp_init*/
-  0, /*tp_alloc*/
-  __pyx_tp_new_6pygrib_open, /*tp_new*/
-  0, /*tp_free*/
-  0, /*tp_is_gc*/
-  0, /*tp_bases*/
-  0, /*tp_mro*/
-  0, /*tp_cache*/
-  0, /*tp_subclasses*/
-  0, /*tp_weaklist*/
-  0, /*tp_del*/
-  #if PY_VERSION_HEX >= 0x02060000
-  0, /*tp_version_tag*/
-  #endif
-  #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE)
+  #if PY_VERSION_HEX >= 0x030400a1
   0, /*tp_finalize*/
   #endif
 };
@@ -27918,7 +30358,11 @@ static PyTypeObject __pyx_type_6pygrib_open = {
 static PyObject *__pyx_tp_new_6pygrib_index(PyTypeObject *t, PyObject *a, PyObject *k) {
   struct __pyx_obj_6pygrib_index *p;
   PyObject *o;
-  o = (*t->tp_alloc)(t, 0);
+  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
+    o = (*t->tp_alloc)(t, 0);
+  } else {
+    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
+  }
   if (unlikely(!o)) return 0;
   p = ((struct __pyx_obj_6pygrib_index *)o);
   p->keys = Py_None; Py_INCREF(Py_None);
@@ -27932,13 +30376,17 @@ static PyObject *__pyx_tp_new_6pygrib_index(PyTypeObject *t, PyObject *a, PyObje
 
 static void __pyx_tp_dealloc_6pygrib_index(PyObject *o) {
   struct __pyx_obj_6pygrib_index *p = (struct __pyx_obj_6pygrib_index *)o;
+  #if PY_VERSION_HEX >= 0x030400a1
+  if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
+    if (PyObject_CallFinalizerFromDealloc(o)) return;
+  }
+  #endif
   PyObject_GC_UnTrack(o);
   {
     PyObject *etype, *eval, *etb;
     PyErr_Fetch(&etype, &eval, &etb);
     ++Py_REFCNT(o);
     __pyx_pw_6pygrib_5index_13__dealloc__(o);
-    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
     --Py_REFCNT(o);
     PyErr_Restore(etype, eval, etb);
   }
@@ -27964,8 +30412,8 @@ static int __pyx_tp_traverse_6pygrib_index(PyObject *o, visitproc v, void *a) {
 }
 
 static int __pyx_tp_clear_6pygrib_index(PyObject *o) {
-  struct __pyx_obj_6pygrib_index *p = (struct __pyx_obj_6pygrib_index *)o;
   PyObject* tmp;
+  struct __pyx_obj_6pygrib_index *p = (struct __pyx_obj_6pygrib_index *)o;
   tmp = ((PyObject*)p->keys);
   p->keys = Py_None; Py_INCREF(Py_None);
   Py_XDECREF(tmp);
@@ -28018,9 +30466,9 @@ static int __pyx_setprop_6pygrib_5index_name(PyObject *o, PyObject *v, CYTHON_UN
 }
 
 static PyMethodDef __pyx_methods_6pygrib_index[] = {
-  {__Pyx_NAMESTR("select"), (PyCFunction)__pyx_pw_6pygrib_5index_7select, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pygrib_5index_6select)},
-  {__Pyx_NAMESTR("write"), (PyCFunction)__pyx_pw_6pygrib_5index_9write, METH_O, __Pyx_DOCSTR(__pyx_doc_6pygrib_5index_8write)},
-  {__Pyx_NAMESTR("close"), (PyCFunction)__pyx_pw_6pygrib_5index_11close, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6pygrib_5index_10close)},
+  {"select", (PyCFunction)__pyx_pw_6pygrib_5index_7select, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pygrib_5index_6select},
+  {"write", (PyCFunction)__pyx_pw_6pygrib_5index_9write, METH_O, __pyx_doc_6pygrib_5index_8write},
+  {"close", (PyCFunction)__pyx_pw_6pygrib_5index_11close, METH_NOARGS, __pyx_doc_6pygrib_5index_10close},
   {0, 0, 0, 0}
 };
 
@@ -28033,7 +30481,7 @@ static struct PyGetSetDef __pyx_getsets_6pygrib_index[] = {
 
 static PyTypeObject __pyx_type_6pygrib_index = {
   PyVarObject_HEAD_INIT(0, 0)
-  __Pyx_NAMESTR("pygrib.index"), /*tp_name*/
+  "pygrib.index", /*tp_name*/
   sizeof(struct __pyx_obj_6pygrib_index), /*tp_basicsize*/
   0, /*tp_itemsize*/
   __pyx_tp_dealloc_6pygrib_index, /*tp_dealloc*/
@@ -28056,7 +30504,7 @@ static PyTypeObject __pyx_type_6pygrib_index = {
   0, /*tp_setattro*/
   0, /*tp_as_buffer*/
   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
-  __Pyx_DOCSTR(" \nindex(filename, *args)\n    \nreturns grib index object given GRIB filename indexed by keys given in\n*args.  The L{select} or L{__call__} method can then be used to selected grib messages\nbased on specified values of indexed keys.\nUnlike L{open.select}, containers or callables cannot be used to \nselect multiple key values.\nHowever, using L{index.select} is much faster than L{open.select}.\n\nB{Warning}:  Searching for data within multi-field grib messages does not [...]
+  " \nindex(filename, *args)\n    \nreturns grib index object given GRIB filename indexed by keys given in\n*args.  The L{select} or L{__call__} method can then be used to selected grib messages\nbased on specified values of indexed keys.\nUnlike L{open.select}, containers or callables cannot be used to \nselect multiple key values.\nHowever, using L{index.select} is much faster than L{open.select}.\n\nB{Warning}:  Searching for data within multi-field grib messages does not\nwork using  [...]
   __pyx_tp_traverse_6pygrib_index, /*tp_traverse*/
   __pyx_tp_clear_6pygrib_index, /*tp_clear*/
   0, /*tp_richcompare*/
@@ -28082,10 +30530,8 @@ static PyTypeObject __pyx_type_6pygrib_index = {
   0, /*tp_subclasses*/
   0, /*tp_weaklist*/
   0, /*tp_del*/
-  #if PY_VERSION_HEX >= 0x02060000
   0, /*tp_version_tag*/
-  #endif
-  #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE)
+  #if PY_VERSION_HEX >= 0x030400a1
   0, /*tp_finalize*/
   #endif
 };
@@ -28101,8 +30547,8 @@ static struct PyModuleDef __pyx_moduledef = {
   #else
     PyModuleDef_HEAD_INIT,
   #endif
-    __Pyx_NAMESTR("pygrib"),
-    __Pyx_DOCSTR(__pyx_k_192), /* m_doc */
+    "pygrib",
+    __pyx_k_Introduction_Python_module_for, /* m_doc */
     -1, /* m_size */
     __pyx_methods /* m_methods */,
     NULL, /* m_reload */
@@ -28113,406 +30559,406 @@ static struct PyModuleDef __pyx_moduledef = {
 #endif
 
 static __Pyx_StringTabEntry __pyx_string_tab[] = {
-  {&__pyx_n_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 1},
-  {&__pyx_kp_s_10, __pyx_k_10, sizeof(__pyx_k_10), 0, 0, 1, 0},
-  {&__pyx_kp_s_104, __pyx_k_104, sizeof(__pyx_k_104), 0, 0, 1, 0},
-  {&__pyx_kp_s_105, __pyx_k_105, sizeof(__pyx_k_105), 0, 0, 1, 0},
-  {&__pyx_kp_s_106, __pyx_k_106, sizeof(__pyx_k_106), 0, 0, 1, 0},
-  {&__pyx_n_s_108, __pyx_k_108, sizeof(__pyx_k_108), 0, 0, 1, 1},
-  {&__pyx_kp_s_112, __pyx_k_112, sizeof(__pyx_k_112), 0, 0, 1, 0},
-  {&__pyx_kp_s_115, __pyx_k_115, sizeof(__pyx_k_115), 0, 0, 1, 0},
-  {&__pyx_n_s_117, __pyx_k_117, sizeof(__pyx_k_117), 0, 0, 1, 1},
-  {&__pyx_kp_s_12, __pyx_k_12, sizeof(__pyx_k_12), 0, 0, 1, 0},
-  {&__pyx_n_s_139, __pyx_k_139, sizeof(__pyx_k_139), 0, 0, 1, 1},
-  {&__pyx_n_s_141, __pyx_k_141, sizeof(__pyx_k_141), 0, 0, 1, 1},
-  {&__pyx_n_s_142, __pyx_k_142, sizeof(__pyx_k_142), 0, 0, 1, 1},
-  {&__pyx_n_s_143, __pyx_k_143, sizeof(__pyx_k_143), 0, 0, 1, 1},
-  {&__pyx_n_s_144, __pyx_k_144, sizeof(__pyx_k_144), 0, 0, 1, 1},
-  {&__pyx_n_s_145, __pyx_k_145, sizeof(__pyx_k_145), 0, 0, 1, 1},
-  {&__pyx_n_s_146, __pyx_k_146, sizeof(__pyx_k_146), 0, 0, 1, 1},
-  {&__pyx_n_s_148, __pyx_k_148, sizeof(__pyx_k_148), 0, 0, 1, 1},
-  {&__pyx_kp_s_149, __pyx_k_149, sizeof(__pyx_k_149), 0, 0, 1, 0},
-  {&__pyx_kp_s_15, __pyx_k_15, sizeof(__pyx_k_15), 0, 0, 1, 0},
-  {&__pyx_n_s_151, __pyx_k_151, sizeof(__pyx_k_151), 0, 0, 1, 1},
-  {&__pyx_n_s_152, __pyx_k_152, sizeof(__pyx_k_152), 0, 0, 1, 1},
-  {&__pyx_n_s_154, __pyx_k_154, sizeof(__pyx_k_154), 0, 0, 1, 1},
-  {&__pyx_kp_s_156, __pyx_k_156, sizeof(__pyx_k_156), 0, 0, 1, 0},
-  {&__pyx_n_s_158, __pyx_k_158, sizeof(__pyx_k_158), 0, 0, 1, 1},
-  {&__pyx_n_s_159, __pyx_k_159, sizeof(__pyx_k_159), 0, 0, 1, 1},
-  {&__pyx_n_s_160, __pyx_k_160, sizeof(__pyx_k_160), 0, 0, 1, 1},
-  {&__pyx_n_s_161, __pyx_k_161, sizeof(__pyx_k_161), 0, 0, 1, 1},
-  {&__pyx_n_s_162, __pyx_k_162, sizeof(__pyx_k_162), 0, 0, 1, 1},
-  {&__pyx_n_s_163, __pyx_k_163, sizeof(__pyx_k_163), 0, 0, 1, 1},
-  {&__pyx_n_s_164, __pyx_k_164, sizeof(__pyx_k_164), 0, 0, 1, 1},
-  {&__pyx_n_s_165, __pyx_k_165, sizeof(__pyx_k_165), 0, 0, 1, 1},
-  {&__pyx_n_s_166, __pyx_k_166, sizeof(__pyx_k_166), 0, 0, 1, 1},
-  {&__pyx_n_s_167, __pyx_k_167, sizeof(__pyx_k_167), 0, 0, 1, 1},
-  {&__pyx_kp_s_168, __pyx_k_168, sizeof(__pyx_k_168), 0, 0, 1, 0},
-  {&__pyx_n_s_169, __pyx_k_169, sizeof(__pyx_k_169), 0, 0, 1, 1},
-  {&__pyx_kp_s_17, __pyx_k_17, sizeof(__pyx_k_17), 0, 0, 1, 0},
-  {&__pyx_n_s_170, __pyx_k_170, sizeof(__pyx_k_170), 0, 0, 1, 1},
-  {&__pyx_n_s_171, __pyx_k_171, sizeof(__pyx_k_171), 0, 0, 1, 1},
-  {&__pyx_n_s_172, __pyx_k_172, sizeof(__pyx_k_172), 0, 0, 1, 1},
-  {&__pyx_n_s_176, __pyx_k_176, sizeof(__pyx_k_176), 0, 0, 1, 1},
-  {&__pyx_n_s_177, __pyx_k_177, sizeof(__pyx_k_177), 0, 0, 1, 1},
-  {&__pyx_kp_s_178, __pyx_k_178, sizeof(__pyx_k_178), 0, 0, 1, 0},
-  {&__pyx_n_s_180, __pyx_k_180, sizeof(__pyx_k_180), 0, 0, 1, 1},
-  {&__pyx_n_s_181, __pyx_k_181, sizeof(__pyx_k_181), 0, 0, 1, 1},
-  {&__pyx_kp_s_182, __pyx_k_182, sizeof(__pyx_k_182), 0, 0, 1, 0},
-  {&__pyx_kp_s_183, __pyx_k_183, sizeof(__pyx_k_183), 0, 0, 1, 0},
-  {&__pyx_kp_s_186, __pyx_k_186, sizeof(__pyx_k_186), 0, 0, 1, 0},
-  {&__pyx_kp_s_188, __pyx_k_188, sizeof(__pyx_k_188), 0, 0, 1, 0},
-  {&__pyx_kp_s_19, __pyx_k_19, sizeof(__pyx_k_19), 0, 0, 1, 0},
-  {&__pyx_kp_s_193, __pyx_k_193, sizeof(__pyx_k_193), 0, 0, 1, 0},
-  {&__pyx_n_s_194, __pyx_k_194, sizeof(__pyx_k_194), 0, 0, 1, 1},
-  {&__pyx_kp_s_195, __pyx_k_195, sizeof(__pyx_k_195), 0, 0, 1, 0},
-  {&__pyx_n_s_199, __pyx_k_199, sizeof(__pyx_k_199), 0, 0, 1, 1},
-  {&__pyx_kp_s_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 1, 0},
-  {&__pyx_n_s_20, __pyx_k_20, sizeof(__pyx_k_20), 0, 0, 1, 1},
-  {&__pyx_kp_s_200, __pyx_k_200, sizeof(__pyx_k_200), 0, 0, 1, 0},
-  {&__pyx_n_s_203, __pyx_k_203, sizeof(__pyx_k_203), 0, 0, 1, 1},
-  {&__pyx_kp_s_206, __pyx_k_206, sizeof(__pyx_k_206), 0, 0, 1, 0},
-  {&__pyx_kp_s_24, __pyx_k_24, sizeof(__pyx_k_24), 0, 0, 1, 0},
-  {&__pyx_kp_s_27, __pyx_k_27, sizeof(__pyx_k_27), 0, 0, 1, 0},
-  {&__pyx_kp_s_28, __pyx_k_28, sizeof(__pyx_k_28), 0, 0, 1, 0},
-  {&__pyx_kp_s_29, __pyx_k_29, sizeof(__pyx_k_29), 0, 0, 1, 0},
-  {&__pyx_kp_s_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 0, 1, 0},
-  {&__pyx_kp_s_30, __pyx_k_30, sizeof(__pyx_k_30), 0, 0, 1, 0},
-  {&__pyx_kp_s_33, __pyx_k_33, sizeof(__pyx_k_33), 0, 0, 1, 0},
-  {&__pyx_kp_s_38, __pyx_k_38, sizeof(__pyx_k_38), 0, 0, 1, 0},
-  {&__pyx_kp_s_39, __pyx_k_39, sizeof(__pyx_k_39), 0, 0, 1, 0},
-  {&__pyx_n_s_46, __pyx_k_46, sizeof(__pyx_k_46), 0, 0, 1, 1},
-  {&__pyx_n_s_48, __pyx_k_48, sizeof(__pyx_k_48), 0, 0, 1, 1},
-  {&__pyx_kp_s_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 0, 1, 0},
-  {&__pyx_n_s_50, __pyx_k_50, sizeof(__pyx_k_50), 0, 0, 1, 1},
-  {&__pyx_n_s_52, __pyx_k_52, sizeof(__pyx_k_52), 0, 0, 1, 1},
-  {&__pyx_n_s_54, __pyx_k_54, sizeof(__pyx_k_54), 0, 0, 1, 1},
-  {&__pyx_n_s_56, __pyx_k_56, sizeof(__pyx_k_56), 0, 0, 1, 1},
-  {&__pyx_n_s_58, __pyx_k_58, sizeof(__pyx_k_58), 0, 0, 1, 1},
-  {&__pyx_kp_s_6, __pyx_k_6, sizeof(__pyx_k_6), 0, 0, 1, 0},
-  {&__pyx_kp_s_60, __pyx_k_60, sizeof(__pyx_k_60), 0, 0, 1, 0},
-  {&__pyx_kp_s_61, __pyx_k_61, sizeof(__pyx_k_61), 0, 0, 1, 0},
-  {&__pyx_kp_s_62, __pyx_k_62, sizeof(__pyx_k_62), 0, 0, 1, 0},
-  {&__pyx_kp_s_66, __pyx_k_66, sizeof(__pyx_k_66), 0, 0, 1, 0},
-  {&__pyx_kp_s_67, __pyx_k_67, sizeof(__pyx_k_67), 0, 0, 1, 0},
-  {&__pyx_kp_s_71, __pyx_k_71, sizeof(__pyx_k_71), 0, 0, 1, 0},
-  {&__pyx_kp_s_72, __pyx_k_72, sizeof(__pyx_k_72), 0, 0, 1, 0},
-  {&__pyx_n_s_74, __pyx_k_74, sizeof(__pyx_k_74), 0, 0, 1, 1},
-  {&__pyx_kp_s_76, __pyx_k_76, sizeof(__pyx_k_76), 0, 0, 1, 0},
-  {&__pyx_kp_s_77, __pyx_k_77, sizeof(__pyx_k_77), 0, 0, 1, 0},
-  {&__pyx_kp_s_78, __pyx_k_78, sizeof(__pyx_k_78), 0, 0, 1, 0},
-  {&__pyx_kp_s_79, __pyx_k_79, sizeof(__pyx_k_79), 0, 0, 1, 0},
-  {&__pyx_kp_s_8, __pyx_k_8, sizeof(__pyx_k_8), 0, 0, 1, 0},
-  {&__pyx_kp_s_81, __pyx_k_81, sizeof(__pyx_k_81), 0, 0, 1, 0},
-  {&__pyx_kp_s_82, __pyx_k_82, sizeof(__pyx_k_82), 0, 0, 1, 0},
-  {&__pyx_kp_s_83, __pyx_k_83, sizeof(__pyx_k_83), 0, 0, 1, 0},
-  {&__pyx_kp_s_84, __pyx_k_84, sizeof(__pyx_k_84), 0, 0, 1, 0},
-  {&__pyx_kp_s_85, __pyx_k_85, sizeof(__pyx_k_85), 0, 0, 1, 0},
-  {&__pyx_kp_s_86, __pyx_k_86, sizeof(__pyx_k_86), 0, 0, 1, 0},
-  {&__pyx_kp_s_87, __pyx_k_87, sizeof(__pyx_k_87), 0, 0, 1, 0},
-  {&__pyx_n_s_89, __pyx_k_89, sizeof(__pyx_k_89), 0, 0, 1, 1},
-  {&__pyx_n_s_91, __pyx_k_91, sizeof(__pyx_k_91), 0, 0, 1, 1},
-  {&__pyx_n_s_93, __pyx_k_93, sizeof(__pyx_k_93), 0, 0, 1, 1},
-  {&__pyx_n_s_95, __pyx_k_95, sizeof(__pyx_k_95), 0, 0, 1, 1},
-  {&__pyx_kp_s_97, __pyx_k_97, sizeof(__pyx_k_97), 0, 0, 1, 0},
-  {&__pyx_kp_s_98, __pyx_k_98, sizeof(__pyx_k_98), 0, 0, 1, 0},
-  {&__pyx_kp_s_99, __pyx_k_99, sizeof(__pyx_k_99), 0, 0, 1, 0},
-  {&__pyx_kp_s__7777, __pyx_k__7777, sizeof(__pyx_k__7777), 0, 0, 1, 0},
-  {&__pyx_n_s__AttributeError, __pyx_k__AttributeError, sizeof(__pyx_k__AttributeError), 0, 0, 1, 1},
-  {&__pyx_n_s__C, __pyx_k__C, sizeof(__pyx_k__C), 0, 0, 1, 1},
-  {&__pyx_n_s__Dx, __pyx_k__Dx, sizeof(__pyx_k__Dx), 0, 0, 1, 1},
-  {&__pyx_n_s__DxInMetres, __pyx_k__DxInMetres, sizeof(__pyx_k__DxInMetres), 0, 0, 1, 1},
-  {&__pyx_n_s__Dy, __pyx_k__Dy, sizeof(__pyx_k__Dy), 0, 0, 1, 1},
-  {&__pyx_n_s__DyInMetres, __pyx_k__DyInMetres, sizeof(__pyx_k__DyInMetres), 0, 0, 1, 1},
-  {&__pyx_n_s__F, __pyx_k__F, sizeof(__pyx_k__F), 0, 0, 1, 1},
-  {&__pyx_n_s__Grib2Decode, __pyx_k__Grib2Decode, sizeof(__pyx_k__Grib2Decode), 0, 0, 1, 1},
-  {&__pyx_n_s__IOError, __pyx_k__IOError, sizeof(__pyx_k__IOError), 0, 0, 1, 1},
-  {&__pyx_n_s__ImportError, __pyx_k__ImportError, sizeof(__pyx_k__ImportError), 0, 0, 1, 1},
-  {&__pyx_n_s__IndexError, __pyx_k__IndexError, sizeof(__pyx_k__IndexError), 0, 0, 1, 1},
-  {&__pyx_n_s__KeyError, __pyx_k__KeyError, sizeof(__pyx_k__KeyError), 0, 0, 1, 1},
-  {&__pyx_n_s__LaD, __pyx_k__LaD, sizeof(__pyx_k__LaD), 0, 0, 1, 1},
-  {&__pyx_n_s__LaDInDegrees, __pyx_k__LaDInDegrees, sizeof(__pyx_k__LaDInDegrees), 0, 0, 1, 1},
-  {&__pyx_n_s__Latin, __pyx_k__Latin, sizeof(__pyx_k__Latin), 0, 0, 1, 1},
-  {&__pyx_n_s__Latin1, __pyx_k__Latin1, sizeof(__pyx_k__Latin1), 0, 0, 1, 1},
-  {&__pyx_n_s__Latin1InDegrees, __pyx_k__Latin1InDegrees, sizeof(__pyx_k__Latin1InDegrees), 0, 0, 1, 1},
-  {&__pyx_n_s__Latin2, __pyx_k__Latin2, sizeof(__pyx_k__Latin2), 0, 0, 1, 1},
-  {&__pyx_n_s__Latin2InDegrees, __pyx_k__Latin2InDegrees, sizeof(__pyx_k__Latin2InDegrees), 0, 0, 1, 1},
-  {&__pyx_n_s__LoV, __pyx_k__LoV, sizeof(__pyx_k__LoV), 0, 0, 1, 1},
-  {&__pyx_n_s__LoVInDegrees, __pyx_k__LoVInDegrees, sizeof(__pyx_k__LoVInDegrees), 0, 0, 1, 1},
-  {&__pyx_n_s__Ni, __pyx_k__Ni, sizeof(__pyx_k__Ni), 0, 0, 1, 1},
-  {&__pyx_n_s__Nj, __pyx_k__Nj, sizeof(__pyx_k__Nj), 0, 0, 1, 1},
-  {&__pyx_n_s__Nr, __pyx_k__Nr, sizeof(__pyx_k__Nr), 0, 0, 1, 1},
-  {&__pyx_n_s__Nx, __pyx_k__Nx, sizeof(__pyx_k__Nx), 0, 0, 1, 1},
-  {&__pyx_n_s__Ny, __pyx_k__Ny, sizeof(__pyx_k__Ny), 0, 0, 1, 1},
-  {&__pyx_n_s__Proj, __pyx_k__Proj, sizeof(__pyx_k__Proj), 0, 0, 1, 1},
-  {&__pyx_n_s__RuntimeError, __pyx_k__RuntimeError, sizeof(__pyx_k__RuntimeError), 0, 0, 1, 1},
-  {&__pyx_n_s__StopIteration, __pyx_k__StopIteration, sizeof(__pyx_k__StopIteration), 0, 0, 1, 1},
-  {&__pyx_n_s__TypeError, __pyx_k__TypeError, sizeof(__pyx_k__TypeError), 0, 0, 1, 1},
-  {&__pyx_n_s__ValueError, __pyx_k__ValueError, sizeof(__pyx_k__ValueError), 0, 0, 1, 1},
-  {&__pyx_n_s____call__, __pyx_k____call__, sizeof(__pyx_k____call__), 0, 0, 1, 1},
-  {&__pyx_n_s____dict__, __pyx_k____dict__, sizeof(__pyx_k____dict__), 0, 0, 1, 1},
-  {&__pyx_n_s____getitem__, __pyx_k____getitem__, sizeof(__pyx_k____getitem__), 0, 0, 1, 1},
-  {&__pyx_n_s____import__, __pyx_k____import__, sizeof(__pyx_k____import__), 0, 0, 1, 1},
-  {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1},
-  {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1},
-  {&__pyx_n_s____version__, __pyx_k____version__, sizeof(__pyx_k____version__), 0, 0, 1, 1},
-  {&__pyx_n_s___advance, __pyx_k___advance, sizeof(__pyx_k___advance), 0, 0, 1, 1},
-  {&__pyx_n_s___all_keys, __pyx_k___all_keys, sizeof(__pyx_k___all_keys), 0, 0, 1, 1},
-  {&__pyx_n_s___find, __pyx_k___find, sizeof(__pyx_k___find), 0, 0, 1, 1},
-  {&__pyx_n_s___ftimedict, __pyx_k___ftimedict, sizeof(__pyx_k___ftimedict), 0, 0, 1, 1},
-  {&__pyx_n_s___get_key, __pyx_k___get_key, sizeof(__pyx_k___get_key), 0, 0, 1, 1},
-  {&__pyx_n_s___gh, __pyx_k___gh, sizeof(__pyx_k___gh), 0, 0, 1, 1},
-  {&__pyx_n_s___is_container, __pyx_k___is_container, sizeof(__pyx_k___is_container), 0, 0, 1, 1},
-  {&__pyx_n_s___is_stringlike, __pyx_k___is_stringlike, sizeof(__pyx_k___is_stringlike), 0, 0, 1, 1},
-  {&__pyx_n_s___private_atts, __pyx_k___private_atts, sizeof(__pyx_k___private_atts), 0, 0, 1, 1},
-  {&__pyx_n_s___read_only_keys, __pyx_k___read_only_keys, sizeof(__pyx_k___read_only_keys), 0, 0, 1, 1},
-  {&__pyx_n_s___redtoreg, __pyx_k___redtoreg, sizeof(__pyx_k___redtoreg), 0, 0, 1, 1},
-  {&__pyx_n_s___reshape_mask, __pyx_k___reshape_mask, sizeof(__pyx_k___reshape_mask), 0, 0, 1, 1},
-  {&__pyx_n_s___ro_keys, __pyx_k___ro_keys, sizeof(__pyx_k___ro_keys), 0, 0, 1, 1},
-  {&__pyx_n_s___set_projparams, __pyx_k___set_projparams, sizeof(__pyx_k___set_projparams), 0, 0, 1, 1},
-  {&__pyx_n_s___unshape_mask, __pyx_k___unshape_mask, sizeof(__pyx_k___unshape_mask), 0, 0, 1, 1},
-  {&__pyx_n_s__a, __pyx_k__a, sizeof(__pyx_k__a), 0, 0, 1, 1},
-  {&__pyx_n_s__aea, __pyx_k__aea, sizeof(__pyx_k__aea), 0, 0, 1, 1},
-  {&__pyx_n_s__aeqd, __pyx_k__aeqd, sizeof(__pyx_k__aeqd), 0, 0, 1, 1},
-  {&__pyx_n_s__albers, __pyx_k__albers, sizeof(__pyx_k__albers), 0, 0, 1, 1},
-  {&__pyx_n_s__analDate, __pyx_k__analDate, sizeof(__pyx_k__analDate), 0, 0, 1, 1},
-  {&__pyx_n_s__arange, __pyx_k__arange, sizeof(__pyx_k__arange), 0, 0, 1, 1},
-  {&__pyx_n_s__arcsin, __pyx_k__arcsin, sizeof(__pyx_k__arcsin), 0, 0, 1, 1},
-  {&__pyx_n_s__asarray, __pyx_k__asarray, sizeof(__pyx_k__asarray), 0, 0, 1, 1},
-  {&__pyx_n_s__ascii, __pyx_k__ascii, sizeof(__pyx_k__ascii), 0, 0, 1, 1},
-  {&__pyx_n_s__atype, __pyx_k__atype, sizeof(__pyx_k__atype), 0, 0, 1, 1},
-  {&__pyx_n_s__b, __pyx_k__b, sizeof(__pyx_k__b), 0, 0, 1, 1},
-  {&__pyx_n_s__bottomLevel, __pyx_k__bottomLevel, sizeof(__pyx_k__bottomLevel), 0, 0, 1, 1},
-  {&__pyx_n_s__centralLongitude, __pyx_k__centralLongitude, sizeof(__pyx_k__centralLongitude), 0, 0, 1, 1},
-  {&__pyx_n_s__centuries, __pyx_k__centuries, sizeof(__pyx_k__centuries), 0, 0, 1, 1},
-  {&__pyx_n_s__close, __pyx_k__close, sizeof(__pyx_k__close), 0, 0, 1, 1},
-  {&__pyx_n_s__copy, __pyx_k__copy, sizeof(__pyx_k__copy), 0, 0, 1, 1},
-  {&__pyx_n_s__cyl, __pyx_k__cyl, sizeof(__pyx_k__cyl), 0, 0, 1, 1},
-  {&__pyx_n_s__d, __pyx_k__d, sizeof(__pyx_k__d), 0, 0, 1, 1},
-  {&__pyx_n_s__data, __pyx_k__data, sizeof(__pyx_k__data), 0, 0, 1, 1},
-  {&__pyx_n_s__dataDate, __pyx_k__dataDate, sizeof(__pyx_k__dataDate), 0, 0, 1, 1},
-  {&__pyx_n_s__dataTime, __pyx_k__dataTime, sizeof(__pyx_k__dataTime), 0, 0, 1, 1},
-  {&__pyx_n_s__datetime, __pyx_k__datetime, sizeof(__pyx_k__datetime), 0, 0, 1, 1},
-  {&__pyx_n_s__datetime_to_julian, __pyx_k__datetime_to_julian, sizeof(__pyx_k__datetime_to_julian), 0, 0, 1, 1},
-  {&__pyx_n_s__day, __pyx_k__day, sizeof(__pyx_k__day), 0, 0, 1, 1},
-  {&__pyx_n_s__days, __pyx_k__days, sizeof(__pyx_k__days), 0, 0, 1, 1},
-  {&__pyx_n_s__decades, __pyx_k__decades, sizeof(__pyx_k__decades), 0, 0, 1, 1},
-  {&__pyx_n_s__decode, __pyx_k__decode, sizeof(__pyx_k__decode), 0, 0, 1, 1},
-  {&__pyx_n_s__default, __pyx_k__default, sizeof(__pyx_k__default), 0, 0, 1, 1},
-  {&__pyx_n_s__default_encoding, __pyx_k__default_encoding, sizeof(__pyx_k__default_encoding), 0, 0, 1, 1},
-  {&__pyx_n_s__derivedForecast, __pyx_k__derivedForecast, sizeof(__pyx_k__derivedForecast), 0, 0, 1, 1},
-  {&__pyx_n_s__distinctLatitudes, __pyx_k__distinctLatitudes, sizeof(__pyx_k__distinctLatitudes), 0, 0, 1, 1},
-  {&__pyx_n_s__distinctLongitudes, __pyx_k__distinctLongitudes, sizeof(__pyx_k__distinctLongitudes), 0, 0, 1, 1},
-  {&__pyx_n_s__div, __pyx_k__div, sizeof(__pyx_k__div), 0, 0, 1, 1},
-  {&__pyx_n_s__double, __pyx_k__double, sizeof(__pyx_k__double), 0, 0, 1, 1},
-  {&__pyx_n_s__dx, __pyx_k__dx, sizeof(__pyx_k__dx), 0, 0, 1, 1},
-  {&__pyx_n_s__dy, __pyx_k__dy, sizeof(__pyx_k__dy), 0, 0, 1, 1},
-  {&__pyx_n_s__eight, __pyx_k__eight, sizeof(__pyx_k__eight), 0, 0, 1, 1},
-  {&__pyx_n_s__eleven, __pyx_k__eleven, sizeof(__pyx_k__eleven), 0, 0, 1, 1},
-  {&__pyx_n_s__empty, __pyx_k__empty, sizeof(__pyx_k__empty), 0, 0, 1, 1},
-  {&__pyx_n_s__encode, __pyx_k__encode, sizeof(__pyx_k__encode), 0, 0, 1, 1},
-  {&__pyx_n_s__err, __pyx_k__err, sizeof(__pyx_k__err), 0, 0, 1, 1},
-  {&__pyx_n_s__expand_reduced, __pyx_k__expand_reduced, sizeof(__pyx_k__expand_reduced), 0, 0, 1, 1},
-  {&__pyx_n_s__fabs, __pyx_k__fabs, sizeof(__pyx_k__fabs), 0, 0, 1, 1},
-  {&__pyx_n_s__false, __pyx_k__false, sizeof(__pyx_k__false), 0, 0, 1, 1},
-  {&__pyx_n_s__fcstimeunits, __pyx_k__fcstimeunits, sizeof(__pyx_k__fcstimeunits), 0, 0, 1, 1},
-  {&__pyx_n_s__file, __pyx_k__file, sizeof(__pyx_k__file), 0, 0, 1, 1},
-  {&__pyx_n_s__filename, __pyx_k__filename, sizeof(__pyx_k__filename), 0, 0, 1, 1},
-  {&__pyx_n_s__filled, __pyx_k__filled, sizeof(__pyx_k__filled), 0, 0, 1, 1},
-  {&__pyx_n_s__float, __pyx_k__float, sizeof(__pyx_k__float), 0, 0, 1, 1},
-  {&__pyx_n_s__float64, __pyx_k__float64, sizeof(__pyx_k__float64), 0, 0, 1, 1},
-  {&__pyx_n_s__forecastTime, __pyx_k__forecastTime, sizeof(__pyx_k__forecastTime), 0, 0, 1, 1},
-  {&__pyx_n_s__from_what, __pyx_k__from_what, sizeof(__pyx_k__from_what), 0, 0, 1, 1},
-  {&__pyx_n_s__fromstring, __pyx_k__fromstring, sizeof(__pyx_k__fromstring), 0, 0, 1, 1},
-  {&__pyx_n_s__ftime, __pyx_k__ftime, sizeof(__pyx_k__ftime), 0, 0, 1, 1},
-  {&__pyx_n_s__gaulats, __pyx_k__gaulats, sizeof(__pyx_k__gaulats), 0, 0, 1, 1},
-  {&__pyx_n_s__geos, __pyx_k__geos, sizeof(__pyx_k__geos), 0, 0, 1, 1},
-  {&__pyx_n_s__gh, __pyx_k__gh, sizeof(__pyx_k__gh), 0, 0, 1, 1},
-  {&__pyx_n_s__grb, __pyx_k__grb, sizeof(__pyx_k__grb), 0, 0, 1, 1},
-  {&__pyx_n_s__grib2divider, __pyx_k__grib2divider, sizeof(__pyx_k__grib2divider), 0, 0, 1, 1},
-  {&__pyx_n_s__grib_api_version, __pyx_k__grib_api_version, sizeof(__pyx_k__grib_api_version), 0, 0, 1, 1},
-  {&__pyx_n_s__gribmsg, __pyx_k__gribmsg, sizeof(__pyx_k__gribmsg), 0, 0, 1, 1},
-  {&__pyx_n_s__gribstr, __pyx_k__gribstr, sizeof(__pyx_k__gribstr), 0, 0, 1, 1},
-  {&__pyx_n_s__gribstring, __pyx_k__gribstring, sizeof(__pyx_k__gribstring), 0, 0, 1, 1},
-  {&__pyx_n_s__gridType, __pyx_k__gridType, sizeof(__pyx_k__gridType), 0, 0, 1, 1},
-  {&__pyx_n_s__grid_complex, __pyx_k__grid_complex, sizeof(__pyx_k__grid_complex), 0, 0, 1, 1},
-  {&__pyx_n_s__h, __pyx_k__h, sizeof(__pyx_k__h), 0, 0, 1, 1},
-  {&__pyx_n_s__has_key, __pyx_k__has_key, sizeof(__pyx_k__has_key), 0, 0, 1, 1},
-  {&__pyx_n_s__hour, __pyx_k__hour, sizeof(__pyx_k__hour), 0, 0, 1, 1},
-  {&__pyx_n_s__hrs, __pyx_k__hrs, sizeof(__pyx_k__hrs), 0, 0, 1, 1},
-  {&__pyx_n_s__iDirectionIncrement, __pyx_k__iDirectionIncrement, sizeof(__pyx_k__iDirectionIncrement), 0, 0, 1, 1},
-  {&__pyx_n_s__index, __pyx_k__index, sizeof(__pyx_k__index), 0, 0, 1, 1},
-  {&__pyx_n_s__indices, __pyx_k__indices, sizeof(__pyx_k__indices), 0, 0, 1, 1},
-  {&__pyx_n_s__instant, __pyx_k__instant, sizeof(__pyx_k__instant), 0, 0, 1, 1},
-  {&__pyx_n_s__int, __pyx_k__int, sizeof(__pyx_k__int), 0, 0, 1, 1},
-  {&__pyx_n_s__inverse, __pyx_k__inverse, sizeof(__pyx_k__inverse), 0, 0, 1, 1},
-  {&__pyx_n_s__isMA, __pyx_k__isMA, sizeof(__pyx_k__isMA), 0, 0, 1, 1},
-  {&__pyx_n_s__is_missing, __pyx_k__is_missing, sizeof(__pyx_k__is_missing), 0, 0, 1, 1},
-  {&__pyx_n_s__iscallable, __pyx_k__iscallable, sizeof(__pyx_k__iscallable), 0, 0, 1, 1},
-  {&__pyx_n_s__iscontainer, __pyx_k__iscontainer, sizeof(__pyx_k__iscontainer), 0, 0, 1, 1},
-  {&__pyx_n_s__items, __pyx_k__items, sizeof(__pyx_k__items), 0, 0, 1, 1},
-  {&__pyx_n_s__jd, __pyx_k__jd, sizeof(__pyx_k__jd), 0, 0, 1, 1},
-  {&__pyx_n_s__join, __pyx_k__join, sizeof(__pyx_k__join), 0, 0, 1, 1},
-  {&__pyx_n_s__julday, __pyx_k__julday, sizeof(__pyx_k__julday), 0, 0, 1, 1},
-  {&__pyx_n_s__julianDay, __pyx_k__julianDay, sizeof(__pyx_k__julianDay), 0, 0, 1, 1},
-  {&__pyx_n_s__julian_to_datetime, __pyx_k__julian_to_datetime, sizeof(__pyx_k__julian_to_datetime), 0, 0, 1, 1},
-  {&__pyx_n_s__k, __pyx_k__k, sizeof(__pyx_k__k), 0, 0, 1, 1},
-  {&__pyx_n_s__key, __pyx_k__key, sizeof(__pyx_k__key), 0, 0, 1, 1},
-  {&__pyx_n_s__keys, __pyx_k__keys, sizeof(__pyx_k__keys), 0, 0, 1, 1},
-  {&__pyx_n_s__kwargs, __pyx_k__kwargs, sizeof(__pyx_k__kwargs), 0, 0, 1, 1},
-  {&__pyx_n_s__l, __pyx_k__l, sizeof(__pyx_k__l), 0, 0, 1, 1},
-  {&__pyx_n_s__laea, __pyx_k__laea, sizeof(__pyx_k__laea), 0, 0, 1, 1},
-  {&__pyx_n_s__lambert, __pyx_k__lambert, sizeof(__pyx_k__lambert), 0, 0, 1, 1},
-  {&__pyx_n_s__lat1, __pyx_k__lat1, sizeof(__pyx_k__lat1), 0, 0, 1, 1},
-  {&__pyx_n_s__lat2, __pyx_k__lat2, sizeof(__pyx_k__lat2), 0, 0, 1, 1},
-  {&__pyx_n_s__lat_0, __pyx_k__lat_0, sizeof(__pyx_k__lat_0), 0, 0, 1, 1},
-  {&__pyx_n_s__lat_1, __pyx_k__lat_1, sizeof(__pyx_k__lat_1), 0, 0, 1, 1},
-  {&__pyx_n_s__lat_2, __pyx_k__lat_2, sizeof(__pyx_k__lat_2), 0, 0, 1, 1},
-  {&__pyx_n_s__lat_ts, __pyx_k__lat_ts, sizeof(__pyx_k__lat_ts), 0, 0, 1, 1},
-  {&__pyx_n_s__latitudes, __pyx_k__latitudes, sizeof(__pyx_k__latitudes), 0, 0, 1, 1},
-  {&__pyx_n_s__latlons, __pyx_k__latlons, sizeof(__pyx_k__latlons), 0, 0, 1, 1},
-  {&__pyx_n_s__lats, __pyx_k__lats, sizeof(__pyx_k__lats), 0, 0, 1, 1},
-  {&__pyx_n_s__lcc, __pyx_k__lcc, sizeof(__pyx_k__lcc), 0, 0, 1, 1},
-  {&__pyx_n_s__level, __pyx_k__level, sizeof(__pyx_k__level), 0, 0, 1, 1},
-  {&__pyx_n_s__linspace, __pyx_k__linspace, sizeof(__pyx_k__linspace), 0, 0, 1, 1},
-  {&__pyx_n_s__localDir, __pyx_k__localDir, sizeof(__pyx_k__localDir), 0, 0, 1, 1},
-  {&__pyx_n_s__lon1, __pyx_k__lon1, sizeof(__pyx_k__lon1), 0, 0, 1, 1},
-  {&__pyx_n_s__lon2, __pyx_k__lon2, sizeof(__pyx_k__lon2), 0, 0, 1, 1},
-  {&__pyx_n_s__lon_0, __pyx_k__lon_0, sizeof(__pyx_k__lon_0), 0, 0, 1, 1},
-  {&__pyx_n_s__longitudes, __pyx_k__longitudes, sizeof(__pyx_k__longitudes), 0, 0, 1, 1},
-  {&__pyx_n_s__longlat, __pyx_k__longlat, sizeof(__pyx_k__longlat), 0, 0, 1, 1},
-  {&__pyx_n_s__ma, __pyx_k__ma, sizeof(__pyx_k__ma), 0, 0, 1, 1},
-  {&__pyx_n_s__major, __pyx_k__major, sizeof(__pyx_k__major), 0, 0, 1, 1},
-  {&__pyx_n_s__masked_values, __pyx_k__masked_values, sizeof(__pyx_k__masked_values), 0, 0, 1, 1},
-  {&__pyx_n_s__max, __pyx_k__max, sizeof(__pyx_k__max), 0, 0, 1, 1},
-  {&__pyx_n_s__merc, __pyx_k__merc, sizeof(__pyx_k__merc), 0, 0, 1, 1},
-  {&__pyx_n_s__mercator, __pyx_k__mercator, sizeof(__pyx_k__mercator), 0, 0, 1, 1},
-  {&__pyx_n_s__meshgrid, __pyx_k__meshgrid, sizeof(__pyx_k__meshgrid), 0, 0, 1, 1},
-  {&__pyx_n_s__message, __pyx_k__message, sizeof(__pyx_k__message), 0, 0, 1, 1},
-  {&__pyx_n_s__messagenumber, __pyx_k__messagenumber, sizeof(__pyx_k__messagenumber), 0, 0, 1, 1},
-  {&__pyx_n_s__min, __pyx_k__min, sizeof(__pyx_k__min), 0, 0, 1, 1},
-  {&__pyx_n_s__minor, __pyx_k__minor, sizeof(__pyx_k__minor), 0, 0, 1, 1},
-  {&__pyx_n_s__mins, __pyx_k__mins, sizeof(__pyx_k__mins), 0, 0, 1, 1},
-  {&__pyx_n_s__minute, __pyx_k__minute, sizeof(__pyx_k__minute), 0, 0, 1, 1},
-  {&__pyx_n_s__missingValue, __pyx_k__missingValue, sizeof(__pyx_k__missingValue), 0, 0, 1, 1},
-  {&__pyx_n_s__missingvalue_float, __pyx_k__missingvalue_float, sizeof(__pyx_k__missingvalue_float), 0, 0, 1, 1},
-  {&__pyx_n_s__missingvalue_int, __pyx_k__missingvalue_int, sizeof(__pyx_k__missingvalue_int), 0, 0, 1, 1},
-  {&__pyx_n_s__month, __pyx_k__month, sizeof(__pyx_k__month), 0, 0, 1, 1},
-  {&__pyx_n_s__months, __pyx_k__months, sizeof(__pyx_k__months), 0, 0, 1, 1},
-  {&__pyx_n_s__msg, __pyx_k__msg, sizeof(__pyx_k__msg), 0, 0, 1, 1},
-  {&__pyx_n_s__msgs, __pyx_k__msgs, sizeof(__pyx_k__msgs), 0, 0, 1, 1},
-  {&__pyx_n_s__multi_support_off, __pyx_k__multi_support_off, sizeof(__pyx_k__multi_support_off), 0, 0, 1, 1},
-  {&__pyx_n_s__multi_support_on, __pyx_k__multi_support_on, sizeof(__pyx_k__multi_support_on), 0, 0, 1, 1},
-  {&__pyx_n_s__name, __pyx_k__name, sizeof(__pyx_k__name), 0, 0, 1, 1},
-  {&__pyx_n_s__ncepgrib2, __pyx_k__ncepgrib2, sizeof(__pyx_k__ncepgrib2), 0, 0, 1, 1},
-  {&__pyx_n_s__ndim, __pyx_k__ndim, sizeof(__pyx_k__ndim), 0, 0, 1, 1},
-  {&__pyx_n_s__next, __pyx_k__next, sizeof(__pyx_k__next), 0, 0, 1, 1},
-  {&__pyx_n_s__nlats, __pyx_k__nlats, sizeof(__pyx_k__nlats), 0, 0, 1, 1},
-  {&__pyx_n_s__nmsgs, __pyx_k__nmsgs, sizeof(__pyx_k__nmsgs), 0, 0, 1, 1},
-  {&__pyx_n_s__np, __pyx_k__np, sizeof(__pyx_k__np), 0, 0, 1, 1},
-  {&__pyx_n_s__nsper, __pyx_k__nsper, sizeof(__pyx_k__nsper), 0, 0, 1, 1},
-  {&__pyx_n_s__numberOfMissing, __pyx_k__numberOfMissing, sizeof(__pyx_k__numberOfMissing), 0, 0, 1, 1},
-  {&__pyx_n_s__numberOfValues, __pyx_k__numberOfValues, sizeof(__pyx_k__numberOfValues), 0, 0, 1, 1},
-  {&__pyx_n_s__numpy, __pyx_k__numpy, sizeof(__pyx_k__numpy), 0, 0, 1, 1},
-  {&__pyx_n_s__o_lat_p, __pyx_k__o_lat_p, sizeof(__pyx_k__o_lat_p), 0, 0, 1, 1},
-  {&__pyx_n_s__o_lon_p, __pyx_k__o_lon_p, sizeof(__pyx_k__o_lon_p), 0, 0, 1, 1},
-  {&__pyx_n_s__o_proj, __pyx_k__o_proj, sizeof(__pyx_k__o_proj), 0, 0, 1, 1},
-  {&__pyx_n_s__ob_tran, __pyx_k__ob_tran, sizeof(__pyx_k__ob_tran), 0, 0, 1, 1},
-  {&__pyx_n_s__one, __pyx_k__one, sizeof(__pyx_k__one), 0, 0, 1, 1},
-  {&__pyx_n_s__oneThousand, __pyx_k__oneThousand, sizeof(__pyx_k__oneThousand), 0, 0, 1, 1},
-  {&__pyx_n_s__order, __pyx_k__order, sizeof(__pyx_k__order), 0, 0, 1, 1},
-  {&__pyx_n_s__packingType, __pyx_k__packingType, sizeof(__pyx_k__packingType), 0, 0, 1, 1},
-  {&__pyx_n_s__paramId, __pyx_k__paramId, sizeof(__pyx_k__paramId), 0, 0, 1, 1},
-  {&__pyx_n_s__parameterName, __pyx_k__parameterName, sizeof(__pyx_k__parameterName), 0, 0, 1, 1},
-  {&__pyx_n_s__parameterUnits, __pyx_k__parameterUnits, sizeof(__pyx_k__parameterUnits), 0, 0, 1, 1},
-  {&__pyx_n_s__perturbationNumber, __pyx_k__perturbationNumber, sizeof(__pyx_k__perturbationNumber), 0, 0, 1, 1},
-  {&__pyx_n_s__pi, __pyx_k__pi, sizeof(__pyx_k__pi), 0, 0, 1, 1},
-  {&__pyx_n_s__pl, __pyx_k__pl, sizeof(__pyx_k__pl), 0, 0, 1, 1},
-  {&__pyx_n_s__polar_stereographic, __pyx_k__polar_stereographic, sizeof(__pyx_k__polar_stereographic), 0, 0, 1, 1},
-  {&__pyx_n_s__power, __pyx_k__power, sizeof(__pyx_k__power), 0, 0, 1, 1},
-  {&__pyx_n_s__probabilityTypeName, __pyx_k__probabilityTypeName, sizeof(__pyx_k__probabilityTypeName), 0, 0, 1, 1},
-  {&__pyx_n_s__proj, __pyx_k__proj, sizeof(__pyx_k__proj), 0, 0, 1, 1},
-  {&__pyx_n_s__projparams, __pyx_k__projparams, sizeof(__pyx_k__projparams), 0, 0, 1, 1},
-  {&__pyx_n_s__pygrib, __pyx_k__pygrib, sizeof(__pyx_k__pygrib), 0, 0, 1, 1},
-  {&__pyx_n_s__pyproj, __pyx_k__pyproj, sizeof(__pyx_k__pyproj), 0, 0, 1, 1},
-  {&__pyx_n_s__radius, __pyx_k__radius, sizeof(__pyx_k__radius), 0, 0, 1, 1},
-  {&__pyx_n_s__range, __pyx_k__range, sizeof(__pyx_k__range), 0, 0, 1, 1},
-  {&__pyx_n_s__redtoreg, __pyx_k__redtoreg, sizeof(__pyx_k__redtoreg), 0, 0, 1, 1},
-  {&__pyx_n_s__reduced, __pyx_k__reduced, sizeof(__pyx_k__reduced), 0, 0, 1, 1},
-  {&__pyx_n_s__reduced_gg, __pyx_k__reduced_gg, sizeof(__pyx_k__reduced_gg), 0, 0, 1, 1},
-  {&__pyx_n_s__reduced_ll, __pyx_k__reduced_ll, sizeof(__pyx_k__reduced_ll), 0, 0, 1, 1},
-  {&__pyx_n_s__regular_gg, __pyx_k__regular_gg, sizeof(__pyx_k__regular_gg), 0, 0, 1, 1},
-  {&__pyx_n_s__regular_ll, __pyx_k__regular_ll, sizeof(__pyx_k__regular_ll), 0, 0, 1, 1},
-  {&__pyx_n_s__reload, __pyx_k__reload, sizeof(__pyx_k__reload), 0, 0, 1, 1},
-  {&__pyx_n_s__reshape, __pyx_k__reshape, sizeof(__pyx_k__reshape), 0, 0, 1, 1},
-  {&__pyx_n_s__return_msgs, __pyx_k__return_msgs, sizeof(__pyx_k__return_msgs), 0, 0, 1, 1},
-  {&__pyx_n_s__revision, __pyx_k__revision, sizeof(__pyx_k__revision), 0, 0, 1, 1},
-  {&__pyx_n_s__rewind, __pyx_k__rewind, sizeof(__pyx_k__rewind), 0, 0, 1, 1},
-  {&__pyx_n_s__rotated_gg, __pyx_k__rotated_gg, sizeof(__pyx_k__rotated_gg), 0, 0, 1, 1},
-  {&__pyx_n_s__rotated_ll, __pyx_k__rotated_ll, sizeof(__pyx_k__rotated_ll), 0, 0, 1, 1},
-  {&__pyx_n_s__rstrip, __pyx_k__rstrip, sizeof(__pyx_k__rstrip), 0, 0, 1, 1},
-  {&__pyx_n_s__s, __pyx_k__s, sizeof(__pyx_k__s), 0, 0, 1, 1},
-  {&__pyx_n_s__second, __pyx_k__second, sizeof(__pyx_k__second), 0, 0, 1, 1},
-  {&__pyx_n_s__secs, __pyx_k__secs, sizeof(__pyx_k__secs), 0, 0, 1, 1},
-  {&__pyx_n_s__seek, __pyx_k__seek, sizeof(__pyx_k__seek), 0, 0, 1, 1},
-  {&__pyx_n_s__select, __pyx_k__select, sizeof(__pyx_k__select), 0, 0, 1, 1},
-  {&__pyx_n_s__setdates, __pyx_k__setdates, sizeof(__pyx_k__setdates), 0, 0, 1, 1},
-  {&__pyx_n_s__shape, __pyx_k__shape, sizeof(__pyx_k__shape), 0, 0, 1, 1},
-  {&__pyx_n_s__shapeOfTheEarth, __pyx_k__shapeOfTheEarth, sizeof(__pyx_k__shapeOfTheEarth), 0, 0, 1, 1},
-  {&__pyx_n_s__size, __pyx_k__size, sizeof(__pyx_k__size), 0, 0, 1, 1},
-  {&__pyx_n_s__space_view, __pyx_k__space_view, sizeof(__pyx_k__space_view), 0, 0, 1, 1},
-  {&__pyx_n_s__split, __pyx_k__split, sizeof(__pyx_k__split), 0, 0, 1, 1},
-  {&__pyx_n_s__standardParallel, __pyx_k__standardParallel, sizeof(__pyx_k__standardParallel), 0, 0, 1, 1},
-  {&__pyx_n_s__startswith, __pyx_k__startswith, sizeof(__pyx_k__startswith), 0, 0, 1, 1},
-  {&__pyx_n_s__stepRange, __pyx_k__stepRange, sizeof(__pyx_k__stepRange), 0, 0, 1, 1},
-  {&__pyx_n_s__stepType, __pyx_k__stepType, sizeof(__pyx_k__stepType), 0, 0, 1, 1},
-  {&__pyx_n_s__stepUnits, __pyx_k__stepUnits, sizeof(__pyx_k__stepUnits), 0, 0, 1, 1},
-  {&__pyx_n_s__stere, __pyx_k__stere, sizeof(__pyx_k__stere), 0, 0, 1, 1},
-  {&__pyx_n_s__sum, __pyx_k__sum, sizeof(__pyx_k__sum), 0, 0, 1, 1},
-  {&__pyx_n_s__tell, __pyx_k__tell, sizeof(__pyx_k__tell), 0, 0, 1, 1},
-  {&__pyx_n_s__thousand, __pyx_k__thousand, sizeof(__pyx_k__thousand), 0, 0, 1, 1},
-  {&__pyx_n_s__tolerate_badgrib, __pyx_k__tolerate_badgrib, sizeof(__pyx_k__tolerate_badgrib), 0, 0, 1, 1},
-  {&__pyx_n_s__tolerate_badgrib_on, __pyx_k__tolerate_badgrib_on, sizeof(__pyx_k__tolerate_badgrib_on), 0, 0, 1, 1},
-  {&__pyx_n_s__topLevel, __pyx_k__topLevel, sizeof(__pyx_k__topLevel), 0, 0, 1, 1},
-  {&__pyx_n_s__tostring, __pyx_k__tostring, sizeof(__pyx_k__tostring), 0, 0, 1, 1},
-  {&__pyx_n_s__traceback, __pyx_k__traceback, sizeof(__pyx_k__traceback), 0, 0, 1, 1},
-  {&__pyx_n_s__truncateDegrees, __pyx_k__truncateDegrees, sizeof(__pyx_k__truncateDegrees), 0, 0, 1, 1},
-  {&__pyx_n_s__typeOfGrid, __pyx_k__typeOfGrid, sizeof(__pyx_k__typeOfGrid), 0, 0, 1, 1},
-  {&__pyx_n_s__typeOfLevel, __pyx_k__typeOfLevel, sizeof(__pyx_k__typeOfLevel), 0, 0, 1, 1},
-  {&__pyx_n_s__units, __pyx_k__units, sizeof(__pyx_k__units), 0, 0, 1, 1},
-  {&__pyx_n_s__unknown, __pyx_k__unknown, sizeof(__pyx_k__unknown), 0, 0, 1, 1},
-  {&__pyx_n_s__v, __pyx_k__v, sizeof(__pyx_k__v), 0, 0, 1, 1},
-  {&__pyx_n_s__validDate, __pyx_k__validDate, sizeof(__pyx_k__validDate), 0, 0, 1, 1},
-  {&__pyx_n_s__valid_key, __pyx_k__valid_key, sizeof(__pyx_k__valid_key), 0, 0, 1, 1},
-  {&__pyx_n_s__value, __pyx_k__value, sizeof(__pyx_k__value), 0, 0, 1, 1},
-  {&__pyx_n_b__values, __pyx_k__values, sizeof(__pyx_k__values), 0, 0, 0, 1},
-  {&__pyx_n_s__values, __pyx_k__values, sizeof(__pyx_k__values), 0, 0, 1, 1},
-  {&__pyx_n_s__warn, __pyx_k__warn, sizeof(__pyx_k__warn), 0, 0, 1, 1},
-  {&__pyx_n_s__warnings, __pyx_k__warnings, sizeof(__pyx_k__warnings), 0, 0, 1, 1},
-  {&__pyx_n_s__where, __pyx_k__where, sizeof(__pyx_k__where), 0, 0, 1, 1},
-  {&__pyx_n_s__xrange, __pyx_k__xrange, sizeof(__pyx_k__xrange), 0, 0, 1, 1},
-  {&__pyx_n_s__year, __pyx_k__year, sizeof(__pyx_k__year), 0, 0, 1, 1},
-  {&__pyx_n_s__yrs, __pyx_k__yrs, sizeof(__pyx_k__yrs), 0, 0, 1, 1},
-  {&__pyx_n_s__zero, __pyx_k__zero, sizeof(__pyx_k__zero), 0, 0, 1, 1},
-  {&__pyx_n_s__zeros, __pyx_k__zeros, sizeof(__pyx_k__zeros), 0, 0, 1, 1},
+  {&__pyx_kp_s_04i, __pyx_k_04i, sizeof(__pyx_k_04i), 0, 0, 1, 0},
+  {&__pyx_kp_s_12_hr_periods, __pyx_k_12_hr_periods, sizeof(__pyx_k_12_hr_periods), 0, 0, 1, 0},
+  {&__pyx_kp_s_2_0_0, __pyx_k_2_0_0, sizeof(__pyx_k_2_0_0), 0, 0, 1, 0},
+  {&__pyx_kp_s_30_yr_periods, __pyx_k_30_yr_periods, sizeof(__pyx_k_30_yr_periods), 0, 0, 1, 0},
+  {&__pyx_kp_s_3_hr_periods, __pyx_k_3_hr_periods, sizeof(__pyx_k_3_hr_periods), 0, 0, 1, 0},
+  {&__pyx_kp_s_6_hr_periods, __pyx_k_6_hr_periods, sizeof(__pyx_k_6_hr_periods), 0, 0, 1, 0},
+  {&__pyx_kp_s_7777, __pyx_k_7777, sizeof(__pyx_k_7777), 0, 0, 1, 0},
+  {&__pyx_n_s_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 0, 1, 1},
+  {&__pyx_n_s_C, __pyx_k_C, sizeof(__pyx_k_C), 0, 0, 1, 1},
+  {&__pyx_n_s_Dx, __pyx_k_Dx, sizeof(__pyx_k_Dx), 0, 0, 1, 1},
+  {&__pyx_n_s_DxInMetres, __pyx_k_DxInMetres, sizeof(__pyx_k_DxInMetres), 0, 0, 1, 1},
+  {&__pyx_n_s_Dy, __pyx_k_Dy, sizeof(__pyx_k_Dy), 0, 0, 1, 1},
+  {&__pyx_n_s_DyInMetres, __pyx_k_DyInMetres, sizeof(__pyx_k_DyInMetres), 0, 0, 1, 1},
+  {&__pyx_n_s_F, __pyx_k_F, sizeof(__pyx_k_F), 0, 0, 1, 1},
+  {&__pyx_n_s_Grib2Decode, __pyx_k_Grib2Decode, sizeof(__pyx_k_Grib2Decode), 0, 0, 1, 1},
+  {&__pyx_n_s_IOError, __pyx_k_IOError, sizeof(__pyx_k_IOError), 0, 0, 1, 1},
+  {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
+  {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
+  {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1},
+  {&__pyx_n_s_LaD, __pyx_k_LaD, sizeof(__pyx_k_LaD), 0, 0, 1, 1},
+  {&__pyx_n_s_LaDInDegrees, __pyx_k_LaDInDegrees, sizeof(__pyx_k_LaDInDegrees), 0, 0, 1, 1},
+  {&__pyx_n_s_Latin, __pyx_k_Latin, sizeof(__pyx_k_Latin), 0, 0, 1, 1},
+  {&__pyx_n_s_Latin1, __pyx_k_Latin1, sizeof(__pyx_k_Latin1), 0, 0, 1, 1},
+  {&__pyx_n_s_Latin1InDegrees, __pyx_k_Latin1InDegrees, sizeof(__pyx_k_Latin1InDegrees), 0, 0, 1, 1},
+  {&__pyx_n_s_Latin2, __pyx_k_Latin2, sizeof(__pyx_k_Latin2), 0, 0, 1, 1},
+  {&__pyx_n_s_Latin2InDegrees, __pyx_k_Latin2InDegrees, sizeof(__pyx_k_Latin2InDegrees), 0, 0, 1, 1},
+  {&__pyx_n_s_LoV, __pyx_k_LoV, sizeof(__pyx_k_LoV), 0, 0, 1, 1},
+  {&__pyx_n_s_LoVInDegrees, __pyx_k_LoVInDegrees, sizeof(__pyx_k_LoVInDegrees), 0, 0, 1, 1},
+  {&__pyx_n_s_Ni, __pyx_k_Ni, sizeof(__pyx_k_Ni), 0, 0, 1, 1},
+  {&__pyx_n_s_Nj, __pyx_k_Nj, sizeof(__pyx_k_Nj), 0, 0, 1, 1},
+  {&__pyx_n_s_Nr, __pyx_k_Nr, sizeof(__pyx_k_Nr), 0, 0, 1, 1},
+  {&__pyx_n_s_Nx, __pyx_k_Nx, sizeof(__pyx_k_Nx), 0, 0, 1, 1},
+  {&__pyx_n_s_Ny, __pyx_k_Ny, sizeof(__pyx_k_Ny), 0, 0, 1, 1},
+  {&__pyx_n_s_Proj, __pyx_k_Proj, sizeof(__pyx_k_Proj), 0, 0, 1, 1},
+  {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
+  {&__pyx_n_s_StopIteration, __pyx_k_StopIteration, sizeof(__pyx_k_StopIteration), 0, 0, 1, 1},
+  {&__pyx_kp_s_This_class_cannot_be_instantiate, __pyx_k_This_class_cannot_be_instantiate, sizeof(__pyx_k_This_class_cannot_be_instantiate), 0, 0, 1, 0},
+  {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
+  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
+  {&__pyx_kp_s_Volumes_User_jwhitaker_python_p, __pyx_k_Volumes_User_jwhitaker_python_p, sizeof(__pyx_k_Volumes_User_jwhitaker_python_p), 0, 0, 1, 0},
+  {&__pyx_kp_s__12, __pyx_k__12, sizeof(__pyx_k__12), 0, 0, 1, 0},
+  {&__pyx_kp_s__17, __pyx_k__17, sizeof(__pyx_k__17), 0, 0, 1, 0},
+  {&__pyx_kp_s__22, __pyx_k__22, sizeof(__pyx_k__22), 0, 0, 1, 0},
+  {&__pyx_kp_s__23, __pyx_k__23, sizeof(__pyx_k__23), 0, 0, 1, 0},
+  {&__pyx_kp_s__8, __pyx_k__8, sizeof(__pyx_k__8), 0, 0, 1, 0},
+  {&__pyx_kp_s__99, __pyx_k__99, sizeof(__pyx_k__99), 0, 0, 1, 0},
+  {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1},
+  {&__pyx_n_s_advance, __pyx_k_advance, sizeof(__pyx_k_advance), 0, 0, 1, 1},
+  {&__pyx_n_s_aea, __pyx_k_aea, sizeof(__pyx_k_aea), 0, 0, 1, 1},
+  {&__pyx_n_s_aeqd, __pyx_k_aeqd, sizeof(__pyx_k_aeqd), 0, 0, 1, 1},
+  {&__pyx_n_s_albers, __pyx_k_albers, sizeof(__pyx_k_albers), 0, 0, 1, 1},
+  {&__pyx_n_s_all_keys, __pyx_k_all_keys, sizeof(__pyx_k_all_keys), 0, 0, 1, 1},
+  {&__pyx_n_s_alternativeRowScanning, __pyx_k_alternativeRowScanning, sizeof(__pyx_k_alternativeRowScanning), 0, 0, 1, 1},
+  {&__pyx_n_s_analDate, __pyx_k_analDate, sizeof(__pyx_k_analDate), 0, 0, 1, 1},
+  {&__pyx_n_s_angleOfRotationInDegrees, __pyx_k_angleOfRotationInDegrees, sizeof(__pyx_k_angleOfRotationInDegrees), 0, 0, 1, 1},
+  {&__pyx_n_s_arange, __pyx_k_arange, sizeof(__pyx_k_arange), 0, 0, 1, 1},
+  {&__pyx_n_s_arcsin, __pyx_k_arcsin, sizeof(__pyx_k_arcsin), 0, 0, 1, 1},
+  {&__pyx_kp_s_array_must_be_1d_or_2d, __pyx_k_array_must_be_1d_or_2d, sizeof(__pyx_k_array_must_be_1d_or_2d), 0, 0, 1, 0},
+  {&__pyx_n_s_asarray, __pyx_k_asarray, sizeof(__pyx_k_asarray), 0, 0, 1, 1},
+  {&__pyx_n_s_ascii, __pyx_k_ascii, sizeof(__pyx_k_ascii), 0, 0, 1, 1},
+  {&__pyx_n_s_atype, __pyx_k_atype, sizeof(__pyx_k_atype), 0, 0, 1, 1},
+  {&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1},
+  {&__pyx_n_s_bottomLevel, __pyx_k_bottomLevel, sizeof(__pyx_k_bottomLevel), 0, 0, 1, 1},
+  {&__pyx_n_s_call, __pyx_k_call, sizeof(__pyx_k_call), 0, 0, 1, 1},
+  {&__pyx_kp_s_can_only_modify_existing_grib_ke, __pyx_k_can_only_modify_existing_grib_ke, sizeof(__pyx_k_can_only_modify_existing_grib_ke), 0, 0, 1, 0},
+  {&__pyx_kp_s_cannot_find_projection_center_fl, __pyx_k_cannot_find_projection_center_fl, sizeof(__pyx_k_cannot_find_projection_center_fl), 0, 0, 1, 0},
+  {&__pyx_n_s_centralLongitude, __pyx_k_centralLongitude, sizeof(__pyx_k_centralLongitude), 0, 0, 1, 1},
+  {&__pyx_n_s_centuries, __pyx_k_centuries, sizeof(__pyx_k_centuries), 0, 0, 1, 1},
+  {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1},
+  {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1},
+  {&__pyx_kp_s_could_not_open_s, __pyx_k_could_not_open_s, sizeof(__pyx_k_could_not_open_s), 0, 0, 1, 0},
+  {&__pyx_n_s_cyl, __pyx_k_cyl, sizeof(__pyx_k_cyl), 0, 0, 1, 1},
+  {&__pyx_n_s_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 0, 1, 1},
+  {&__pyx_kp_s_d_d_d, __pyx_k_d_d_d, sizeof(__pyx_k_d_d_d), 0, 0, 1, 0},
+  {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1},
+  {&__pyx_n_s_dataDate, __pyx_k_dataDate, sizeof(__pyx_k_dataDate), 0, 0, 1, 1},
+  {&__pyx_n_s_dataTime, __pyx_k_dataTime, sizeof(__pyx_k_dataTime), 0, 0, 1, 1},
+  {&__pyx_n_s_datetime, __pyx_k_datetime, sizeof(__pyx_k_datetime), 0, 0, 1, 1},
+  {&__pyx_n_s_datetime_to_julian, __pyx_k_datetime_to_julian, sizeof(__pyx_k_datetime_to_julian), 0, 0, 1, 1},
+  {&__pyx_n_s_day, __pyx_k_day, sizeof(__pyx_k_day), 0, 0, 1, 1},
+  {&__pyx_n_s_days, __pyx_k_days, sizeof(__pyx_k_days), 0, 0, 1, 1},
+  {&__pyx_n_s_decades, __pyx_k_decades, sizeof(__pyx_k_decades), 0, 0, 1, 1},
+  {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1},
+  {&__pyx_n_s_default, __pyx_k_default, sizeof(__pyx_k_default), 0, 0, 1, 1},
+  {&__pyx_n_s_default_encoding, __pyx_k_default_encoding, sizeof(__pyx_k_default_encoding), 0, 0, 1, 1},
+  {&__pyx_n_s_derivedForecast, __pyx_k_derivedForecast, sizeof(__pyx_k_derivedForecast), 0, 0, 1, 1},
+  {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
+  {&__pyx_n_s_distinctLatitudes, __pyx_k_distinctLatitudes, sizeof(__pyx_k_distinctLatitudes), 0, 0, 1, 1},
+  {&__pyx_n_s_distinctLongitudes, __pyx_k_distinctLongitudes, sizeof(__pyx_k_distinctLongitudes), 0, 0, 1, 1},
+  {&__pyx_n_s_div, __pyx_k_div, sizeof(__pyx_k_div), 0, 0, 1, 1},
+  {&__pyx_n_s_double, __pyx_k_double, sizeof(__pyx_k_double), 0, 0, 1, 1},
+  {&__pyx_n_s_dx, __pyx_k_dx, sizeof(__pyx_k_dx), 0, 0, 1, 1},
+  {&__pyx_n_s_dy, __pyx_k_dy, sizeof(__pyx_k_dy), 0, 0, 1, 1},
+  {&__pyx_n_s_eight, __pyx_k_eight, sizeof(__pyx_k_eight), 0, 0, 1, 1},
+  {&__pyx_kp_s_either_pyproj_or_basemap_require, __pyx_k_either_pyproj_or_basemap_require, sizeof(__pyx_k_either_pyproj_or_basemap_require), 0, 0, 1, 0},
+  {&__pyx_n_s_eleven, __pyx_k_eleven, sizeof(__pyx_k_eleven), 0, 0, 1, 1},
+  {&__pyx_n_s_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 1},
+  {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
+  {&__pyx_kp_s_ens_large_anomaly_index, __pyx_k_ens_large_anomaly_index, sizeof(__pyx_k_ens_large_anomaly_index), 0, 0, 1, 0},
+  {&__pyx_kp_s_ens_mean, __pyx_k_ens_mean, sizeof(__pyx_k_ens_mean), 0, 0, 1, 0},
+  {&__pyx_kp_s_ens_mean_of_cluster, __pyx_k_ens_mean_of_cluster, sizeof(__pyx_k_ens_mean_of_cluster), 0, 0, 1, 0},
+  {&__pyx_kp_s_ens_spread, __pyx_k_ens_spread, sizeof(__pyx_k_ens_spread), 0, 0, 1, 0},
+  {&__pyx_kp_s_ens_std_dev, __pyx_k_ens_std_dev, sizeof(__pyx_k_ens_std_dev), 0, 0, 1, 0},
+  {&__pyx_n_s_equatorial_azimuthal_equidistant, __pyx_k_equatorial_azimuthal_equidistant, sizeof(__pyx_k_equatorial_azimuthal_equidistant), 0, 0, 1, 1},
+  {&__pyx_n_s_err, __pyx_k_err, sizeof(__pyx_k_err), 0, 0, 1, 1},
+  {&__pyx_n_s_expand_reduced, __pyx_k_expand_reduced, sizeof(__pyx_k_expand_reduced), 0, 0, 1, 1},
+  {&__pyx_n_s_fabs, __pyx_k_fabs, sizeof(__pyx_k_fabs), 0, 0, 1, 1},
+  {&__pyx_n_s_false, __pyx_k_false, sizeof(__pyx_k_false), 0, 0, 1, 1},
+  {&__pyx_kp_s_fcst_time_s_s, __pyx_k_fcst_time_s_s, sizeof(__pyx_k_fcst_time_s_s), 0, 0, 1, 0},
+  {&__pyx_kp_s_fcst_time_s_s_s, __pyx_k_fcst_time_s_s_s, sizeof(__pyx_k_fcst_time_s_s_s), 0, 0, 1, 0},
+  {&__pyx_n_s_fcstimeunits, __pyx_k_fcstimeunits, sizeof(__pyx_k_fcstimeunits), 0, 0, 1, 1},
+  {&__pyx_n_s_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1},
+  {&__pyx_kp_s_file_s_has_multi_field_messages, __pyx_k_file_s_has_multi_field_messages, sizeof(__pyx_k_file_s_has_multi_field_messages), 0, 0, 1, 0},
+  {&__pyx_n_s_filename, __pyx_k_filename, sizeof(__pyx_k_filename), 0, 0, 1, 1},
+  {&__pyx_n_s_filled, __pyx_k_filled, sizeof(__pyx_k_filled), 0, 0, 1, 1},
+  {&__pyx_n_s_find, __pyx_k_find, sizeof(__pyx_k_find), 0, 0, 1, 1},
+  {&__pyx_n_s_float, __pyx_k_float, sizeof(__pyx_k_float), 0, 0, 1, 1},
+  {&__pyx_n_s_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 1, 1},
+  {&__pyx_n_s_forecastTime, __pyx_k_forecastTime, sizeof(__pyx_k_forecastTime), 0, 0, 1, 1},
+  {&__pyx_kp_s_from, __pyx_k_from, sizeof(__pyx_k_from), 0, 0, 1, 0},
+  {&__pyx_n_s_from_what, __pyx_k_from_what, sizeof(__pyx_k_from_what), 0, 0, 1, 1},
+  {&__pyx_kp_s_from_what_keyword_arg_to_seek_mu, __pyx_k_from_what_keyword_arg_to_seek_mu, sizeof(__pyx_k_from_what_keyword_arg_to_seek_mu), 0, 0, 1, 0},
+  {&__pyx_n_s_fromstring, __pyx_k_fromstring, sizeof(__pyx_k_fromstring), 0, 0, 1, 1},
+  {&__pyx_n_s_ftime, __pyx_k_ftime, sizeof(__pyx_k_ftime), 0, 0, 1, 1},
+  {&__pyx_n_s_ftimedict, __pyx_k_ftimedict, sizeof(__pyx_k_ftimedict), 0, 0, 1, 1},
+  {&__pyx_n_s_gaulats, __pyx_k_gaulats, sizeof(__pyx_k_gaulats), 0, 0, 1, 1},
+  {&__pyx_n_s_geos, __pyx_k_geos, sizeof(__pyx_k_geos), 0, 0, 1, 1},
+  {&__pyx_n_s_get_grib_api_version, __pyx_k_get_grib_api_version, sizeof(__pyx_k_get_grib_api_version), 0, 0, 1, 1},
+  {&__pyx_n_s_get_grib_api_version_locals_lam, __pyx_k_get_grib_api_version_locals_lam, sizeof(__pyx_k_get_grib_api_version_locals_lam), 0, 0, 1, 1},
+  {&__pyx_n_s_get_key, __pyx_k_get_key, sizeof(__pyx_k_get_key), 0, 0, 1, 1},
+  {&__pyx_n_s_getitem, __pyx_k_getitem, sizeof(__pyx_k_getitem), 0, 0, 1, 1},
+  {&__pyx_n_s_gh, __pyx_k_gh, sizeof(__pyx_k_gh), 0, 0, 1, 1},
+  {&__pyx_n_s_gh_2, __pyx_k_gh_2, sizeof(__pyx_k_gh_2), 0, 0, 1, 1},
+  {&__pyx_n_s_grb, __pyx_k_grb, sizeof(__pyx_k_grb), 0, 0, 1, 1},
+  {&__pyx_kp_s_grb_message_numbers_start_at_1, __pyx_k_grb_message_numbers_start_at_1, sizeof(__pyx_k_grb_message_numbers_start_at_1), 0, 0, 1, 0},
+  {&__pyx_n_s_grib2divider, __pyx_k_grib2divider, sizeof(__pyx_k_grib2divider), 0, 0, 1, 1},
+  {&__pyx_n_s_grib_api_version, __pyx_k_grib_api_version, sizeof(__pyx_k_grib_api_version), 0, 0, 1, 1},
+  {&__pyx_n_s_gribmsg, __pyx_k_gribmsg, sizeof(__pyx_k_gribmsg), 0, 0, 1, 1},
+  {&__pyx_n_s_gribstr, __pyx_k_gribstr, sizeof(__pyx_k_gribstr), 0, 0, 1, 1},
+  {&__pyx_n_s_gribstring, __pyx_k_gribstring, sizeof(__pyx_k_gribstring), 0, 0, 1, 1},
+  {&__pyx_n_s_gridType, __pyx_k_gridType, sizeof(__pyx_k_gridType), 0, 0, 1, 1},
+  {&__pyx_n_s_grid_complex, __pyx_k_grid_complex, sizeof(__pyx_k_grid_complex), 0, 0, 1, 1},
+  {&__pyx_n_s_h, __pyx_k_h, sizeof(__pyx_k_h), 0, 0, 1, 1},
+  {&__pyx_n_s_has_key, __pyx_k_has_key, sizeof(__pyx_k_has_key), 0, 0, 1, 1},
+  {&__pyx_kp_s_hi_res_cntl_fcst, __pyx_k_hi_res_cntl_fcst, sizeof(__pyx_k_hi_res_cntl_fcst), 0, 0, 1, 0},
+  {&__pyx_n_s_hour, __pyx_k_hour, sizeof(__pyx_k_hour), 0, 0, 1, 1},
+  {&__pyx_n_s_hrs, __pyx_k_hrs, sizeof(__pyx_k_hrs), 0, 0, 1, 1},
+  {&__pyx_n_s_iDirectionIncrement, __pyx_k_iDirectionIncrement, sizeof(__pyx_k_iDirectionIncrement), 0, 0, 1, 1},
+  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
+  {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1},
+  {&__pyx_n_s_indicatorOfUnitOfTimeRange, __pyx_k_indicatorOfUnitOfTimeRange, sizeof(__pyx_k_indicatorOfUnitOfTimeRange), 0, 0, 1, 1},
+  {&__pyx_n_s_indices, __pyx_k_indices, sizeof(__pyx_k_indices), 0, 0, 1, 1},
+  {&__pyx_n_s_instant, __pyx_k_instant, sizeof(__pyx_k_instant), 0, 0, 1, 1},
+  {&__pyx_n_s_int, __pyx_k_int, sizeof(__pyx_k_int), 0, 0, 1, 1},
+  {&__pyx_n_s_inverse, __pyx_k_inverse, sizeof(__pyx_k_inverse), 0, 0, 1, 1},
+  {&__pyx_n_s_isMA, __pyx_k_isMA, sizeof(__pyx_k_isMA), 0, 0, 1, 1},
+  {&__pyx_n_s_is_container, __pyx_k_is_container, sizeof(__pyx_k_is_container), 0, 0, 1, 1},
+  {&__pyx_n_s_is_missing, __pyx_k_is_missing, sizeof(__pyx_k_is_missing), 0, 0, 1, 1},
+  {&__pyx_n_s_is_stringlike, __pyx_k_is_stringlike, sizeof(__pyx_k_is_stringlike), 0, 0, 1, 1},
+  {&__pyx_n_s_iscallable, __pyx_k_iscallable, sizeof(__pyx_k_iscallable), 0, 0, 1, 1},
+  {&__pyx_n_s_iscontainer, __pyx_k_iscontainer, sizeof(__pyx_k_iscontainer), 0, 0, 1, 1},
+  {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1},
+  {&__pyx_n_s_jPointsAreConsecutive, __pyx_k_jPointsAreConsecutive, sizeof(__pyx_k_jPointsAreConsecutive), 0, 0, 1, 1},
+  {&__pyx_n_s_jd, __pyx_k_jd, sizeof(__pyx_k_jd), 0, 0, 1, 1},
+  {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1},
+  {&__pyx_n_s_julday, __pyx_k_julday, sizeof(__pyx_k_julday), 0, 0, 1, 1},
+  {&__pyx_n_s_julianDay, __pyx_k_julianDay, sizeof(__pyx_k_julianDay), 0, 0, 1, 1},
+  {&__pyx_n_s_julian_to_datetime, __pyx_k_julian_to_datetime, sizeof(__pyx_k_julian_to_datetime), 0, 0, 1, 1},
+  {&__pyx_n_s_k, __pyx_k_k, sizeof(__pyx_k_k), 0, 0, 1, 1},
+  {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1},
+  {&__pyx_kp_s_key_must_be_an_integer_message_n, __pyx_k_key_must_be_an_integer_message_n, sizeof(__pyx_k_key_must_be_an_integer_message_n), 0, 0, 1, 0},
+  {&__pyx_kp_s_key_not_part_of_grib_index, __pyx_k_key_not_part_of_grib_index, sizeof(__pyx_k_key_not_part_of_grib_index), 0, 0, 1, 0},
+  {&__pyx_kp_s_key_s_is_read_only, __pyx_k_key_s_is_read_only, sizeof(__pyx_k_key_s_is_read_only), 0, 0, 1, 0},
+  {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1},
+  {&__pyx_n_s_kwargs, __pyx_k_kwargs, sizeof(__pyx_k_kwargs), 0, 0, 1, 1},
+  {&__pyx_n_s_l, __pyx_k_l, sizeof(__pyx_k_l), 0, 0, 1, 1},
+  {&__pyx_n_s_laea, __pyx_k_laea, sizeof(__pyx_k_laea), 0, 0, 1, 1},
+  {&__pyx_n_s_lambert, __pyx_k_lambert, sizeof(__pyx_k_lambert), 0, 0, 1, 1},
+  {&__pyx_n_s_lambert_azimuthal_equal_area, __pyx_k_lambert_azimuthal_equal_area, sizeof(__pyx_k_lambert_azimuthal_equal_area), 0, 0, 1, 1},
+  {&__pyx_n_s_lat1, __pyx_k_lat1, sizeof(__pyx_k_lat1), 0, 0, 1, 1},
+  {&__pyx_n_s_lat2, __pyx_k_lat2, sizeof(__pyx_k_lat2), 0, 0, 1, 1},
+  {&__pyx_n_s_lat_0, __pyx_k_lat_0, sizeof(__pyx_k_lat_0), 0, 0, 1, 1},
+  {&__pyx_n_s_lat_1, __pyx_k_lat_1, sizeof(__pyx_k_lat_1), 0, 0, 1, 1},
+  {&__pyx_n_s_lat_2, __pyx_k_lat_2, sizeof(__pyx_k_lat_2), 0, 0, 1, 1},
+  {&__pyx_n_s_lat_ts, __pyx_k_lat_ts, sizeof(__pyx_k_lat_ts), 0, 0, 1, 1},
+  {&__pyx_n_s_latitudeOfFirstGridPoint, __pyx_k_latitudeOfFirstGridPoint, sizeof(__pyx_k_latitudeOfFirstGridPoint), 0, 0, 1, 1},
+  {&__pyx_n_s_latitudeOfFirstGridPointInDegree, __pyx_k_latitudeOfFirstGridPointInDegree, sizeof(__pyx_k_latitudeOfFirstGridPointInDegree), 0, 0, 1, 1},
+  {&__pyx_n_s_latitudeOfLastGridPoint, __pyx_k_latitudeOfLastGridPoint, sizeof(__pyx_k_latitudeOfLastGridPoint), 0, 0, 1, 1},
+  {&__pyx_n_s_latitudeOfLastGridPointInDegrees, __pyx_k_latitudeOfLastGridPointInDegrees, sizeof(__pyx_k_latitudeOfLastGridPointInDegrees), 0, 0, 1, 1},
+  {&__pyx_n_s_latitudeOfSouthernPoleInDegrees, __pyx_k_latitudeOfSouthernPoleInDegrees, sizeof(__pyx_k_latitudeOfSouthernPoleInDegrees), 0, 0, 1, 1},
+  {&__pyx_n_s_latitudeOfSubSatellitePointInDeg, __pyx_k_latitudeOfSubSatellitePointInDeg, sizeof(__pyx_k_latitudeOfSubSatellitePointInDeg), 0, 0, 1, 1},
+  {&__pyx_n_s_latitudeWhereDxAndDyAreSpecified, __pyx_k_latitudeWhereDxAndDyAreSpecified, sizeof(__pyx_k_latitudeWhereDxAndDyAreSpecified), 0, 0, 1, 1},
+  {&__pyx_n_s_latitudes, __pyx_k_latitudes, sizeof(__pyx_k_latitudes), 0, 0, 1, 1},
+  {&__pyx_n_s_latlons, __pyx_k_latlons, sizeof(__pyx_k_latlons), 0, 0, 1, 1},
+  {&__pyx_n_s_lats, __pyx_k_lats, sizeof(__pyx_k_lats), 0, 0, 1, 1},
+  {&__pyx_n_s_lcc, __pyx_k_lcc, sizeof(__pyx_k_lcc), 0, 0, 1, 1},
+  {&__pyx_n_s_level, __pyx_k_level, sizeof(__pyx_k_level), 0, 0, 1, 1},
+  {&__pyx_kp_s_level_s, __pyx_k_level_s, sizeof(__pyx_k_level_s), 0, 0, 1, 0},
+  {&__pyx_kp_s_levels_s_s, __pyx_k_levels_s_s, sizeof(__pyx_k_levels_s_s), 0, 0, 1, 0},
+  {&__pyx_n_s_linspace, __pyx_k_linspace, sizeof(__pyx_k_linspace), 0, 0, 1, 1},
+  {&__pyx_kp_s_lo_res_cntl_fcst, __pyx_k_lo_res_cntl_fcst, sizeof(__pyx_k_lo_res_cntl_fcst), 0, 0, 1, 0},
+  {&__pyx_n_s_localDir, __pyx_k_localDir, sizeof(__pyx_k_localDir), 0, 0, 1, 1},
+  {&__pyx_n_s_lon1, __pyx_k_lon1, sizeof(__pyx_k_lon1), 0, 0, 1, 1},
+  {&__pyx_n_s_lon2, __pyx_k_lon2, sizeof(__pyx_k_lon2), 0, 0, 1, 1},
+  {&__pyx_n_s_lon_0, __pyx_k_lon_0, sizeof(__pyx_k_lon_0), 0, 0, 1, 1},
+  {&__pyx_n_s_longitudeOfFirstGridPoint, __pyx_k_longitudeOfFirstGridPoint, sizeof(__pyx_k_longitudeOfFirstGridPoint), 0, 0, 1, 1},
+  {&__pyx_n_s_longitudeOfFirstGridPointInDegre, __pyx_k_longitudeOfFirstGridPointInDegre, sizeof(__pyx_k_longitudeOfFirstGridPointInDegre), 0, 0, 1, 1},
+  {&__pyx_n_s_longitudeOfLastGridPoint, __pyx_k_longitudeOfLastGridPoint, sizeof(__pyx_k_longitudeOfLastGridPoint), 0, 0, 1, 1},
+  {&__pyx_n_s_longitudeOfLastGridPointInDegree, __pyx_k_longitudeOfLastGridPointInDegree, sizeof(__pyx_k_longitudeOfLastGridPointInDegree), 0, 0, 1, 1},
+  {&__pyx_n_s_longitudeOfSouthernPoleInDegrees, __pyx_k_longitudeOfSouthernPoleInDegrees, sizeof(__pyx_k_longitudeOfSouthernPoleInDegrees), 0, 0, 1, 1},
+  {&__pyx_n_s_longitudeOfSubSatellitePointInDe, __pyx_k_longitudeOfSubSatellitePointInDe, sizeof(__pyx_k_longitudeOfSubSatellitePointInDe), 0, 0, 1, 1},
+  {&__pyx_n_s_longitudes, __pyx_k_longitudes, sizeof(__pyx_k_longitudes), 0, 0, 1, 1},
+  {&__pyx_n_s_longlat, __pyx_k_longlat, sizeof(__pyx_k_longlat), 0, 0, 1, 1},
+  {&__pyx_n_s_ma, __pyx_k_ma, sizeof(__pyx_k_ma), 0, 0, 1, 1},
+  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
+  {&__pyx_n_s_major, __pyx_k_major, sizeof(__pyx_k_major), 0, 0, 1, 1},
+  {&__pyx_n_s_masked_values, __pyx_k_masked_values, sizeof(__pyx_k_masked_values), 0, 0, 1, 1},
+  {&__pyx_n_s_max, __pyx_k_max, sizeof(__pyx_k_max), 0, 0, 1, 1},
+  {&__pyx_n_s_merc, __pyx_k_merc, sizeof(__pyx_k_merc), 0, 0, 1, 1},
+  {&__pyx_n_s_mercator, __pyx_k_mercator, sizeof(__pyx_k_mercator), 0, 0, 1, 1},
+  {&__pyx_n_s_meshgrid, __pyx_k_meshgrid, sizeof(__pyx_k_meshgrid), 0, 0, 1, 1},
+  {&__pyx_n_s_message, __pyx_k_message, sizeof(__pyx_k_message), 0, 0, 1, 1},
+  {&__pyx_n_s_messagenumber, __pyx_k_messagenumber, sizeof(__pyx_k_messagenumber), 0, 0, 1, 1},
+  {&__pyx_n_s_min, __pyx_k_min, sizeof(__pyx_k_min), 0, 0, 1, 1},
+  {&__pyx_n_s_minor, __pyx_k_minor, sizeof(__pyx_k_minor), 0, 0, 1, 1},
+  {&__pyx_n_s_mins, __pyx_k_mins, sizeof(__pyx_k_mins), 0, 0, 1, 1},
+  {&__pyx_n_s_minute, __pyx_k_minute, sizeof(__pyx_k_minute), 0, 0, 1, 1},
+  {&__pyx_n_s_missingValue, __pyx_k_missingValue, sizeof(__pyx_k_missingValue), 0, 0, 1, 1},
+  {&__pyx_n_s_missingvalue_float, __pyx_k_missingvalue_float, sizeof(__pyx_k_missingvalue_float), 0, 0, 1, 1},
+  {&__pyx_n_s_missingvalue_int, __pyx_k_missingvalue_int, sizeof(__pyx_k_missingvalue_int), 0, 0, 1, 1},
+  {&__pyx_n_s_month, __pyx_k_month, sizeof(__pyx_k_month), 0, 0, 1, 1},
+  {&__pyx_n_s_months, __pyx_k_months, sizeof(__pyx_k_months), 0, 0, 1, 1},
+  {&__pyx_n_s_mpl_toolkits_basemap, __pyx_k_mpl_toolkits_basemap, sizeof(__pyx_k_mpl_toolkits_basemap), 0, 0, 1, 1},
+  {&__pyx_n_s_msg, __pyx_k_msg, sizeof(__pyx_k_msg), 0, 0, 1, 1},
+  {&__pyx_n_s_msgs, __pyx_k_msgs, sizeof(__pyx_k_msgs), 0, 0, 1, 1},
+  {&__pyx_n_s_multi_support_off, __pyx_k_multi_support_off, sizeof(__pyx_k_multi_support_off), 0, 0, 1, 1},
+  {&__pyx_n_s_multi_support_on, __pyx_k_multi_support_on, sizeof(__pyx_k_multi_support_on), 0, 0, 1, 1},
+  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
+  {&__pyx_n_s_ncepgrib2, __pyx_k_ncepgrib2, sizeof(__pyx_k_ncepgrib2), 0, 0, 1, 1},
+  {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1},
+  {&__pyx_kp_s_neg_ens_pert_d, __pyx_k_neg_ens_pert_d, sizeof(__pyx_k_neg_ens_pert_d), 0, 0, 1, 0},
+  {&__pyx_n_s_next, __pyx_k_next, sizeof(__pyx_k_next), 0, 0, 1, 1},
+  {&__pyx_n_s_nlats, __pyx_k_nlats, sizeof(__pyx_k_nlats), 0, 0, 1, 1},
+  {&__pyx_kp_s_nlats_must_be_even, __pyx_k_nlats_must_be_even, sizeof(__pyx_k_nlats_must_be_even), 0, 0, 1, 0},
+  {&__pyx_n_s_nmsgs, __pyx_k_nmsgs, sizeof(__pyx_k_nmsgs), 0, 0, 1, 1},
+  {&__pyx_kp_s_nmsgs_must_be_0_in__advance, __pyx_k_nmsgs_must_be_0_in__advance, sizeof(__pyx_k_nmsgs_must_be_0_in__advance), 0, 0, 1, 0},
+  {&__pyx_kp_s_no_matches_found, __pyx_k_no_matches_found, sizeof(__pyx_k_no_matches_found), 0, 0, 1, 0},
+  {&__pyx_kp_s_normalized_ens_std_dev, __pyx_k_normalized_ens_std_dev, sizeof(__pyx_k_normalized_ens_std_dev), 0, 0, 1, 0},
+  {&__pyx_kp_s_not_that_many_messages_in_file, __pyx_k_not_that_many_messages_in_file, sizeof(__pyx_k_not_that_many_messages_in_file), 0, 0, 1, 0},
+  {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
+  {&__pyx_n_s_nsper, __pyx_k_nsper, sizeof(__pyx_k_nsper), 0, 0, 1, 1},
+  {&__pyx_n_s_numberOfMissing, __pyx_k_numberOfMissing, sizeof(__pyx_k_numberOfMissing), 0, 0, 1, 1},
+  {&__pyx_n_s_numberOfValues, __pyx_k_numberOfValues, sizeof(__pyx_k_numberOfValues), 0, 0, 1, 1},
+  {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
+  {&__pyx_n_s_o_lat_p, __pyx_k_o_lat_p, sizeof(__pyx_k_o_lat_p), 0, 0, 1, 1},
+  {&__pyx_n_s_o_lon_p, __pyx_k_o_lon_p, sizeof(__pyx_k_o_lon_p), 0, 0, 1, 1},
+  {&__pyx_n_s_o_proj, __pyx_k_o_proj, sizeof(__pyx_k_o_proj), 0, 0, 1, 1},
+  {&__pyx_n_s_ob_tran, __pyx_k_ob_tran, sizeof(__pyx_k_ob_tran), 0, 0, 1, 1},
+  {&__pyx_n_s_one, __pyx_k_one, sizeof(__pyx_k_one), 0, 0, 1, 1},
+  {&__pyx_n_s_oneThousand, __pyx_k_oneThousand, sizeof(__pyx_k_oneThousand), 0, 0, 1, 1},
+  {&__pyx_n_s_order, __pyx_k_order, sizeof(__pyx_k_order), 0, 0, 1, 1},
+  {&__pyx_n_s_orientationOfTheGridInDegrees, __pyx_k_orientationOfTheGridInDegrees, sizeof(__pyx_k_orientationOfTheGridInDegrees), 0, 0, 1, 1},
+  {&__pyx_n_s_packingType, __pyx_k_packingType, sizeof(__pyx_k_packingType), 0, 0, 1, 1},
+  {&__pyx_n_s_paramId, __pyx_k_paramId, sizeof(__pyx_k_paramId), 0, 0, 1, 1},
+  {&__pyx_n_s_parameterName, __pyx_k_parameterName, sizeof(__pyx_k_parameterName), 0, 0, 1, 1},
+  {&__pyx_n_s_parameterUnits, __pyx_k_parameterUnits, sizeof(__pyx_k_parameterUnits), 0, 0, 1, 1},
+  {&__pyx_n_s_perturbationNumber, __pyx_k_perturbationNumber, sizeof(__pyx_k_perturbationNumber), 0, 0, 1, 1},
+  {&__pyx_n_s_pi, __pyx_k_pi, sizeof(__pyx_k_pi), 0, 0, 1, 1},
+  {&__pyx_n_s_pl, __pyx_k_pl, sizeof(__pyx_k_pl), 0, 0, 1, 1},
+  {&__pyx_n_s_polar_stereographic, __pyx_k_polar_stereographic, sizeof(__pyx_k_polar_stereographic), 0, 0, 1, 1},
+  {&__pyx_kp_s_pos_ens_pert_d, __pyx_k_pos_ens_pert_d, sizeof(__pyx_k_pos_ens_pert_d), 0, 0, 1, 0},
+  {&__pyx_n_s_power, __pyx_k_power, sizeof(__pyx_k_power), 0, 0, 1, 1},
+  {&__pyx_n_s_private_atts, __pyx_k_private_atts, sizeof(__pyx_k_private_atts), 0, 0, 1, 1},
+  {&__pyx_n_s_probabilityTypeName, __pyx_k_probabilityTypeName, sizeof(__pyx_k_probabilityTypeName), 0, 0, 1, 1},
+  {&__pyx_n_s_proj, __pyx_k_proj, sizeof(__pyx_k_proj), 0, 0, 1, 1},
+  {&__pyx_n_s_projectionCenterFlag, __pyx_k_projectionCenterFlag, sizeof(__pyx_k_projectionCenterFlag), 0, 0, 1, 1},
+  {&__pyx_n_s_projectionCentreFlag, __pyx_k_projectionCentreFlag, sizeof(__pyx_k_projectionCentreFlag), 0, 0, 1, 1},
+  {&__pyx_n_s_projparams, __pyx_k_projparams, sizeof(__pyx_k_projparams), 0, 0, 1, 1},
+  {&__pyx_n_s_pygrib, __pyx_k_pygrib, sizeof(__pyx_k_pygrib), 0, 0, 1, 1},
+  {&__pyx_n_s_pyproj, __pyx_k_pyproj, sizeof(__pyx_k_pyproj), 0, 0, 1, 1},
+  {&__pyx_n_s_radius, __pyx_k_radius, sizeof(__pyx_k_radius), 0, 0, 1, 1},
+  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
+  {&__pyx_n_s_read_only_keys, __pyx_k_read_only_keys, sizeof(__pyx_k_read_only_keys), 0, 0, 1, 1},
+  {&__pyx_n_s_redtoreg, __pyx_k_redtoreg, sizeof(__pyx_k_redtoreg), 0, 0, 1, 1},
+  {&__pyx_n_s_redtoreg_2, __pyx_k_redtoreg_2, sizeof(__pyx_k_redtoreg_2), 0, 0, 1, 1},
+  {&__pyx_n_s_reduced, __pyx_k_reduced, sizeof(__pyx_k_reduced), 0, 0, 1, 1},
+  {&__pyx_n_s_reduced_gg, __pyx_k_reduced_gg, sizeof(__pyx_k_reduced_gg), 0, 0, 1, 1},
+  {&__pyx_kp_s_reduced_grid_data_array_must_be, __pyx_k_reduced_grid_data_array_must_be, sizeof(__pyx_k_reduced_grid_data_array_must_be), 0, 0, 1, 0},
+  {&__pyx_n_s_reduced_ll, __pyx_k_reduced_ll, sizeof(__pyx_k_reduced_ll), 0, 0, 1, 1},
+  {&__pyx_n_s_regular_gg, __pyx_k_regular_gg, sizeof(__pyx_k_regular_gg), 0, 0, 1, 1},
+  {&__pyx_n_s_regular_ll, __pyx_k_regular_ll, sizeof(__pyx_k_regular_ll), 0, 0, 1, 1},
+  {&__pyx_n_s_reload, __pyx_k_reload, sizeof(__pyx_k_reload), 0, 0, 1, 1},
+  {&__pyx_n_s_reshape, __pyx_k_reshape, sizeof(__pyx_k_reshape), 0, 0, 1, 1},
+  {&__pyx_n_s_reshape_mask, __pyx_k_reshape_mask, sizeof(__pyx_k_reshape_mask), 0, 0, 1, 1},
+  {&__pyx_n_s_return_msgs, __pyx_k_return_msgs, sizeof(__pyx_k_return_msgs), 0, 0, 1, 1},
+  {&__pyx_n_s_revision, __pyx_k_revision, sizeof(__pyx_k_revision), 0, 0, 1, 1},
+  {&__pyx_n_s_rewind, __pyx_k_rewind, sizeof(__pyx_k_rewind), 0, 0, 1, 1},
+  {&__pyx_n_s_ro_keys, __pyx_k_ro_keys, sizeof(__pyx_k_ro_keys), 0, 0, 1, 1},
+  {&__pyx_n_s_rotated_gg, __pyx_k_rotated_gg, sizeof(__pyx_k_rotated_gg), 0, 0, 1, 1},
+  {&__pyx_n_s_rotated_ll, __pyx_k_rotated_ll, sizeof(__pyx_k_rotated_ll), 0, 0, 1, 1},
+  {&__pyx_n_s_rstrip, __pyx_k_rstrip, sizeof(__pyx_k_rstrip), 0, 0, 1, 1},
+  {&__pyx_kp_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 0},
+  {&__pyx_kp_s_s_2, __pyx_k_s_2, sizeof(__pyx_k_s_2), 0, 0, 1, 0},
+  {&__pyx_kp_s_s_3, __pyx_k_s_3, sizeof(__pyx_k_s_3), 0, 0, 1, 0},
+  {&__pyx_n_s_s_4, __pyx_k_s_4, sizeof(__pyx_k_s_4), 0, 0, 1, 1},
+  {&__pyx_kp_s_s_s, __pyx_k_s_s, sizeof(__pyx_k_s_s), 0, 0, 1, 0},
+  {&__pyx_n_s_scaleFactorOfFirstFixedSurface, __pyx_k_scaleFactorOfFirstFixedSurface, sizeof(__pyx_k_scaleFactorOfFirstFixedSurface), 0, 0, 1, 1},
+  {&__pyx_n_s_scaleFactorOfLowerLimit, __pyx_k_scaleFactorOfLowerLimit, sizeof(__pyx_k_scaleFactorOfLowerLimit), 0, 0, 1, 1},
+  {&__pyx_n_s_scaleFactorOfMajorAxisOfOblateSp, __pyx_k_scaleFactorOfMajorAxisOfOblateSp, sizeof(__pyx_k_scaleFactorOfMajorAxisOfOblateSp), 0, 0, 1, 1},
+  {&__pyx_n_s_scaleFactorOfMinorAxisOfOblateSp, __pyx_k_scaleFactorOfMinorAxisOfOblateSp, sizeof(__pyx_k_scaleFactorOfMinorAxisOfOblateSp), 0, 0, 1, 1},
+  {&__pyx_n_s_scaleFactorOfRadiusOfSphericalEa, __pyx_k_scaleFactorOfRadiusOfSphericalEa, sizeof(__pyx_k_scaleFactorOfRadiusOfSphericalEa), 0, 0, 1, 1},
+  {&__pyx_n_s_scaleFactorOfSecondFixedSurface, __pyx_k_scaleFactorOfSecondFixedSurface, sizeof(__pyx_k_scaleFactorOfSecondFixedSurface), 0, 0, 1, 1},
+  {&__pyx_n_s_scaleFactorOfUpperLimit, __pyx_k_scaleFactorOfUpperLimit, sizeof(__pyx_k_scaleFactorOfUpperLimit), 0, 0, 1, 1},
+  {&__pyx_n_s_scaledValueOfEarthMajorAxis, __pyx_k_scaledValueOfEarthMajorAxis, sizeof(__pyx_k_scaledValueOfEarthMajorAxis), 0, 0, 1, 1},
+  {&__pyx_n_s_scaledValueOfEarthMinorAxis, __pyx_k_scaledValueOfEarthMinorAxis, sizeof(__pyx_k_scaledValueOfEarthMinorAxis), 0, 0, 1, 1},
+  {&__pyx_n_s_scaledValueOfFirstFixedSurface, __pyx_k_scaledValueOfFirstFixedSurface, sizeof(__pyx_k_scaledValueOfFirstFixedSurface), 0, 0, 1, 1},
+  {&__pyx_n_s_scaledValueOfLowerLimit, __pyx_k_scaledValueOfLowerLimit, sizeof(__pyx_k_scaledValueOfLowerLimit), 0, 0, 1, 1},
+  {&__pyx_n_s_scaledValueOfMajorAxisOfOblateSp, __pyx_k_scaledValueOfMajorAxisOfOblateSp, sizeof(__pyx_k_scaledValueOfMajorAxisOfOblateSp), 0, 0, 1, 1},
+  {&__pyx_n_s_scaledValueOfMinorAxisOfOblateSp, __pyx_k_scaledValueOfMinorAxisOfOblateSp, sizeof(__pyx_k_scaledValueOfMinorAxisOfOblateSp), 0, 0, 1, 1},
+  {&__pyx_n_s_scaledValueOfRadiusOfSphericalEa, __pyx_k_scaledValueOfRadiusOfSphericalEa, sizeof(__pyx_k_scaledValueOfRadiusOfSphericalEa), 0, 0, 1, 1},
+  {&__pyx_n_s_scaledValueOfSecondFixedSurface, __pyx_k_scaledValueOfSecondFixedSurface, sizeof(__pyx_k_scaledValueOfSecondFixedSurface), 0, 0, 1, 1},
+  {&__pyx_n_s_scaledValueOfUpperLimit, __pyx_k_scaledValueOfUpperLimit, sizeof(__pyx_k_scaledValueOfUpperLimit), 0, 0, 1, 1},
+  {&__pyx_n_s_second, __pyx_k_second, sizeof(__pyx_k_second), 0, 0, 1, 1},
+  {&__pyx_n_s_secs, __pyx_k_secs, sizeof(__pyx_k_secs), 0, 0, 1, 1},
+  {&__pyx_n_s_seek, __pyx_k_seek, sizeof(__pyx_k_seek), 0, 0, 1, 1},
+  {&__pyx_n_s_select, __pyx_k_select, sizeof(__pyx_k_select), 0, 0, 1, 1},
+  {&__pyx_n_s_set_projparams, __pyx_k_set_projparams, sizeof(__pyx_k_set_projparams), 0, 0, 1, 1},
+  {&__pyx_n_s_setdates, __pyx_k_setdates, sizeof(__pyx_k_setdates), 0, 0, 1, 1},
+  {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
+  {&__pyx_n_s_shapeOfTheEarth, __pyx_k_shapeOfTheEarth, sizeof(__pyx_k_shapeOfTheEarth), 0, 0, 1, 1},
+  {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
+  {&__pyx_n_s_space_view, __pyx_k_space_view, sizeof(__pyx_k_space_view), 0, 0, 1, 1},
+  {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1},
+  {&__pyx_n_s_standardParallel, __pyx_k_standardParallel, sizeof(__pyx_k_standardParallel), 0, 0, 1, 1},
+  {&__pyx_n_s_startswith, __pyx_k_startswith, sizeof(__pyx_k_startswith), 0, 0, 1, 1},
+  {&__pyx_n_s_stepRange, __pyx_k_stepRange, sizeof(__pyx_k_stepRange), 0, 0, 1, 1},
+  {&__pyx_n_s_stepType, __pyx_k_stepType, sizeof(__pyx_k_stepType), 0, 0, 1, 1},
+  {&__pyx_n_s_stepUnits, __pyx_k_stepUnits, sizeof(__pyx_k_stepUnits), 0, 0, 1, 1},
+  {&__pyx_n_s_stere, __pyx_k_stere, sizeof(__pyx_k_stere), 0, 0, 1, 1},
+  {&__pyx_n_s_sum, __pyx_k_sum, sizeof(__pyx_k_sum), 0, 0, 1, 1},
+  {&__pyx_n_s_tell, __pyx_k_tell, sizeof(__pyx_k_tell), 0, 0, 1, 1},
+  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
+  {&__pyx_n_s_thousand, __pyx_k_thousand, sizeof(__pyx_k_thousand), 0, 0, 1, 1},
+  {&__pyx_n_s_tolerate_badgrib, __pyx_k_tolerate_badgrib, sizeof(__pyx_k_tolerate_badgrib), 0, 0, 1, 1},
+  {&__pyx_n_s_tolerate_badgrib_off, __pyx_k_tolerate_badgrib_off, sizeof(__pyx_k_tolerate_badgrib_off), 0, 0, 1, 1},
+  {&__pyx_n_s_tolerate_badgrib_on, __pyx_k_tolerate_badgrib_on, sizeof(__pyx_k_tolerate_badgrib_on), 0, 0, 1, 1},
+  {&__pyx_n_s_topLevel, __pyx_k_topLevel, sizeof(__pyx_k_topLevel), 0, 0, 1, 1},
+  {&__pyx_n_s_tostring, __pyx_k_tostring, sizeof(__pyx_k_tostring), 0, 0, 1, 1},
+  {&__pyx_n_s_traceback, __pyx_k_traceback, sizeof(__pyx_k_traceback), 0, 0, 1, 1},
+  {&__pyx_n_s_truncateDegrees, __pyx_k_truncateDegrees, sizeof(__pyx_k_truncateDegrees), 0, 0, 1, 1},
+  {&__pyx_n_s_typeOfEnsembleForecast, __pyx_k_typeOfEnsembleForecast, sizeof(__pyx_k_typeOfEnsembleForecast), 0, 0, 1, 1},
+  {&__pyx_n_s_typeOfFirstFixedSurface, __pyx_k_typeOfFirstFixedSurface, sizeof(__pyx_k_typeOfFirstFixedSurface), 0, 0, 1, 1},
+  {&__pyx_n_s_typeOfGrid, __pyx_k_typeOfGrid, sizeof(__pyx_k_typeOfGrid), 0, 0, 1, 1},
+  {&__pyx_n_s_typeOfLevel, __pyx_k_typeOfLevel, sizeof(__pyx_k_typeOfLevel), 0, 0, 1, 1},
+  {&__pyx_n_s_typeOfSecondFixedSurface, __pyx_k_typeOfSecondFixedSurface, sizeof(__pyx_k_typeOfSecondFixedSurface), 0, 0, 1, 1},
+  {&__pyx_n_s_units, __pyx_k_units, sizeof(__pyx_k_units), 0, 0, 1, 1},
+  {&__pyx_n_s_unitsOfFirstFixedSurface, __pyx_k_unitsOfFirstFixedSurface, sizeof(__pyx_k_unitsOfFirstFixedSurface), 0, 0, 1, 1},
+  {&__pyx_n_s_unknown, __pyx_k_unknown, sizeof(__pyx_k_unknown), 0, 0, 1, 1},
+  {&__pyx_kp_s_unknown_shape_of_the_earth_flag, __pyx_k_unknown_shape_of_the_earth_flag, sizeof(__pyx_k_unknown_shape_of_the_earth_flag), 0, 0, 1, 0},
+  {&__pyx_kp_s_unrecognized_grib_type_d, __pyx_k_unrecognized_grib_type_d, sizeof(__pyx_k_unrecognized_grib_type_d), 0, 0, 1, 0},
+  {&__pyx_n_s_unshape_mask, __pyx_k_unshape_mask, sizeof(__pyx_k_unshape_mask), 0, 0, 1, 1},
+  {&__pyx_kp_s_unsupported_grid_earth_not_a_per, __pyx_k_unsupported_grid_earth_not_a_per, sizeof(__pyx_k_unsupported_grid_earth_not_a_per), 0, 0, 1, 0},
+  {&__pyx_kp_s_unsupported_grid_s, __pyx_k_unsupported_grid_s, sizeof(__pyx_k_unsupported_grid_s), 0, 0, 1, 0},
+  {&__pyx_n_s_v, __pyx_k_v, sizeof(__pyx_k_v), 0, 0, 1, 1},
+  {&__pyx_n_s_validDate, __pyx_k_validDate, sizeof(__pyx_k_validDate), 0, 0, 1, 1},
+  {&__pyx_n_s_valid_key, __pyx_k_valid_key, sizeof(__pyx_k_valid_key), 0, 0, 1, 1},
+  {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1},
+  {&__pyx_kp_s_value_must_be_float_int_or_strin, __pyx_k_value_must_be_float_int_or_strin, sizeof(__pyx_k_value_must_be_float_int_or_strin), 0, 0, 1, 0},
+  {&__pyx_n_b_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 0, 1},
+  {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1},
+  {&__pyx_n_s_version, __pyx_k_version, sizeof(__pyx_k_version), 0, 0, 1, 1},
+  {&__pyx_n_s_warn, __pyx_k_warn, sizeof(__pyx_k_warn), 0, 0, 1, 1},
+  {&__pyx_n_s_warnings, __pyx_k_warnings, sizeof(__pyx_k_warnings), 0, 0, 1, 1},
+  {&__pyx_kp_s_weighted_ens_mean, __pyx_k_weighted_ens_mean, sizeof(__pyx_k_weighted_ens_mean), 0, 0, 1, 0},
+  {&__pyx_n_s_where, __pyx_k_where, sizeof(__pyx_k_where), 0, 0, 1, 1},
+  {&__pyx_n_s_xDirectionGridLengthInMetres, __pyx_k_xDirectionGridLengthInMetres, sizeof(__pyx_k_xDirectionGridLengthInMetres), 0, 0, 1, 1},
+  {&__pyx_n_s_xrange, __pyx_k_xrange, sizeof(__pyx_k_xrange), 0, 0, 1, 1},
+  {&__pyx_n_s_yDirectionGridLengthInMetres, __pyx_k_yDirectionGridLengthInMetres, sizeof(__pyx_k_yDirectionGridLengthInMetres), 0, 0, 1, 1},
+  {&__pyx_n_s_year, __pyx_k_year, sizeof(__pyx_k_year), 0, 0, 1, 1},
+  {&__pyx_n_s_yrs, __pyx_k_yrs, sizeof(__pyx_k_yrs), 0, 0, 1, 1},
+  {&__pyx_n_s_zero, __pyx_k_zero, sizeof(__pyx_k_zero), 0, 0, 1, 1},
+  {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1},
   {0, 0, 0, 0, 0, 0, 0}
 };
 static int __Pyx_InitCachedBuiltins(void) {
-  __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s__ImportError); if (!__pyx_builtin_ImportError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_IOError = __Pyx_GetBuiltinName(__pyx_n_s__IOError); if (!__pyx_builtin_IOError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s__StopIteration); if (!__pyx_builtin_StopIteration) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s__RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_builtin_IOError = __Pyx_GetBuiltinName(__pyx_n_s_IOError); if (!__pyx_builtin_IOError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   #if PY_MAJOR_VERSION >= 3
-  __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s__range); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   #else
-  __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s__xrange); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_xrange); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   #endif
-  __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s__KeyError); if (!__pyx_builtin_KeyError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s__range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s__TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s__AttributeError); if (!__pyx_builtin_AttributeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s__IndexError); if (!__pyx_builtin_IndexError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   return 0;
   __pyx_L1_error:;
   return -1;
@@ -28522,848 +30968,914 @@ static int __Pyx_InitCachedConstants(void) {
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
 
-  /* "pygrib.pyx":337
+  /* "pygrib.pyx":331
  *     cdef ndarray lats
  *     if nlats%2:
  *         raise ValueError('nlats must be even')             # <<<<<<<<<<<<<<
  *     lats = np.empty(nlats, np.float64)
  *     grib_get_gaussian_latitudes(<long>nlats/2, <double *>lats.data)
  */
-  __pyx_k_tuple_4 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_3)); if (unlikely(!__pyx_k_tuple_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_4);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_4));
+  __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_nlats_must_be_even); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple_);
+  __Pyx_GIVEREF(__pyx_tuple_);
 
-  /* "pygrib.pyx":461
+  /* "pygrib.pyx":455
  *             return grb
  *         else:
  *             raise KeyError('key must be an integer message number or a slice')             # <<<<<<<<<<<<<<
  *     def __call__(self, **kwargs):
  *         """same as L{select}"""
  */
-  __pyx_k_tuple_7 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_6)); if (unlikely(!__pyx_k_tuple_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_7);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_7));
+  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_key_must_be_an_integer_message_n); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__2);
+  __Pyx_GIVEREF(__pyx_tuple__2);
 
-  /* "pygrib.pyx":481
+  /* "pygrib.pyx":475
  *         or from the end of file (if C{from_what=2})."""
  *         if from_what not in [0,1,2]:
  *             raise ValueError('from_what keyword arg to seek must be 0,1 or 2')             # <<<<<<<<<<<<<<
  *         if msg == 0:
  *             if from_what == 0:
  */
-  __pyx_k_tuple_9 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_8)); if (unlikely(!__pyx_k_tuple_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_9);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_9));
+  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_from_what_keyword_arg_to_seek_mu); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__3);
+  __Pyx_GIVEREF(__pyx_tuple__3);
 
-  /* "pygrib.pyx":564
+  /* "pygrib.pyx":558
  *         same as seek(N-1) followed by readline()."""
  *         if N < 1:
  *             raise IOError('grb message numbers start at 1')             # <<<<<<<<<<<<<<
  *         # if iterator positioned past message N, reposition at beginning.
  *         if self.messagenumber >= N:
  */
-  __pyx_k_tuple_11 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_10)); if (unlikely(!__pyx_k_tuple_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_11);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_11));
+  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_grb_message_numbers_start_at_1); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__4);
+  __Pyx_GIVEREF(__pyx_tuple__4);
 
-  /* "pygrib.pyx":615
+  /* "pygrib.pyx":609
  *         self.seek(msgnum) # leave iterator in original position.
  *         if not grbs:
  *             raise ValueError('no matches found')             # <<<<<<<<<<<<<<
  *         return grbs
  *     def _advance(self,nmsgs,return_msgs=False):
  */
-  __pyx_k_tuple_13 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_12)); if (unlikely(!__pyx_k_tuple_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_13);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_13));
+  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_no_matches_found); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__5);
+  __Pyx_GIVEREF(__pyx_tuple__5);
 
-  /* "pygrib.pyx":623
+  /* "pygrib.pyx":617
  *         cdef int err
  *         if nmsgs < 0:
  *             raise ValueError('nmsgs must be >= 0 in _advance')             # <<<<<<<<<<<<<<
  *         if return_msgs: grbs=[]
  *         for n in range(self.messagenumber,self.messagenumber+nmsgs):
  */
-  __pyx_k_tuple_16 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_15)); if (unlikely(!__pyx_k_tuple_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_16);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_16));
+  __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_nmsgs_must_be_0_in__advance); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__6);
+  __Pyx_GIVEREF(__pyx_tuple__6);
 
-  /* "pygrib.pyx":633
+  /* "pygrib.pyx":627
  *                 raise RuntimeError(grib_get_error_message(err))
  *             if self._gh == NULL:
  *                 raise IOError('not that many messages in file')             # <<<<<<<<<<<<<<
  *             self.messagenumber = self.messagenumber + 1
  *             if return_msgs: grbs.append(_create_gribmessage(self._gh, self.messagenumber))
  */
-  __pyx_k_tuple_18 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_17)); if (unlikely(!__pyx_k_tuple_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_18);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_18));
+  __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_not_that_many_messages_in_file); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__7);
+  __Pyx_GIVEREF(__pyx_tuple__7);
 
-  /* "pygrib.pyx":718
+  /* "pygrib.pyx":712
  *     """
  *     grb.fcstimeunits = ""
  *     if grb.has_key('indicatorOfUnitOfTimeRange') and\             # <<<<<<<<<<<<<<
  *        grb.indicatorOfUnitOfTimeRange in _ftimedict:
  *         grb.fcstimeunits = _ftimedict[grb.indicatorOfUnitOfTimeRange]
  */
-  __pyx_k_tuple_21 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s_20)); if (unlikely(!__pyx_k_tuple_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_21);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_21));
+  __pyx_tuple__9 = PyTuple_Pack(1, __pyx_n_s_indicatorOfUnitOfTimeRange); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__9);
+  __Pyx_GIVEREF(__pyx_tuple__9);
 
-  /* "pygrib.pyx":721
+  /* "pygrib.pyx":715
  *        grb.indicatorOfUnitOfTimeRange in _ftimedict:
  *         grb.fcstimeunits = _ftimedict[grb.indicatorOfUnitOfTimeRange]
  *     if grb.has_key('forecastTime'):             # <<<<<<<<<<<<<<
  *         if grb.has_key('stepRange'):
  *             # this is a hack to work around grib_api bug
  */
-  __pyx_k_tuple_22 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__forecastTime)); if (unlikely(!__pyx_k_tuple_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_22);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_22));
+  __pyx_tuple__10 = PyTuple_Pack(1, __pyx_n_s_forecastTime); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__10);
+  __Pyx_GIVEREF(__pyx_tuple__10);
 
-  /* "pygrib.pyx":722
+  /* "pygrib.pyx":716
  *         grb.fcstimeunits = _ftimedict[grb.indicatorOfUnitOfTimeRange]
  *     if grb.has_key('forecastTime'):
  *         if grb.has_key('stepRange'):             # <<<<<<<<<<<<<<
  *             # this is a hack to work around grib_api bug
  *             # sometimes stepUnits and indicatorOfUnitOfTimeRange
  */
-  __pyx_k_tuple_23 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__stepRange)); if (unlikely(!__pyx_k_tuple_23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_23);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_23));
+  __pyx_tuple__11 = PyTuple_Pack(1, __pyx_n_s_stepRange); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__11);
+  __Pyx_GIVEREF(__pyx_tuple__11);
 
-  /* "pygrib.pyx":730
+  /* "pygrib.pyx":724
  *             # if it's a range, use the end of the range to define validDate
  *             try:
  *                 ftime = float(ftime.split('-')[1])             # <<<<<<<<<<<<<<
  *             except:
  *                 ftime = grb.forecastTime
  */
-  __pyx_k_tuple_25 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_24)); if (unlikely(!__pyx_k_tuple_25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_25);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_25));
+  __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s__12); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__13);
+  __Pyx_GIVEREF(__pyx_tuple__13);
 
-  /* "pygrib.pyx":737
+  /* "pygrib.pyx":731
  *     else:
  *         ftime = 0
  *     if grb.has_key('julianDay'):             # <<<<<<<<<<<<<<
  *         # don't do anything if datetime fails (because of a miscoded julianDay)
  *         try:
  */
-  __pyx_k_tuple_26 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__julianDay)); if (unlikely(!__pyx_k_tuple_26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_26);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_26));
+  __pyx_tuple__14 = PyTuple_Pack(1, __pyx_n_s_julianDay); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__14);
+  __Pyx_GIVEREF(__pyx_tuple__14);
 
-  /* "pygrib.pyx":841
+  /* "pygrib.pyx":835
  *     def __init__(self):
  *         # calling "__new__()" will not call "__init__()" !
  *         raise TypeError("This class cannot be instantiated from Python")             # <<<<<<<<<<<<<<
  *     def __dealloc__(self):
  *         # finalization (inverse of __cinit__): needed to allow garbage collector to free memory.
  */
-  __pyx_k_tuple_31 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_30)); if (unlikely(!__pyx_k_tuple_31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_31);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_31));
+  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_This_class_cannot_be_instantiate); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__15);
+  __Pyx_GIVEREF(__pyx_tuple__15);
 
-  /* "pygrib.pyx":864
+  /* "pygrib.pyx":858
  *         """prints a short inventory of the grib message"""
  *         inventory = []
  *         if self.valid_key('name'):             # <<<<<<<<<<<<<<
  *             if self['name'] != 'unknown':
  *                 inventory.append(repr(self.messagenumber)+':'+self['name'])
  */
-  __pyx_k_tuple_32 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__name)); if (unlikely(!__pyx_k_tuple_32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_32);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_32));
+  __pyx_tuple__16 = PyTuple_Pack(1, __pyx_n_s_name); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__16);
+  __Pyx_GIVEREF(__pyx_tuple__16);
 
-  /* "pygrib.pyx":867
+  /* "pygrib.pyx":861
  *             if self['name'] != 'unknown':
  *                 inventory.append(repr(self.messagenumber)+':'+self['name'])
  *             elif self.valid_key('parameterName'):             # <<<<<<<<<<<<<<
  *                 inventory.append(repr(self.messagenumber)+':'+self['parameterName'])
  *         if self.valid_key('units'):
  */
-  __pyx_k_tuple_34 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__parameterName)); if (unlikely(!__pyx_k_tuple_34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_34);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_34));
+  __pyx_tuple__18 = PyTuple_Pack(1, __pyx_n_s_parameterName); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__18);
+  __Pyx_GIVEREF(__pyx_tuple__18);
 
-  /* "pygrib.pyx":869
+  /* "pygrib.pyx":863
  *             elif self.valid_key('parameterName'):
  *                 inventory.append(repr(self.messagenumber)+':'+self['parameterName'])
  *         if self.valid_key('units'):             # <<<<<<<<<<<<<<
  *             if self['units'] != 'unknown':
  *                 inventory.append(':'+self['units'])
  */
-  __pyx_k_tuple_35 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__units)); if (unlikely(!__pyx_k_tuple_35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_35);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_35));
+  __pyx_tuple__19 = PyTuple_Pack(1, __pyx_n_s_units); if (unlikely(!__pyx_tuple__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__19);
+  __Pyx_GIVEREF(__pyx_tuple__19);
 
-  /* "pygrib.pyx":872
+  /* "pygrib.pyx":866
  *             if self['units'] != 'unknown':
  *                 inventory.append(':'+self['units'])
  *             elif self.valid_key('parameterUnits'):             # <<<<<<<<<<<<<<
  *                 inventory.append(':'+self['parameterUnits'])
  *         if self.valid_key('stepType'):
  */
-  __pyx_k_tuple_36 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__parameterUnits)); if (unlikely(!__pyx_k_tuple_36)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_36);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_36));
+  __pyx_tuple__20 = PyTuple_Pack(1, __pyx_n_s_parameterUnits); if (unlikely(!__pyx_tuple__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__20);
+  __Pyx_GIVEREF(__pyx_tuple__20);
 
-  /* "pygrib.pyx":874
+  /* "pygrib.pyx":868
  *             elif self.valid_key('parameterUnits'):
  *                 inventory.append(':'+self['parameterUnits'])
  *         if self.valid_key('stepType'):             # <<<<<<<<<<<<<<
  *             inventory.append(' ('+self['stepType']+')')
  *         if self.valid_key('typeOfGrid') or self.valid_key('gridType'):
  */
-  __pyx_k_tuple_37 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__stepType)); if (unlikely(!__pyx_k_tuple_37)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_37);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_37));
+  __pyx_tuple__21 = PyTuple_Pack(1, __pyx_n_s_stepType); if (unlikely(!__pyx_tuple__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__21);
+  __Pyx_GIVEREF(__pyx_tuple__21);
 
-  /* "pygrib.pyx":876
+  /* "pygrib.pyx":870
  *         if self.valid_key('stepType'):
  *             inventory.append(' ('+self['stepType']+')')
  *         if self.valid_key('typeOfGrid') or self.valid_key('gridType'):             # <<<<<<<<<<<<<<
  *             if self.valid_key('typeOfGrid'):
  *                inventory.append(':'+self['typeOfGrid'])
  */
-  __pyx_k_tuple_40 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__typeOfGrid)); if (unlikely(!__pyx_k_tuple_40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_40);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_40));
-  __pyx_k_tuple_41 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__gridType)); if (unlikely(!__pyx_k_tuple_41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_41);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_41));
+  __pyx_tuple__24 = PyTuple_Pack(1, __pyx_n_s_typeOfGrid); if (unlikely(!__pyx_tuple__24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__24);
+  __Pyx_GIVEREF(__pyx_tuple__24);
+  __pyx_tuple__25 = PyTuple_Pack(1, __pyx_n_s_gridType); if (unlikely(!__pyx_tuple__25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__25);
+  __Pyx_GIVEREF(__pyx_tuple__25);
 
-  /* "pygrib.pyx":877
+  /* "pygrib.pyx":871
  *             inventory.append(' ('+self['stepType']+')')
  *         if self.valid_key('typeOfGrid') or self.valid_key('gridType'):
  *             if self.valid_key('typeOfGrid'):             # <<<<<<<<<<<<<<
  *                inventory.append(':'+self['typeOfGrid'])
  *             else:
  */
-  __pyx_k_tuple_42 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__typeOfGrid)); if (unlikely(!__pyx_k_tuple_42)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_42);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_42));
+  __pyx_tuple__26 = PyTuple_Pack(1, __pyx_n_s_typeOfGrid); if (unlikely(!__pyx_tuple__26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__26);
+  __Pyx_GIVEREF(__pyx_tuple__26);
 
-  /* "pygrib.pyx":881
+  /* "pygrib.pyx":875
  *             else:
  *                inventory.append(':'+self['gridType'])
  *         if self.valid_key('typeOfLevel'):             # <<<<<<<<<<<<<<
  *             inventory.append(':'+self['typeOfLevel'])
  *         if self.valid_key('topLevel') and self.valid_key('bottomLevel'):
  */
-  __pyx_k_tuple_43 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__typeOfLevel)); if (unlikely(!__pyx_k_tuple_43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_43);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_43));
+  __pyx_tuple__27 = PyTuple_Pack(1, __pyx_n_s_typeOfLevel); if (unlikely(!__pyx_tuple__27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__27);
+  __Pyx_GIVEREF(__pyx_tuple__27);
 
-  /* "pygrib.pyx":883
+  /* "pygrib.pyx":877
  *         if self.valid_key('typeOfLevel'):
  *             inventory.append(':'+self['typeOfLevel'])
  *         if self.valid_key('topLevel') and self.valid_key('bottomLevel'):             # <<<<<<<<<<<<<<
  *             toplev = None; botlev = None
  *             levunits = 'unknown'
  */
-  __pyx_k_tuple_44 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__topLevel)); if (unlikely(!__pyx_k_tuple_44)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_44);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_44));
-  __pyx_k_tuple_45 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__bottomLevel)); if (unlikely(!__pyx_k_tuple_45)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_45);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_45));
+  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_n_s_topLevel); if (unlikely(!__pyx_tuple__28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__28);
+  __Pyx_GIVEREF(__pyx_tuple__28);
+  __pyx_tuple__29 = PyTuple_Pack(1, __pyx_n_s_bottomLevel); if (unlikely(!__pyx_tuple__29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__29);
+  __Pyx_GIVEREF(__pyx_tuple__29);
 
-  /* "pygrib.pyx":886
+  /* "pygrib.pyx":880
  *             toplev = None; botlev = None
  *             levunits = 'unknown'
  *             if self.valid_key('unitsOfFirstFixedSurface'):             # <<<<<<<<<<<<<<
  *                 levunits = self['unitsOfFirstFixedSurface']
  *             if self.valid_key('typeOfFirstFixedSurface') and self['typeOfFirstFixedSurface'] != 255:
  */
-  __pyx_k_tuple_47 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s_46)); if (unlikely(!__pyx_k_tuple_47)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_47);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_47));
+  __pyx_tuple__30 = PyTuple_Pack(1, __pyx_n_s_unitsOfFirstFixedSurface); if (unlikely(!__pyx_tuple__30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__30);
+  __Pyx_GIVEREF(__pyx_tuple__30);
 
-  /* "pygrib.pyx":888
+  /* "pygrib.pyx":882
  *             if self.valid_key('unitsOfFirstFixedSurface'):
  *                 levunits = self['unitsOfFirstFixedSurface']
  *             if self.valid_key('typeOfFirstFixedSurface') and self['typeOfFirstFixedSurface'] != 255:             # <<<<<<<<<<<<<<
  *                 toplev = self['topLevel']
  *                 if self.valid_key('scaledValueOfFirstFixedSurface') and\
  */
-  __pyx_k_tuple_49 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s_48)); if (unlikely(!__pyx_k_tuple_49)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_49);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_49));
+  __pyx_tuple__31 = PyTuple_Pack(1, __pyx_n_s_typeOfFirstFixedSurface); if (unlikely(!__pyx_tuple__31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__31);
+  __Pyx_GIVEREF(__pyx_tuple__31);
 
-  /* "pygrib.pyx":890
+  /* "pygrib.pyx":884
  *             if self.valid_key('typeOfFirstFixedSurface') and self['typeOfFirstFixedSurface'] != 255:
  *                 toplev = self['topLevel']
  *                 if self.valid_key('scaledValueOfFirstFixedSurface') and\             # <<<<<<<<<<<<<<
  *                    self.valid_key('scaleFactorOfFirstFixedSurface'):
  *                    if self['scaleFactorOfFirstFixedSurface']:
  */
-  __pyx_k_tuple_51 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s_50)); if (unlikely(!__pyx_k_tuple_51)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_51);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_51));
+  __pyx_tuple__32 = PyTuple_Pack(1, __pyx_n_s_scaledValueOfFirstFixedSurface); if (unlikely(!__pyx_tuple__32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__32);
+  __Pyx_GIVEREF(__pyx_tuple__32);
 
-  /* "pygrib.pyx":891
+  /* "pygrib.pyx":885
  *                 toplev = self['topLevel']
  *                 if self.valid_key('scaledValueOfFirstFixedSurface') and\
  *                    self.valid_key('scaleFactorOfFirstFixedSurface'):             # <<<<<<<<<<<<<<
  *                    if self['scaleFactorOfFirstFixedSurface']:
  *                        toplev = self['scaledValueOfFirstFixedSurface']/\
  */
-  __pyx_k_tuple_53 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s_52)); if (unlikely(!__pyx_k_tuple_53)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_53);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_53));
+  __pyx_tuple__33 = PyTuple_Pack(1, __pyx_n_s_scaleFactorOfFirstFixedSurface); if (unlikely(!__pyx_tuple__33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__33);
+  __Pyx_GIVEREF(__pyx_tuple__33);
 
-  /* "pygrib.pyx":897
+  /* "pygrib.pyx":891
  *                    else:
  *                        toplev = self['scaledValueOfFirstFixedSurface']
  *             if self.valid_key('typeOfSecondFixedSurface') and self['typeOfSecondFixedSurface'] != 255:             # <<<<<<<<<<<<<<
  *                 botlev = self['bottomLevel']
  *                 if self.valid_key('scaledValueOfSecondFixedSurface') and\
  */
-  __pyx_k_tuple_55 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s_54)); if (unlikely(!__pyx_k_tuple_55)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_55);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_55));
+  __pyx_tuple__34 = PyTuple_Pack(1, __pyx_n_s_typeOfSecondFixedSurface); if (unlikely(!__pyx_tuple__34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__34);
+  __Pyx_GIVEREF(__pyx_tuple__34);
 
-  /* "pygrib.pyx":899
+  /* "pygrib.pyx":893
  *             if self.valid_key('typeOfSecondFixedSurface') and self['typeOfSecondFixedSurface'] != 255:
  *                 botlev = self['bottomLevel']
  *                 if self.valid_key('scaledValueOfSecondFixedSurface') and\             # <<<<<<<<<<<<<<
  *                    self.valid_key('scaleFactorOfSecondFixedSurface'):
  *                    if self['scaleFactorOfSecondFixedSurface']:
  */
-  __pyx_k_tuple_57 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s_56)); if (unlikely(!__pyx_k_tuple_57)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_57);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_57));
+  __pyx_tuple__35 = PyTuple_Pack(1, __pyx_n_s_scaledValueOfSecondFixedSurface); if (unlikely(!__pyx_tuple__35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__35);
+  __Pyx_GIVEREF(__pyx_tuple__35);
 
-  /* "pygrib.pyx":900
+  /* "pygrib.pyx":894
  *                 botlev = self['bottomLevel']
  *                 if self.valid_key('scaledValueOfSecondFixedSurface') and\
  *                    self.valid_key('scaleFactorOfSecondFixedSurface'):             # <<<<<<<<<<<<<<
  *                    if self['scaleFactorOfSecondFixedSurface']:
  *                        botlev = self['scaledValueOfSecondFixedSurface']/\
  */
-  __pyx_k_tuple_59 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s_58)); if (unlikely(!__pyx_k_tuple_59)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_59);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_59));
+  __pyx_tuple__36 = PyTuple_Pack(1, __pyx_n_s_scaleFactorOfSecondFixedSurface); if (unlikely(!__pyx_tuple__36)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__36);
+  __Pyx_GIVEREF(__pyx_tuple__36);
 
-  /* "pygrib.pyx":915
+  /* "pygrib.pyx":909
  *             if levstring is not None:
  *                 inventory.append(levstring)
  *         elif self.valid_key('level'):             # <<<<<<<<<<<<<<
  *             inventory.append(':level %s' % self['level'])
  *         if self.has_key('stepRange'):
  */
-  __pyx_k_tuple_63 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__level)); if (unlikely(!__pyx_k_tuple_63)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_63);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_63));
+  __pyx_tuple__37 = PyTuple_Pack(1, __pyx_n_s_level); if (unlikely(!__pyx_tuple__37)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__37);
+  __Pyx_GIVEREF(__pyx_tuple__37);
 
-  /* "pygrib.pyx":917
+  /* "pygrib.pyx":911
  *         elif self.valid_key('level'):
  *             inventory.append(':level %s' % self['level'])
  *         if self.has_key('stepRange'):             # <<<<<<<<<<<<<<
  *             ftime = self['stepRange'] # computed key, uses stepUnits
  *             if self.valid_key('stepType') and self['stepType'] != 'instant':
  */
-  __pyx_k_tuple_64 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__stepRange)); if (unlikely(!__pyx_k_tuple_64)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_64);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_64));
+  __pyx_tuple__38 = PyTuple_Pack(1, __pyx_n_s_stepRange); if (unlikely(!__pyx_tuple__38)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__38);
+  __Pyx_GIVEREF(__pyx_tuple__38);
 
-  /* "pygrib.pyx":919
+  /* "pygrib.pyx":913
  *         if self.has_key('stepRange'):
  *             ftime = self['stepRange'] # computed key, uses stepUnits
  *             if self.valid_key('stepType') and self['stepType'] != 'instant':             # <<<<<<<<<<<<<<
  *                 inventory.append(':fcst time %s %s (%s)'%\
  *                     (ftime,self.fcstimeunits,self.stepType))
  */
-  __pyx_k_tuple_65 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__stepType)); if (unlikely(!__pyx_k_tuple_65)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_65);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_65));
+  __pyx_tuple__39 = PyTuple_Pack(1, __pyx_n_s_stepType); if (unlikely(!__pyx_tuple__39)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__39);
+  __Pyx_GIVEREF(__pyx_tuple__39);
 
-  /* "pygrib.pyx":924
+  /* "pygrib.pyx":918
  *             else:
  *                 inventory.append(':fcst time %s %s'% (ftime,self.fcstimeunits))
  *         elif self.valid_key('forecastTime'):             # <<<<<<<<<<<<<<
  *             ftime = repr(self['forecastTime'])
  *             inventory.append(':fcst time %s %s'% (ftime,self.fcstimeunits))
  */
-  __pyx_k_tuple_68 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__forecastTime)); if (unlikely(!__pyx_k_tuple_68)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_68);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_68));
+  __pyx_tuple__40 = PyTuple_Pack(1, __pyx_n_s_forecastTime); if (unlikely(!__pyx_tuple__40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__40);
+  __Pyx_GIVEREF(__pyx_tuple__40);
 
-  /* "pygrib.pyx":927
+  /* "pygrib.pyx":921
  *             ftime = repr(self['forecastTime'])
  *             inventory.append(':fcst time %s %s'% (ftime,self.fcstimeunits))
  *         if self.valid_key('dataDate') and self.valid_key('dataTime'):             # <<<<<<<<<<<<<<
  *             inventory.append(
  *             ':from '+repr(self['dataDate'])+'%04i' % self['dataTime'])
  */
-  __pyx_k_tuple_69 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__dataDate)); if (unlikely(!__pyx_k_tuple_69)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_69);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_69));
-  __pyx_k_tuple_70 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__dataTime)); if (unlikely(!__pyx_k_tuple_70)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_70);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_70));
+  __pyx_tuple__41 = PyTuple_Pack(1, __pyx_n_s_dataDate); if (unlikely(!__pyx_tuple__41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__41);
+  __Pyx_GIVEREF(__pyx_tuple__41);
+  __pyx_tuple__42 = PyTuple_Pack(1, __pyx_n_s_dataTime); if (unlikely(!__pyx_tuple__42)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__42);
+  __Pyx_GIVEREF(__pyx_tuple__42);
 
-  /* "pygrib.pyx":933
+  /* "pygrib.pyx":927
  *         #    inventory.append(
  *         #    ':valid '+repr(self['validityDate'])+repr(self['validityTime']))
  *         if self.valid_key('perturbationNumber') and\             # <<<<<<<<<<<<<<
  *            self.valid_key('typeOfEnsembleForecast'):
  *             ens_type = self['typeOfEnsembleForecast']
  */
-  __pyx_k_tuple_73 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__perturbationNumber)); if (unlikely(!__pyx_k_tuple_73)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_73);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_73));
+  __pyx_tuple__43 = PyTuple_Pack(1, __pyx_n_s_perturbationNumber); if (unlikely(!__pyx_tuple__43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__43);
+  __Pyx_GIVEREF(__pyx_tuple__43);
 
-  /* "pygrib.pyx":934
+  /* "pygrib.pyx":928
  *         #    ':valid '+repr(self['validityDate'])+repr(self['validityTime']))
  *         if self.valid_key('perturbationNumber') and\
  *            self.valid_key('typeOfEnsembleForecast'):             # <<<<<<<<<<<<<<
  *             ens_type = self['typeOfEnsembleForecast']
  *             pert_num = self['perturbationNumber']
  */
-  __pyx_k_tuple_75 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s_74)); if (unlikely(!__pyx_k_tuple_75)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_75);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_75));
+  __pyx_tuple__44 = PyTuple_Pack(1, __pyx_n_s_typeOfEnsembleForecast); if (unlikely(!__pyx_tuple__44)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__44);
+  __Pyx_GIVEREF(__pyx_tuple__44);
 
-  /* "pygrib.pyx":945
+  /* "pygrib.pyx":939
  *             elif ens_type == 3:
  *                inventory.append(":pos ens pert %d" % pert_num)
  *         if self.valid_key('derivedForecast'):             # <<<<<<<<<<<<<<
  *             if self['derivedForecast'] == 0:
  *                 inventory.append(":ens mean")
  */
-  __pyx_k_tuple_80 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__derivedForecast)); if (unlikely(!__pyx_k_tuple_80)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_80);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_80));
+  __pyx_tuple__45 = PyTuple_Pack(1, __pyx_n_s_derivedForecast); if (unlikely(!__pyx_tuple__45)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__45);
+  __Pyx_GIVEREF(__pyx_tuple__45);
 
-  /* "pygrib.pyx":960
+  /* "pygrib.pyx":954
  *             elif self['derivedForecast'] == 6:
  *                 inventory.append(":ens mean of cluster")
  *         if self.valid_key('probabilityTypeName'):             # <<<<<<<<<<<<<<
  *             inventory.append(":"+self['probabilityTypeName'])
  *             lowerlim = None
  */
-  __pyx_k_tuple_88 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__probabilityTypeName)); if (unlikely(!__pyx_k_tuple_88)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_88);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_88));
+  __pyx_tuple__46 = PyTuple_Pack(1, __pyx_n_s_probabilityTypeName); if (unlikely(!__pyx_tuple__46)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__46);
+  __Pyx_GIVEREF(__pyx_tuple__46);
 
-  /* "pygrib.pyx":963
+  /* "pygrib.pyx":957
  *             inventory.append(":"+self['probabilityTypeName'])
  *             lowerlim = None
  *             if self.valid_key('scaledValueOfLowerLimit') and\             # <<<<<<<<<<<<<<
  *                self.valid_key('scaleFactorOfLowerLimit'):
  *                if self['scaledValueOfLowerLimit'] and\
  */
-  __pyx_k_tuple_90 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s_89)); if (unlikely(!__pyx_k_tuple_90)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_90);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_90));
+  __pyx_tuple__47 = PyTuple_Pack(1, __pyx_n_s_scaledValueOfLowerLimit); if (unlikely(!__pyx_tuple__47)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__47);
+  __Pyx_GIVEREF(__pyx_tuple__47);
 
-  /* "pygrib.pyx":964
+  /* "pygrib.pyx":958
  *             lowerlim = None
  *             if self.valid_key('scaledValueOfLowerLimit') and\
  *                self.valid_key('scaleFactorOfLowerLimit'):             # <<<<<<<<<<<<<<
  *                if self['scaledValueOfLowerLimit'] and\
  *                   self['scaleFactorOfLowerLimit']:
  */
-  __pyx_k_tuple_92 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s_91)); if (unlikely(!__pyx_k_tuple_92)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_92);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_92));
+  __pyx_tuple__48 = PyTuple_Pack(1, __pyx_n_s_scaleFactorOfLowerLimit); if (unlikely(!__pyx_tuple__48)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__48);
+  __Pyx_GIVEREF(__pyx_tuple__48);
 
-  /* "pygrib.pyx":970
+  /* "pygrib.pyx":964
  *                               np.power(10.0,self['scaleFactorOfLowerLimit'])
  *             upperlim = None
  *             if self.valid_key('scaledValueOfUpperLimit') and\             # <<<<<<<<<<<<<<
  *                self.valid_key('scaleFactorOfUpperLimit'):
  *                if self['scaledValueOfUpperLimit'] and\
  */
-  __pyx_k_tuple_94 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s_93)); if (unlikely(!__pyx_k_tuple_94)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_94);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_94));
+  __pyx_tuple__49 = PyTuple_Pack(1, __pyx_n_s_scaledValueOfUpperLimit); if (unlikely(!__pyx_tuple__49)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__49);
+  __Pyx_GIVEREF(__pyx_tuple__49);
 
-  /* "pygrib.pyx":971
+  /* "pygrib.pyx":965
  *             upperlim = None
  *             if self.valid_key('scaledValueOfUpperLimit') and\
  *                self.valid_key('scaleFactorOfUpperLimit'):             # <<<<<<<<<<<<<<
  *                if self['scaledValueOfUpperLimit'] and\
  *                   self['scaleFactorOfUpperLimit']:
  */
-  __pyx_k_tuple_96 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s_95)); if (unlikely(!__pyx_k_tuple_96)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_96);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_96));
+  __pyx_tuple__50 = PyTuple_Pack(1, __pyx_n_s_scaleFactorOfUpperLimit); if (unlikely(!__pyx_tuple__50)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__50);
+  __Pyx_GIVEREF(__pyx_tuple__50);
 
-  /* "pygrib.pyx":1106
+  /* "pygrib.pyx":1098
  *             reduced_expand = self['gridType'] in ['reduced_ll','reduced_gg'] and self.expand_reduced
  *             if self['gridType'] in ['regular_gg','regular_ll'] or reduced_expand:
  *                 nlats = masklat[:,0].sum()             # <<<<<<<<<<<<<<
  *                 nlons = masklon[0,:].sum()
  *                 if ma.isMA(datsubset):
  */
-  __pyx_k_slice_100 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_k_slice_100)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_slice_100);
-  __Pyx_GIVEREF(__pyx_k_slice_100);
-  __pyx_k_tuple_101 = PyTuple_Pack(2, __pyx_k_slice_100, __pyx_int_0); if (unlikely(!__pyx_k_tuple_101)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_101);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_101));
+  __pyx_slice__51 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__51)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_slice__51);
+  __Pyx_GIVEREF(__pyx_slice__51);
+  __pyx_tuple__52 = PyTuple_Pack(2, __pyx_slice__51, __pyx_int_0); if (unlikely(!__pyx_tuple__52)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__52);
+  __Pyx_GIVEREF(__pyx_tuple__52);
 
-  /* "pygrib.pyx":1107
+  /* "pygrib.pyx":1099
  *             if self['gridType'] in ['regular_gg','regular_ll'] or reduced_expand:
  *                 nlats = masklat[:,0].sum()
  *                 nlons = masklon[0,:].sum()             # <<<<<<<<<<<<<<
  *                 if ma.isMA(datsubset):
  *                     datsubset = ma.reshape(datsubset,(nlats,nlons))
  */
-  __pyx_k_slice_102 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_k_slice_102)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_slice_102);
-  __Pyx_GIVEREF(__pyx_k_slice_102);
-  __pyx_k_tuple_103 = PyTuple_Pack(2, __pyx_int_0, __pyx_k_slice_102); if (unlikely(!__pyx_k_tuple_103)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_103);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_103));
+  __pyx_slice__53 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__53)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_slice__53);
+  __Pyx_GIVEREF(__pyx_slice__53);
+  __pyx_tuple__54 = PyTuple_Pack(2, __pyx_int_0, __pyx_slice__53); if (unlikely(!__pyx_tuple__54)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__54);
+  __Pyx_GIVEREF(__pyx_tuple__54);
 
-  /* "pygrib.pyx":1204
+  /* "pygrib.pyx":1196
  *         bytestr = _strencode(key)
  *         name = bytestr
  *         usenceplib = key == 'values' and self.packingType.startswith('grid_complex')             # <<<<<<<<<<<<<<
  *         # this workaround only needed for grib_api < 1.9.16.
  *         if usenceplib:
  */
-  __pyx_k_tuple_107 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__grid_complex)); if (unlikely(!__pyx_k_tuple_107)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_107);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_107));
+  __pyx_tuple__55 = PyTuple_Pack(1, __pyx_n_s_grid_complex); if (unlikely(!__pyx_tuple__55)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__55);
+  __Pyx_GIVEREF(__pyx_tuple__55);
 
-  /* "pygrib.pyx":1234
+  /* "pygrib.pyx":1226
  *                 return longval
  *             else: # array
  *                 if self.has_key('jPointsAreConsecutive') and\             # <<<<<<<<<<<<<<
  *                    self['jPointsAreConsecutive']:
  *                     storageorder='F'
  */
-  __pyx_k_tuple_109 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s_108)); if (unlikely(!__pyx_k_tuple_109)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_109);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_109));
+  __pyx_tuple__56 = PyTuple_Pack(1, __pyx_n_s_jPointsAreConsecutive); if (unlikely(!__pyx_tuple__56)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__56);
+  __Pyx_GIVEREF(__pyx_tuple__56);
 
-  /* "pygrib.pyx":1254
+  /* "pygrib.pyx":1246
  *                 return doubleval
  *             else: # array
  *                 if self.has_key('jPointsAreConsecutive') and\             # <<<<<<<<<<<<<<
  *                    self['jPointsAreConsecutive']:
  *                     storageorder='F'
  */
-  __pyx_k_tuple_110 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s_108)); if (unlikely(!__pyx_k_tuple_110)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_110);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_110));
+  __pyx_tuple__57 = PyTuple_Pack(1, __pyx_n_s_jPointsAreConsecutive); if (unlikely(!__pyx_tuple__57)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__57);
+  __Pyx_GIVEREF(__pyx_tuple__57);
 
-  /* "pygrib.pyx":1318
+  /* "pygrib.pyx":1310
  *         bytestr = b'values'
  *         name = bytestr
  *         usenceplib = self.packingType.startswith('grid_complex')             # <<<<<<<<<<<<<<
  *         # this workaround only needed for grib_api < 1.9.16.
  *         if usenceplib:
  */
-  __pyx_k_tuple_111 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__grid_complex)); if (unlikely(!__pyx_k_tuple_111)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_111);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_111));
+  __pyx_tuple__58 = PyTuple_Pack(1, __pyx_n_s_grid_complex); if (unlikely(!__pyx_tuple__58)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__58);
+  __Pyx_GIVEREF(__pyx_tuple__58);
 
-  /* "pygrib.pyx":1334
+  /* "pygrib.pyx":1326
  *         """private method for reshaping and removing mask from "values" array"""
  *         if datarr.ndim > 2:
  *             raise ValueError('array must be 1d or 2d')             # <<<<<<<<<<<<<<
  *         # if array is masked, put in masked values and convert to plain numpy array.
  *         if ma.isMA(datarr):
  */
-  __pyx_k_tuple_113 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_112)); if (unlikely(!__pyx_k_tuple_113)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_113);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_113));
+  __pyx_tuple__59 = PyTuple_Pack(1, __pyx_kp_s_array_must_be_1d_or_2d); if (unlikely(!__pyx_tuple__59)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__59);
+  __Pyx_GIVEREF(__pyx_tuple__59);
 
-  /* "pygrib.pyx":1339
+  /* "pygrib.pyx":1331
  *             datarr = datarr.filled()
  *         # raise error is expanded reduced grid array is supplied.
  *         if self['gridType'].startswith('reduced'):             # <<<<<<<<<<<<<<
  *             if datarr.ndim != 1:
  *                 raise ValueError("reduced grid data array must be 1d")
  */
-  __pyx_k_tuple_114 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__reduced)); if (unlikely(!__pyx_k_tuple_114)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_114);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_114));
+  __pyx_tuple__60 = PyTuple_Pack(1, __pyx_n_s_reduced); if (unlikely(!__pyx_tuple__60)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__60);
+  __Pyx_GIVEREF(__pyx_tuple__60);
 
-  /* "pygrib.pyx":1341
+  /* "pygrib.pyx":1333
  *         if self['gridType'].startswith('reduced'):
  *             if datarr.ndim != 1:
  *                 raise ValueError("reduced grid data array must be 1d")             # <<<<<<<<<<<<<<
  *         if datarr.ndim == 2:
  *             # check scan modes for rect grids.
  */
-  __pyx_k_tuple_116 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_115)); if (unlikely(!__pyx_k_tuple_116)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_116);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_116));
+  __pyx_tuple__61 = PyTuple_Pack(1, __pyx_kp_s_reduced_grid_data_array_must_be); if (unlikely(!__pyx_tuple__61)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__61);
+  __Pyx_GIVEREF(__pyx_tuple__61);
 
-  /* "pygrib.pyx":1356
+  /* "pygrib.pyx":1348
  *             if self['alternativeRowScanning']:
  *                 datsave = datarr.copy()
  *                 datarr[1::2,::-1] = datsave[1::2,:]             # <<<<<<<<<<<<<<
  *         return datarr
  *     def _reshape_mask(self, datarr):
  */
-  __pyx_k_slice_118 = PySlice_New(__pyx_int_1, Py_None, __pyx_int_2); if (unlikely(!__pyx_k_slice_118)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_slice_118);
-  __Pyx_GIVEREF(__pyx_k_slice_118);
-  __pyx_k_slice_119 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_k_slice_119)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_slice_119);
-  __Pyx_GIVEREF(__pyx_k_slice_119);
-  __pyx_k_tuple_120 = PyTuple_Pack(2, __pyx_k_slice_118, __pyx_k_slice_119); if (unlikely(!__pyx_k_tuple_120)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_120);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_120));
-  __pyx_k_slice_121 = PySlice_New(__pyx_int_1, Py_None, __pyx_int_2); if (unlikely(!__pyx_k_slice_121)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_slice_121);
-  __Pyx_GIVEREF(__pyx_k_slice_121);
-  __pyx_k_slice_122 = PySlice_New(Py_None, Py_None, __pyx_int_neg_1); if (unlikely(!__pyx_k_slice_122)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_slice_122);
-  __Pyx_GIVEREF(__pyx_k_slice_122);
-  __pyx_k_tuple_123 = PyTuple_Pack(2, __pyx_k_slice_121, __pyx_k_slice_122); if (unlikely(!__pyx_k_tuple_123)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_123);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_123));
-
-  /* "pygrib.pyx":1363
+  __pyx_slice__62 = PySlice_New(__pyx_int_1, Py_None, __pyx_int_2); if (unlikely(!__pyx_slice__62)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_slice__62);
+  __Pyx_GIVEREF(__pyx_slice__62);
+  __pyx_slice__63 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__63)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_slice__63);
+  __Pyx_GIVEREF(__pyx_slice__63);
+  __pyx_tuple__64 = PyTuple_Pack(2, __pyx_slice__62, __pyx_slice__63); if (unlikely(!__pyx_tuple__64)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__64);
+  __Pyx_GIVEREF(__pyx_tuple__64);
+  __pyx_slice__65 = PySlice_New(__pyx_int_1, Py_None, __pyx_int_2); if (unlikely(!__pyx_slice__65)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_slice__65);
+  __Pyx_GIVEREF(__pyx_slice__65);
+  __pyx_slice__66 = PySlice_New(Py_None, Py_None, __pyx_int_neg_1); if (unlikely(!__pyx_slice__66)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_slice__66);
+  __Pyx_GIVEREF(__pyx_slice__66);
+  __pyx_tuple__67 = PyTuple_Pack(2, __pyx_slice__65, __pyx_slice__66); if (unlikely(!__pyx_tuple__67)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__67);
+  __Pyx_GIVEREF(__pyx_tuple__67);
+
+  /* "pygrib.pyx":1355
  *         from redtoreg import _redtoreg
  *         if datarr.ndim > 2:
  *             raise ValueError('array must be 1d or 2d')             # <<<<<<<<<<<<<<
  *         # reduced grid.
  *         if self['gridType'].startswith('reduced'):
  */
-  __pyx_k_tuple_124 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_112)); if (unlikely(!__pyx_k_tuple_124)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_124);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_124));
+  __pyx_tuple__68 = PyTuple_Pack(1, __pyx_kp_s_array_must_be_1d_or_2d); if (unlikely(!__pyx_tuple__68)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__68);
+  __Pyx_GIVEREF(__pyx_tuple__68);
 
-  /* "pygrib.pyx":1365
+  /* "pygrib.pyx":1357
  *             raise ValueError('array must be 1d or 2d')
  *         # reduced grid.
  *         if self['gridType'].startswith('reduced'):             # <<<<<<<<<<<<<<
  *             try:
  *                 ny = self['Ny']
  */
-  __pyx_k_tuple_125 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__reduced)); if (unlikely(!__pyx_k_tuple_125)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_125);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_125));
+  __pyx_tuple__69 = PyTuple_Pack(1, __pyx_n_s_reduced); if (unlikely(!__pyx_tuple__69)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__69);
+  __Pyx_GIVEREF(__pyx_tuple__69);
 
-  /* "pygrib.pyx":1370
+  /* "pygrib.pyx":1362
  *             except:
  *                 ny = self['Nj']
  *             if self.has_key('missingValue'):             # <<<<<<<<<<<<<<
  *                 missval = self['missingValue']
  *             else:
  */
-  __pyx_k_tuple_126 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__missingValue)); if (unlikely(!__pyx_k_tuple_126)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_126);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_126));
+  __pyx_tuple__70 = PyTuple_Pack(1, __pyx_n_s_missingValue); if (unlikely(!__pyx_tuple__70)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__70);
+  __Pyx_GIVEREF(__pyx_tuple__70);
 
-  /* "pygrib.pyx":1379
+  /* "pygrib.pyx":1371
  *             else:
  *                 nx = None
  *         elif self.has_key('Nx') and self.has_key('Ny'):             # <<<<<<<<<<<<<<
  *             nx = self['Nx']
  *             ny = self['Ny']
  */
-  __pyx_k_tuple_127 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__Nx)); if (unlikely(!__pyx_k_tuple_127)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_127);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_127));
-  __pyx_k_tuple_128 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__Ny)); if (unlikely(!__pyx_k_tuple_128)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_128);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_128));
+  __pyx_tuple__71 = PyTuple_Pack(1, __pyx_n_s_Nx); if (unlikely(!__pyx_tuple__71)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__71);
+  __Pyx_GIVEREF(__pyx_tuple__71);
+  __pyx_tuple__72 = PyTuple_Pack(1, __pyx_n_s_Ny); if (unlikely(!__pyx_tuple__72)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__72);
+  __Pyx_GIVEREF(__pyx_tuple__72);
 
-  /* "pygrib.pyx":1383
+  /* "pygrib.pyx":1375
  *             ny = self['Ny']
  *         # key renamed from Ni to Nx in grib_api 1.8.0.1
  *         elif self.has_key('Ni') and self.has_key('Nj'):             # <<<<<<<<<<<<<<
  *             nx = self['Ni']
  *             ny = self['Nj']
  */
-  __pyx_k_tuple_129 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__Ni)); if (unlikely(!__pyx_k_tuple_129)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_129);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_129));
-  __pyx_k_tuple_130 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__Nj)); if (unlikely(!__pyx_k_tuple_130)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_130);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_130));
+  __pyx_tuple__73 = PyTuple_Pack(1, __pyx_n_s_Ni); if (unlikely(!__pyx_tuple__73)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__73);
+  __Pyx_GIVEREF(__pyx_tuple__73);
+  __pyx_tuple__74 = PyTuple_Pack(1, __pyx_n_s_Nj); if (unlikely(!__pyx_tuple__74)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__74);
+  __Pyx_GIVEREF(__pyx_tuple__74);
 
-  /* "pygrib.pyx":1405
+  /* "pygrib.pyx":1397
  *            if self['alternativeRowScanning']:
  *                datsave = datarr.copy()
  *                datarr[1::2,:] = datsave[1::2,::-1]             # <<<<<<<<<<<<<<
  *            # if there is a missingValue, and some values missing,
  *            # create a masked array.
  */
-  __pyx_k_slice_131 = PySlice_New(__pyx_int_1, Py_None, __pyx_int_2); if (unlikely(!__pyx_k_slice_131)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_slice_131);
-  __Pyx_GIVEREF(__pyx_k_slice_131);
-  __pyx_k_slice_132 = PySlice_New(Py_None, Py_None, __pyx_int_neg_1); if (unlikely(!__pyx_k_slice_132)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_slice_132);
-  __Pyx_GIVEREF(__pyx_k_slice_132);
-  __pyx_k_tuple_133 = PyTuple_Pack(2, __pyx_k_slice_131, __pyx_k_slice_132); if (unlikely(!__pyx_k_tuple_133)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_133);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_133));
-  __pyx_k_slice_134 = PySlice_New(__pyx_int_1, Py_None, __pyx_int_2); if (unlikely(!__pyx_k_slice_134)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_slice_134);
-  __Pyx_GIVEREF(__pyx_k_slice_134);
-  __pyx_k_slice_135 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_k_slice_135)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_slice_135);
-  __Pyx_GIVEREF(__pyx_k_slice_135);
-  __pyx_k_tuple_136 = PyTuple_Pack(2, __pyx_k_slice_134, __pyx_k_slice_135); if (unlikely(!__pyx_k_tuple_136)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_136);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_136));
-
-  /* "pygrib.pyx":1408
+  __pyx_slice__75 = PySlice_New(__pyx_int_1, Py_None, __pyx_int_2); if (unlikely(!__pyx_slice__75)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_slice__75);
+  __Pyx_GIVEREF(__pyx_slice__75);
+  __pyx_slice__76 = PySlice_New(Py_None, Py_None, __pyx_int_neg_1); if (unlikely(!__pyx_slice__76)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_slice__76);
+  __Pyx_GIVEREF(__pyx_slice__76);
+  __pyx_tuple__77 = PyTuple_Pack(2, __pyx_slice__75, __pyx_slice__76); if (unlikely(!__pyx_tuple__77)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__77);
+  __Pyx_GIVEREF(__pyx_tuple__77);
+  __pyx_slice__78 = PySlice_New(__pyx_int_1, Py_None, __pyx_int_2); if (unlikely(!__pyx_slice__78)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_slice__78);
+  __Pyx_GIVEREF(__pyx_slice__78);
+  __pyx_slice__79 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__79)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_slice__79);
+  __Pyx_GIVEREF(__pyx_slice__79);
+  __pyx_tuple__80 = PyTuple_Pack(2, __pyx_slice__78, __pyx_slice__79); if (unlikely(!__pyx_tuple__80)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__80);
+  __Pyx_GIVEREF(__pyx_tuple__80);
+
+  /* "pygrib.pyx":1400
  *            # if there is a missingValue, and some values missing,
  *            # create a masked array.
  *            if self.has_key('missingValue') and self['numberOfMissing']:             # <<<<<<<<<<<<<<
  *                datarr = ma.masked_values(datarr, self['missingValue'])
  *         return datarr
  */
-  __pyx_k_tuple_137 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__missingValue)); if (unlikely(!__pyx_k_tuple_137)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_137);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_137));
+  __pyx_tuple__81 = PyTuple_Pack(1, __pyx_n_s_missingValue); if (unlikely(!__pyx_tuple__81)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__81);
+  __Pyx_GIVEREF(__pyx_tuple__81);
 
-  /* "pygrib.pyx":1421
+  /* "pygrib.pyx":1413
  *         # check for radius key, if it exists just use it
  *         # and don't bother with shapeOfTheEarth
  *         if self.has_key('radius'):             # <<<<<<<<<<<<<<
  *             projparams['a'] = self['radius']
  *             projparams['b'] = self['radius']
  */
-  __pyx_k_tuple_138 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__radius)); if (unlikely(!__pyx_k_tuple_138)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_138);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_138));
+  __pyx_tuple__82 = PyTuple_Pack(1, __pyx_n_s_radius); if (unlikely(!__pyx_tuple__82)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__82);
+  __Pyx_GIVEREF(__pyx_tuple__82);
 
-  /* "pygrib.pyx":1429
+  /* "pygrib.pyx":1421
  *                 projparams['b']=6371229.0
  *             elif self['shapeOfTheEarth'] in [3,7]:
  *                 if self.has_key('scaleFactorOfMajorAxisOfOblateSpheroidEarth'):             # <<<<<<<<<<<<<<
  *                     scalea = self['scaleFactorOfMajorAxisOfOblateSpheroidEarth']
  *                     scaleb = self['scaleFactorOfMinorAxisOfOblateSpheroidEarth']
  */
-  __pyx_k_tuple_140 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s_139)); if (unlikely(!__pyx_k_tuple_140)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_140);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_140));
+  __pyx_tuple__83 = PyTuple_Pack(1, __pyx_n_s_scaleFactorOfMajorAxisOfOblateSp); if (unlikely(!__pyx_tuple__83)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__83);
+  __Pyx_GIVEREF(__pyx_tuple__83);
 
-  /* "pygrib.pyx":1457
+  /* "pygrib.pyx":1449
  *                 projparams['b']=6356775.0
  *             elif self['shapeOfTheEarth'] == 1:
  *                 if self.has_key('scaleFactorOfRadiusOfSphericalEarth'):             # <<<<<<<<<<<<<<
  *                     scalea = self['scaleFactorOfRadiusOfSphericalEarth']
  *                     if scalea and scalea is not missingvalue_int:
  */
-  __pyx_k_tuple_147 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s_146)); if (unlikely(!__pyx_k_tuple_147)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_147);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_147));
+  __pyx_tuple__84 = PyTuple_Pack(1, __pyx_n_s_scaleFactorOfRadiusOfSphericalEa); if (unlikely(!__pyx_tuple__84)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__84);
+  __Pyx_GIVEREF(__pyx_tuple__84);
 
-  /* "pygrib.pyx":1479
+  /* "pygrib.pyx":1471
  *                 projparams['b']=6371200.0
  *             else:
  *                 if not tolerate_badgrib: raise ValueError('unknown shape of the earth flag')             # <<<<<<<<<<<<<<
  * 
  *         if self['gridType'] in ['reduced_gg','reduced_ll','regular_gg','regular_ll']: # regular lat/lon grid
  */
-  __pyx_k_tuple_150 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_149)); if (unlikely(!__pyx_k_tuple_150)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_150);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_150));
+  __pyx_tuple__85 = PyTuple_Pack(1, __pyx_kp_s_unknown_shape_of_the_earth_flag); if (unlikely(!__pyx_tuple__85)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__85);
+  __Pyx_GIVEREF(__pyx_tuple__85);
 
-  /* "pygrib.pyx":1486
+  /* "pygrib.pyx":1478
  *             projparams['proj']='stere'
  *             projparams['lat_ts']=self['latitudeWhereDxAndDyAreSpecifiedInDegrees']
  *             if self.has_key('projectionCentreFlag'):             # <<<<<<<<<<<<<<
  *                 projcenterflag = self['projectionCentreFlag']
  *             elif self.has_key('projectionCenterFlag'):
  */
-  __pyx_k_tuple_153 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s_152)); if (unlikely(!__pyx_k_tuple_153)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_153);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_153));
+  __pyx_tuple__86 = PyTuple_Pack(1, __pyx_n_s_projectionCentreFlag); if (unlikely(!__pyx_tuple__86)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__86);
+  __Pyx_GIVEREF(__pyx_tuple__86);
 
-  /* "pygrib.pyx":1488
+  /* "pygrib.pyx":1480
  *             if self.has_key('projectionCentreFlag'):
  *                 projcenterflag = self['projectionCentreFlag']
  *             elif self.has_key('projectionCenterFlag'):             # <<<<<<<<<<<<<<
  *                 projcenterflag = self['projectionCenterFlag']
  *             else:
  */
-  __pyx_k_tuple_155 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s_154)); if (unlikely(!__pyx_k_tuple_155)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_155);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_155));
+  __pyx_tuple__87 = PyTuple_Pack(1, __pyx_n_s_projectionCenterFlag); if (unlikely(!__pyx_tuple__87)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__87);
+  __Pyx_GIVEREF(__pyx_tuple__87);
 
-  /* "pygrib.pyx":1491
+  /* "pygrib.pyx":1483
  *                 projcenterflag = self['projectionCenterFlag']
  *             else:
  *                 if not tolerate_badgrib: raise KeyError('cannot find projection center flag')             # <<<<<<<<<<<<<<
  *             if projcenterflag == 0:
  *                 projparams['lat_0']=90.
  */
-  __pyx_k_tuple_157 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_156)); if (unlikely(!__pyx_k_tuple_157)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_157);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_157));
+  __pyx_tuple__88 = PyTuple_Pack(1, __pyx_kp_s_cannot_find_projection_center_fl); if (unlikely(!__pyx_tuple__88)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__88);
+  __Pyx_GIVEREF(__pyx_tuple__88);
+
+  /* "pygrib.pyx":1531
+ *             projparams['proj'] = 'laea'
+ *         elif self['gridType'] == 'mercator':
+ *             scale = self._get_key('grib2divider',False)             # <<<<<<<<<<<<<<
+ *             if scale:
+ *                 scale = float(scale)
+ */
+  __pyx_tuple__89 = PyTuple_Pack(2, __pyx_n_s_grib2divider, Py_False); if (unlikely(!__pyx_tuple__89)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__89);
+  __Pyx_GIVEREF(__pyx_tuple__89);
+
+  /* "pygrib.pyx":1538
+ *             lon1 = self['longitudeOfFirstGridPoint']/scale
+ *             lon2 = self['longitudeOfLastGridPoint']/scale
+ *             if self._get_key('truncateDegrees',False):             # <<<<<<<<<<<<<<
+ *                 lon1 = int(lon1)
+ *                 lon2 = int(lon2)
+ */
+  __pyx_tuple__90 = PyTuple_Pack(2, __pyx_n_s_truncateDegrees, Py_False); if (unlikely(!__pyx_tuple__90)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__90);
+  __Pyx_GIVEREF(__pyx_tuple__90);
+
+  /* "pygrib.pyx":1541
+ *                 lon1 = int(lon1)
+ *                 lon2 = int(lon2)
+ *             if self._get_key('LaD',False):             # <<<<<<<<<<<<<<
+ *                 projparams['lat_ts'] = self['LaD']/scale
+ *             else:
+ */
+  __pyx_tuple__91 = PyTuple_Pack(2, __pyx_n_s_LaD, Py_False); if (unlikely(!__pyx_tuple__91)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__91);
+  __Pyx_GIVEREF(__pyx_tuple__91);
 
-  /* "pygrib.pyx":1599
+  /* "pygrib.pyx":1591
  *             # (distinctLongitudes, distinctLatitudes throws error,
  *             #  so use np.linspace to define values)
  *             if self.packingType.startswith('grid_complex'):             # <<<<<<<<<<<<<<
  *                 # this is not strictly correct for gaussian grids,
  *                 # but the error is very small.
  */
-  __pyx_k_tuple_173 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__grid_complex)); if (unlikely(!__pyx_k_tuple_173)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_173);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_173));
+  __pyx_tuple__92 = PyTuple_Pack(1, __pyx_n_s_grid_complex); if (unlikely(!__pyx_tuple__92)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__92);
+  __Pyx_GIVEREF(__pyx_tuple__92);
 
-  /* "pygrib.pyx":1606
+  /* "pygrib.pyx":1598
  *             else:
  *                 lats = self['distinctLatitudes']
  *                 if lat2 < lat1 and lats[-1] > lats[0]: lats = lats[::-1]             # <<<<<<<<<<<<<<
  *                 lons = self['distinctLongitudes']
  *             # don't trust distinctLongitudes
  */
-  __pyx_k_slice_174 = PySlice_New(Py_None, Py_None, __pyx_int_neg_1); if (unlikely(!__pyx_k_slice_174)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_slice_174);
-  __Pyx_GIVEREF(__pyx_k_slice_174);
+  __pyx_slice__93 = PySlice_New(Py_None, Py_None, __pyx_int_neg_1); if (unlikely(!__pyx_slice__93)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_slice__93);
+  __Pyx_GIVEREF(__pyx_slice__93);
 
-  /* "pygrib.pyx":1619
+  /* "pygrib.pyx":1611
  *                 lat2 = self['latitudeOfLastGridPointInDegrees']
  *                 lats = self['distinctLatitudes']
  *                 if lat2 < lat1 and lats[-1] > lats[0]: lats = lats[::-1]             # <<<<<<<<<<<<<<
  *                 ny = self['Nj']
  *                 nx = 2*ny
  */
-  __pyx_k_slice_175 = PySlice_New(Py_None, Py_None, __pyx_int_neg_1); if (unlikely(!__pyx_k_slice_175)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_slice_175);
-  __Pyx_GIVEREF(__pyx_k_slice_175);
+  __pyx_slice__94 = PySlice_New(Py_None, Py_None, __pyx_int_neg_1); if (unlikely(!__pyx_slice__94)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1611; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_slice__94);
+  __Pyx_GIVEREF(__pyx_slice__94);
 
-  /* "pygrib.pyx":1713
+  /* "pygrib.pyx":1705
  *             if self.projparams['proj'] == 'nsper' and \
  *                self.projparams['a'] != self.projparams['b']:
  *                 raise ValueError('unsupported grid - earth not a perfect sphere')             # <<<<<<<<<<<<<<
  *             scale = float(self['grib2divider'])
  *             # latitude of horizon on central meridian
  */
-  __pyx_k_tuple_179 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_178)); if (unlikely(!__pyx_k_tuple_179)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_179);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_179));
+  __pyx_tuple__95 = PyTuple_Pack(1, __pyx_kp_s_unsupported_grid_earth_not_a_per); if (unlikely(!__pyx_tuple__95)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__95);
+  __Pyx_GIVEREF(__pyx_tuple__95);
+
+  /* "pygrib.pyx":1767
+ *             lons, lats = pj(x, y, inverse=True)
+ *         elif self['gridType'] == 'mercator':
+ *             scale = self._get_key('grib2divider',False)             # <<<<<<<<<<<<<<
+ *             if scale:
+ *                 scale = float(scale)
+ */
+  __pyx_tuple__96 = PyTuple_Pack(2, __pyx_n_s_grib2divider, Py_False); if (unlikely(!__pyx_tuple__96)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__96);
+  __Pyx_GIVEREF(__pyx_tuple__96);
+
+  /* "pygrib.pyx":1774
+ *             lon1 = self['longitudeOfFirstGridPoint']/scale
+ *             lon2 = self['longitudeOfLastGridPoint']/scale
+ *             if self._get_key('truncateDegrees',False):             # <<<<<<<<<<<<<<
+ *                 lon1 = int(lon1)
+ *                 lon2 = int(lon2)
+ */
+  __pyx_tuple__97 = PyTuple_Pack(2, __pyx_n_s_truncateDegrees, Py_False); if (unlikely(!__pyx_tuple__97)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__97);
+  __Pyx_GIVEREF(__pyx_tuple__97);
 
-  /* "pygrib.pyx":1898
+  /* "pygrib.pyx":1779
+ *             lat1 = self['latitudeOfFirstGridPoint']/scale
+ *             lat2 = self['latitudeOfLastGridPoint']/scale
+ *             if self._get_key('truncateDegrees',False):             # <<<<<<<<<<<<<<
+ *                 lat1 = int(lat1)
+ *                 lat2 = int(lat2)
+ */
+  __pyx_tuple__98 = PyTuple_Pack(2, __pyx_n_s_truncateDegrees, Py_False); if (unlikely(!__pyx_tuple__98)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__98);
+  __Pyx_GIVEREF(__pyx_tuple__98);
+
+  /* "pygrib.pyx":1897
  *         if args != ():
  *             # is type is specified, strip it off.
  *             keys = [arg.split(':')[0] for arg in args]             # <<<<<<<<<<<<<<
  *             # if type is declared, save it (None if not declared)
  *             types = []
  */
-  __pyx_k_tuple_184 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_33)); if (unlikely(!__pyx_k_tuple_184)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_184);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_184));
+  __pyx_tuple__100 = PyTuple_Pack(1, __pyx_kp_s__17); if (unlikely(!__pyx_tuple__100)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__100);
+  __Pyx_GIVEREF(__pyx_tuple__100);
 
-  /* "pygrib.pyx":1903
+  /* "pygrib.pyx":1902
  *             for arg in args:
  *                 try:
  *                     type = arg.split(':')[1]             # <<<<<<<<<<<<<<
  *                 except IndexError:
  *                     type = None
  */
-  __pyx_k_tuple_185 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_33)); if (unlikely(!__pyx_k_tuple_185)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_185);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_185));
+  __pyx_tuple__101 = PyTuple_Pack(1, __pyx_kp_s__17); if (unlikely(!__pyx_tuple__101)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__101);
+  __Pyx_GIVEREF(__pyx_tuple__101);
 
   /* "pygrib.pyx":1948
  *         for k,v in kwargs.items():
@@ -29372,9 +31884,9 @@ static int __Pyx_InitCachedConstants(void) {
  *             if self.types is not None:
  *                 typ = self.types[self.keys.index(k)]
  */
-  __pyx_k_tuple_187 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_186)); if (unlikely(!__pyx_k_tuple_187)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_187);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_187));
+  __pyx_tuple__102 = PyTuple_Pack(1, __pyx_kp_s_key_not_part_of_grib_index); if (unlikely(!__pyx_tuple__102)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__102);
+  __Pyx_GIVEREF(__pyx_tuple__102);
 
   /* "pygrib.pyx":1979
  *                     raise RuntimeError(grib_get_error_message(err))
@@ -29383,9 +31895,9 @@ static int __Pyx_InitCachedConstants(void) {
  *         # if no matches found, raise an error.
  *         if sizetot == 0:
  */
-  __pyx_k_tuple_189 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_188)); if (unlikely(!__pyx_k_tuple_189)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_189);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_189));
+  __pyx_tuple__103 = PyTuple_Pack(1, __pyx_kp_s_value_must_be_float_int_or_strin); if (unlikely(!__pyx_tuple__103)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__103);
+  __Pyx_GIVEREF(__pyx_tuple__103);
 
   /* "pygrib.pyx":1982
  *         # if no matches found, raise an error.
@@ -29394,9 +31906,9 @@ static int __Pyx_InitCachedConstants(void) {
  *         # create a list of grib messages corresponding to selection.
  *         messagenumber = 0; grbs = []
  */
-  __pyx_k_tuple_190 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_12)); if (unlikely(!__pyx_k_tuple_190)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_190);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_190));
+  __pyx_tuple__104 = PyTuple_Pack(1, __pyx_kp_s_no_matches_found); if (unlikely(!__pyx_tuple__104)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__104);
+  __Pyx_GIVEREF(__pyx_tuple__104);
 
   /* "pygrib.pyx":1996
  *                 raise RuntimeError(grib_get_error_message(err))
@@ -29405,140 +31917,140 @@ static int __Pyx_InitCachedConstants(void) {
  *         # return the list of grib messages.
  *         return grbs
  */
-  __pyx_k_tuple_191 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_12)); if (unlikely(!__pyx_k_tuple_191)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_191);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_191));
+  __pyx_tuple__105 = PyTuple_Pack(1, __pyx_kp_s_no_matches_found); if (unlikely(!__pyx_tuple__105)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__105);
+  __Pyx_GIVEREF(__pyx_tuple__105);
 
-  /* "pygrib.pyx":190
+  /* "pygrib.pyx":184
  *         from mpl_toolkits.basemap import pyproj
  *     except:
  *         raise ImportError("either pyproj or basemap required")             # <<<<<<<<<<<<<<
  * from ncepgrib2 import Grib2Decode
  * import_array()
  */
-  __pyx_k_tuple_196 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_195)); if (unlikely(!__pyx_k_tuple_196)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_196);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_196));
+  __pyx_tuple__106 = PyTuple_Pack(1, __pyx_kp_s_either_pyproj_or_basemap_require); if (unlikely(!__pyx_tuple__106)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__106);
+  __Pyx_GIVEREF(__pyx_tuple__106);
 
-  /* "pygrib.pyx":304
+  /* "pygrib.pyx":298
  * #missingvalue_float = GRIB_MISSING_DOUBLE
  * missingvalue_float = -1.e100 # value given in grib_api.h version 1.90
  * def _get_grib_api_version():             # <<<<<<<<<<<<<<
  *     div = lambda v,d: (v/d,v%d)
  *     v = grib_get_api_version()
  */
-  __pyx_k_tuple_197 = PyTuple_Pack(5, ((PyObject *)__pyx_n_s__div), ((PyObject *)__pyx_n_s__v), ((PyObject *)__pyx_n_s__revision), ((PyObject *)__pyx_n_s__minor), ((PyObject *)__pyx_n_s__major)); if (unlikely(!__pyx_k_tuple_197)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_197);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_197));
-  __pyx_k_codeobj_198 = (PyObject*)__Pyx_PyCode_New(0, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_197, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_200, __pyx_n_s_199, 304, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_198)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_tuple__107 = PyTuple_Pack(5, __pyx_n_s_div, __pyx_n_s_v, __pyx_n_s_revision, __pyx_n_s_minor, __pyx_n_s_major); if (unlikely(!__pyx_tuple__107)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__107);
+  __Pyx_GIVEREF(__pyx_tuple__107);
+  __pyx_codeobj__108 = (PyObject*)__Pyx_PyCode_New(0, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__107, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Volumes_User_jwhitaker_python_p, __pyx_n_s_get_grib_api_version, 298, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__108)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
-  /* "pygrib.pyx":314
+  /* "pygrib.pyx":308
  * tolerate_badgrib = False
  * 
  * def tolerate_badgrib_on():             # <<<<<<<<<<<<<<
  *     """
  *     don't raise an exception when a missing or malformed key is encountered.
  */
-  __pyx_k_codeobj_201 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_200, __pyx_n_s__tolerate_badgrib_on, 314, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_201)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_codeobj__109 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Volumes_User_jwhitaker_python_p, __pyx_n_s_tolerate_badgrib_on, 308, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__109)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
-  /* "pygrib.pyx":321
+  /* "pygrib.pyx":315
  *     tolerate_badgrib = True
  * 
  * def tolerate_badgrib_off():             # <<<<<<<<<<<<<<
  *     """
  *     raise an exception when a missing or malformed key is encountered
  */
-  __pyx_k_codeobj_202 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_200, __pyx_n_s_203, 321, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_202)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_codeobj__110 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Volumes_User_jwhitaker_python_p, __pyx_n_s_tolerate_badgrib_off, 315, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__110)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
-  /* "pygrib.pyx":329
+  /* "pygrib.pyx":323
  *     tolerate_badgrib = False
  * 
  * def gaulats(object nlats):             # <<<<<<<<<<<<<<
  *     """
  *     gaulats(nlats)
  */
-  __pyx_k_tuple_204 = PyTuple_Pack(2, ((PyObject *)__pyx_n_s__nlats), ((PyObject *)__pyx_n_s__lats)); if (unlikely(!__pyx_k_tuple_204)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_204);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_204));
-  __pyx_k_codeobj_205 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_204, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_200, __pyx_n_s__gaulats, 329, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_205)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_tuple__111 = PyTuple_Pack(2, __pyx_n_s_nlats, __pyx_n_s_lats); if (unlikely(!__pyx_tuple__111)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__111);
+  __Pyx_GIVEREF(__pyx_tuple__111);
+  __pyx_codeobj__112 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__111, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Volumes_User_jwhitaker_python_p, __pyx_n_s_gaulats, 323, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__112)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
-  /* "pygrib.pyx":360
+  /* "pygrib.pyx":354
  * grib_multi_support_on(NULL)
  * 
  * def multi_support_on():             # <<<<<<<<<<<<<<
  *     """turn on support for multi-field grib messages (default)"""
  *     grib_multi_support_on(NULL)
  */
-  __pyx_k_codeobj_207 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_200, __pyx_n_s__multi_support_on, 360, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_207)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_codeobj__113 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Volumes_User_jwhitaker_python_p, __pyx_n_s_multi_support_on, 354, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__113)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
-  /* "pygrib.pyx":364
+  /* "pygrib.pyx":358
  *     grib_multi_support_on(NULL)
  * 
  * def multi_support_off():             # <<<<<<<<<<<<<<
  *     """turn off support for multi-field grib messages"""
  *     grib_multi_support_off(NULL)
  */
-  __pyx_k_codeobj_208 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_200, __pyx_n_s__multi_support_off, 364, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_208)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_codeobj__114 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Volumes_User_jwhitaker_python_p, __pyx_n_s_multi_support_off, 358, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__114)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
-  /* "pygrib.pyx":643
+  /* "pygrib.pyx":637
  * ['_gh','fcstimeunits','expand_reduced','projparams','messagenumber','_all_keys','_ro_keys']
  * 
  * def julian_to_datetime(object jd):             # <<<<<<<<<<<<<<
  *     """
  *     julian_to_datetime(julday)
  */
-  __pyx_k_tuple_209 = PyTuple_Pack(9, ((PyObject *)__pyx_n_s__jd), ((PyObject *)__pyx_n_s__julday), ((PyObject *)__pyx_n_s__year), ((PyObject *)__pyx_n_s__month), ((PyObject *)__pyx_n_s__day), ((PyObject *)__pyx_n_s__hour), ((PyObject *)__pyx_n_s__minute), ((PyObject *)__pyx_n_s__second), ((PyObject *)__pyx_n_s__err)); if (unlikely(!__pyx_k_tuple_209)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_209);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_209));
-  __pyx_k_codeobj_210 = (PyObject*)__Pyx_PyCode_New(1, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_209, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_200, __pyx_n_s__julian_to_datetime, 643, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_210)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_tuple__115 = PyTuple_Pack(9, __pyx_n_s_jd, __pyx_n_s_julday, __pyx_n_s_year, __pyx_n_s_month, __pyx_n_s_day, __pyx_n_s_hour, __pyx_n_s_minute, __pyx_n_s_second, __pyx_n_s_err); if (unlikely(!__pyx_tuple__115)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__115);
+  __Pyx_GIVEREF(__pyx_tuple__115);
+  __pyx_codeobj__116 = (PyObject*)__Pyx_PyCode_New(1, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__115, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Volumes_User_jwhitaker_python_p, __pyx_n_s_julian_to_datetime, 637, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__116)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
-  /* "pygrib.pyx":660
+  /* "pygrib.pyx":654
  *     return datetime(year, month, day, hour, minute, second)
  * 
  * def datetime_to_julian(object d):             # <<<<<<<<<<<<<<
  *     """
  *     datetime_to_julian(date)
  */
-  __pyx_k_tuple_211 = PyTuple_Pack(9, ((PyObject *)__pyx_n_s__d), ((PyObject *)__pyx_n_s__julday), ((PyObject *)__pyx_n_s__err), ((PyObject *)__pyx_n_s__year), ((PyObject *)__pyx_n_s__month), ((PyObject *)__pyx_n_s__day), ((PyObject *)__pyx_n_s__hour), ((PyObject *)__pyx_n_s__minute), ((PyObject *)__pyx_n_s__second)); if (unlikely(!__pyx_k_tuple_211)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_211);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_211));
-  __pyx_k_codeobj_212 = (PyObject*)__Pyx_PyCode_New(1, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_211, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_200, __pyx_n_s__datetime_to_julian, 660, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_212)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_tuple__117 = PyTuple_Pack(9, __pyx_n_s_d, __pyx_n_s_julday, __pyx_n_s_err, __pyx_n_s_year, __pyx_n_s_month, __pyx_n_s_day, __pyx_n_s_hour, __pyx_n_s_minute, __pyx_n_s_second); if (unlikely(!__pyx_tuple__117)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__117);
+  __Pyx_GIVEREF(__pyx_tuple__117);
+  __pyx_codeobj__118 = (PyObject*)__Pyx_PyCode_New(1, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__117, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Volumes_User_jwhitaker_python_p, __pyx_n_s_datetime_to_julian, 654, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__118)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
-  /* "pygrib.pyx":686
+  /* "pygrib.pyx":680
  *     return setdates(grb)
  * 
  * def fromstring(gribstring):             # <<<<<<<<<<<<<<
  *     """
  *     fromstring(string)
  */
-  __pyx_k_tuple_213 = PyTuple_Pack(4, ((PyObject *)__pyx_n_s__gribstring), ((PyObject *)__pyx_n_s__gribstr), ((PyObject *)__pyx_n_s__gh), ((PyObject *)__pyx_n_s__grb)); if (unlikely(!__pyx_k_tuple_213)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_213);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_213));
-  __pyx_k_codeobj_214 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_213, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_200, __pyx_n_s__fromstring, 686, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_214)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_tuple__119 = PyTuple_Pack(4, __pyx_n_s_gribstring, __pyx_n_s_gribstr, __pyx_n_s_gh_2, __pyx_n_s_grb); if (unlikely(!__pyx_tuple__119)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__119);
+  __Pyx_GIVEREF(__pyx_tuple__119);
+  __pyx_codeobj__120 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__119, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Volumes_User_jwhitaker_python_p, __pyx_n_s_fromstring, 680, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__120)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
-  /* "pygrib.pyx":707
+  /* "pygrib.pyx":701
  *     return setdates(grb)
  * 
  * def setdates(gribmessage grb):             # <<<<<<<<<<<<<<
  *     """
  *     setdates(grb)
  */
-  __pyx_k_tuple_215 = PyTuple_Pack(2, ((PyObject *)__pyx_n_s__grb), ((PyObject *)__pyx_n_s__ftime)); if (unlikely(!__pyx_k_tuple_215)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_215);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_215));
-  __pyx_k_codeobj_216 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_215, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_200, __pyx_n_s__setdates, 707, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_216)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_tuple__121 = PyTuple_Pack(2, __pyx_n_s_grb, __pyx_n_s_ftime); if (unlikely(!__pyx_tuple__121)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__121);
+  __Pyx_GIVEREF(__pyx_tuple__121);
+  __pyx_codeobj__122 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__121, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Volumes_User_jwhitaker_python_p, __pyx_n_s_setdates, 701, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__122)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
-  /* "pygrib.pyx":788
+  /* "pygrib.pyx":782
  *     return grb
  * 
  * def reload(gribmessage grb):             # <<<<<<<<<<<<<<
  *     """
  *     reload(grb)
  */
-  __pyx_k_tuple_217 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__grb)); if (unlikely(!__pyx_k_tuple_217)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_217);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_217));
-  __pyx_k_codeobj_218 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_217, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_200, __pyx_n_s__reload, 788, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_218)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_tuple__123 = PyTuple_Pack(1, __pyx_n_s_grb); if (unlikely(!__pyx_tuple__123)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__123);
+  __Pyx_GIVEREF(__pyx_tuple__123);
+  __pyx_codeobj__124 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__123, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Volumes_User_jwhitaker_python_p, __pyx_n_s_reload, 782, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__124)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
   /* "pygrib.pyx":2024
  *             grib_index_delete(self._gi)
@@ -29547,10 +32059,10 @@ static int __Pyx_InitCachedConstants(void) {
  *     if type(a) == str or type(a) == bytes or type(a) == unicode:
  *         return True
  */
-  __pyx_k_tuple_219 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__a)); if (unlikely(!__pyx_k_tuple_219)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_219);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_219));
-  __pyx_k_codeobj_220 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_219, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_200, __pyx_n_s___is_stringlike, 2024, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_220)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_tuple__125 = PyTuple_Pack(1, __pyx_n_s_a); if (unlikely(!__pyx_tuple__125)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__125);
+  __Pyx_GIVEREF(__pyx_tuple__125);
+  __pyx_codeobj__126 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__125, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Volumes_User_jwhitaker_python_p, __pyx_n_s_is_stringlike, 2024, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__126)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
   /* "pygrib.pyx":2030
  *         return False
@@ -29559,10 +32071,10 @@ static int __Pyx_InitCachedConstants(void) {
  *     # is object container-like?  (can test for
  *     # membership with "is in", but not a string)
  */
-  __pyx_k_tuple_221 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__a)); if (unlikely(!__pyx_k_tuple_221)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2030; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_221);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_221));
-  __pyx_k_codeobj_222 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_221, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_200, __pyx_n_s___is_container, 2030, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_222)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2030; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_tuple__127 = PyTuple_Pack(1, __pyx_n_s_a); if (unlikely(!__pyx_tuple__127)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2030; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__127);
+  __Pyx_GIVEREF(__pyx_tuple__127);
+  __pyx_codeobj__128 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__127, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Volumes_User_jwhitaker_python_p, __pyx_n_s_is_container, 2030, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__128)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2030; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
   /* "pygrib.pyx":2038
  *     return True
@@ -29571,10 +32083,10 @@ static int __Pyx_InitCachedConstants(void) {
  *     # search for key/value matches in grib message.
  *     # If value is a container-like object, search for matches to any element.
  */
-  __pyx_k_tuple_223 = PyTuple_Pack(7, ((PyObject *)__pyx_n_s__grb), ((PyObject *)__pyx_n_s__kwargs), ((PyObject *)__pyx_n_s__kwargs), ((PyObject *)__pyx_n_s__k), ((PyObject *)__pyx_n_s__v), ((PyObject *)__pyx_n_s__iscontainer), ((PyObject *)__pyx_n_s__iscallable)); if (unlikely(!__pyx_k_tuple_223)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_223);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_223));
-  __pyx_k_codeobj_224 = (PyObject*)__Pyx_PyCode_New(1, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_223, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_200, __pyx_n_s___find, 2038, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_224)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_tuple__129 = PyTuple_Pack(6, __pyx_n_s_grb, __pyx_n_s_kwargs, __pyx_n_s_k, __pyx_n_s_v, __pyx_n_s_iscontainer, __pyx_n_s_iscallable); if (unlikely(!__pyx_tuple__129)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__129);
+  __Pyx_GIVEREF(__pyx_tuple__129);
+  __pyx_codeobj__130 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__129, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Volumes_User_jwhitaker_python_p, __pyx_n_s_find, 2038, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__130)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_RefNannyFinishContext();
   return 0;
   __pyx_L1_error:;
@@ -29584,21 +32096,48 @@ static int __Pyx_InitCachedConstants(void) {
 
 static int __Pyx_InitGlobals(void) {
   if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __pyx_int_6 = PyInt_FromLong(6); if (unlikely(!__pyx_int_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __pyx_int_7 = PyInt_FromLong(7); if (unlikely(!__pyx_int_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __pyx_int_8 = PyInt_FromLong(8); if (unlikely(!__pyx_int_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __pyx_int_100 = PyInt_FromLong(100); if (unlikely(!__pyx_int_100)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __pyx_int_255 = PyInt_FromLong(255); if (unlikely(!__pyx_int_255)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __pyx_int_360 = PyInt_FromLong(360); if (unlikely(!__pyx_int_360)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __pyx_int_1000 = PyInt_FromLong(1000); if (unlikely(!__pyx_int_1000)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __pyx_int_10900 = PyInt_FromLong(10900); if (unlikely(!__pyx_int_10900)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+  __pyx_float_0_ = PyFloat_FromDouble(0.); if (unlikely(!__pyx_float_0_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_float_1_ = PyFloat_FromDouble(1.); if (unlikely(!__pyx_float_1_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_float_2_ = PyFloat_FromDouble(2.); if (unlikely(!__pyx_float_2_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_float_4_ = PyFloat_FromDouble(4.); if (unlikely(!__pyx_float_4_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_float_8_ = PyFloat_FromDouble(8.); if (unlikely(!__pyx_float_8_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_float_0_5 = PyFloat_FromDouble(0.5); if (unlikely(!__pyx_float_0_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_float_24_ = PyFloat_FromDouble(24.); if (unlikely(!__pyx_float_24_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_float_90_ = PyFloat_FromDouble(90.); if (unlikely(!__pyx_float_90_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_float_1_e3 = PyFloat_FromDouble(1.e3); if (unlikely(!__pyx_float_1_e3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_float_1_e6 = PyFloat_FromDouble(1.e6); if (unlikely(!__pyx_float_1_e6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_float_10_0 = PyFloat_FromDouble(10.0); if (unlikely(!__pyx_float_10_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_float_180_ = PyFloat_FromDouble(180.); if (unlikely(!__pyx_float_180_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_float_1_e20 = PyFloat_FromDouble(1.e20); if (unlikely(!__pyx_float_1_e20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_float_1_e30 = PyFloat_FromDouble(1.e30); if (unlikely(!__pyx_float_1_e30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_float_1000_ = PyFloat_FromDouble(1000.); if (unlikely(!__pyx_float_1000_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_float_1440_ = PyFloat_FromDouble(1440.); if (unlikely(!__pyx_float_1440_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_float_86400_ = PyFloat_FromDouble(86400.); if (unlikely(!__pyx_float_86400_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_float_6356775_0 = PyFloat_FromDouble(6356775.0); if (unlikely(!__pyx_float_6356775_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_float_6367470_0 = PyFloat_FromDouble(6367470.0); if (unlikely(!__pyx_float_6367470_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_float_6371200_0 = PyFloat_FromDouble(6371200.0); if (unlikely(!__pyx_float_6371200_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_float_6371229_0 = PyFloat_FromDouble(6371229.0); if (unlikely(!__pyx_float_6371229_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_float_6378137_0 = PyFloat_FromDouble(6378137.0); if (unlikely(!__pyx_float_6378137_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_float_6378160_0 = PyFloat_FromDouble(6378160.0); if (unlikely(!__pyx_float_6378160_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_float_6356752_3142 = PyFloat_FromDouble(6356752.3142); if (unlikely(!__pyx_float_6356752_3142)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_float_neg_0_5 = PyFloat_FromDouble(-0.5); if (unlikely(!__pyx_float_neg_0_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_float_neg_90_ = PyFloat_FromDouble(-90.); if (unlikely(!__pyx_float_neg_90_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_float_neg_1_e100 = PyFloat_FromDouble(-1.e100); if (unlikely(!__pyx_float_neg_1_e100)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_int_6 = PyInt_FromLong(6); if (unlikely(!__pyx_int_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_int_7 = PyInt_FromLong(7); if (unlikely(!__pyx_int_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_int_8 = PyInt_FromLong(8); if (unlikely(!__pyx_int_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_int_100 = PyInt_FromLong(100); if (unlikely(!__pyx_int_100)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_int_255 = PyInt_FromLong(255); if (unlikely(!__pyx_int_255)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_int_360 = PyInt_FromLong(360); if (unlikely(!__pyx_int_360)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_int_1000 = PyInt_FromLong(1000); if (unlikely(!__pyx_int_1000)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_int_10900 = PyInt_FromLong(10900L); if (unlikely(!__pyx_int_10900)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   return 0;
   __pyx_L1_error:;
   return -1;
@@ -29661,34 +32200,34 @@ PyMODINIT_FUNC PyInit_pygrib(void)
   #endif
   /*--- Module creation code ---*/
   #if PY_MAJOR_VERSION < 3
-  __pyx_m = Py_InitModule4(__Pyx_NAMESTR("pygrib"), __pyx_methods, __Pyx_DOCSTR(__pyx_k_192), 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
+  __pyx_m = Py_InitModule4("pygrib", __pyx_methods, __pyx_k_Introduction_Python_module_for, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
   #else
   __pyx_m = PyModule_Create(&__pyx_moduledef);
   #endif
   if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   Py_INCREF(__pyx_d);
-  #if PY_MAJOR_VERSION >= 3
-  {
-    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    if (!PyDict_GetItemString(modules, "pygrib")) {
-      if (unlikely(PyDict_SetItemString(modules, "pygrib", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    }
-  }
-  #endif
-  __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   #if CYTHON_COMPILING_IN_PYPY
   Py_INCREF(__pyx_b);
   #endif
-  if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
   /*--- Initialize various global constants etc. ---*/
   if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
   if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   #endif
   if (__pyx_module_is_main_pygrib) {
-    if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+  }
+  #if PY_MAJOR_VERSION >= 3
+  {
+    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (!PyDict_GetItemString(modules, "pygrib")) {
+      if (unlikely(PyDict_SetItemString(modules, "pygrib", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    }
   }
+  #endif
   /*--- Builtin init code ---*/
   if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   /*--- Constants init code ---*/
@@ -29697,11 +32236,26 @@ PyMODINIT_FUNC PyInit_pygrib(void)
   /*--- Variable export code ---*/
   /*--- Function export code ---*/
   /*--- Type init code ---*/
-  __pyx_ptype_6pygrib_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_6pygrib_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyType_Ready(&__pyx_type_6pygrib_gribmessage) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_ptype_6pygrib_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_6pygrib_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyType_Ready(&__pyx_type_6pygrib_open) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_type_6pygrib_open.tp_print = 0;
+  #if CYTHON_COMPILING_IN_CPYTHON
+  {
+    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_6pygrib_open, "__call__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
+      __pyx_wrapperbase_6pygrib_4open_10__call__ = *((PyWrapperDescrObject *)wrapper)->d_base;
+      __pyx_wrapperbase_6pygrib_4open_10__call__.doc = __pyx_doc_6pygrib_4open_10__call__;
+      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_6pygrib_4open_10__call__;
+    }
+  }
+  #endif
+  if (PyObject_SetAttrString(__pyx_m, "open", (PyObject *)&__pyx_type_6pygrib_open) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_ptype_6pygrib_open = &__pyx_type_6pygrib_open;
+  if (PyType_Ready(&__pyx_type_6pygrib_gribmessage) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_type_6pygrib_gribmessage.tp_print = 0;
   #if CYTHON_COMPILING_IN_CPYTHON
   {
-    PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_6pygrib_gribmessage, "__repr__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_6pygrib_gribmessage, "__repr__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
       __pyx_wrapperbase_6pygrib_11gribmessage_8__repr__ = *((PyWrapperDescrObject *)wrapper)->d_base;
       __pyx_wrapperbase_6pygrib_11gribmessage_8__repr__.doc = __pyx_doc_6pygrib_11gribmessage_8__repr__;
@@ -29711,7 +32265,7 @@ PyMODINIT_FUNC PyInit_pygrib(void)
   #endif
   #if CYTHON_COMPILING_IN_CPYTHON
   {
-    PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_6pygrib_gribmessage, "__setitem__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_6pygrib_gribmessage, "__setitem__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
       __pyx_wrapperbase_6pygrib_11gribmessage_22__setitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
       __pyx_wrapperbase_6pygrib_11gribmessage_22__setitem__.doc = __pyx_doc_6pygrib_11gribmessage_22__setitem__;
@@ -29721,7 +32275,7 @@ PyMODINIT_FUNC PyInit_pygrib(void)
   #endif
   #if CYTHON_COMPILING_IN_CPYTHON
   {
-    PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_6pygrib_gribmessage, "__getitem__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_6pygrib_gribmessage, "__getitem__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
       __pyx_wrapperbase_6pygrib_11gribmessage_24__getitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
       __pyx_wrapperbase_6pygrib_11gribmessage_24__getitem__.doc = __pyx_doc_6pygrib_11gribmessage_24__getitem__;
@@ -29729,25 +32283,13 @@ PyMODINIT_FUNC PyInit_pygrib(void)
     }
   }
   #endif
-  if (__Pyx_SetAttrString(__pyx_m, "gribmessage", (PyObject *)&__pyx_type_6pygrib_gribmessage) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyObject_SetAttrString(__pyx_m, "gribmessage", (PyObject *)&__pyx_type_6pygrib_gribmessage) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_ptype_6pygrib_gribmessage = &__pyx_type_6pygrib_gribmessage;
-  if (PyType_Ready(&__pyx_type_6pygrib_open) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  #if CYTHON_COMPILING_IN_CPYTHON
-  {
-    PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_6pygrib_open, "__call__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
-      __pyx_wrapperbase_6pygrib_4open_10__call__ = *((PyWrapperDescrObject *)wrapper)->d_base;
-      __pyx_wrapperbase_6pygrib_4open_10__call__.doc = __pyx_doc_6pygrib_4open_10__call__;
-      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_6pygrib_4open_10__call__;
-    }
-  }
-  #endif
-  if (__Pyx_SetAttrString(__pyx_m, "open", (PyObject *)&__pyx_type_6pygrib_open) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_6pygrib_open = &__pyx_type_6pygrib_open;
-  if (PyType_Ready(&__pyx_type_6pygrib_index) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyType_Ready(&__pyx_type_6pygrib_index) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_type_6pygrib_index.tp_print = 0;
   #if CYTHON_COMPILING_IN_CPYTHON
   {
-    PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_6pygrib_index, "__call__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_6pygrib_index, "__call__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
       __pyx_wrapperbase_6pygrib_5index_4__call__ = *((PyWrapperDescrObject *)wrapper)->d_base;
       __pyx_wrapperbase_6pygrib_5index_4__call__.doc = __pyx_doc_6pygrib_5index_4__call__;
@@ -29755,107 +32297,107 @@ PyMODINIT_FUNC PyInit_pygrib(void)
     }
   }
   #endif
-  if (__Pyx_SetAttrString(__pyx_m, "index", (PyObject *)&__pyx_type_6pygrib_index) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyObject_SetAttrString(__pyx_m, "index", (PyObject *)&__pyx_type_6pygrib_index) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_ptype_6pygrib_index = &__pyx_type_6pygrib_index;
   /*--- Type import code ---*/
   /*--- Variable import code ---*/
   /*--- Function import code ---*/
   /*--- Execution code ---*/
 
-  /* "pygrib.pyx":176
+  /* "pygrib.pyx":170
  * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  * PERFORMANCE OF THIS SOFTWARE."""
  * __test__ = None             # <<<<<<<<<<<<<<
  * del __test__ # hack so epydoc doesn't show __test__
- * __version__ = '1.9.9'
+ * __version__ = '2.0.0'
  */
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s____test__, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
-  /* "pygrib.pyx":177
+  /* "pygrib.pyx":171
  * PERFORMANCE OF THIS SOFTWARE."""
  * __test__ = None
  * del __test__ # hack so epydoc doesn't show __test__             # <<<<<<<<<<<<<<
- * __version__ = '1.9.9'
+ * __version__ = '2.0.0'
  * 
  */
-  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s____test__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_test) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
-  /* "pygrib.pyx":178
+  /* "pygrib.pyx":172
  * __test__ = None
  * del __test__ # hack so epydoc doesn't show __test__
- * __version__ = '1.9.9'             # <<<<<<<<<<<<<<
+ * __version__ = '2.0.0'             # <<<<<<<<<<<<<<
  * 
  * import numpy as np
  */
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s____version__, ((PyObject *)__pyx_kp_s_193)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_version, __pyx_kp_s_2_0_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
-  /* "pygrib.pyx":180
- * __version__ = '1.9.9'
+  /* "pygrib.pyx":174
+ * __version__ = '2.0.0'
  * 
  * import numpy as np             # <<<<<<<<<<<<<<
  * import warnings
  * from datetime import datetime
  */
-  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__numpy), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s__np, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "pygrib.pyx":181
+  /* "pygrib.pyx":175
  * 
  * import numpy as np
  * import warnings             # <<<<<<<<<<<<<<
  * from datetime import datetime
  * from numpy import ma
  */
-  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__warnings), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_warnings, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s__warnings, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_warnings, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "pygrib.pyx":182
+  /* "pygrib.pyx":176
  * import numpy as np
  * import warnings
  * from datetime import datetime             # <<<<<<<<<<<<<<
  * from numpy import ma
  * try:
  */
-  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__datetime));
-  PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__datetime));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__datetime));
-  __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s__datetime), ((PyObject *)__pyx_t_1), -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_INCREF(__pyx_n_s_datetime);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_datetime);
+  __Pyx_GIVEREF(__pyx_n_s_datetime);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_datetime, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
-  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s__datetime); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_datetime); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s__datetime, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_datetime, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pygrib.pyx":183
+  /* "pygrib.pyx":177
  * import warnings
  * from datetime import datetime
  * from numpy import ma             # <<<<<<<<<<<<<<
  * try:
  *     import pyproj
  */
-  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__ma));
-  PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_n_s__ma));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ma));
-  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__numpy), ((PyObject *)__pyx_t_2), -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_INCREF(__pyx_n_s_ma);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_ma);
+  __Pyx_GIVEREF(__pyx_n_s_ma);
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
-  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s__ma); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_ma); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s__ma, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ma, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "pygrib.pyx":184
+  /* "pygrib.pyx":178
  * from datetime import datetime
  * from numpy import ma
  * try:             # <<<<<<<<<<<<<<
@@ -29869,16 +32411,16 @@ PyMODINIT_FUNC PyInit_pygrib(void)
     __Pyx_XGOTREF(__pyx_t_5);
     /*try:*/ {
 
-      /* "pygrib.pyx":185
+      /* "pygrib.pyx":179
  * from numpy import ma
  * try:
  *     import pyproj             # <<<<<<<<<<<<<<
  * except ImportError:
  *     try:
  */
-      __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__pyproj), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L2_error;}
+      __pyx_t_1 = __Pyx_Import(__pyx_n_s_pyproj, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L2_error;}
       __Pyx_GOTREF(__pyx_t_1);
-      if (PyDict_SetItem(__pyx_d, __pyx_n_s__pyproj, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L2_error;}
+      if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyproj, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L2_error;}
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     }
     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
@@ -29889,7 +32431,7 @@ PyMODINIT_FUNC PyInit_pygrib(void)
     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-    /* "pygrib.pyx":186
+    /* "pygrib.pyx":180
  * try:
  *     import pyproj
  * except ImportError:             # <<<<<<<<<<<<<<
@@ -29899,12 +32441,12 @@ PyMODINIT_FUNC PyInit_pygrib(void)
     __pyx_t_6 = PyErr_ExceptionMatches(__pyx_builtin_ImportError);
     if (__pyx_t_6) {
       __Pyx_AddTraceback("pygrib", __pyx_clineno, __pyx_lineno, __pyx_filename);
-      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L4_except_error;}
+      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L4_except_error;}
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_GOTREF(__pyx_t_2);
       __Pyx_GOTREF(__pyx_t_7);
 
-      /* "pygrib.pyx":187
+      /* "pygrib.pyx":181
  *     import pyproj
  * except ImportError:
  *     try:             # <<<<<<<<<<<<<<
@@ -29918,24 +32460,24 @@ PyMODINIT_FUNC PyInit_pygrib(void)
         __Pyx_XGOTREF(__pyx_t_10);
         /*try:*/ {
 
-          /* "pygrib.pyx":188
+          /* "pygrib.pyx":182
  * except ImportError:
  *     try:
  *         from mpl_toolkits.basemap import pyproj             # <<<<<<<<<<<<<<
  *     except:
  *         raise ImportError("either pyproj or basemap required")
  */
-          __pyx_t_11 = PyList_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L12_error;}
+          __pyx_t_11 = PyList_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L12_error;}
           __Pyx_GOTREF(__pyx_t_11);
-          __Pyx_INCREF(((PyObject *)__pyx_n_s__pyproj));
-          PyList_SET_ITEM(__pyx_t_11, 0, ((PyObject *)__pyx_n_s__pyproj));
-          __Pyx_GIVEREF(((PyObject *)__pyx_n_s__pyproj));
-          __pyx_t_12 = __Pyx_Import(((PyObject *)__pyx_n_s_194), ((PyObject *)__pyx_t_11), -1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L12_error;}
+          __Pyx_INCREF(__pyx_n_s_pyproj);
+          PyList_SET_ITEM(__pyx_t_11, 0, __pyx_n_s_pyproj);
+          __Pyx_GIVEREF(__pyx_n_s_pyproj);
+          __pyx_t_12 = __Pyx_Import(__pyx_n_s_mpl_toolkits_basemap, __pyx_t_11, -1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L12_error;}
           __Pyx_GOTREF(__pyx_t_12);
-          __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
-          __pyx_t_11 = __Pyx_ImportFrom(__pyx_t_12, __pyx_n_s__pyproj); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L12_error;}
+          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+          __pyx_t_11 = __Pyx_ImportFrom(__pyx_t_12, __pyx_n_s_pyproj); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L12_error;}
           __Pyx_GOTREF(__pyx_t_11);
-          if (PyDict_SetItem(__pyx_d, __pyx_n_s__pyproj, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L12_error;}
+          if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyproj, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L12_error;}
           __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
           __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
         }
@@ -29947,7 +32489,7 @@ PyMODINIT_FUNC PyInit_pygrib(void)
         __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
         __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
 
-        /* "pygrib.pyx":189
+        /* "pygrib.pyx":183
  *     try:
  *         from mpl_toolkits.basemap import pyproj
  *     except:             # <<<<<<<<<<<<<<
@@ -29956,27 +32498,23 @@ PyMODINIT_FUNC PyInit_pygrib(void)
  */
         /*except:*/ {
           __Pyx_AddTraceback("pygrib", __pyx_clineno, __pyx_lineno, __pyx_filename);
-          if (__Pyx_GetException(&__pyx_t_12, &__pyx_t_11, &__pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L14_except_error;}
+          if (__Pyx_GetException(&__pyx_t_12, &__pyx_t_11, &__pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L14_except_error;}
           __Pyx_GOTREF(__pyx_t_12);
           __Pyx_GOTREF(__pyx_t_11);
           __Pyx_GOTREF(__pyx_t_13);
 
-          /* "pygrib.pyx":190
+          /* "pygrib.pyx":184
  *         from mpl_toolkits.basemap import pyproj
  *     except:
  *         raise ImportError("either pyproj or basemap required")             # <<<<<<<<<<<<<<
  * from ncepgrib2 import Grib2Decode
  * import_array()
  */
-          __pyx_t_14 = PyObject_Call(__pyx_builtin_ImportError, ((PyObject *)__pyx_k_tuple_196), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L14_except_error;}
+          __pyx_t_14 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__106, NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L14_except_error;}
           __Pyx_GOTREF(__pyx_t_14);
           __Pyx_Raise(__pyx_t_14, 0, 0, 0);
           __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
-          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L14_except_error;}
-          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
-          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
-          goto __pyx_L13_exception_handled;
+          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L14_except_error;}
         }
         __pyx_L14_except_error:;
         __Pyx_XGIVEREF(__pyx_t_8);
@@ -29984,11 +32522,6 @@ PyMODINIT_FUNC PyInit_pygrib(void)
         __Pyx_XGIVEREF(__pyx_t_10);
         __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
         goto __pyx_L4_except_error;
-        __pyx_L13_exception_handled:;
-        __Pyx_XGIVEREF(__pyx_t_8);
-        __Pyx_XGIVEREF(__pyx_t_9);
-        __Pyx_XGIVEREF(__pyx_t_10);
-        __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
         __pyx_L19_try_end:;
       }
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -29996,6 +32529,7 @@ PyMODINIT_FUNC PyInit_pygrib(void)
       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
       goto __pyx_L3_exception_handled;
     }
+    goto __pyx_L4_except_error;
     __pyx_L4_except_error:;
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_XGIVEREF(__pyx_t_4);
@@ -30010,28 +32544,28 @@ PyMODINIT_FUNC PyInit_pygrib(void)
     __pyx_L9_try_end:;
   }
 
-  /* "pygrib.pyx":191
+  /* "pygrib.pyx":185
  *     except:
  *         raise ImportError("either pyproj or basemap required")
  * from ncepgrib2 import Grib2Decode             # <<<<<<<<<<<<<<
  * import_array()
  * 
  */
-  __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_7);
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__Grib2Decode));
-  PyList_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_n_s__Grib2Decode));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__Grib2Decode));
-  __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s__ncepgrib2), ((PyObject *)__pyx_t_7), -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_INCREF(__pyx_n_s_Grib2Decode);
+  PyList_SET_ITEM(__pyx_t_7, 0, __pyx_n_s_Grib2Decode);
+  __Pyx_GIVEREF(__pyx_n_s_Grib2Decode);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_ncepgrib2, __pyx_t_7, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
-  __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s__Grib2Decode); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Grib2Decode); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s__Grib2Decode, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Grib2Decode, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pygrib.pyx":192
+  /* "pygrib.pyx":186
  *         raise ImportError("either pyproj or basemap required")
  * from ncepgrib2 import Grib2Decode
  * import_array()             # <<<<<<<<<<<<<<
@@ -30040,271 +32574,280 @@ PyMODINIT_FUNC PyInit_pygrib(void)
  */
   import_array();
 
-  /* "pygrib.pyx":208
+  /* "pygrib.pyx":202
  * cdef extern from "Python.h":
  *     object PyBytes_FromStringAndSize(char *s, size_t size)
  * default_encoding = 'ascii'             # <<<<<<<<<<<<<<
  * 
  * cdef extern from "numpy/arrayobject.h":
  */
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s__default_encoding, ((PyObject *)__pyx_n_s__ascii)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_encoding, __pyx_n_s_ascii) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
-  /* "pygrib.pyx":300
+  /* "pygrib.pyx":294
  * 
  * 
  * missingvalue_int = GRIB_MISSING_LONG             # <<<<<<<<<<<<<<
  * #this doesn't work, since defined constants are assumed to be integers
  * #missingvalue_float = GRIB_MISSING_DOUBLE
  */
-  __pyx_t_2 = PyInt_FromLong(GRIB_MISSING_LONG); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyInt_From_int(GRIB_MISSING_LONG); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s__missingvalue_int, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_missingvalue_int, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pygrib.pyx":303
+  /* "pygrib.pyx":297
  * #this doesn't work, since defined constants are assumed to be integers
  * #missingvalue_float = GRIB_MISSING_DOUBLE
  * missingvalue_float = -1.e100 # value given in grib_api.h version 1.90             # <<<<<<<<<<<<<<
  * def _get_grib_api_version():
  *     div = lambda v,d: (v/d,v%d)
  */
-  __pyx_t_2 = PyFloat_FromDouble(-1.e100); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s__missingvalue_float, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_missingvalue_float, __pyx_float_neg_1_e100) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
-  /* "pygrib.pyx":304
+  /* "pygrib.pyx":298
  * #missingvalue_float = GRIB_MISSING_DOUBLE
  * missingvalue_float = -1.e100 # value given in grib_api.h version 1.90
  * def _get_grib_api_version():             # <<<<<<<<<<<<<<
  *     div = lambda v,d: (v/d,v%d)
  *     v = grib_get_api_version()
  */
-  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pygrib_1_get_grib_api_version, NULL, __pyx_n_s__pygrib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pygrib_1_get_grib_api_version, NULL, __pyx_n_s_pygrib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_199, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_grib_api_version, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pygrib.pyx":311
+  /* "pygrib.pyx":305
  *     major = v
  *     return "%d.%d.%d" % (major,minor,revision)
  * grib_api_version = _get_grib_api_version()             # <<<<<<<<<<<<<<
  * tolerate_badgrib = False
  * 
  */
-  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_199); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_7 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_grib_api_version); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_7);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s__grib_api_version, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = NULL;
+  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
+    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_7);
+    if (likely(__pyx_t_1)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
+      __Pyx_INCREF(__pyx_t_1);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_7, function);
+    }
+  }
+  if (__pyx_t_1) {
+    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  } else {
+    __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  }
+  __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_grib_api_version, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pygrib.pyx":312
+  /* "pygrib.pyx":306
  *     return "%d.%d.%d" % (major,minor,revision)
  * grib_api_version = _get_grib_api_version()
  * tolerate_badgrib = False             # <<<<<<<<<<<<<<
  * 
  * def tolerate_badgrib_on():
  */
-  __pyx_t_7 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s__tolerate_badgrib, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_tolerate_badgrib, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
-  /* "pygrib.pyx":314
+  /* "pygrib.pyx":308
  * tolerate_badgrib = False
  * 
  * def tolerate_badgrib_on():             # <<<<<<<<<<<<<<
  *     """
  *     don't raise an exception when a missing or malformed key is encountered.
  */
-  __pyx_t_7 = PyCFunction_NewEx(&__pyx_mdef_6pygrib_3tolerate_badgrib_on, NULL, __pyx_n_s__pygrib); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s__tolerate_badgrib_on, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pygrib_3tolerate_badgrib_on, NULL, __pyx_n_s_pygrib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_tolerate_badgrib_on, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pygrib.pyx":321
+  /* "pygrib.pyx":315
  *     tolerate_badgrib = True
  * 
  * def tolerate_badgrib_off():             # <<<<<<<<<<<<<<
  *     """
  *     raise an exception when a missing or malformed key is encountered
  */
-  __pyx_t_7 = PyCFunction_NewEx(&__pyx_mdef_6pygrib_5tolerate_badgrib_off, NULL, __pyx_n_s__pygrib); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_203, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pygrib_5tolerate_badgrib_off, NULL, __pyx_n_s_pygrib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_tolerate_badgrib_off, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pygrib.pyx":329
+  /* "pygrib.pyx":323
  *     tolerate_badgrib = False
  * 
  * def gaulats(object nlats):             # <<<<<<<<<<<<<<
  *     """
  *     gaulats(nlats)
  */
-  __pyx_t_7 = PyCFunction_NewEx(&__pyx_mdef_6pygrib_7gaulats, NULL, __pyx_n_s__pygrib); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s__gaulats, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pygrib_7gaulats, NULL, __pyx_n_s_pygrib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_gaulats, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pygrib.pyx":343
+  /* "pygrib.pyx":337
  * 
  * # dict for forecast time units (Code Table 4.4).
  * _ftimedict = {}             # <<<<<<<<<<<<<<
  * _ftimedict[0]='mins'
  * _ftimedict[1]='hrs'
  */
-  __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_7));
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s___ftimedict, ((PyObject *)__pyx_t_7)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
+  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ftimedict, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pygrib.pyx":344
+  /* "pygrib.pyx":338
  * # dict for forecast time units (Code Table 4.4).
  * _ftimedict = {}
  * _ftimedict[0]='mins'             # <<<<<<<<<<<<<<
  * _ftimedict[1]='hrs'
  * _ftimedict[2]='days'
  */
-  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s___ftimedict); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-  if (__Pyx_SetItemInt(__pyx_t_7, 0, ((PyObject *)__pyx_n_s__mins), sizeof(long), PyInt_FromLong, 0, 0, 1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ftimedict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  if (unlikely(__Pyx_SetItemInt(__pyx_t_2, 0, __pyx_n_s_mins, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pygrib.pyx":345
+  /* "pygrib.pyx":339
  * _ftimedict = {}
  * _ftimedict[0]='mins'
  * _ftimedict[1]='hrs'             # <<<<<<<<<<<<<<
  * _ftimedict[2]='days'
  * _ftimedict[3]='months'
  */
-  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s___ftimedict); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-  if (__Pyx_SetItemInt(__pyx_t_7, 1, ((PyObject *)__pyx_n_s__hrs), sizeof(long), PyInt_FromLong, 0, 0, 1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ftimedict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  if (unlikely(__Pyx_SetItemInt(__pyx_t_2, 1, __pyx_n_s_hrs, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pygrib.pyx":346
+  /* "pygrib.pyx":340
  * _ftimedict[0]='mins'
  * _ftimedict[1]='hrs'
  * _ftimedict[2]='days'             # <<<<<<<<<<<<<<
  * _ftimedict[3]='months'
  * _ftimedict[4]='yrs'
  */
-  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s___ftimedict); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-  if (__Pyx_SetItemInt(__pyx_t_7, 2, ((PyObject *)__pyx_n_s__days), sizeof(long), PyInt_FromLong, 0, 0, 1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ftimedict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  if (unlikely(__Pyx_SetItemInt(__pyx_t_2, 2, __pyx_n_s_days, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pygrib.pyx":347
+  /* "pygrib.pyx":341
  * _ftimedict[1]='hrs'
  * _ftimedict[2]='days'
  * _ftimedict[3]='months'             # <<<<<<<<<<<<<<
  * _ftimedict[4]='yrs'
  * _ftimedict[5]='decades'
  */
-  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s___ftimedict); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-  if (__Pyx_SetItemInt(__pyx_t_7, 3, ((PyObject *)__pyx_n_s__months), sizeof(long), PyInt_FromLong, 0, 0, 1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ftimedict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  if (unlikely(__Pyx_SetItemInt(__pyx_t_2, 3, __pyx_n_s_months, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pygrib.pyx":348
+  /* "pygrib.pyx":342
  * _ftimedict[2]='days'
  * _ftimedict[3]='months'
  * _ftimedict[4]='yrs'             # <<<<<<<<<<<<<<
  * _ftimedict[5]='decades'
  * _ftimedict[6]='30 yr periods'
  */
-  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s___ftimedict); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-  if (__Pyx_SetItemInt(__pyx_t_7, 4, ((PyObject *)__pyx_n_s__yrs), sizeof(long), PyInt_FromLong, 0, 0, 1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ftimedict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  if (unlikely(__Pyx_SetItemInt(__pyx_t_2, 4, __pyx_n_s_yrs, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pygrib.pyx":349
+  /* "pygrib.pyx":343
  * _ftimedict[3]='months'
  * _ftimedict[4]='yrs'
  * _ftimedict[5]='decades'             # <<<<<<<<<<<<<<
  * _ftimedict[6]='30 yr periods'
  * _ftimedict[7]='centuries'
  */
-  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s___ftimedict); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-  if (__Pyx_SetItemInt(__pyx_t_7, 5, ((PyObject *)__pyx_n_s__decades), sizeof(long), PyInt_FromLong, 0, 0, 1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ftimedict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  if (unlikely(__Pyx_SetItemInt(__pyx_t_2, 5, __pyx_n_s_decades, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pygrib.pyx":350
+  /* "pygrib.pyx":344
  * _ftimedict[4]='yrs'
  * _ftimedict[5]='decades'
  * _ftimedict[6]='30 yr periods'             # <<<<<<<<<<<<<<
  * _ftimedict[7]='centuries'
  * _ftimedict[10]='3 hr periods'
  */
-  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s___ftimedict); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-  if (__Pyx_SetItemInt(__pyx_t_7, 6, ((PyObject *)__pyx_kp_s_206), sizeof(long), PyInt_FromLong, 0, 0, 1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ftimedict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  if (unlikely(__Pyx_SetItemInt(__pyx_t_2, 6, __pyx_kp_s_30_yr_periods, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pygrib.pyx":351
+  /* "pygrib.pyx":345
  * _ftimedict[5]='decades'
  * _ftimedict[6]='30 yr periods'
  * _ftimedict[7]='centuries'             # <<<<<<<<<<<<<<
  * _ftimedict[10]='3 hr periods'
  * _ftimedict[11]='6 hr periods'
  */
-  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s___ftimedict); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-  if (__Pyx_SetItemInt(__pyx_t_7, 7, ((PyObject *)__pyx_n_s__centuries), sizeof(long), PyInt_FromLong, 0, 0, 1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ftimedict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  if (unlikely(__Pyx_SetItemInt(__pyx_t_2, 7, __pyx_n_s_centuries, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pygrib.pyx":352
+  /* "pygrib.pyx":346
  * _ftimedict[6]='30 yr periods'
  * _ftimedict[7]='centuries'
  * _ftimedict[10]='3 hr periods'             # <<<<<<<<<<<<<<
  * _ftimedict[11]='6 hr periods'
  * _ftimedict[12]='12 hr periods'
  */
-  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s___ftimedict); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-  if (__Pyx_SetItemInt(__pyx_t_7, 10, ((PyObject *)__pyx_kp_s_27), sizeof(long), PyInt_FromLong, 0, 0, 1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ftimedict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  if (unlikely(__Pyx_SetItemInt(__pyx_t_2, 10, __pyx_kp_s_3_hr_periods, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pygrib.pyx":353
+  /* "pygrib.pyx":347
  * _ftimedict[7]='centuries'
  * _ftimedict[10]='3 hr periods'
  * _ftimedict[11]='6 hr periods'             # <<<<<<<<<<<<<<
  * _ftimedict[12]='12 hr periods'
  * _ftimedict[13]='secs'
  */
-  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s___ftimedict); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-  if (__Pyx_SetItemInt(__pyx_t_7, 11, ((PyObject *)__pyx_kp_s_28), sizeof(long), PyInt_FromLong, 0, 0, 1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ftimedict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  if (unlikely(__Pyx_SetItemInt(__pyx_t_2, 11, __pyx_kp_s_6_hr_periods, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pygrib.pyx":354
+  /* "pygrib.pyx":348
  * _ftimedict[10]='3 hr periods'
  * _ftimedict[11]='6 hr periods'
  * _ftimedict[12]='12 hr periods'             # <<<<<<<<<<<<<<
  * _ftimedict[13]='secs'
  * 
  */
-  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s___ftimedict); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-  if (__Pyx_SetItemInt(__pyx_t_7, 12, ((PyObject *)__pyx_kp_s_29), sizeof(long), PyInt_FromLong, 0, 0, 1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ftimedict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  if (unlikely(__Pyx_SetItemInt(__pyx_t_2, 12, __pyx_kp_s_12_hr_periods, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pygrib.pyx":355
+  /* "pygrib.pyx":349
  * _ftimedict[11]='6 hr periods'
  * _ftimedict[12]='12 hr periods'
  * _ftimedict[13]='secs'             # <<<<<<<<<<<<<<
  * 
  * # turn on support for multi-field grib messages.
  */
-  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s___ftimedict); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-  if (__Pyx_SetItemInt(__pyx_t_7, 13, ((PyObject *)__pyx_n_s__secs), sizeof(long), PyInt_FromLong, 0, 0, 1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ftimedict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  if (unlikely(__Pyx_SetItemInt(__pyx_t_2, 13, __pyx_n_s_secs, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pygrib.pyx":358
+  /* "pygrib.pyx":352
  * 
  * # turn on support for multi-field grib messages.
  * grib_multi_support_on(NULL)             # <<<<<<<<<<<<<<
@@ -30313,135 +32856,122 @@ PyMODINIT_FUNC PyInit_pygrib(void)
  */
   grib_multi_support_on(NULL);
 
-  /* "pygrib.pyx":360
+  /* "pygrib.pyx":354
  * grib_multi_support_on(NULL)
  * 
  * def multi_support_on():             # <<<<<<<<<<<<<<
  *     """turn on support for multi-field grib messages (default)"""
  *     grib_multi_support_on(NULL)
  */
-  __pyx_t_7 = PyCFunction_NewEx(&__pyx_mdef_6pygrib_9multi_support_on, NULL, __pyx_n_s__pygrib); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s__multi_support_on, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pygrib_9multi_support_on, NULL, __pyx_n_s_pygrib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_multi_support_on, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pygrib.pyx":364
+  /* "pygrib.pyx":358
  *     grib_multi_support_on(NULL)
  * 
  * def multi_support_off():             # <<<<<<<<<<<<<<
  *     """turn off support for multi-field grib messages"""
  *     grib_multi_support_off(NULL)
  */
-  __pyx_t_7 = PyCFunction_NewEx(&__pyx_mdef_6pygrib_11multi_support_off, NULL, __pyx_n_s__pygrib); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s__multi_support_off, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
-  /* "pygrib.pyx":617
- *             raise ValueError('no matches found')
- *         return grbs
- *     def _advance(self,nmsgs,return_msgs=False):             # <<<<<<<<<<<<<<
- *         """advance iterator n messages from current position.
- *         if return_msgs==True, grib message instances are returned
- */
-  __pyx_t_7 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-  __pyx_k_14 = __pyx_t_7;
-  __Pyx_GIVEREF(__pyx_t_7);
-  __pyx_t_7 = 0;
+  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pygrib_11multi_support_off, NULL, __pyx_n_s_pygrib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_multi_support_off, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pygrib.pyx":641
+  /* "pygrib.pyx":635
  * # distinguished from grib keys.
  * _private_atts =\
  * ['_gh','fcstimeunits','expand_reduced','projparams','messagenumber','_all_keys','_ro_keys']             # <<<<<<<<<<<<<<
  * 
  * def julian_to_datetime(object jd):
  */
-  __pyx_t_7 = PyList_New(7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-  __Pyx_INCREF(((PyObject *)__pyx_n_s___gh));
-  PyList_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_n_s___gh));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s___gh));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__fcstimeunits));
-  PyList_SET_ITEM(__pyx_t_7, 1, ((PyObject *)__pyx_n_s__fcstimeunits));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__fcstimeunits));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__expand_reduced));
-  PyList_SET_ITEM(__pyx_t_7, 2, ((PyObject *)__pyx_n_s__expand_reduced));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__expand_reduced));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__projparams));
-  PyList_SET_ITEM(__pyx_t_7, 3, ((PyObject *)__pyx_n_s__projparams));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__projparams));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s__messagenumber));
-  PyList_SET_ITEM(__pyx_t_7, 4, ((PyObject *)__pyx_n_s__messagenumber));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__messagenumber));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s___all_keys));
-  PyList_SET_ITEM(__pyx_t_7, 5, ((PyObject *)__pyx_n_s___all_keys));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s___all_keys));
-  __Pyx_INCREF(((PyObject *)__pyx_n_s___ro_keys));
-  PyList_SET_ITEM(__pyx_t_7, 6, ((PyObject *)__pyx_n_s___ro_keys));
-  __Pyx_GIVEREF(((PyObject *)__pyx_n_s___ro_keys));
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s___private_atts, ((PyObject *)__pyx_t_7)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
-
-  /* "pygrib.pyx":643
+  __pyx_t_2 = PyList_New(7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_gh);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_gh);
+  __Pyx_GIVEREF(__pyx_n_s_gh);
+  __Pyx_INCREF(__pyx_n_s_fcstimeunits);
+  PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_fcstimeunits);
+  __Pyx_GIVEREF(__pyx_n_s_fcstimeunits);
+  __Pyx_INCREF(__pyx_n_s_expand_reduced);
+  PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_expand_reduced);
+  __Pyx_GIVEREF(__pyx_n_s_expand_reduced);
+  __Pyx_INCREF(__pyx_n_s_projparams);
+  PyList_SET_ITEM(__pyx_t_2, 3, __pyx_n_s_projparams);
+  __Pyx_GIVEREF(__pyx_n_s_projparams);
+  __Pyx_INCREF(__pyx_n_s_messagenumber);
+  PyList_SET_ITEM(__pyx_t_2, 4, __pyx_n_s_messagenumber);
+  __Pyx_GIVEREF(__pyx_n_s_messagenumber);
+  __Pyx_INCREF(__pyx_n_s_all_keys);
+  PyList_SET_ITEM(__pyx_t_2, 5, __pyx_n_s_all_keys);
+  __Pyx_GIVEREF(__pyx_n_s_all_keys);
+  __Pyx_INCREF(__pyx_n_s_ro_keys);
+  PyList_SET_ITEM(__pyx_t_2, 6, __pyx_n_s_ro_keys);
+  __Pyx_GIVEREF(__pyx_n_s_ro_keys);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_private_atts, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+  /* "pygrib.pyx":637
  * ['_gh','fcstimeunits','expand_reduced','projparams','messagenumber','_all_keys','_ro_keys']
  * 
  * def julian_to_datetime(object jd):             # <<<<<<<<<<<<<<
  *     """
  *     julian_to_datetime(julday)
  */
-  __pyx_t_7 = PyCFunction_NewEx(&__pyx_mdef_6pygrib_13julian_to_datetime, NULL, __pyx_n_s__pygrib); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s__julian_to_datetime, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pygrib_13julian_to_datetime, NULL, __pyx_n_s_pygrib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_julian_to_datetime, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pygrib.pyx":660
+  /* "pygrib.pyx":654
  *     return datetime(year, month, day, hour, minute, second)
  * 
  * def datetime_to_julian(object d):             # <<<<<<<<<<<<<<
  *     """
  *     datetime_to_julian(date)
  */
-  __pyx_t_7 = PyCFunction_NewEx(&__pyx_mdef_6pygrib_15datetime_to_julian, NULL, __pyx_n_s__pygrib); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s__datetime_to_julian, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pygrib_15datetime_to_julian, NULL, __pyx_n_s_pygrib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_datetime_to_julian, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pygrib.pyx":686
+  /* "pygrib.pyx":680
  *     return setdates(grb)
  * 
  * def fromstring(gribstring):             # <<<<<<<<<<<<<<
  *     """
  *     fromstring(string)
  */
-  __pyx_t_7 = PyCFunction_NewEx(&__pyx_mdef_6pygrib_17fromstring, NULL, __pyx_n_s__pygrib); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s__fromstring, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pygrib_17fromstring, NULL, __pyx_n_s_pygrib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_fromstring, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pygrib.pyx":707
+  /* "pygrib.pyx":701
  *     return setdates(grb)
  * 
  * def setdates(gribmessage grb):             # <<<<<<<<<<<<<<
  *     """
  *     setdates(grb)
  */
-  __pyx_t_7 = PyCFunction_NewEx(&__pyx_mdef_6pygrib_19setdates, NULL, __pyx_n_s__pygrib); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s__setdates, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pygrib_19setdates, NULL, __pyx_n_s_pygrib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setdates, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pygrib.pyx":788
+  /* "pygrib.pyx":782
  *     return grb
  * 
  * def reload(gribmessage grb):             # <<<<<<<<<<<<<<
  *     """
  *     reload(grb)
  */
-  __pyx_t_7 = PyCFunction_NewEx(&__pyx_mdef_6pygrib_21reload, NULL, __pyx_n_s__pygrib); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s__reload, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pygrib_21reload, NULL, __pyx_n_s_pygrib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reload, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "pygrib.pyx":2024
  *             grib_index_delete(self._gi)
@@ -30450,10 +32980,10 @@ PyMODINIT_FUNC PyInit_pygrib(void)
  *     if type(a) == str or type(a) == bytes or type(a) == unicode:
  *         return True
  */
-  __pyx_t_7 = PyCFunction_NewEx(&__pyx_mdef_6pygrib_23_is_stringlike, NULL, __pyx_n_s__pygrib); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s___is_stringlike, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pygrib_23_is_stringlike, NULL, __pyx_n_s_pygrib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_stringlike, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "pygrib.pyx":2030
  *         return False
@@ -30462,10 +32992,10 @@ PyMODINIT_FUNC PyInit_pygrib(void)
  *     # is object container-like?  (can test for
  *     # membership with "is in", but not a string)
  */
-  __pyx_t_7 = PyCFunction_NewEx(&__pyx_mdef_6pygrib_25_is_container, NULL, __pyx_n_s__pygrib); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2030; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s___is_container, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2030; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pygrib_25_is_container, NULL, __pyx_n_s_pygrib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2030; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_container, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2030; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "pygrib.pyx":2038
  *     return True
@@ -30474,10 +33004,10 @@ PyMODINIT_FUNC PyInit_pygrib(void)
  *     # search for key/value matches in grib message.
  *     # If value is a container-like object, search for matches to any element.
  */
-  __pyx_t_7 = PyCFunction_NewEx(&__pyx_mdef_6pygrib_27_find, NULL, __pyx_n_s__pygrib); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s___find, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pygrib_27_find, NULL, __pyx_n_s_pygrib); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_find, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "pygrib.pyx":2061
  *     return True
@@ -30486,6 +33016,9 @@ PyMODINIT_FUNC PyInit_pygrib(void)
  *     # encode a string into bytes.  If already bytes, do nothing.
  *     # uses default_encoding module variable for default encoding.
  */
+
+  /*--- Wrapped vars code ---*/
+
   goto __pyx_L0;
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
@@ -30496,7 +33029,9 @@ PyMODINIT_FUNC PyInit_pygrib(void)
   __Pyx_XDECREF(__pyx_t_13);
   __Pyx_XDECREF(__pyx_t_14);
   if (__pyx_m) {
-    __Pyx_AddTraceback("init pygrib", __pyx_clineno, __pyx_lineno, __pyx_filename);
+    if (__pyx_d) {
+      __Pyx_AddTraceback("init pygrib", __pyx_clineno, __pyx_lineno, __pyx_filename);
+    }
     Py_DECREF(__pyx_m); __pyx_m = 0;
   } else if (!PyErr_Occurred()) {
     PyErr_SetString(PyExc_ImportError, "init pygrib");
@@ -30525,7 +33060,7 @@ end:
     Py_XDECREF(m);
     return (__Pyx_RefNannyAPIStruct *)r;
 }
-#endif /* CYTHON_REFNANNY */
+#endif
 
 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
     PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
@@ -30534,7 +33069,7 @@ static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
 #if PY_MAJOR_VERSION >= 3
             "name '%U' is not defined", name);
 #else
-            "name '%s' is not defined", PyString_AS_STRING(name));
+            "name '%.200s' is not defined", PyString_AS_STRING(name));
 #endif
     }
     return result;
@@ -30560,7 +33095,7 @@ static void __Pyx_RaiseArgtupleInvalid(
         more_or_less = "exactly";
     }
     PyErr_Format(PyExc_TypeError,
-                 "%s() takes %s %" CYTHON_FORMAT_SSIZE_T "d positional argument%s (%" CYTHON_FORMAT_SSIZE_T "d given)",
+                 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
                  func_name, more_or_less, num_expected,
                  (num_expected == 1) ? "" : "s", num_found);
 }
@@ -30664,12 +33199,12 @@ arg_passed_twice:
     goto bad;
 invalid_keyword_type:
     PyErr_Format(PyExc_TypeError,
-        "%s() keywords must be strings", function_name);
+        "%.200s() keywords must be strings", function_name);
     goto bad;
 invalid_keyword:
     PyErr_Format(PyExc_TypeError,
     #if PY_MAJOR_VERSION < 3
-        "%s() got an unexpected keyword argument '%s'",
+        "%.200s() got an unexpected keyword argument '%.200s'",
         function_name, PyString_AsString(key));
     #else
         "%s() got an unexpected keyword argument '%U'",
@@ -30679,6 +33214,44 @@ bad:
     return -1;
 }
 
+static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
+    PyObject* fake_module;
+    PyTypeObject* cached_type = NULL;
+    fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
+    if (!fake_module) return NULL;
+    Py_INCREF(fake_module);
+    cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
+    if (cached_type) {
+        if (!PyType_Check((PyObject*)cached_type)) {
+            PyErr_Format(PyExc_TypeError,
+                "Shared Cython type %.200s is not a type object",
+                type->tp_name);
+            goto bad;
+        }
+        if (cached_type->tp_basicsize != type->tp_basicsize) {
+            PyErr_Format(PyExc_TypeError,
+                "Shared Cython type %.200s has the wrong size, try recompiling",
+                type->tp_name);
+            goto bad;
+        }
+    } else {
+        if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
+        PyErr_Clear();
+        if (PyType_Ready(type) < 0) goto bad;
+        if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
+            goto bad;
+        Py_INCREF(type);
+        cached_type = type;
+    }
+done:
+    Py_DECREF(fake_module);
+    return cached_type;
+bad:
+    Py_XDECREF(cached_type);
+    cached_type = NULL;
+    goto done;
+}
+
 static PyObject *
 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
 {
@@ -30703,8 +33276,9 @@ static int
 __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value)
 {
     PyObject *tmp = op->func_doc;
-    if (value == NULL)
-        value = Py_None; /* Mark as deleted */
+    if (value == NULL) {
+        value = Py_None;
+    }
     Py_INCREF(value);
     op->func_doc = value;
     Py_XDECREF(tmp);
@@ -30811,11 +33385,10 @@ __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value)
     return 0;
 }
 static PyObject *
-__Pyx_CyFunction_get_globals(CYTHON_UNUSED __pyx_CyFunctionObject *op)
+__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op)
 {
-    PyObject* dict = PyModule_GetDict(__pyx_m);
-    Py_XINCREF(dict);
-    return dict;
+    Py_INCREF(op->func_globals);
+    return op->func_globals;
 }
 static PyObject *
 __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op)
@@ -30950,7 +33523,7 @@ static PyGetSetDef __pyx_CyFunction_getsets[] = {
     {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
     {0, 0, 0, 0, 0}
 };
-#ifndef PY_WRITE_RESTRICTED /* < Py2.5 */
+#ifndef PY_WRITE_RESTRICTED
 #define PY_WRITE_RESTRICTED WRITE_RESTRICTED
 #endif
 static PyMemberDef __pyx_CyFunction_members[] = {
@@ -30967,16 +33540,21 @@ __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
 #endif
 }
 static PyMethodDef __pyx_CyFunction_methods[] = {
-    {__Pyx_NAMESTR("__reduce__"), (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
+    {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
     {0, 0, 0, 0}
 };
+#if PY_VERSION_HEX < 0x030500A0
+#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
+#else
+#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
+#endif
 static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname,
-                                      PyObject *closure, PyObject *module, PyObject* code) {
+                                      PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
     __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type);
     if (op == NULL)
         return NULL;
     op->flags = flags;
-    op->func_weakreflist = NULL;
+    __Pyx_CyFunction_weakreflist(op) = NULL;
     op->func.m_ml = ml;
     op->func.m_self = (PyObject *) op;
     Py_XINCREF(closure);
@@ -30989,6 +33567,8 @@ static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int f
     op->func_qualname = qualname;
     op->func_doc = NULL;
     op->func_classobj = NULL;
+    op->func_globals = globals;
+    Py_INCREF(op->func_globals);
     Py_XINCREF(code);
     op->func_code = code;
     op->defaults_pyobjects = 0;
@@ -31009,6 +33589,7 @@ __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
     Py_CLEAR(m->func_name);
     Py_CLEAR(m->func_qualname);
     Py_CLEAR(m->func_doc);
+    Py_CLEAR(m->func_globals);
     Py_CLEAR(m->func_code);
     Py_CLEAR(m->func_classobj);
     Py_CLEAR(m->defaults_tuple);
@@ -31027,7 +33608,7 @@ __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
 {
     PyObject_GC_UnTrack(m);
-    if (m->func_weakreflist != NULL)
+    if (__Pyx_CyFunction_weakreflist(m) != NULL)
         PyObject_ClearWeakRefs((PyObject *) m);
     __Pyx_CyFunction_clear(m);
     PyObject_GC_Del(m);
@@ -31040,6 +33621,7 @@ static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit,
     Py_VISIT(m->func_name);
     Py_VISIT(m->func_qualname);
     Py_VISIT(m->func_doc);
+    Py_VISIT(m->func_globals);
     Py_VISIT(m->func_code);
     Py_VISIT(m->func_classobj);
     Py_VISIT(m->defaults_tuple);
@@ -31062,12 +33644,11 @@ static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObj
     if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
         if (type == NULL)
             type = (PyObject *)(Py_TYPE(obj));
-        return PyMethod_New(func,
-                            type, (PyObject *)(Py_TYPE(type)));
+        return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
     }
     if (obj == Py_None)
         obj = NULL;
-    return PyMethod_New(func, obj, type);
+    return __Pyx_PyMethod_New(func, obj, type);
 }
 static PyObject*
 __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
@@ -31132,69 +33713,72 @@ static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject
 #endif
 static PyTypeObject __pyx_CyFunctionType_type = {
     PyVarObject_HEAD_INIT(0, 0)
-    __Pyx_NAMESTR("cython_function_or_method"), /*tp_name*/
-    sizeof(__pyx_CyFunctionObject),   /*tp_basicsize*/
-    0,                                  /*tp_itemsize*/
-    (destructor) __Pyx_CyFunction_dealloc, /*tp_dealloc*/
-    0,                                  /*tp_print*/
-    0,                                  /*tp_getattr*/
-    0,                                  /*tp_setattr*/
+    "cython_function_or_method",
+    sizeof(__pyx_CyFunctionObject),
+    0,
+    (destructor) __Pyx_CyFunction_dealloc,
+    0,
+    0,
+    0,
 #if PY_MAJOR_VERSION < 3
-    0,                                  /*tp_compare*/
+    0,
 #else
-    0,                                  /*reserved*/
+    0,
 #endif
-    (reprfunc) __Pyx_CyFunction_repr,   /*tp_repr*/
-    0,                                  /*tp_as_number*/
-    0,                                  /*tp_as_sequence*/
-    0,                                  /*tp_as_mapping*/
-    0,                                  /*tp_hash*/
-    __Pyx_CyFunction_Call,              /*tp_call*/
-    0,                                  /*tp_str*/
-    0,                                  /*tp_getattro*/
-    0,                                  /*tp_setattro*/
-    0,                                  /*tp_as_buffer*/
-    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags*/
-    0,                                  /*tp_doc*/
-    (traverseproc) __Pyx_CyFunction_traverse,   /*tp_traverse*/
-    (inquiry) __Pyx_CyFunction_clear,   /*tp_clear*/
-    0,                                  /*tp_richcompare*/
-    offsetof(__pyx_CyFunctionObject, func_weakreflist), /* tp_weaklistoffse */
-    0,                                  /*tp_iter*/
-    0,                                  /*tp_iternext*/
-    __pyx_CyFunction_methods,           /*tp_methods*/
-    __pyx_CyFunction_members,           /*tp_members*/
-    __pyx_CyFunction_getsets,           /*tp_getset*/
-    0,                                  /*tp_base*/
-    0,                                  /*tp_dict*/
-    __Pyx_CyFunction_descr_get,         /*tp_descr_get*/
-    0,                                  /*tp_descr_set*/
-    offsetof(__pyx_CyFunctionObject, func_dict),/*tp_dictoffset*/
-    0,                                  /*tp_init*/
-    0,                                  /*tp_alloc*/
-    0,                                  /*tp_new*/
-    0,                                  /*tp_free*/
-    0,                                  /*tp_is_gc*/
-    0,                                  /*tp_bases*/
-    0,                                  /*tp_mro*/
-    0,                                  /*tp_cache*/
-    0,                                  /*tp_subclasses*/
-    0,                                  /*tp_weaklist*/
-    0,                                  /*tp_del*/
-#if PY_VERSION_HEX >= 0x02060000
-    0,                                  /*tp_version_tag*/
+    (reprfunc) __Pyx_CyFunction_repr,
+    0,
+    0,
+    0,
+    0,
+    __Pyx_CyFunction_Call,
+    0,
+    0,
+    0,
+    0,
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
+    0,
+    (traverseproc) __Pyx_CyFunction_traverse,
+    (inquiry) __Pyx_CyFunction_clear,
+    0,
+#if PY_VERSION_HEX < 0x030500A0
+    offsetof(__pyx_CyFunctionObject, func_weakreflist),
+#else
+    offsetof(PyCFunctionObject, m_weakreflist),
 #endif
-#if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE)
-    0,                                  /*tp_finalize*/
+    0,
+    0,
+    __pyx_CyFunction_methods,
+    __pyx_CyFunction_members,
+    __pyx_CyFunction_getsets,
+    0,
+    0,
+    __Pyx_CyFunction_descr_get,
+    0,
+    offsetof(__pyx_CyFunctionObject, func_dict),
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+#if PY_VERSION_HEX >= 0x030400a1
+    0,
 #endif
 };
 static int __Pyx_CyFunction_init(void) {
 #if !CYTHON_COMPILING_IN_PYPY
     __pyx_CyFunctionType_type.tp_call = PyCFunction_Call;
 #endif
-    if (PyType_Ready(&__pyx_CyFunctionType_type) < 0)
+    __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
+    if (__pyx_CyFunctionType == NULL) {
         return -1;
-    __pyx_CyFunctionType = &__pyx_CyFunctionType_type;
+    }
     return 0;
 }
 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
@@ -31229,7 +33813,7 @@ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
 
 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
     PyErr_Format(PyExc_ValueError,
-                 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%s to unpack",
+                 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
                  index, (index == 1) ? "" : "s");
 }
 
@@ -31278,6 +33862,25 @@ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
     return 0;
 }
 
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
+    PyObject *result;
+    ternaryfunc call = func->ob_type->tp_call;
+    if (unlikely(!call))
+        return PyObject_Call(func, arg, kw);
+    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
+        return NULL;
+    result = (*call)(func, arg, kw);
+    Py_LeaveRecursiveCall();
+    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
+        PyErr_SetString(
+            PyExc_SystemError,
+            "NULL result without error in PyObject_Call");
+    }
+    return result;
+}
+#endif
+
 static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
 #if CYTHON_COMPILING_IN_CPYTHON
     PyObject *tmp_type, *tmp_value, *tmp_tb;
@@ -31327,11 +33930,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
             goto raise_error;
         }
     }
-    #if PY_VERSION_HEX < 0x02050000
-    if (PyClass_Check(type)) {
-    #else
     if (PyType_Check(type)) {
-    #endif
 #if CYTHON_COMPILING_IN_PYPY
         if (!value) {
             Py_INCREF(Py_None);
@@ -31346,17 +33945,6 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
             goto raise_error;
         }
         value = type;
-        #if PY_VERSION_HEX < 0x02050000
-        if (PyInstance_Check(type)) {
-            type = (PyObject*) ((PyInstanceObject*)type)->in_class;
-            Py_INCREF(type);
-        } else {
-            type = 0;
-            PyErr_SetString(PyExc_TypeError,
-                "raise: exception must be an old-style class or instance");
-            goto raise_error;
-        }
-        #else
         type = (PyObject*) Py_TYPE(type);
         Py_INCREF(type);
         if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
@@ -31364,7 +33952,6 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
                 "raise: exception class must be a subclass of BaseException");
             goto raise_error;
         }
-        #endif
     }
     __Pyx_ErrRestore(type, value, tb);
     return;
@@ -31374,7 +33961,7 @@ raise_error:
     Py_XDECREF(tb);
     return;
 }
-#else /* Python 3+ */
+#else
 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
     PyObject* owned_instance = NULL;
     if (tb == Py_None) {
@@ -31395,27 +33982,40 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject
         value = type;
         type = (PyObject*) Py_TYPE(value);
     } else if (PyExceptionClass_Check(type)) {
-        PyObject *args;
-        if (!value)
-            args = PyTuple_New(0);
-        else if (PyTuple_Check(value)) {
-            Py_INCREF(value);
-            args = value;
-        } else
-            args = PyTuple_Pack(1, value);
-        if (!args)
-            goto bad;
-        owned_instance = PyEval_CallObject(type, args);
-        Py_DECREF(args);
-        if (!owned_instance)
-            goto bad;
-        value = owned_instance;
-        if (!PyExceptionInstance_Check(value)) {
-            PyErr_Format(PyExc_TypeError,
-                         "calling %R should have returned an instance of "
-                         "BaseException, not %R",
-                         type, Py_TYPE(value));
-            goto bad;
+        PyObject *instance_class = NULL;
+        if (value && PyExceptionInstance_Check(value)) {
+            instance_class = (PyObject*) Py_TYPE(value);
+            if (instance_class != type) {
+                if (PyObject_IsSubclass(instance_class, type)) {
+                    type = instance_class;
+                } else {
+                    instance_class = NULL;
+                }
+            }
+        }
+        if (!instance_class) {
+            PyObject *args;
+            if (!value)
+                args = PyTuple_New(0);
+            else if (PyTuple_Check(value)) {
+                Py_INCREF(value);
+                args = value;
+            } else
+                args = PyTuple_Pack(1, value);
+            if (!args)
+                goto bad;
+            owned_instance = PyObject_Call(type, args, NULL);
+            Py_DECREF(args);
+            if (!owned_instance)
+                goto bad;
+            value = owned_instance;
+            if (!PyExceptionInstance_Check(value)) {
+                PyErr_Format(PyExc_TypeError,
+                             "calling %R should have returned an instance of "
+                             "BaseException, not %R",
+                             type, Py_TYPE(value));
+                goto bad;
+            }
         }
     } else {
         PyErr_SetString(PyExc_TypeError,
@@ -31447,6 +34047,13 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject
     }
     PyErr_SetObject(type, value);
     if (tb) {
+#if CYTHON_COMPILING_IN_PYPY
+        PyObject *tmp_type, *tmp_value, *tmp_tb;
+        PyErr_Fetch(tmp_type, tmp_value, tmp_tb);
+        Py_INCREF(tb);
+        PyErr_Restore(tmp_type, tmp_value, tb);
+        Py_XDECREF(tmp_tb);
+#else
         PyThreadState *tstate = PyThreadState_GET();
         PyObject* tmp_tb = tstate->curexc_traceback;
         if (tb != tmp_tb) {
@@ -31454,6 +34061,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject
             tstate->curexc_traceback = tb;
             Py_XDECREF(tmp_tb);
         }
+#endif
     }
 bad:
     Py_XDECREF(owned_instance);
@@ -31465,7 +34073,7 @@ static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
     PyObject *result;
 #if CYTHON_COMPILING_IN_CPYTHON
     result = PyDict_GetItem(__pyx_d, name);
-    if (result) {
+    if (likely(result)) {
         Py_INCREF(result);
     } else {
 #else
@@ -31480,7 +34088,7 @@ static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
 
 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
     if (unlikely(!type)) {
-        PyErr_Format(PyExc_SystemError, "Missing type object");
+        PyErr_SetString(PyExc_SystemError, "Missing type object");
         return 0;
     }
     if (likely(PyObject_TypeCheck(obj, type)))
@@ -31497,6 +34105,70 @@ static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
     return q;
 }
 
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
+    PyObject *self, *result;
+    PyCFunction cfunc;
+    cfunc = PyCFunction_GET_FUNCTION(func);
+    self = PyCFunction_GET_SELF(func);
+    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
+        return NULL;
+    result = cfunc(self, arg);
+    Py_LeaveRecursiveCall();
+    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
+        PyErr_SetString(
+            PyExc_SystemError,
+            "NULL result without error in PyObject_Call");
+    }
+    return result;
+}
+#endif
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
+    PyObject *result;
+    PyObject *args = PyTuple_New(1);
+    if (unlikely(!args)) return NULL;
+    Py_INCREF(arg);
+    PyTuple_SET_ITEM(args, 0, arg);
+    result = __Pyx_PyObject_Call(func, args, NULL);
+    Py_DECREF(args);
+    return result;
+}
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
+#ifdef __Pyx_CyFunction_USED
+    if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
+#else
+    if (likely(PyCFunction_Check(func))) {
+#endif
+        if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
+            return __Pyx_PyObject_CallMethO(func, arg);
+        }
+    }
+    return __Pyx__PyObject_CallOneArg(func, arg);
+}
+#else
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
+    PyObject* args = PyTuple_Pack(1, arg);
+    return (likely(args)) ? __Pyx_PyObject_Call(func, args, NULL) : NULL;
+}
+#endif
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
+#ifdef __Pyx_CyFunction_USED
+    if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
+#else
+    if (likely(PyCFunction_Check(func))) {
+#endif
+        if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
+            return __Pyx_PyObject_CallMethO(func, NULL);
+        }
+    }
+    return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
+}
+#endif
+
 static CYTHON_INLINE int __Pyx_CheckKeywordStrings(
     PyObject *kwdict,
     const char* function_name,
@@ -31504,7 +34176,7 @@ static CYTHON_INLINE int __Pyx_CheckKeywordStrings(
 {
     PyObject* key = 0;
     Py_ssize_t pos = 0;
-#if CPYTHON_COMPILING_IN_PYPY
+#if CYTHON_COMPILING_IN_PYPY
     if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0))
         goto invalid_keyword;
     return 1;
@@ -31521,13 +34193,13 @@ static CYTHON_INLINE int __Pyx_CheckKeywordStrings(
     return 1;
 invalid_keyword_type:
     PyErr_Format(PyExc_TypeError,
-        "%s() keywords must be strings", function_name);
+        "%.200s() keywords must be strings", function_name);
     return 0;
 #endif
 invalid_keyword:
     PyErr_Format(PyExc_TypeError,
     #if PY_MAJOR_VERSION < 3
-        "%s() got an unexpected keyword argument '%s'",
+        "%.200s() got an unexpected keyword argument '%.200s'",
         function_name, PyString_AsString(key));
     #else
         "%s() got an unexpected keyword argument '%U'",
@@ -31552,7 +34224,7 @@ static CYTHON_INLINE PyObject *__Pyx_PyIter_Next2(PyObject* iterator, PyObject*
     if (likely(next))
         return next;
 #if CYTHON_COMPILING_IN_CPYTHON
-#if PY_VERSION_HEX >= 0x03010000 || (PY_MAJOR_VERSION < 3 && PY_VERSION_HEX >= 0x02070000)
+#if PY_VERSION_HEX >= 0x02070000
     if (unlikely(iternext == &_PyObject_NextNotImplemented))
         return NULL;
 #endif
@@ -31573,6 +34245,37 @@ static CYTHON_INLINE PyObject *__Pyx_PyIter_Next2(PyObject* iterator, PyObject*
     return NULL;
 }
 
+static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) {
+#if CYTHON_COMPILING_IN_CPYTHON
+    PyThreadState *tstate = PyThreadState_GET();
+    *type = tstate->exc_type;
+    *value = tstate->exc_value;
+    *tb = tstate->exc_traceback;
+    Py_XINCREF(*type);
+    Py_XINCREF(*value);
+    Py_XINCREF(*tb);
+#else
+    PyErr_GetExcInfo(type, value, tb);
+#endif
+}
+static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) {
+#if CYTHON_COMPILING_IN_CPYTHON
+    PyObject *tmp_type, *tmp_value, *tmp_tb;
+    PyThreadState *tstate = PyThreadState_GET();
+    tmp_type = tstate->exc_type;
+    tmp_value = tstate->exc_value;
+    tmp_tb = tstate->exc_traceback;
+    tstate->exc_type = type;
+    tstate->exc_value = value;
+    tstate->exc_traceback = tb;
+    Py_XDECREF(tmp_type);
+    Py_XDECREF(tmp_value);
+    Py_XDECREF(tmp_tb);
+#else
+    PyErr_SetExcInfo(type, value, tb);
+#endif
+}
+
 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
     PyObject *local_type, *local_value, *local_tb;
 #if CYTHON_COMPILING_IN_CPYTHON
@@ -31595,12 +34298,14 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
 #endif
         goto bad;
     #if PY_MAJOR_VERSION >= 3
-    if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
-        goto bad;
+    if (local_tb) {
+        if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
+            goto bad;
+    }
     #endif
-    Py_INCREF(local_type);
-    Py_INCREF(local_value);
-    Py_INCREF(local_tb);
+    Py_XINCREF(local_tb);
+    Py_XINCREF(local_type);
+    Py_XINCREF(local_value);
     *type = local_type;
     *value = local_value;
     *tb = local_tb;
@@ -31611,8 +34316,6 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
     tstate->exc_type = local_type;
     tstate->exc_value = local_value;
     tstate->exc_traceback = local_tb;
-    /* Make sure tstate is in a consistent state when we XDECREF
-       these objects (DECREF may run arbitrary code). */
     Py_XDECREF(tmp_type);
     Py_XDECREF(tmp_value);
     Py_XDECREF(tmp_tb);
@@ -31634,23 +34337,29 @@ static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
     PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
 }
 
-static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
+static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) {
+    PyErr_Format(PyExc_TypeError,
+        "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
+        name, type->tp_name, Py_TYPE(obj)->tp_name);
+}
+static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
     const char *name, int exact)
 {
-    if (!type) {
-        PyErr_Format(PyExc_SystemError, "Missing type object");
+    if (unlikely(!type)) {
+        PyErr_SetString(PyExc_SystemError, "Missing type object");
         return 0;
     }
     if (none_allowed && obj == Py_None) return 1;
     else if (exact) {
-        if (Py_TYPE(obj) == type) return 1;
+        if (likely(Py_TYPE(obj) == type)) return 1;
+        #if PY_MAJOR_VERSION == 2
+        else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
+        #endif
     }
     else {
-        if (PyObject_TypeCheck(obj, type)) return 1;
+        if (likely(PyObject_TypeCheck(obj, type))) return 1;
     }
-    PyErr_Format(PyExc_TypeError,
-        "Argument '%s' has incorrect type (expected %s, got %s)",
-        name, type->tp_name, Py_TYPE(obj)->tp_name);
+    __Pyx_RaiseArgumentTypeInvalid(name, obj, type);
     return 0;
 }
 
@@ -31771,6 +34480,132 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
     return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
 }
 
+static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
+#if CYTHON_COMPILING_IN_PYPY
+    return PyObject_RichCompareBool(s1, s2, equals);
+#else
+    if (s1 == s2) {
+        return (equals == Py_EQ);
+    } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
+        const char *ps1, *ps2;
+        Py_ssize_t length = PyBytes_GET_SIZE(s1);
+        if (length != PyBytes_GET_SIZE(s2))
+            return (equals == Py_NE);
+        ps1 = PyBytes_AS_STRING(s1);
+        ps2 = PyBytes_AS_STRING(s2);
+        if (ps1[0] != ps2[0]) {
+            return (equals == Py_NE);
+        } else if (length == 1) {
+            return (equals == Py_EQ);
+        } else {
+            int result = memcmp(ps1, ps2, (size_t)length);
+            return (equals == Py_EQ) ? (result == 0) : (result != 0);
+        }
+    } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
+        return (equals == Py_NE);
+    } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
+        return (equals == Py_NE);
+    } else {
+        int result;
+        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
+        if (!py_result)
+            return -1;
+        result = __Pyx_PyObject_IsTrue(py_result);
+        Py_DECREF(py_result);
+        return result;
+    }
+#endif
+}
+
+static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
+#if CYTHON_COMPILING_IN_PYPY
+    return PyObject_RichCompareBool(s1, s2, equals);
+#else
+#if PY_MAJOR_VERSION < 3
+    PyObject* owned_ref = NULL;
+#endif
+    int s1_is_unicode, s2_is_unicode;
+    if (s1 == s2) {
+        goto return_eq;
+    }
+    s1_is_unicode = PyUnicode_CheckExact(s1);
+    s2_is_unicode = PyUnicode_CheckExact(s2);
+#if PY_MAJOR_VERSION < 3
+    if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
+        owned_ref = PyUnicode_FromObject(s2);
+        if (unlikely(!owned_ref))
+            return -1;
+        s2 = owned_ref;
+        s2_is_unicode = 1;
+    } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
+        owned_ref = PyUnicode_FromObject(s1);
+        if (unlikely(!owned_ref))
+            return -1;
+        s1 = owned_ref;
+        s1_is_unicode = 1;
+    } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
+        return __Pyx_PyBytes_Equals(s1, s2, equals);
+    }
+#endif
+    if (s1_is_unicode & s2_is_unicode) {
+        Py_ssize_t length;
+        int kind;
+        void *data1, *data2;
+        if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
+            return -1;
+        length = __Pyx_PyUnicode_GET_LENGTH(s1);
+        if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
+            goto return_ne;
+        }
+        kind = __Pyx_PyUnicode_KIND(s1);
+        if (kind != __Pyx_PyUnicode_KIND(s2)) {
+            goto return_ne;
+        }
+        data1 = __Pyx_PyUnicode_DATA(s1);
+        data2 = __Pyx_PyUnicode_DATA(s2);
+        if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
+            goto return_ne;
+        } else if (length == 1) {
+            goto return_eq;
+        } else {
+            int result = memcmp(data1, data2, (size_t)(length * kind));
+            #if PY_MAJOR_VERSION < 3
+            Py_XDECREF(owned_ref);
+            #endif
+            return (equals == Py_EQ) ? (result == 0) : (result != 0);
+        }
+    } else if ((s1 == Py_None) & s2_is_unicode) {
+        goto return_ne;
+    } else if ((s2 == Py_None) & s1_is_unicode) {
+        goto return_ne;
+    } else {
+        int result;
+        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
+        if (!py_result)
+            return -1;
+        result = __Pyx_PyObject_IsTrue(py_result);
+        Py_DECREF(py_result);
+        return result;
+    }
+return_eq:
+    #if PY_MAJOR_VERSION < 3
+    Py_XDECREF(owned_ref);
+    #endif
+    return (equals == Py_EQ);
+return_ne:
+    #if PY_MAJOR_VERSION < 3
+    Py_XDECREF(owned_ref);
+    #endif
+    return (equals == Py_NE);
+#endif
+}
+
+#if !CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) {
+    return PyObject_CallMethodObjArgs(sep, __pyx_n_s_join, values, NULL);
+}
+#endif
+
 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
          const char* cstring, Py_ssize_t start, Py_ssize_t stop,
          const char* encoding, const char* errors,
@@ -31810,11 +34645,43 @@ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
     return value;
 }
 
-#if PY_MAJOR_VERSION >= 3
+static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
+    PyObject *method, *result = NULL;
+    method = __Pyx_PyObject_GetAttrStr(obj, method_name);
+    if (unlikely(!method)) goto bad;
+#if CYTHON_COMPILING_IN_CPYTHON
+    if (likely(PyMethod_Check(method))) {
+        PyObject *self = PyMethod_GET_SELF(method);
+        if (likely(self)) {
+            PyObject *args;
+            PyObject *function = PyMethod_GET_FUNCTION(method);
+            args = PyTuple_New(2);
+            if (unlikely(!args)) goto bad;
+            Py_INCREF(self);
+            PyTuple_SET_ITEM(args, 0, self);
+            Py_INCREF(arg);
+            PyTuple_SET_ITEM(args, 1, arg);
+            Py_INCREF(function);
+            Py_DECREF(method); method = NULL;
+            result = __Pyx_PyObject_Call(function, args, NULL);
+            Py_DECREF(args);
+            Py_DECREF(function);
+            return result;
+        }
+    }
+#endif
+    result = __Pyx_PyObject_CallOneArg(method, arg);
+bad:
+    Py_XDECREF(method);
+    return result;
+}
+
 static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d) {
-    return __Pyx_PyObject_CallMethod1((PyObject*)&PyDict_Type, __pyx_n_s__items, d);
+    if (PY_MAJOR_VERSION >= 3)
+        return __Pyx_PyObject_CallMethod1((PyObject*)&PyDict_Type, __pyx_n_s_items, d);
+    else
+        return PyDict_Items(d);
 }
-#endif
 
 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
 #if CYTHON_COMPILING_IN_CPYTHON
@@ -31876,35 +34743,163 @@ static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObje
     return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v);
 }
 
-static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) {
-#if CYTHON_COMPILING_IN_CPYTHON
-    PyThreadState *tstate = PyThreadState_GET();
-    *type = tstate->exc_type;
-    *value = tstate->exc_value;
-    *tb = tstate->exc_traceback;
-    Py_XINCREF(*type);
-    Py_XINCREF(*value);
-    Py_XINCREF(*tb);
-#else
-    PyErr_GetExcInfo(type, value, tb);
-#endif
+static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
+    int start = 0, mid = 0, end = count - 1;
+    if (end >= 0 && code_line > entries[end].code_line) {
+        return count;
+    }
+    while (start < end) {
+        mid = (start + end) / 2;
+        if (code_line < entries[mid].code_line) {
+            end = mid;
+        } else if (code_line > entries[mid].code_line) {
+             start = mid + 1;
+        } else {
+            return mid;
+        }
+    }
+    if (code_line <= entries[mid].code_line) {
+        return mid;
+    } else {
+        return mid + 1;
+    }
 }
-static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) {
-#if CYTHON_COMPILING_IN_CPYTHON
-    PyObject *tmp_type, *tmp_value, *tmp_tb;
-    PyThreadState *tstate = PyThreadState_GET();
-    tmp_type = tstate->exc_type;
-    tmp_value = tstate->exc_value;
-    tmp_tb = tstate->exc_traceback;
-    tstate->exc_type = type;
-    tstate->exc_value = value;
-    tstate->exc_traceback = tb;
-    Py_XDECREF(tmp_type);
-    Py_XDECREF(tmp_value);
-    Py_XDECREF(tmp_tb);
-#else
-    PyErr_SetExcInfo(type, value, tb);
-#endif
+static PyCodeObject *__pyx_find_code_object(int code_line) {
+    PyCodeObject* code_object;
+    int pos;
+    if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
+        return NULL;
+    }
+    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
+    if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
+        return NULL;
+    }
+    code_object = __pyx_code_cache.entries[pos].code_object;
+    Py_INCREF(code_object);
+    return code_object;
+}
+static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
+    int pos, i;
+    __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
+    if (unlikely(!code_line)) {
+        return;
+    }
+    if (unlikely(!entries)) {
+        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
+        if (likely(entries)) {
+            __pyx_code_cache.entries = entries;
+            __pyx_code_cache.max_count = 64;
+            __pyx_code_cache.count = 1;
+            entries[0].code_line = code_line;
+            entries[0].code_object = code_object;
+            Py_INCREF(code_object);
+        }
+        return;
+    }
+    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
+    if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
+        PyCodeObject* tmp = entries[pos].code_object;
+        entries[pos].code_object = code_object;
+        Py_DECREF(tmp);
+        return;
+    }
+    if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
+        int new_max = __pyx_code_cache.max_count + 64;
+        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
+            __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
+        if (unlikely(!entries)) {
+            return;
+        }
+        __pyx_code_cache.entries = entries;
+        __pyx_code_cache.max_count = new_max;
+    }
+    for (i=__pyx_code_cache.count; i>pos; i--) {
+        entries[i] = entries[i-1];
+    }
+    entries[pos].code_line = code_line;
+    entries[pos].code_object = code_object;
+    __pyx_code_cache.count++;
+    Py_INCREF(code_object);
+}
+
+#include "compile.h"
+#include "frameobject.h"
+#include "traceback.h"
+static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
+            const char *funcname, int c_line,
+            int py_line, const char *filename) {
+    PyCodeObject *py_code = 0;
+    PyObject *py_srcfile = 0;
+    PyObject *py_funcname = 0;
+    #if PY_MAJOR_VERSION < 3
+    py_srcfile = PyString_FromString(filename);
+    #else
+    py_srcfile = PyUnicode_FromString(filename);
+    #endif
+    if (!py_srcfile) goto bad;
+    if (c_line) {
+        #if PY_MAJOR_VERSION < 3
+        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
+        #else
+        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
+        #endif
+    }
+    else {
+        #if PY_MAJOR_VERSION < 3
+        py_funcname = PyString_FromString(funcname);
+        #else
+        py_funcname = PyUnicode_FromString(funcname);
+        #endif
+    }
+    if (!py_funcname) goto bad;
+    py_code = __Pyx_PyCode_New(
+        0,
+        0,
+        0,
+        0,
+        0,
+        __pyx_empty_bytes, /*PyObject *code,*/
+        __pyx_empty_tuple, /*PyObject *consts,*/
+        __pyx_empty_tuple, /*PyObject *names,*/
+        __pyx_empty_tuple, /*PyObject *varnames,*/
+        __pyx_empty_tuple, /*PyObject *freevars,*/
+        __pyx_empty_tuple, /*PyObject *cellvars,*/
+        py_srcfile,   /*PyObject *filename,*/
+        py_funcname,  /*PyObject *name,*/
+        py_line,
+        __pyx_empty_bytes  /*PyObject *lnotab*/
+    );
+    Py_DECREF(py_srcfile);
+    Py_DECREF(py_funcname);
+    return py_code;
+bad:
+    Py_XDECREF(py_srcfile);
+    Py_XDECREF(py_funcname);
+    return NULL;
+}
+static void __Pyx_AddTraceback(const char *funcname, int c_line,
+                               int py_line, const char *filename) {
+    PyCodeObject *py_code = 0;
+    PyFrameObject *py_frame = 0;
+    py_code = __pyx_find_code_object(c_line ? c_line : py_line);
+    if (!py_code) {
+        py_code = __Pyx_CreateCodeObjectForTraceback(
+            funcname, c_line, py_line, filename);
+        if (!py_code) goto bad;
+        __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
+    }
+    py_frame = PyFrame_New(
+        PyThreadState_GET(), /*PyThreadState *tstate,*/
+        py_code,             /*PyCodeObject *code,*/
+        __pyx_d,      /*PyObject *globals,*/
+        0                    /*PyObject *locals*/
+    );
+    if (!py_frame) goto bad;
+    py_frame->f_lineno = py_line;
+    PyTraceBack_Here(py_frame);
+bad:
+    Py_XDECREF(py_code);
+    Py_XDECREF(py_frame);
 }
 
 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
@@ -31915,7 +34910,7 @@ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
     PyObject *list;
     #if PY_VERSION_HEX < 0x03030000
     PyObject *py_import;
-    py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s____import__);
+    py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
     if (!py_import)
         goto bad;
     #endif
@@ -31933,7 +34928,6 @@ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
     empty_dict = PyDict_New();
     if (!empty_dict)
         goto bad;
-    #if PY_VERSION_HEX >= 0x02050000
     {
         #if PY_MAJOR_VERSION >= 3
         if (level == -1) {
@@ -31955,7 +34949,7 @@ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
                     PyErr_Clear();
                 }
             }
-            level = 0; /* try absolute import on failure */
+            level = 0;
         }
         #endif
         if (!module) {
@@ -31972,14 +34966,6 @@ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
             #endif
         }
     }
-    #else
-    if (level>0) {
-        PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4.");
-        goto bad;
-    }
-    module = PyObject_CallFunctionObjArgs(py_import,
-        name, global_dict, empty_dict, list, NULL);
-    #endif
 bad:
     #if PY_VERSION_HEX < 0x03030000
     Py_XDECREF(py_import);
@@ -31989,560 +34975,362 @@ bad:
     return module;
 }
 
-static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) {
-    const unsigned char neg_one = (unsigned char)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(unsigned char) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(unsigned char)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to unsigned char" :
-                    "value too large to convert to unsigned char");
-            }
-            return (unsigned char)-1;
-        }
-        return (unsigned char)val;
-    }
-    return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x);
-}
-
-static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) {
-    const unsigned short neg_one = (unsigned short)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(unsigned short) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(unsigned short)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to unsigned short" :
-                    "value too large to convert to unsigned short");
-            }
-            return (unsigned short)-1;
-        }
-        return (unsigned short)val;
-    }
-    return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x);
-}
-
-static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) {
-    const unsigned int neg_one = (unsigned int)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(unsigned int) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(unsigned int)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to unsigned int" :
-                    "value too large to convert to unsigned int");
-            }
-            return (unsigned int)-1;
-        }
-        return (unsigned int)val;
-    }
-    return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x);
-}
-
-static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) {
-    const char neg_one = (char)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(char) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(char)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to char" :
-                    "value too large to convert to char");
-            }
-            return (char)-1;
-        }
-        return (char)val;
-    }
-    return (char)__Pyx_PyInt_AsLong(x);
-}
-
-static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) {
-    const short neg_one = (short)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(short) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(short)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to short" :
-                    "value too large to convert to short");
-            }
-            return (short)-1;
-        }
-        return (short)val;
-    }
-    return (short)__Pyx_PyInt_AsLong(x);
-}
-
-static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) {
-    const int neg_one = (int)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(int) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(int)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to int" :
-                    "value too large to convert to int");
-            }
-            return (int)-1;
-        }
-        return (int)val;
-    }
-    return (int)__Pyx_PyInt_AsLong(x);
-}
-
-static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) {
-    const signed char neg_one = (signed char)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(signed char) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(signed char)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to signed char" :
-                    "value too large to convert to signed char");
-            }
-            return (signed char)-1;
-        }
-        return (signed char)val;
-    }
-    return (signed char)__Pyx_PyInt_AsSignedLong(x);
-}
-
-static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) {
-    const signed short neg_one = (signed short)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(signed short) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(signed short)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to signed short" :
-                    "value too large to convert to signed short");
-            }
-            return (signed short)-1;
-        }
-        return (signed short)val;
-    }
-    return (signed short)__Pyx_PyInt_AsSignedLong(x);
-}
-
-static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) {
-    const signed int neg_one = (signed int)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(signed int) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(signed int)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to signed int" :
-                    "value too large to convert to signed int");
-            }
-            return (signed int)-1;
-        }
-        return (signed int)val;
-    }
-    return (signed int)__Pyx_PyInt_AsSignedLong(x);
-}
-
-static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) {
-    const int neg_one = (int)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(int) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(int)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to int" :
-                    "value too large to convert to int");
-            }
-            return (int)-1;
-        }
-        return (int)val;
-    }
-    return (int)__Pyx_PyInt_AsLong(x);
-}
-
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
-#include "longintrepr.h"
-#endif
-#endif
-static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) {
-    const unsigned long neg_one = (unsigned long)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-#if PY_MAJOR_VERSION < 3
-    if (likely(PyInt_Check(x))) {
-        long val = PyInt_AS_LONG(x);
-        if (is_unsigned && unlikely(val < 0)) {
-            PyErr_SetString(PyExc_OverflowError,
-                            "can't convert negative value to unsigned long");
-            return (unsigned long)-1;
-        }
-        return (unsigned long)val;
-    } else
-#endif
-    if (likely(PyLong_Check(x))) {
-        if (is_unsigned) {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(unsigned long)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return (unsigned long) ((PyLongObject*)x)->ob_digit[0];
-                }
-            }
-#endif
-#endif
-            if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to unsigned long");
-                return (unsigned long)-1;
-            }
-            return (unsigned long)PyLong_AsUnsignedLong(x);
-        } else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(unsigned long)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return +(unsigned long) ((PyLongObject*)x)->ob_digit[0];
-                    case -1: return -(unsigned long) ((PyLongObject*)x)->ob_digit[0];
-                }
-            }
-#endif
-#endif
-            return (unsigned long)PyLong_AsLong(x);
-        }
-    } else {
-        unsigned long val;
-        PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (unsigned long)-1;
-        val = __Pyx_PyInt_AsUnsignedLong(tmp);
-        Py_DECREF(tmp);
-        return val;
-    }
-}
-
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
-#include "longintrepr.h"
-#endif
-#endif
-static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) {
-    const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-#if PY_MAJOR_VERSION < 3
-    if (likely(PyInt_Check(x))) {
-        long val = PyInt_AS_LONG(x);
-        if (is_unsigned && unlikely(val < 0)) {
-            PyErr_SetString(PyExc_OverflowError,
-                            "can't convert negative value to unsigned PY_LONG_LONG");
-            return (unsigned PY_LONG_LONG)-1;
-        }
-        return (unsigned PY_LONG_LONG)val;
-    } else
-#endif
-    if (likely(PyLong_Check(x))) {
-        if (is_unsigned) {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(unsigned PY_LONG_LONG)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return (unsigned PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
-                }
-            }
-#endif
-#endif
-            if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to unsigned PY_LONG_LONG");
-                return (unsigned PY_LONG_LONG)-1;
-            }
-            return (unsigned PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
-        } else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(unsigned PY_LONG_LONG)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return +(unsigned PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
-                    case -1: return -(unsigned PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
-                }
-            }
-#endif
-#endif
-            return (unsigned PY_LONG_LONG)PyLong_AsLongLong(x);
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
+    const int neg_one = (int) -1, const_zero = 0;
+    const int is_unsigned = neg_one > const_zero;
+    if (is_unsigned) {
+        if (sizeof(int) < sizeof(long)) {
+            return PyInt_FromLong((long) value);
+        } else if (sizeof(int) <= sizeof(unsigned long)) {
+            return PyLong_FromUnsignedLong((unsigned long) value);
+        } else if (sizeof(int) <= sizeof(unsigned long long)) {
+            return PyLong_FromUnsignedLongLong((unsigned long long) value);
         }
     } else {
-        unsigned PY_LONG_LONG val;
-        PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (unsigned PY_LONG_LONG)-1;
-        val = __Pyx_PyInt_AsUnsignedLongLong(tmp);
-        Py_DECREF(tmp);
-        return val;
+        if (sizeof(int) <= sizeof(long)) {
+            return PyInt_FromLong((long) value);
+        } else if (sizeof(int) <= sizeof(long long)) {
+            return PyLong_FromLongLong((long long) value);
+        }
+    }
+    {
+        int one = 1; int little = (int)*(unsigned char *)&one;
+        unsigned char *bytes = (unsigned char *)&value;
+        return _PyLong_FromByteArray(bytes, sizeof(int),
+                                     little, !is_unsigned);
     }
 }
 
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
-#include "longintrepr.h"
-#endif
-#endif
-static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) {
-    const long neg_one = (long)-1, const_zero = 0;
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
+    const long neg_one = (long) -1, const_zero = 0;
     const int is_unsigned = neg_one > const_zero;
-#if PY_MAJOR_VERSION < 3
-    if (likely(PyInt_Check(x))) {
-        long val = PyInt_AS_LONG(x);
-        if (is_unsigned && unlikely(val < 0)) {
-            PyErr_SetString(PyExc_OverflowError,
-                            "can't convert negative value to long");
-            return (long)-1;
-        }
-        return (long)val;
-    } else
-#endif
-    if (likely(PyLong_Check(x))) {
-        if (is_unsigned) {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(long)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return (long) ((PyLongObject*)x)->ob_digit[0];
-                }
-            }
-#endif
-#endif
-            if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to long");
-                return (long)-1;
-            }
-            return (long)PyLong_AsUnsignedLong(x);
-        } else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(long)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return +(long) ((PyLongObject*)x)->ob_digit[0];
-                    case -1: return -(long) ((PyLongObject*)x)->ob_digit[0];
-                }
-            }
-#endif
-#endif
-            return (long)PyLong_AsLong(x);
+    if (is_unsigned) {
+        if (sizeof(long) < sizeof(long)) {
+            return PyInt_FromLong((long) value);
+        } else if (sizeof(long) <= sizeof(unsigned long)) {
+            return PyLong_FromUnsignedLong((unsigned long) value);
+        } else if (sizeof(long) <= sizeof(unsigned long long)) {
+            return PyLong_FromUnsignedLongLong((unsigned long long) value);
         }
     } else {
-        long val;
-        PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (long)-1;
-        val = __Pyx_PyInt_AsLong(tmp);
-        Py_DECREF(tmp);
-        return val;
+        if (sizeof(long) <= sizeof(long)) {
+            return PyInt_FromLong((long) value);
+        } else if (sizeof(long) <= sizeof(long long)) {
+            return PyLong_FromLongLong((long long) value);
+        }
+    }
+    {
+        int one = 1; int little = (int)*(unsigned char *)&one;
+        unsigned char *bytes = (unsigned char *)&value;
+        return _PyLong_FromByteArray(bytes, sizeof(long),
+                                     little, !is_unsigned);
     }
 }
 
+#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)       \
+    {                                                                     \
+        func_type value = func_value;                                     \
+        if (sizeof(target_type) < sizeof(func_type)) {                    \
+            if (unlikely(value != (func_type) (target_type) value)) {     \
+                func_type zero = 0;                                       \
+                if (is_unsigned && unlikely(value < zero))                \
+                    goto raise_neg_overflow;                              \
+                else                                                      \
+                    goto raise_overflow;                                  \
+            }                                                             \
+        }                                                                 \
+        return (target_type) value;                                       \
+    }
+
 #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
-#include "longintrepr.h"
-#endif
+ #if CYTHON_USE_PYLONG_INTERNALS
+  #include "longintrepr.h"
+ #endif
 #endif
-static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) {
-    const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0;
+
+static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
+    const long neg_one = (long) -1, const_zero = 0;
     const int is_unsigned = neg_one > const_zero;
 #if PY_MAJOR_VERSION < 3
     if (likely(PyInt_Check(x))) {
-        long val = PyInt_AS_LONG(x);
-        if (is_unsigned && unlikely(val < 0)) {
-            PyErr_SetString(PyExc_OverflowError,
-                            "can't convert negative value to PY_LONG_LONG");
-            return (PY_LONG_LONG)-1;
+        if (sizeof(long) < sizeof(long)) {
+            __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
+        } else {
+            long val = PyInt_AS_LONG(x);
+            if (is_unsigned && unlikely(val < 0)) {
+                goto raise_neg_overflow;
+            }
+            return (long) val;
         }
-        return (PY_LONG_LONG)val;
     } else
 #endif
     if (likely(PyLong_Check(x))) {
         if (is_unsigned) {
 #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(PY_LONG_LONG)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return (PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
-                }
+ #if CYTHON_USE_PYLONG_INTERNALS
+            switch (Py_SIZE(x)) {
+                case  0: return 0;
+                case  1: __PYX_VERIFY_RETURN_INT(long, digit, ((PyLongObject*)x)->ob_digit[0]);
             }
-#endif
+ #endif
 #endif
             if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to PY_LONG_LONG");
-                return (PY_LONG_LONG)-1;
+                goto raise_neg_overflow;
+            }
+            if (sizeof(long) <= sizeof(unsigned long)) {
+                __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong(x))
+            } else if (sizeof(long) <= sizeof(unsigned long long)) {
+                __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong(x))
             }
-            return (PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
         } else {
 #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(PY_LONG_LONG)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return +(PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
-                    case -1: return -(PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
-                }
+ #if CYTHON_USE_PYLONG_INTERNALS
+            switch (Py_SIZE(x)) {
+                case  0: return 0;
+                case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +(((PyLongObject*)x)->ob_digit[0]));
+                case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
             }
+ #endif
 #endif
+            if (sizeof(long) <= sizeof(long)) {
+                __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong(x))
+            } else if (sizeof(long) <= sizeof(long long)) {
+                __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong(x))
+            }
+        }
+        {
+#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
+            PyErr_SetString(PyExc_RuntimeError,
+                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
+#else
+            long val;
+            PyObject *v = __Pyx_PyNumber_Int(x);
+ #if PY_MAJOR_VERSION < 3
+            if (likely(v) && !PyLong_Check(v)) {
+                PyObject *tmp = v;
+                v = PyNumber_Long(tmp);
+                Py_DECREF(tmp);
+            }
+ #endif
+            if (likely(v)) {
+                int one = 1; int is_little = (int)*(unsigned char *)&one;
+                unsigned char *bytes = (unsigned char *)&val;
+                int ret = _PyLong_AsByteArray((PyLongObject *)v,
+                                              bytes, sizeof(val),
+                                              is_little, !is_unsigned);
+                Py_DECREF(v);
+                if (likely(!ret))
+                    return val;
+            }
 #endif
-            return (PY_LONG_LONG)PyLong_AsLongLong(x);
+            return (long) -1;
         }
     } else {
-        PY_LONG_LONG val;
+        long val;
         PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (PY_LONG_LONG)-1;
-        val = __Pyx_PyInt_AsLongLong(tmp);
+        if (!tmp) return (long) -1;
+        val = __Pyx_PyInt_As_long(tmp);
         Py_DECREF(tmp);
         return val;
     }
+raise_overflow:
+    PyErr_SetString(PyExc_OverflowError,
+        "value too large to convert to long");
+    return (long) -1;
+raise_neg_overflow:
+    PyErr_SetString(PyExc_OverflowError,
+        "can't convert negative value to long");
+    return (long) -1;
 }
 
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
-#include "longintrepr.h"
-#endif
-#endif
-static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) {
-    const signed long neg_one = (signed long)-1, const_zero = 0;
+static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) {
+    const size_t neg_one = (size_t) -1, const_zero = 0;
     const int is_unsigned = neg_one > const_zero;
 #if PY_MAJOR_VERSION < 3
     if (likely(PyInt_Check(x))) {
-        long val = PyInt_AS_LONG(x);
-        if (is_unsigned && unlikely(val < 0)) {
-            PyErr_SetString(PyExc_OverflowError,
-                            "can't convert negative value to signed long");
-            return (signed long)-1;
+        if (sizeof(size_t) < sizeof(long)) {
+            __PYX_VERIFY_RETURN_INT(size_t, long, PyInt_AS_LONG(x))
+        } else {
+            long val = PyInt_AS_LONG(x);
+            if (is_unsigned && unlikely(val < 0)) {
+                goto raise_neg_overflow;
+            }
+            return (size_t) val;
         }
-        return (signed long)val;
     } else
 #endif
     if (likely(PyLong_Check(x))) {
         if (is_unsigned) {
 #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(signed long)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return (signed long) ((PyLongObject*)x)->ob_digit[0];
-                }
+ #if CYTHON_USE_PYLONG_INTERNALS
+            switch (Py_SIZE(x)) {
+                case  0: return 0;
+                case  1: __PYX_VERIFY_RETURN_INT(size_t, digit, ((PyLongObject*)x)->ob_digit[0]);
             }
-#endif
+ #endif
 #endif
             if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to signed long");
-                return (signed long)-1;
+                goto raise_neg_overflow;
+            }
+            if (sizeof(size_t) <= sizeof(unsigned long)) {
+                __PYX_VERIFY_RETURN_INT(size_t, unsigned long, PyLong_AsUnsignedLong(x))
+            } else if (sizeof(size_t) <= sizeof(unsigned long long)) {
+                __PYX_VERIFY_RETURN_INT(size_t, unsigned long long, PyLong_AsUnsignedLongLong(x))
             }
-            return (signed long)PyLong_AsUnsignedLong(x);
         } else {
 #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(signed long)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return +(signed long) ((PyLongObject*)x)->ob_digit[0];
-                    case -1: return -(signed long) ((PyLongObject*)x)->ob_digit[0];
-                }
+ #if CYTHON_USE_PYLONG_INTERNALS
+            switch (Py_SIZE(x)) {
+                case  0: return 0;
+                case  1: __PYX_VERIFY_RETURN_INT(size_t,  digit, +(((PyLongObject*)x)->ob_digit[0]));
+                case -1: __PYX_VERIFY_RETURN_INT(size_t, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
             }
+ #endif
 #endif
+            if (sizeof(size_t) <= sizeof(long)) {
+                __PYX_VERIFY_RETURN_INT(size_t, long, PyLong_AsLong(x))
+            } else if (sizeof(size_t) <= sizeof(long long)) {
+                __PYX_VERIFY_RETURN_INT(size_t, long long, PyLong_AsLongLong(x))
+            }
+        }
+        {
+#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
+            PyErr_SetString(PyExc_RuntimeError,
+                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
+#else
+            size_t val;
+            PyObject *v = __Pyx_PyNumber_Int(x);
+ #if PY_MAJOR_VERSION < 3
+            if (likely(v) && !PyLong_Check(v)) {
+                PyObject *tmp = v;
+                v = PyNumber_Long(tmp);
+                Py_DECREF(tmp);
+            }
+ #endif
+            if (likely(v)) {
+                int one = 1; int is_little = (int)*(unsigned char *)&one;
+                unsigned char *bytes = (unsigned char *)&val;
+                int ret = _PyLong_AsByteArray((PyLongObject *)v,
+                                              bytes, sizeof(val),
+                                              is_little, !is_unsigned);
+                Py_DECREF(v);
+                if (likely(!ret))
+                    return val;
+            }
 #endif
-            return (signed long)PyLong_AsLong(x);
+            return (size_t) -1;
         }
     } else {
-        signed long val;
+        size_t val;
         PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (signed long)-1;
-        val = __Pyx_PyInt_AsSignedLong(tmp);
+        if (!tmp) return (size_t) -1;
+        val = __Pyx_PyInt_As_size_t(tmp);
         Py_DECREF(tmp);
         return val;
     }
+raise_overflow:
+    PyErr_SetString(PyExc_OverflowError,
+        "value too large to convert to size_t");
+    return (size_t) -1;
+raise_neg_overflow:
+    PyErr_SetString(PyExc_OverflowError,
+        "can't convert negative value to size_t");
+    return (size_t) -1;
 }
 
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
-#include "longintrepr.h"
-#endif
-#endif
-static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) {
-    const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0;
+static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
+    const int neg_one = (int) -1, const_zero = 0;
     const int is_unsigned = neg_one > const_zero;
 #if PY_MAJOR_VERSION < 3
     if (likely(PyInt_Check(x))) {
-        long val = PyInt_AS_LONG(x);
-        if (is_unsigned && unlikely(val < 0)) {
-            PyErr_SetString(PyExc_OverflowError,
-                            "can't convert negative value to signed PY_LONG_LONG");
-            return (signed PY_LONG_LONG)-1;
+        if (sizeof(int) < sizeof(long)) {
+            __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
+        } else {
+            long val = PyInt_AS_LONG(x);
+            if (is_unsigned && unlikely(val < 0)) {
+                goto raise_neg_overflow;
+            }
+            return (int) val;
         }
-        return (signed PY_LONG_LONG)val;
     } else
 #endif
     if (likely(PyLong_Check(x))) {
         if (is_unsigned) {
 #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(signed PY_LONG_LONG)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return (signed PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
-                }
+ #if CYTHON_USE_PYLONG_INTERNALS
+            switch (Py_SIZE(x)) {
+                case  0: return 0;
+                case  1: __PYX_VERIFY_RETURN_INT(int, digit, ((PyLongObject*)x)->ob_digit[0]);
             }
-#endif
+ #endif
 #endif
             if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to signed PY_LONG_LONG");
-                return (signed PY_LONG_LONG)-1;
+                goto raise_neg_overflow;
+            }
+            if (sizeof(int) <= sizeof(unsigned long)) {
+                __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong(x))
+            } else if (sizeof(int) <= sizeof(unsigned long long)) {
+                __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong(x))
             }
-            return (signed PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
         } else {
 #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(signed PY_LONG_LONG)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return +(signed PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
-                    case -1: return -(signed PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
-                }
+ #if CYTHON_USE_PYLONG_INTERNALS
+            switch (Py_SIZE(x)) {
+                case  0: return 0;
+                case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +(((PyLongObject*)x)->ob_digit[0]));
+                case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
             }
+ #endif
 #endif
+            if (sizeof(int) <= sizeof(long)) {
+                __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong(x))
+            } else if (sizeof(int) <= sizeof(long long)) {
+                __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong(x))
+            }
+        }
+        {
+#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
+            PyErr_SetString(PyExc_RuntimeError,
+                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
+#else
+            int val;
+            PyObject *v = __Pyx_PyNumber_Int(x);
+ #if PY_MAJOR_VERSION < 3
+            if (likely(v) && !PyLong_Check(v)) {
+                PyObject *tmp = v;
+                v = PyNumber_Long(tmp);
+                Py_DECREF(tmp);
+            }
+ #endif
+            if (likely(v)) {
+                int one = 1; int is_little = (int)*(unsigned char *)&one;
+                unsigned char *bytes = (unsigned char *)&val;
+                int ret = _PyLong_AsByteArray((PyLongObject *)v,
+                                              bytes, sizeof(val),
+                                              is_little, !is_unsigned);
+                Py_DECREF(v);
+                if (likely(!ret))
+                    return val;
+            }
 #endif
-            return (signed PY_LONG_LONG)PyLong_AsLongLong(x);
+            return (int) -1;
         }
     } else {
-        signed PY_LONG_LONG val;
+        int val;
         PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (signed PY_LONG_LONG)-1;
-        val = __Pyx_PyInt_AsSignedLongLong(tmp);
+        if (!tmp) return (int) -1;
+        val = __Pyx_PyInt_As_int(tmp);
         Py_DECREF(tmp);
         return val;
     }
+raise_overflow:
+    PyErr_SetString(PyExc_OverflowError,
+        "value too large to convert to int");
+    return (int) -1;
+raise_neg_overflow:
+    PyErr_SetString(PyExc_OverflowError,
+        "can't convert negative value to int");
+    return (int) -1;
 }
 
 static int __Pyx_check_binary_version(void) {
@@ -32555,11 +35343,7 @@ static int __Pyx_check_binary_version(void) {
                       "compiletime version %s of module '%.100s' "
                       "does not match runtime version %s",
                       ctversion, __Pyx_MODULE_NAME, rtversion);
-        #if PY_VERSION_HEX < 0x02050000
-        return PyErr_Warn(NULL, message);
-        #else
         return PyErr_WarnEx(NULL, message, 1);
-        #endif
     }
     return 0;
 }
@@ -32609,7 +35393,7 @@ static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class
         goto bad;
     if (!PyType_Check(result)) {
         PyErr_Format(PyExc_TypeError,
-            "%s.%s is not a type object",
+            "%.200s.%.200s is not a type object",
             module_name, class_name);
         goto bad;
     }
@@ -32629,15 +35413,11 @@ static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class
         PyOS_snprintf(warning, sizeof(warning),
             "%s.%s size changed, may indicate binary incompatibility",
             module_name, class_name);
-        #if PY_VERSION_HEX < 0x02050000
-        if (PyErr_Warn(NULL, warning) < 0) goto bad;
-        #else
         if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
-        #endif
     }
     else if ((size_t)basicsize != size) {
         PyErr_Format(PyExc_ValueError,
-            "%s.%s has the wrong size, try recompiling",
+            "%.200s.%.200s has the wrong size, try recompiling",
             module_name, class_name);
         goto bad;
     }
@@ -32649,168 +35429,6 @@ bad:
 }
 #endif
 
-static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
-    int start = 0, mid = 0, end = count - 1;
-    if (end >= 0 && code_line > entries[end].code_line) {
-        return count;
-    }
-    while (start < end) {
-        mid = (start + end) / 2;
-        if (code_line < entries[mid].code_line) {
-            end = mid;
-        } else if (code_line > entries[mid].code_line) {
-             start = mid + 1;
-        } else {
-            return mid;
-        }
-    }
-    if (code_line <= entries[mid].code_line) {
-        return mid;
-    } else {
-        return mid + 1;
-    }
-}
-static PyCodeObject *__pyx_find_code_object(int code_line) {
-    PyCodeObject* code_object;
-    int pos;
-    if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
-        return NULL;
-    }
-    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
-    if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
-        return NULL;
-    }
-    code_object = __pyx_code_cache.entries[pos].code_object;
-    Py_INCREF(code_object);
-    return code_object;
-}
-static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
-    int pos, i;
-    __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
-    if (unlikely(!code_line)) {
-        return;
-    }
-    if (unlikely(!entries)) {
-        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
-        if (likely(entries)) {
-            __pyx_code_cache.entries = entries;
-            __pyx_code_cache.max_count = 64;
-            __pyx_code_cache.count = 1;
-            entries[0].code_line = code_line;
-            entries[0].code_object = code_object;
-            Py_INCREF(code_object);
-        }
-        return;
-    }
-    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
-    if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
-        PyCodeObject* tmp = entries[pos].code_object;
-        entries[pos].code_object = code_object;
-        Py_DECREF(tmp);
-        return;
-    }
-    if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
-        int new_max = __pyx_code_cache.max_count + 64;
-        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
-            __pyx_code_cache.entries, new_max*sizeof(__Pyx_CodeObjectCacheEntry));
-        if (unlikely(!entries)) {
-            return;
-        }
-        __pyx_code_cache.entries = entries;
-        __pyx_code_cache.max_count = new_max;
-    }
-    for (i=__pyx_code_cache.count; i>pos; i--) {
-        entries[i] = entries[i-1];
-    }
-    entries[pos].code_line = code_line;
-    entries[pos].code_object = code_object;
-    __pyx_code_cache.count++;
-    Py_INCREF(code_object);
-}
-
-#include "compile.h"
-#include "frameobject.h"
-#include "traceback.h"
-static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
-            const char *funcname, int c_line,
-            int py_line, const char *filename) {
-    PyCodeObject *py_code = 0;
-    PyObject *py_srcfile = 0;
-    PyObject *py_funcname = 0;
-    #if PY_MAJOR_VERSION < 3
-    py_srcfile = PyString_FromString(filename);
-    #else
-    py_srcfile = PyUnicode_FromString(filename);
-    #endif
-    if (!py_srcfile) goto bad;
-    if (c_line) {
-        #if PY_MAJOR_VERSION < 3
-        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
-        #else
-        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
-        #endif
-    }
-    else {
-        #if PY_MAJOR_VERSION < 3
-        py_funcname = PyString_FromString(funcname);
-        #else
-        py_funcname = PyUnicode_FromString(funcname);
-        #endif
-    }
-    if (!py_funcname) goto bad;
-    py_code = __Pyx_PyCode_New(
-        0,            /*int argcount,*/
-        0,            /*int kwonlyargcount,*/
-        0,            /*int nlocals,*/
-        0,            /*int stacksize,*/
-        0,            /*int flags,*/
-        __pyx_empty_bytes, /*PyObject *code,*/
-        __pyx_empty_tuple, /*PyObject *consts,*/
-        __pyx_empty_tuple, /*PyObject *names,*/
-        __pyx_empty_tuple, /*PyObject *varnames,*/
-        __pyx_empty_tuple, /*PyObject *freevars,*/
-        __pyx_empty_tuple, /*PyObject *cellvars,*/
-        py_srcfile,   /*PyObject *filename,*/
-        py_funcname,  /*PyObject *name,*/
-        py_line,      /*int firstlineno,*/
-        __pyx_empty_bytes  /*PyObject *lnotab*/
-    );
-    Py_DECREF(py_srcfile);
-    Py_DECREF(py_funcname);
-    return py_code;
-bad:
-    Py_XDECREF(py_srcfile);
-    Py_XDECREF(py_funcname);
-    return NULL;
-}
-static void __Pyx_AddTraceback(const char *funcname, int c_line,
-                               int py_line, const char *filename) {
-    PyCodeObject *py_code = 0;
-    PyObject *py_globals = 0;
-    PyFrameObject *py_frame = 0;
-    py_code = __pyx_find_code_object(c_line ? c_line : py_line);
-    if (!py_code) {
-        py_code = __Pyx_CreateCodeObjectForTraceback(
-            funcname, c_line, py_line, filename);
-        if (!py_code) goto bad;
-        __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
-    }
-    py_globals = PyModule_GetDict(__pyx_m);
-    if (!py_globals) goto bad;
-    py_frame = PyFrame_New(
-        PyThreadState_GET(), /*PyThreadState *tstate,*/
-        py_code,             /*PyCodeObject *code,*/
-        py_globals,          /*PyObject *globals,*/
-        0                    /*PyObject *locals*/
-    );
-    if (!py_frame) goto bad;
-    py_frame->f_lineno = py_line;
-    PyTraceBack_Here(py_frame);
-bad:
-    Py_XDECREF(py_code);
-    Py_XDECREF(py_frame);
-}
-
 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
     while (t->p) {
         #if PY_MAJOR_VERSION < 3
@@ -32821,7 +35439,7 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
         } else {
             *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
         }
-        #else  /* Python 3+ has unicode identifiers */
+        #else
         if (t->is_unicode | t->is_str) {
             if (t->intern) {
                 *t->p = PyUnicode_InternFromString(t->s);
@@ -32841,8 +35459,8 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
     return 0;
 }
 
-static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char* c_str) {
-    return __Pyx_PyUnicode_FromStringAndSize(c_str, strlen(c_str));
+static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
+    return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
 }
 static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
     Py_ssize_t ignore;
@@ -32871,29 +35489,35 @@ static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_
                 }
             }
         }
-#endif /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/
+#endif
         *length = PyBytes_GET_SIZE(defenc);
         return defenc_c;
-#else /* PY_VERSION_HEX < 0x03030000 */
-        if (PyUnicode_READY(o) == -1) return NULL;
+#else
+        if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
         if (PyUnicode_IS_ASCII(o)) {
-            *length = PyUnicode_GET_DATA_SIZE(o);
+            *length = PyUnicode_GET_LENGTH(o);
             return PyUnicode_AsUTF8(o);
         } else {
             PyUnicode_AsASCIIString(o);
             return NULL;
         }
-#else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */
+#else
         return PyUnicode_AsUTF8AndSize(o, length);
-#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */
-#endif /* PY_VERSION_HEX < 0x03030000 */
+#endif
+#endif
+    } else
+#endif
+#if !CYTHON_COMPILING_IN_PYPY
+    if (PyByteArray_Check(o)) {
+        *length = PyByteArray_GET_SIZE(o);
+        return PyByteArray_AS_STRING(o);
     } else
-#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII  || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */
+#endif
     {
         char* result;
         int r = PyBytes_AsStringAndSize(o, &result, length);
-        if (r < 0) {
+        if (unlikely(r < 0)) {
             return NULL;
         } else {
             return result;
@@ -32938,7 +35562,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
     if (!PyLong_Check(res)) {
 #endif
       PyErr_Format(PyExc_TypeError,
-                   "__%s__ returned non-%s (type %.200s)",
+                   "__%.4s__ returned non-%.4s (type %.200s)",
                    name, name, Py_TYPE(res)->tp_name);
       Py_DECREF(res);
       return NULL;
@@ -32952,34 +35576,31 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
 }
 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
   Py_ssize_t ival;
-  PyObject* x = PyNumber_Index(b);
+  PyObject *x;
+#if PY_MAJOR_VERSION < 3
+  if (likely(PyInt_CheckExact(b)))
+      return PyInt_AS_LONG(b);
+#endif
+  if (likely(PyLong_CheckExact(b))) {
+    #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+     #if CYTHON_USE_PYLONG_INTERNALS
+       switch (Py_SIZE(b)) {
+       case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0];
+       case  0: return 0;
+       case  1: return ((PyLongObject*)b)->ob_digit[0];
+       }
+     #endif
+    #endif
+    return PyLong_AsSsize_t(b);
+  }
+  x = PyNumber_Index(b);
   if (!x) return -1;
   ival = PyInt_AsSsize_t(x);
   Py_DECREF(x);
   return ival;
 }
 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
-#if PY_VERSION_HEX < 0x02050000
-   if (ival <= LONG_MAX)
-       return PyInt_FromLong((long)ival);
-   else {
-       unsigned char *bytes = (unsigned char *) &ival;
-       int one = 1; int little = (int)*(unsigned char*)&one;
-       return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0);
-   }
-#else
-   return PyInt_FromSize_t(ival);
-#endif
-}
-static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) {
-   unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x);
-   if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) {
-       if ((val != (unsigned PY_LONG_LONG)-1) || !PyErr_Occurred())
-           PyErr_SetString(PyExc_OverflowError,
-                           "value too large to convert to size_t");
-       return (size_t)-1;
-   }
-   return (size_t)val;
+    return PyInt_FromSize_t(ival);
 }
 
 
diff --git a/pygrib.pyx b/pygrib.pyx
index 6c33bc7..bcb979d 100644
--- a/pygrib.pyx
+++ b/pygrib.pyx
@@ -73,8 +73,7 @@ Installation
  - Look at examples in C{test} directory (most require 
  U{matplotlib<http://matplotlib.sf.net>} and
  U{basemap<http://matplotlib.sourceforge.net/basemap/doc/html/>}).
- - If you're on MacOS X, see
- U{README.macosx<http://pygrib.googlecode.com/svn/trunk/README.macosx>}
+ - If you're on MacOS X, see README.macosx
  for special instruction on how to install pygrib and all it's
  dependencies using U{macports<http://macports.org>}.
 
@@ -148,16 +147,11 @@ Documentation
 
  - see below for the full python API documentation.
   
-Changelog
-=========
-
- - see U{Changelog<http://pygrib.googlecode.com/svn/trunk/Changelog>} file.
-
 @author: Jeffrey Whitaker.
 
 @contact: U{Jeff Whitaker<mailto:jeffrey.s.whitaker at noaa.gov>}
 
- at version: 1.9.9
+ at version: 2.0.0
 
 @copyright: copyright 2010 by Jeffrey Whitaker.
 
@@ -175,7 +169,7 @@ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 PERFORMANCE OF THIS SOFTWARE."""
 __test__ = None
 del __test__ # hack so epydoc doesn't show __test__
-__version__ = '1.9.9'
+__version__ = '2.0.0'
 
 import numpy as np
 import warnings
@@ -996,16 +990,14 @@ cdef class gribmessage(object):
         """
         is_missing(key)
 
-        returns True if value associated with key is equal
+        returns True if key is invalid or value associated with key is equal
         to grib missing value flag (False otherwise)"""
         cdef int err,miss
         cdef char *name
         bytestr = _strencode(key)
         name = bytestr
         miss = grib_is_missing(self._gh, name, &err)
-        if err:
-            raise RuntimeError(grib_get_error_message(err))
-        if miss:
+        if miss or err:
             return True
         else:
             return False
@@ -1838,6 +1830,8 @@ Example usage:
 
 >>> import pygrib
 >>> grbindx=pygrib.index('sampledata/gfs.grb','shortName','typeOfLevel','level')
+>>> grbindx.keys
+['shortName', 'level']
 >>> selected_grbs=grbindx.select(shortName='gh',typeOfLevel='isobaricInhPa',level=500)
 >>> for grb in selected_grbs:
 >>>     grb
@@ -1850,15 +1844,19 @@ Example usage:
 >>> grbindx.write('gfs.grb.idx') # save index to a file
 >>> grbindx.close()
 >>> grbindx = pygrib.index('gfs.grb.idx') # re-open index (no keys specified)
+>>> grbindx.keys # not set when opening a saved index file.
+None
 >>> for grb in selected_grbs:
 >>>     grb
 1:u-component of wind:m s**-1 (instant):regular_ll:isobaricInhPa:level 250 Pa:fcst time 72 hrs:from 200412091200:lo res cntl fcst
 
- at ivar keys: list of strings containing keys used in the index.
+ at ivar keys: list of strings containing keys used in the index.  Set to C{None}
+when opening a previously saved grib index file.
 
 @ivar types: if keys are typed, this list contains the type declarations
 (C{l}, C{s} or C{d}). Type declarations are specified by appending to the key
-name (i.e. C{level:l} will search for values of C{level} that are longs).
+name (i.e. C{level:l} will search for values of C{level} that are longs). Set
+to C{None} when opening a previously saved grib index file.
 """
     cdef grib_index *_gi
     cdef public object keys, types, name
@@ -1866,7 +1864,8 @@ name (i.e. C{level:l} will search for values of C{level} that are longs).
         # initialize C level objects.
         cdef grib_index *gi
         cdef int err
-        cdef char *filenamec, *keys
+        cdef char *filenamec
+        cdef char *keys
         bytestr = _strencode(filename)
         filenamec = bytestr
         if args == ():
@@ -1939,7 +1938,8 @@ Example usage:
         cdef size_t size
         cdef long longval
         cdef double doubval
-        cdef char *strval, *key
+        cdef char *strval
+        cdef char *key
         # set index selection.
         # used declared type if available, other infer from type of value.
         sizetot = 0
diff --git a/redtoreg.c b/redtoreg.c
index cde85cc..3b545f0 100644
--- a/redtoreg.c
+++ b/redtoreg.c
@@ -1,4 +1,4 @@
-/* Generated by Cython 0.19.1 on Tue Nov 19 15:58:39 2013 */
+/* Generated by Cython 0.21.1 */
 
 #define PY_SSIZE_T_CLEAN
 #ifndef CYTHON_USE_PYLONG_INTERNALS
@@ -16,10 +16,11 @@
 #include "Python.h"
 #ifndef Py_PYTHON_H
     #error Python headers needed to compile C extensions, please install development version of Python.
-#elif PY_VERSION_HEX < 0x02040000
-    #error Cython requires Python 2.4+.
+#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
+    #error Cython requires Python 2.6+ or Python 3.2+.
 #else
-#include <stddef.h> /* For offsetof */
+#define CYTHON_ABI "0_21_1"
+#include <stddef.h>
 #ifndef offsetof
 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
 #endif
@@ -53,83 +54,29 @@
 #define CYTHON_COMPILING_IN_PYPY 0
 #define CYTHON_COMPILING_IN_CPYTHON 1
 #endif
-#if PY_VERSION_HEX < 0x02050000
-  typedef int Py_ssize_t;
-  #define PY_SSIZE_T_MAX INT_MAX
-  #define PY_SSIZE_T_MIN INT_MIN
-  #define PY_FORMAT_SIZE_T ""
-  #define CYTHON_FORMAT_SSIZE_T ""
-  #define PyInt_FromSsize_t(z) PyInt_FromLong(z)
-  #define PyInt_AsSsize_t(o)   __Pyx_PyInt_AsInt(o)
-  #define PyNumber_Index(o)    ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \
-                                (PyErr_Format(PyExc_TypeError, \
-                                              "expected index value, got %.200s", Py_TYPE(o)->tp_name), \
-                                 (PyObject*)0))
-  #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \
-                                  !PyComplex_Check(o))
-  #define PyIndex_Check __Pyx_PyIndex_Check
-  #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message)
-  #define __PYX_BUILD_PY_SSIZE_T "i"
-#else
-  #define __PYX_BUILD_PY_SSIZE_T "n"
-  #define CYTHON_FORMAT_SSIZE_T "z"
-  #define __Pyx_PyIndex_Check PyIndex_Check
-#endif
-#if PY_VERSION_HEX < 0x02060000
-  #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)
-  #define Py_TYPE(ob)   (((PyObject*)(ob))->ob_type)
-  #define Py_SIZE(ob)   (((PyVarObject*)(ob))->ob_size)
-  #define PyVarObject_HEAD_INIT(type, size) \
-          PyObject_HEAD_INIT(type) size,
-  #define PyType_Modified(t)
-  typedef struct {
-     void *buf;
-     PyObject *obj;
-     Py_ssize_t len;
-     Py_ssize_t itemsize;
-     int readonly;
-     int ndim;
-     char *format;
-     Py_ssize_t *shape;
-     Py_ssize_t *strides;
-     Py_ssize_t *suboffsets;
-     void *internal;
-  } Py_buffer;
-  #define PyBUF_SIMPLE 0
-  #define PyBUF_WRITABLE 0x0001
-  #define PyBUF_FORMAT 0x0004
-  #define PyBUF_ND 0x0008
-  #define PyBUF_STRIDES (0x0010 | PyBUF_ND)
-  #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES)
-  #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES)
-  #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES)
-  #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES)
-  #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE)
-  #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE)
-  typedef int (*getbufferproc)(PyObject *, Py_buffer *, int);
-  typedef void (*releasebufferproc)(PyObject *, Py_buffer *);
+#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600
+#define Py_OptimizeFlag 0
 #endif
+#define __PYX_BUILD_PY_SSIZE_T "n"
+#define CYTHON_FORMAT_SSIZE_T "z"
 #if PY_MAJOR_VERSION < 3
   #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
   #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
-          PyCode_New(a, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
+          PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
+  #define __Pyx_DefaultClassType PyClass_Type
 #else
   #define __Pyx_BUILTIN_MODULE_NAME "builtins"
   #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
           PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
-#endif
-#if PY_MAJOR_VERSION < 3 && PY_MINOR_VERSION < 6
-  #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict")
+  #define __Pyx_DefaultClassType PyType_Type
 #endif
 #if PY_MAJOR_VERSION >= 3
   #define Py_TPFLAGS_CHECKTYPES 0
   #define Py_TPFLAGS_HAVE_INDEX 0
-#endif
-#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3)
   #define Py_TPFLAGS_HAVE_NEWBUFFER 0
 #endif
-#if PY_VERSION_HEX < 0x02060000
-  #define Py_TPFLAGS_HAVE_VERSION_TAG 0
+#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE)
+  #define Py_TPFLAGS_HAVE_FINALIZE 0
 #endif
 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
   #define CYTHON_PEP393_ENABLED 1
@@ -137,13 +84,34 @@
                                               0 : _PyUnicode_Ready((PyObject *)(op)))
   #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
   #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
+  #define __Pyx_PyUnicode_KIND(u)         PyUnicode_KIND(u)
+  #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
   #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
 #else
   #define CYTHON_PEP393_ENABLED 0
   #define __Pyx_PyUnicode_READY(op)       (0)
   #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
   #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
-  #define __Pyx_PyUnicode_READ(k, d, i)   ((k=k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
+  #define __Pyx_PyUnicode_KIND(u)         (sizeof(Py_UNICODE))
+  #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
+  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
+#endif
+#if CYTHON_COMPILING_IN_PYPY
+  #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
+  #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
+  #define __Pyx_PyFrozenSet_Size(s)         PyObject_Size(s)
+#else
+  #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
+  #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ? \
+      PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
+  #define __Pyx_PyFrozenSet_Size(s)         PySet_Size(s)
+#endif
+#define __Pyx_PyString_FormatSafe(a, b)   ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
+#define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
+#if PY_MAJOR_VERSION >= 3
+  #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
+#else
+  #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
 #endif
 #if PY_MAJOR_VERSION >= 3
   #define PyBaseString_Type            PyUnicode_Type
@@ -152,35 +120,12 @@
   #define PyString_Check               PyUnicode_Check
   #define PyString_CheckExact          PyUnicode_CheckExact
 #endif
-#if PY_VERSION_HEX < 0x02060000
-  #define PyBytesObject                PyStringObject
-  #define PyBytes_Type                 PyString_Type
-  #define PyBytes_Check                PyString_Check
-  #define PyBytes_CheckExact           PyString_CheckExact
-  #define PyBytes_FromString           PyString_FromString
-  #define PyBytes_FromStringAndSize    PyString_FromStringAndSize
-  #define PyBytes_FromFormat           PyString_FromFormat
-  #define PyBytes_DecodeEscape         PyString_DecodeEscape
-  #define PyBytes_AsString             PyString_AsString
-  #define PyBytes_AsStringAndSize      PyString_AsStringAndSize
-  #define PyBytes_Size                 PyString_Size
-  #define PyBytes_AS_STRING            PyString_AS_STRING
-  #define PyBytes_GET_SIZE             PyString_GET_SIZE
-  #define PyBytes_Repr                 PyString_Repr
-  #define PyBytes_Concat               PyString_Concat
-  #define PyBytes_ConcatAndDel         PyString_ConcatAndDel
-#endif
 #if PY_MAJOR_VERSION >= 3
   #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
   #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
 #else
-  #define __Pyx_PyBaseString_Check(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj) || \
-                                         PyString_Check(obj) || PyUnicode_Check(obj))
-  #define __Pyx_PyBaseString_CheckExact(obj) (Py_TYPE(obj) == &PyBaseString_Type)
-#endif
-#if PY_VERSION_HEX < 0x02060000
-  #define PySet_Check(obj)             PyObject_TypeCheck(obj, &PySet_Type)
-  #define PyFrozenSet_Check(obj)       PyObject_TypeCheck(obj, &PyFrozenSet_Type)
+  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
+  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
 #endif
 #ifndef PySet_CheckExact
   #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
@@ -201,11 +146,17 @@
   #define PyInt_AsSsize_t              PyLong_AsSsize_t
   #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
   #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
+  #define PyNumber_Int                 PyNumber_Long
 #endif
 #if PY_MAJOR_VERSION >= 3
   #define PyBoolObject                 PyLongObject
 #endif
-#if PY_VERSION_HEX < 0x03020000
+#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
+  #ifndef PyUnicode_InternFromString
+    #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
+  #endif
+#endif
+#if PY_VERSION_HEX < 0x030200A4
   typedef long Py_hash_t;
   #define __Pyx_PyInt_FromHash_t PyInt_FromLong
   #define __Pyx_PyInt_AsHash_t   PyInt_AsLong
@@ -213,42 +164,10 @@
   #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
   #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
 #endif
-#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300)
-  #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b)
-  #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value)
-  #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b)
-#else
-  #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \
-        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \
-        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \
-            (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0)))
-  #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \
-        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
-        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \
-            (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1)))
-  #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \
-        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
-        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \
-            (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1)))
-#endif
 #if PY_MAJOR_VERSION >= 3
-  #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
-#endif
-#if PY_VERSION_HEX < 0x02050000
-  #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),((char *)(n)))
-  #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a))
-  #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),((char *)(n)))
-#else
-  #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),(n))
-  #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a))
-  #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),(n))
-#endif
-#if PY_VERSION_HEX < 0x02050000
-  #define __Pyx_NAMESTR(n) ((char *)(n))
-  #define __Pyx_DOCSTR(n)  ((char *)(n))
+  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
 #else
-  #define __Pyx_NAMESTR(n) (n)
-  #define __Pyx_DOCSTR(n)  (n)
+  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
 #endif
 #ifndef CYTHON_INLINE
   #if defined(__GNUC__)
@@ -264,7 +183,7 @@
 #ifndef CYTHON_RESTRICT
   #if defined(__GNUC__)
     #define CYTHON_RESTRICT __restrict__
-  #elif defined(_MSC_VER)
+  #elif defined(_MSC_VER) && _MSC_VER >= 1400
     #define CYTHON_RESTRICT __restrict
   #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
     #define CYTHON_RESTRICT restrict
@@ -284,6 +203,12 @@ static CYTHON_INLINE float __PYX_NAN() {
   return value;
 }
 #endif
+#ifdef __cplusplus
+template<typename T>
+void __Pyx_call_destructor(T* x) {
+    x->~T();
+}
+#endif
 
 
 #if PY_MAJOR_VERSION >= 3
@@ -335,18 +260,30 @@ static CYTHON_INLINE float __PYX_NAN() {
 # endif
 #endif
 typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding;
-                const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/
+                const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
 
 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
 #define __PYX_DEFAULT_STRING_ENCODING ""
 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
+#define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (    \
+    (sizeof(type) < sizeof(Py_ssize_t))  ||             \
+    (sizeof(type) > sizeof(Py_ssize_t) &&               \
+          likely(v < (type)PY_SSIZE_T_MAX ||            \
+                 v == (type)PY_SSIZE_T_MAX)  &&         \
+          (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||       \
+                                v == (type)PY_SSIZE_T_MIN)))  ||  \
+    (sizeof(type) == sizeof(Py_ssize_t) &&              \
+          (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||        \
+                               v == (type)PY_SSIZE_T_MAX)))  )
 static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
 static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
+#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
+#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
 #define __Pyx_PyBytes_FromString        PyBytes_FromString
 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
-static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char*);
+static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
 #if PY_MAJOR_VERSION < 3
     #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
     #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
@@ -354,17 +291,19 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char*);
     #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
     #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
 #endif
+#define __Pyx_PyObject_AsSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
 #define __Pyx_PyObject_AsUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
-#define __Pyx_PyObject_FromUString(s)  __Pyx_PyObject_FromString((char*)s)
-#define __Pyx_PyBytes_FromUString(s)   __Pyx_PyBytes_FromString((char*)s)
-#define __Pyx_PyStr_FromUString(s)     __Pyx_PyStr_FromString((char*)s)
-#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((char*)s)
+#define __Pyx_PyObject_FromUString(s)  __Pyx_PyObject_FromString((const char*)s)
+#define __Pyx_PyBytes_FromUString(s)   __Pyx_PyBytes_FromString((const char*)s)
+#define __Pyx_PyByteArray_FromUString(s)   __Pyx_PyByteArray_FromString((const char*)s)
+#define __Pyx_PyStr_FromUString(s)     __Pyx_PyStr_FromString((const char*)s)
+#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((const char*)s)
 #if PY_MAJOR_VERSION < 3
 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
 {
     const Py_UNICODE *u_end = u;
     while (*u_end++) ;
-    return u_end - u - 1;
+    return (size_t)(u_end - u - 1);
 }
 #else
 #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
@@ -378,7 +317,6 @@ static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
 static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
-static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);
 #if CYTHON_COMPILING_IN_CPYTHON
 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
 #else
@@ -387,19 +325,22 @@ static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);
 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
 static int __Pyx_sys_getdefaultencoding_not_ascii;
-static int __Pyx_init_sys_getdefaultencoding_params() {
-    PyObject* sys = NULL;
+static int __Pyx_init_sys_getdefaultencoding_params(void) {
+    PyObject* sys;
     PyObject* default_encoding = NULL;
     PyObject* ascii_chars_u = NULL;
     PyObject* ascii_chars_b = NULL;
+    const char* default_encoding_c;
     sys = PyImport_ImportModule("sys");
-    if (sys == NULL) goto bad;
+    if (!sys) goto bad;
     default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
-    if (default_encoding == NULL) goto bad;
-    if (strcmp(PyBytes_AsString(default_encoding), "ascii") == 0) {
+    Py_DECREF(sys);
+    if (!default_encoding) goto bad;
+    default_encoding_c = PyBytes_AsString(default_encoding);
+    if (!default_encoding_c) goto bad;
+    if (strcmp(default_encoding_c, "ascii") == 0) {
         __Pyx_sys_getdefaultencoding_not_ascii = 0;
     } else {
-        const char* default_encoding_c = PyBytes_AS_STRING(default_encoding);
         char ascii_chars[128];
         int c;
         for (c = 0; c < 128; c++) {
@@ -407,23 +348,21 @@ static int __Pyx_init_sys_getdefaultencoding_params() {
         }
         __Pyx_sys_getdefaultencoding_not_ascii = 1;
         ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
-        if (ascii_chars_u == NULL) goto bad;
+        if (!ascii_chars_u) goto bad;
         ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
-        if (ascii_chars_b == NULL || strncmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
+        if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
             PyErr_Format(
                 PyExc_ValueError,
-                "This module compiled with c_string_encoding=ascii, but default encoding '%s' is not a superset of ascii.",
+                "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
                 default_encoding_c);
             goto bad;
         }
+        Py_DECREF(ascii_chars_u);
+        Py_DECREF(ascii_chars_b);
     }
-    Py_XDECREF(sys);
-    Py_XDECREF(default_encoding);
-    Py_XDECREF(ascii_chars_u);
-    Py_XDECREF(ascii_chars_b);
+    Py_DECREF(default_encoding);
     return 0;
 bad:
-    Py_XDECREF(sys);
     Py_XDECREF(default_encoding);
     Py_XDECREF(ascii_chars_u);
     Py_XDECREF(ascii_chars_b);
@@ -436,22 +375,23 @@ bad:
 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
 static char* __PYX_DEFAULT_STRING_ENCODING;
-static int __Pyx_init_sys_getdefaultencoding_params() {
-    PyObject* sys = NULL;
+static int __Pyx_init_sys_getdefaultencoding_params(void) {
+    PyObject* sys;
     PyObject* default_encoding = NULL;
     char* default_encoding_c;
     sys = PyImport_ImportModule("sys");
-    if (sys == NULL) goto bad;
+    if (!sys) goto bad;
     default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
-    if (default_encoding == NULL) goto bad;
-    default_encoding_c = PyBytes_AS_STRING(default_encoding);
+    Py_DECREF(sys);
+    if (!default_encoding) goto bad;
+    default_encoding_c = PyBytes_AsString(default_encoding);
+    if (!default_encoding_c) goto bad;
     __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c));
+    if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
     strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
-    Py_DECREF(sys);
     Py_DECREF(default_encoding);
     return 0;
 bad:
-    Py_XDECREF(sys);
     Py_XDECREF(default_encoding);
     return -1;
 }
@@ -459,16 +399,11 @@ bad:
 #endif
 
 
-#ifdef __GNUC__
-  /* Test for GCC > 2.95 */
-  #if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))
-    #define likely(x)   __builtin_expect(!!(x), 1)
-    #define unlikely(x) __builtin_expect(!!(x), 0)
-  #else /* __GNUC__ > 2 ... */
-    #define likely(x)   (x)
-    #define unlikely(x) (x)
-  #endif /* __GNUC__ > 2 ... */
-#else /* __GNUC__ */
+/* Test for GCC > 2.95 */
+#if defined(__GNUC__)     && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
+  #define likely(x)   __builtin_expect(!!(x), 1)
+  #define unlikely(x) __builtin_expect(!!(x), 0)
+#else /* !__GNUC__ or GCC < 2.95 */
   #define likely(x)   (x)
   #define unlikely(x) (x)
 #endif /* __GNUC__ */
@@ -507,11 +442,11 @@ static const char *__pyx_filename;
 
 static const char *__pyx_f[] = {
   "redtoreg.pyx",
-  "numpy.pxd",
+  "__init__.pxd",
   "type.pxd",
 };
 
-/* "numpy.pxd":723
+/* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":723
  * # in Cython to enable them only on the right systems.
  * 
  * ctypedef npy_int8       int8_t             # <<<<<<<<<<<<<<
@@ -520,7 +455,7 @@ static const char *__pyx_f[] = {
  */
 typedef npy_int8 __pyx_t_5numpy_int8_t;
 
-/* "numpy.pxd":724
+/* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":724
  * 
  * ctypedef npy_int8       int8_t
  * ctypedef npy_int16      int16_t             # <<<<<<<<<<<<<<
@@ -529,7 +464,7 @@ typedef npy_int8 __pyx_t_5numpy_int8_t;
  */
 typedef npy_int16 __pyx_t_5numpy_int16_t;
 
-/* "numpy.pxd":725
+/* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":725
  * ctypedef npy_int8       int8_t
  * ctypedef npy_int16      int16_t
  * ctypedef npy_int32      int32_t             # <<<<<<<<<<<<<<
@@ -538,7 +473,7 @@ typedef npy_int16 __pyx_t_5numpy_int16_t;
  */
 typedef npy_int32 __pyx_t_5numpy_int32_t;
 
-/* "numpy.pxd":726
+/* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":726
  * ctypedef npy_int16      int16_t
  * ctypedef npy_int32      int32_t
  * ctypedef npy_int64      int64_t             # <<<<<<<<<<<<<<
@@ -547,7 +482,7 @@ typedef npy_int32 __pyx_t_5numpy_int32_t;
  */
 typedef npy_int64 __pyx_t_5numpy_int64_t;
 
-/* "numpy.pxd":730
+/* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":730
  * #ctypedef npy_int128     int128_t
  * 
  * ctypedef npy_uint8      uint8_t             # <<<<<<<<<<<<<<
@@ -556,7 +491,7 @@ typedef npy_int64 __pyx_t_5numpy_int64_t;
  */
 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
 
-/* "numpy.pxd":731
+/* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":731
  * 
  * ctypedef npy_uint8      uint8_t
  * ctypedef npy_uint16     uint16_t             # <<<<<<<<<<<<<<
@@ -565,7 +500,7 @@ typedef npy_uint8 __pyx_t_5numpy_uint8_t;
  */
 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
 
-/* "numpy.pxd":732
+/* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":732
  * ctypedef npy_uint8      uint8_t
  * ctypedef npy_uint16     uint16_t
  * ctypedef npy_uint32     uint32_t             # <<<<<<<<<<<<<<
@@ -574,7 +509,7 @@ typedef npy_uint16 __pyx_t_5numpy_uint16_t;
  */
 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
 
-/* "numpy.pxd":733
+/* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":733
  * ctypedef npy_uint16     uint16_t
  * ctypedef npy_uint32     uint32_t
  * ctypedef npy_uint64     uint64_t             # <<<<<<<<<<<<<<
@@ -583,7 +518,7 @@ typedef npy_uint32 __pyx_t_5numpy_uint32_t;
  */
 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
 
-/* "numpy.pxd":737
+/* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":737
  * #ctypedef npy_uint128    uint128_t
  * 
  * ctypedef npy_float32    float32_t             # <<<<<<<<<<<<<<
@@ -592,7 +527,7 @@ typedef npy_uint64 __pyx_t_5numpy_uint64_t;
  */
 typedef npy_float32 __pyx_t_5numpy_float32_t;
 
-/* "numpy.pxd":738
+/* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":738
  * 
  * ctypedef npy_float32    float32_t
  * ctypedef npy_float64    float64_t             # <<<<<<<<<<<<<<
@@ -601,7 +536,7 @@ typedef npy_float32 __pyx_t_5numpy_float32_t;
  */
 typedef npy_float64 __pyx_t_5numpy_float64_t;
 
-/* "numpy.pxd":747
+/* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":747
  * # The int types are mapped a bit surprising --
  * # numpy.int corresponds to 'l' and numpy.long to 'q'
  * ctypedef npy_long       int_t             # <<<<<<<<<<<<<<
@@ -610,7 +545,7 @@ typedef npy_float64 __pyx_t_5numpy_float64_t;
  */
 typedef npy_long __pyx_t_5numpy_int_t;
 
-/* "numpy.pxd":748
+/* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":748
  * # numpy.int corresponds to 'l' and numpy.long to 'q'
  * ctypedef npy_long       int_t
  * ctypedef npy_longlong   long_t             # <<<<<<<<<<<<<<
@@ -619,7 +554,7 @@ typedef npy_long __pyx_t_5numpy_int_t;
  */
 typedef npy_longlong __pyx_t_5numpy_long_t;
 
-/* "numpy.pxd":749
+/* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":749
  * ctypedef npy_long       int_t
  * ctypedef npy_longlong   long_t
  * ctypedef npy_longlong   longlong_t             # <<<<<<<<<<<<<<
@@ -628,7 +563,7 @@ typedef npy_longlong __pyx_t_5numpy_long_t;
  */
 typedef npy_longlong __pyx_t_5numpy_longlong_t;
 
-/* "numpy.pxd":751
+/* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":751
  * ctypedef npy_longlong   longlong_t
  * 
  * ctypedef npy_ulong      uint_t             # <<<<<<<<<<<<<<
@@ -637,7 +572,7 @@ typedef npy_longlong __pyx_t_5numpy_longlong_t;
  */
 typedef npy_ulong __pyx_t_5numpy_uint_t;
 
-/* "numpy.pxd":752
+/* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":752
  * 
  * ctypedef npy_ulong      uint_t
  * ctypedef npy_ulonglong  ulong_t             # <<<<<<<<<<<<<<
@@ -646,7 +581,7 @@ typedef npy_ulong __pyx_t_5numpy_uint_t;
  */
 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
 
-/* "numpy.pxd":753
+/* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":753
  * ctypedef npy_ulong      uint_t
  * ctypedef npy_ulonglong  ulong_t
  * ctypedef npy_ulonglong  ulonglong_t             # <<<<<<<<<<<<<<
@@ -655,7 +590,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
  */
 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
 
-/* "numpy.pxd":755
+/* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":755
  * ctypedef npy_ulonglong  ulonglong_t
  * 
  * ctypedef npy_intp       intp_t             # <<<<<<<<<<<<<<
@@ -664,7 +599,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
  */
 typedef npy_intp __pyx_t_5numpy_intp_t;
 
-/* "numpy.pxd":756
+/* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":756
  * 
  * ctypedef npy_intp       intp_t
  * ctypedef npy_uintp      uintp_t             # <<<<<<<<<<<<<<
@@ -673,7 +608,7 @@ typedef npy_intp __pyx_t_5numpy_intp_t;
  */
 typedef npy_uintp __pyx_t_5numpy_uintp_t;
 
-/* "numpy.pxd":758
+/* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":758
  * ctypedef npy_uintp      uintp_t
  * 
  * ctypedef npy_double     float_t             # <<<<<<<<<<<<<<
@@ -682,7 +617,7 @@ typedef npy_uintp __pyx_t_5numpy_uintp_t;
  */
 typedef npy_double __pyx_t_5numpy_float_t;
 
-/* "numpy.pxd":759
+/* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":759
  * 
  * ctypedef npy_double     float_t
  * ctypedef npy_double     double_t             # <<<<<<<<<<<<<<
@@ -691,7 +626,7 @@ typedef npy_double __pyx_t_5numpy_float_t;
  */
 typedef npy_double __pyx_t_5numpy_double_t;
 
-/* "numpy.pxd":760
+/* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":760
  * ctypedef npy_double     float_t
  * ctypedef npy_double     double_t
  * ctypedef npy_longdouble longdouble_t             # <<<<<<<<<<<<<<
@@ -722,7 +657,7 @@ typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
 
 /*--- Type declarations ---*/
 
-/* "numpy.pxd":762
+/* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":762
  * ctypedef npy_longdouble longdouble_t
  * 
  * ctypedef npy_cfloat      cfloat_t             # <<<<<<<<<<<<<<
@@ -731,7 +666,7 @@ typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
  */
 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
 
-/* "numpy.pxd":763
+/* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":763
  * 
  * ctypedef npy_cfloat      cfloat_t
  * ctypedef npy_cdouble     cdouble_t             # <<<<<<<<<<<<<<
@@ -740,7 +675,7 @@ typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
  */
 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
 
-/* "numpy.pxd":764
+/* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":764
  * ctypedef npy_cfloat      cfloat_t
  * ctypedef npy_cdouble     cdouble_t
  * ctypedef npy_clongdouble clongdouble_t             # <<<<<<<<<<<<<<
@@ -749,7 +684,7 @@ typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
  */
 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
 
-/* "numpy.pxd":766
+/* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":766
  * ctypedef npy_clongdouble clongdouble_t
  * 
  * ctypedef npy_cdouble     complex_t             # <<<<<<<<<<<<<<
@@ -770,7 +705,7 @@ typedef npy_cdouble __pyx_t_5numpy_complex_t;
     void (*FinishContext)(void**);
   } __Pyx_RefNannyAPIStruct;
   static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
-  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/
+  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
   #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
 #ifdef WITH_THREAD
   #define __Pyx_RefNannySetupContext(name, acquire_gil) \
@@ -807,7 +742,15 @@ typedef npy_cdouble __pyx_t_5numpy_complex_t;
   #define __Pyx_XDECREF(r) Py_XDECREF(r)
   #define __Pyx_XGOTREF(r)
   #define __Pyx_XGIVEREF(r)
-#endif /* CYTHON_REFNANNY */
+#endif
+#define __Pyx_XDECREF_SET(r, v) do {                            \
+        PyObject *tmp = (PyObject *) r;                         \
+        r = v; __Pyx_XDECREF(tmp);                              \
+    } while (0)
+#define __Pyx_DECREF_SET(r, v) do {                             \
+        PyObject *tmp = (PyObject *) r;                         \
+        r = v; __Pyx_DECREF(tmp);                               \
+    } while (0)
 #define __Pyx_CLEAR(r)    do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
 #define __Pyx_XCLEAR(r)   do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
 
@@ -826,28 +769,46 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject
 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
 #endif
 
-static PyObject *__Pyx_GetBuiltinName(PyObject *name); /*proto*/
+static PyObject *__Pyx_GetBuiltinName(PyObject *name);
 
 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
-    Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/
+    Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
 
-static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/
+static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
 
 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \
     PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \
-    const char* function_name); /*proto*/
+    const char* function_name);
+
+static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
+    const char *name, int exact);
 
-static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
-    const char *name, int exact); /*proto*/
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
+#else
+#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
+#endif
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
+#endif
+
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
+#else
+#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
+#endif
 
-static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
-static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
+static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb);
+static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb);
 
-static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
 
-static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*proto*/
+static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);
 
-static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/
+static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
 
 static CYTHON_INLINE long __Pyx_mod_long(long, long); /* proto */
 
@@ -861,11 +822,28 @@ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
 
 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
 
-static CYTHON_INLINE int __Pyx_IterFinish(void); /*proto*/
+typedef struct {
+    int code_line;
+    PyCodeObject* code_object;
+} __Pyx_CodeObjectCacheEntry;
+struct __Pyx_CodeObjectCache {
+    int count;
+    int max_count;
+    __Pyx_CodeObjectCacheEntry* entries;
+};
+static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
+static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
+static PyCodeObject *__pyx_find_code_object(int code_line);
+static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
+
+static void __Pyx_AddTraceback(const char *funcname, int c_line,
+                               int py_line, const char *filename);
+
+static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
 
-static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /*proto*/
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
 
-static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/
+static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
 
 #if CYTHON_CCOMPLEX
   #ifdef __cplusplus
@@ -879,7 +857,7 @@ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /
     #define __Pyx_CREAL(z) ((z).real)
     #define __Pyx_CIMAG(z) ((z).imag)
 #endif
-#if defined(_WIN32) && defined(__cplusplus) && CYTHON_CCOMPLEX
+#if (defined(_WIN32) || defined(__clang__)) && defined(__cplusplus) && CYTHON_CCOMPLEX
     #define __Pyx_SET_CREAL(z,x) ((z).real(x))
     #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
 #else
@@ -965,37 +943,9 @@ static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(do
     #endif
 #endif
 
-static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);
-
-static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);
-
-static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);
-
-static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *);
-
-static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *);
-
-static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *);
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
 
-static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);
-
-static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);
-
-static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);
-
-static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *);
-
-static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);
-
-static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);
-
-static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *);
-
-static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);
-
-static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);
-
-static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);
+static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
 
 static int __Pyx_check_binary_version(void);
 
@@ -1007,28 +957,11 @@ static int __Pyx_check_binary_version(void);
 #endif
 #endif
 
-static PyObject *__Pyx_ImportModule(const char *name); /*proto*/
-
-static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict);  /*proto*/
-
-typedef struct {
-    int code_line;
-    PyCodeObject* code_object;
-} __Pyx_CodeObjectCacheEntry;
-struct __Pyx_CodeObjectCache {
-    int count;
-    int max_count;
-    __Pyx_CodeObjectCacheEntry* entries;
-};
-static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
-static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
-static PyCodeObject *__pyx_find_code_object(int code_line);
-static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
+static PyObject *__Pyx_ImportModule(const char *name);
 
-static void __Pyx_AddTraceback(const char *funcname, int c_line,
-                               int py_line, const char *filename); /*proto*/
+static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict);
 
-static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
+static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
 
 
 /* Module declarations from 'cpython.buffer' */
@@ -1069,124 +1002,131 @@ static PyObject *__pyx_builtin_RuntimeError;
 static PyObject *__pyx_pf_8redtoreg__redtoreg(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_nlonsin, PyArrayObject *__pyx_v_lonsperlat, PyArrayObject *__pyx_v_redgrid, PyObject *__pyx_v_missval); /* proto */
 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */
-static char __pyx_k_1[] = "size of reduced grid does not match number of data values";
-static char __pyx_k_2[] = "ndarray is not C contiguous";
-static char __pyx_k_4[] = "ndarray is not Fortran contiguous";
-static char __pyx_k_6[] = "Non-native byte order not supported";
-static char __pyx_k_8[] = "unknown dtype code in numpy.pxd (%d)";
-static char __pyx_k_9[] = "Format string allocated too short, see comment in numpy.pxd";
-static char __pyx_k_12[] = "Format string allocated too short.";
-static char __pyx_k_16[] = "/Volumes/User/jwhitaker/python/pygrib/redtoreg.pyx";
-static char __pyx_k__B[] = "B";
-static char __pyx_k__H[] = "H";
-static char __pyx_k__I[] = "I";
-static char __pyx_k__L[] = "L";
-static char __pyx_k__O[] = "O";
-static char __pyx_k__Q[] = "Q";
-static char __pyx_k__b[] = "b";
-static char __pyx_k__d[] = "d";
-static char __pyx_k__f[] = "f";
-static char __pyx_k__g[] = "g";
-static char __pyx_k__h[] = "h";
-static char __pyx_k__i[] = "i";
-static char __pyx_k__j[] = "j";
-static char __pyx_k__l[] = "l";
-static char __pyx_k__n[] = "n";
-static char __pyx_k__q[] = "q";
-static char __pyx_k__Zd[] = "Zd";
-static char __pyx_k__Zf[] = "Zf";
-static char __pyx_k__Zg[] = "Zg";
-static char __pyx_k__im[] = "im";
-static char __pyx_k__ip[] = "ip";
-static char __pyx_k__np[] = "np";
-static char __pyx_k__msg[] = "msg";
-static char __pyx_k__sum[] = "sum";
-static char __pyx_k__zdx[] = "zdx";
-static char __pyx_k__zxi[] = "zxi";
-static char __pyx_k__indx[] = "indx";
-static char __pyx_k__npts[] = "npts";
-static char __pyx_k__ones[] = "ones";
-static char __pyx_k__flons[] = "flons";
-static char __pyx_k__ilons[] = "ilons";
-static char __pyx_k__nlats[] = "nlats";
-static char __pyx_k__nlons[] = "nlons";
-static char __pyx_k__numpy[] = "numpy";
-static char __pyx_k__range[] = "range";
-static char __pyx_k__double[] = "double";
-static char __pyx_k__missvl[] = "missvl";
-static char __pyx_k__lonsptr[] = "lonsptr";
-static char __pyx_k__missval[] = "missval";
-static char __pyx_k__nlonsin[] = "nlonsin";
-static char __pyx_k__redgrid[] = "redgrid";
-static char __pyx_k__reggrid[] = "reggrid";
-static char __pyx_k____main__[] = "__main__";
-static char __pyx_k____test__[] = "__test__";
-static char __pyx_k__redtoreg[] = "redtoreg";
-static char __pyx_k___redtoreg[] = "_redtoreg";
-static char __pyx_k__redgrdptr[] = "redgrdptr";
-static char __pyx_k__reggrdptr[] = "reggrdptr";
-static char __pyx_k__ValueError[] = "ValueError";
-static char __pyx_k____import__[] = "__import__";
-static char __pyx_k__lonsperlat[] = "lonsperlat";
-static char __pyx_k__RuntimeError[] = "RuntimeError";
-static PyObject *__pyx_kp_s_1;
-static PyObject *__pyx_kp_u_12;
-static PyObject *__pyx_kp_s_16;
-static PyObject *__pyx_kp_u_2;
-static PyObject *__pyx_kp_u_4;
-static PyObject *__pyx_kp_u_6;
-static PyObject *__pyx_kp_u_8;
-static PyObject *__pyx_kp_u_9;
-static PyObject *__pyx_n_s__RuntimeError;
-static PyObject *__pyx_n_s__ValueError;
-static PyObject *__pyx_n_s____import__;
-static PyObject *__pyx_n_s____main__;
-static PyObject *__pyx_n_s____test__;
-static PyObject *__pyx_n_s___redtoreg;
-static PyObject *__pyx_n_s__double;
-static PyObject *__pyx_n_s__flons;
-static PyObject *__pyx_n_s__i;
-static PyObject *__pyx_n_s__ilons;
-static PyObject *__pyx_n_s__im;
-static PyObject *__pyx_n_s__indx;
-static PyObject *__pyx_n_s__ip;
-static PyObject *__pyx_n_s__j;
-static PyObject *__pyx_n_s__lonsperlat;
-static PyObject *__pyx_n_s__lonsptr;
-static PyObject *__pyx_n_s__missval;
-static PyObject *__pyx_n_s__missvl;
-static PyObject *__pyx_n_s__msg;
-static PyObject *__pyx_n_s__n;
-static PyObject *__pyx_n_s__nlats;
-static PyObject *__pyx_n_s__nlons;
-static PyObject *__pyx_n_s__nlonsin;
-static PyObject *__pyx_n_s__np;
-static PyObject *__pyx_n_s__npts;
-static PyObject *__pyx_n_s__numpy;
-static PyObject *__pyx_n_s__ones;
-static PyObject *__pyx_n_s__range;
-static PyObject *__pyx_n_s__redgrdptr;
-static PyObject *__pyx_n_s__redgrid;
-static PyObject *__pyx_n_s__redtoreg;
-static PyObject *__pyx_n_s__reggrdptr;
-static PyObject *__pyx_n_s__reggrid;
-static PyObject *__pyx_n_s__sum;
-static PyObject *__pyx_n_s__zdx;
-static PyObject *__pyx_n_s__zxi;
-static PyObject *__pyx_int_15;
-static PyObject *__pyx_k_tuple_3;
-static PyObject *__pyx_k_tuple_5;
-static PyObject *__pyx_k_tuple_7;
-static PyObject *__pyx_k_tuple_10;
-static PyObject *__pyx_k_tuple_11;
-static PyObject *__pyx_k_tuple_13;
-static PyObject *__pyx_k_tuple_14;
-static PyObject *__pyx_k_codeobj_15;
+static char __pyx_k_B[] = "B";
+static char __pyx_k_H[] = "H";
+static char __pyx_k_I[] = "I";
+static char __pyx_k_L[] = "L";
+static char __pyx_k_O[] = "O";
+static char __pyx_k_Q[] = "Q";
+static char __pyx_k_b[] = "b";
+static char __pyx_k_d[] = "d";
+static char __pyx_k_f[] = "f";
+static char __pyx_k_g[] = "g";
+static char __pyx_k_h[] = "h";
+static char __pyx_k_i[] = "i";
+static char __pyx_k_j[] = "j";
+static char __pyx_k_l[] = "l";
+static char __pyx_k_n[] = "n";
+static char __pyx_k_q[] = "q";
+static char __pyx_k_Zd[] = "Zd";
+static char __pyx_k_Zf[] = "Zf";
+static char __pyx_k_Zg[] = "Zg";
+static char __pyx_k_im[] = "im";
+static char __pyx_k_ip[] = "ip";
+static char __pyx_k_np[] = "np";
+static char __pyx_k_msg[] = "msg";
+static char __pyx_k_sum[] = "sum";
+static char __pyx_k_zdx[] = "zdx";
+static char __pyx_k_zxi[] = "zxi";
+static char __pyx_k_indx[] = "indx";
+static char __pyx_k_main[] = "__main__";
+static char __pyx_k_npts[] = "npts";
+static char __pyx_k_ones[] = "ones";
+static char __pyx_k_test[] = "__test__";
+static char __pyx_k_flons[] = "flons";
+static char __pyx_k_ilons[] = "ilons";
+static char __pyx_k_nlats[] = "nlats";
+static char __pyx_k_nlons[] = "nlons";
+static char __pyx_k_numpy[] = "numpy";
+static char __pyx_k_range[] = "range";
+static char __pyx_k_double[] = "double";
+static char __pyx_k_import[] = "__import__";
+static char __pyx_k_missvl[] = "missvl";
+static char __pyx_k_lonsptr[] = "lonsptr";
+static char __pyx_k_missval[] = "missval";
+static char __pyx_k_nlonsin[] = "nlonsin";
+static char __pyx_k_redgrid[] = "redgrid";
+static char __pyx_k_reggrid[] = "reggrid";
+static char __pyx_k_redtoreg[] = "_redtoreg";
+static char __pyx_k_redgrdptr[] = "redgrdptr";
+static char __pyx_k_reggrdptr[] = "reggrdptr";
+static char __pyx_k_ValueError[] = "ValueError";
+static char __pyx_k_lonsperlat[] = "lonsperlat";
+static char __pyx_k_redtoreg_2[] = "redtoreg";
+static char __pyx_k_RuntimeError[] = "RuntimeError";
+static char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous";
+static char __pyx_k_Volumes_User_jwhitaker_python_p[] = "/Volumes/User/jwhitaker/python/pygrib.git/redtoreg.pyx";
+static char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
+static char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd";
+static char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported";
+static char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous";
+static char __pyx_k_size_of_reduced_grid_does_not_ma[] = "size of reduced grid does not match number of data values";
+static char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short.";
+static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
+static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
+static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
+static PyObject *__pyx_n_s_RuntimeError;
+static PyObject *__pyx_n_s_ValueError;
+static PyObject *__pyx_kp_s_Volumes_User_jwhitaker_python_p;
+static PyObject *__pyx_n_s_double;
+static PyObject *__pyx_n_s_flons;
+static PyObject *__pyx_n_s_i;
+static PyObject *__pyx_n_s_ilons;
+static PyObject *__pyx_n_s_im;
+static PyObject *__pyx_n_s_import;
+static PyObject *__pyx_n_s_indx;
+static PyObject *__pyx_n_s_ip;
+static PyObject *__pyx_n_s_j;
+static PyObject *__pyx_n_s_lonsperlat;
+static PyObject *__pyx_n_s_lonsptr;
+static PyObject *__pyx_n_s_main;
+static PyObject *__pyx_n_s_missval;
+static PyObject *__pyx_n_s_missvl;
+static PyObject *__pyx_n_s_msg;
+static PyObject *__pyx_n_s_n;
+static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous;
+static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou;
+static PyObject *__pyx_n_s_nlats;
+static PyObject *__pyx_n_s_nlons;
+static PyObject *__pyx_n_s_nlonsin;
+static PyObject *__pyx_n_s_np;
+static PyObject *__pyx_n_s_npts;
+static PyObject *__pyx_n_s_numpy;
+static PyObject *__pyx_n_s_ones;
+static PyObject *__pyx_n_s_range;
+static PyObject *__pyx_n_s_redgrdptr;
+static PyObject *__pyx_n_s_redgrid;
+static PyObject *__pyx_n_s_redtoreg;
+static PyObject *__pyx_n_s_redtoreg_2;
+static PyObject *__pyx_n_s_reggrdptr;
+static PyObject *__pyx_n_s_reggrid;
+static PyObject *__pyx_kp_s_size_of_reduced_grid_does_not_ma;
+static PyObject *__pyx_n_s_sum;
+static PyObject *__pyx_n_s_test;
+static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
+static PyObject *__pyx_n_s_zdx;
+static PyObject *__pyx_n_s_zxi;
+static PyObject *__pyx_tuple_;
+static PyObject *__pyx_tuple__2;
+static PyObject *__pyx_tuple__3;
+static PyObject *__pyx_tuple__4;
+static PyObject *__pyx_tuple__5;
+static PyObject *__pyx_tuple__6;
+static PyObject *__pyx_tuple__7;
+static PyObject *__pyx_codeobj__8;
+
+/* "redtoreg.pyx":3
+ * import numpy as np
+ * cimport numpy as npc
+ * def _redtoreg(object nlonsin, npc.ndarray lonsperlat, npc.ndarray redgrid, \             # <<<<<<<<<<<<<<
+ *               object missval):
+ *     """
+ */
 
 /* Python wrapper */
 static PyObject *__pyx_pw_8redtoreg_1_redtoreg(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static char __pyx_doc_8redtoreg__redtoreg[] = "\n    convert data on global reduced gaussian to global\n    full gaussian grid using linear interpolation.\n    ";
-static PyMethodDef __pyx_mdef_8redtoreg_1_redtoreg = {__Pyx_NAMESTR("_redtoreg"), (PyCFunction)__pyx_pw_8redtoreg_1_redtoreg, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_8redtoreg__redtoreg)};
+static PyMethodDef __pyx_mdef_8redtoreg_1_redtoreg = {"_redtoreg", (PyCFunction)__pyx_pw_8redtoreg_1_redtoreg, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8redtoreg__redtoreg};
 static PyObject *__pyx_pw_8redtoreg_1_redtoreg(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyObject *__pyx_v_nlonsin = 0;
   PyArrayObject *__pyx_v_lonsperlat = 0;
@@ -1199,7 +1139,7 @@ static PyObject *__pyx_pw_8redtoreg_1_redtoreg(PyObject *__pyx_self, PyObject *_
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("_redtoreg (wrapper)", 0);
   {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__nlonsin,&__pyx_n_s__lonsperlat,&__pyx_n_s__redgrid,&__pyx_n_s__missval,0};
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nlonsin,&__pyx_n_s_lonsperlat,&__pyx_n_s_redgrid,&__pyx_n_s_missval,0};
     PyObject* values[4] = {0,0,0,0};
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
@@ -1215,20 +1155,20 @@ static PyObject *__pyx_pw_8redtoreg_1_redtoreg(PyObject *__pyx_self, PyObject *_
       kw_args = PyDict_Size(__pyx_kwds);
       switch (pos_args) {
         case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__nlonsin)) != 0)) kw_args--;
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nlonsin)) != 0)) kw_args--;
         else goto __pyx_L5_argtuple_error;
         case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lonsperlat)) != 0)) kw_args--;
+        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_lonsperlat)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("_redtoreg", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
         case  2:
-        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__redgrid)) != 0)) kw_args--;
+        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_redgrid)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("_redtoreg", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
         case  3:
-        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__missval)) != 0)) kw_args--;
+        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_missval)) != 0)) kw_args--;
         else {
           __Pyx_RaiseArgtupleInvalid("_redtoreg", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
@@ -1260,6 +1200,8 @@ static PyObject *__pyx_pw_8redtoreg_1_redtoreg(PyObject *__pyx_self, PyObject *_
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lonsperlat), __pyx_ptype_5numpy_ndarray, 1, "lonsperlat", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_redgrid), __pyx_ptype_5numpy_ndarray, 1, "redgrid", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_r = __pyx_pf_8redtoreg__redtoreg(__pyx_self, __pyx_v_nlonsin, __pyx_v_lonsperlat, __pyx_v_redgrid, __pyx_v_missval);
+
+  /* function exit code */
   goto __pyx_L0;
   __pyx_L1_error:;
   __pyx_r = NULL;
@@ -1268,14 +1210,6 @@ static PyObject *__pyx_pw_8redtoreg_1_redtoreg(PyObject *__pyx_self, PyObject *_
   return __pyx_r;
 }
 
-/* "redtoreg.pyx":3
- * import numpy as np
- * cimport numpy as npc
- * def _redtoreg(object nlonsin, npc.ndarray lonsperlat, npc.ndarray redgrid, \             # <<<<<<<<<<<<<<
- *               object missval):
- *     """
- */
-
 static PyObject *__pyx_pf_8redtoreg__redtoreg(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_nlonsin, PyArrayObject *__pyx_v_lonsperlat, PyArrayObject *__pyx_v_redgrid, PyObject *__pyx_v_missval) {
   long __pyx_v_i;
   long __pyx_v_j;
@@ -1304,19 +1238,20 @@ static PyObject *__pyx_pf_8redtoreg__redtoreg(CYTHON_UNUSED PyObject *__pyx_self
   PyObject *__pyx_t_4 = NULL;
   int __pyx_t_5;
   PyObject *__pyx_t_6 = NULL;
-  double __pyx_t_7;
-  long __pyx_t_8;
-  long __pyx_t_9;
+  PyObject *__pyx_t_7 = NULL;
+  PyObject *__pyx_t_8 = NULL;
+  double __pyx_t_9;
   long __pyx_t_10;
-  int __pyx_t_11;
-  int __pyx_t_12;
+  long __pyx_t_11;
+  long __pyx_t_12;
+  int __pyx_t_13;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("_redtoreg", 0);
 
-  /* "redtoreg.pyx":14
- *     cdef double *redgrdptr, *reggrdptr
+  /* "redtoreg.pyx":15
+ *     cdef double *reggrdptr
  *     cdef long *lonsptr
  *     nlons = nlonsin             # <<<<<<<<<<<<<<
  *     nlats = len(lonsperlat)
@@ -1325,126 +1260,154 @@ static PyObject *__pyx_pf_8redtoreg__redtoreg(CYTHON_UNUSED PyObject *__pyx_self
   __Pyx_INCREF(__pyx_v_nlonsin);
   __pyx_v_nlons = __pyx_v_nlonsin;
 
-  /* "redtoreg.pyx":15
+  /* "redtoreg.pyx":16
  *     cdef long *lonsptr
  *     nlons = nlonsin
  *     nlats = len(lonsperlat)             # <<<<<<<<<<<<<<
  *     npts = len(redgrid)
  *     if lonsperlat.sum() != npts:
  */
-  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_lonsperlat)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_lonsperlat)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_v_nlats = __pyx_t_1;
 
-  /* "redtoreg.pyx":16
+  /* "redtoreg.pyx":17
  *     nlons = nlonsin
  *     nlats = len(lonsperlat)
  *     npts = len(redgrid)             # <<<<<<<<<<<<<<
  *     if lonsperlat.sum() != npts:
  *         msg='size of reduced grid does not match number of data values'
  */
-  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_redgrid)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_redgrid)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_v_npts = __pyx_t_1;
 
-  /* "redtoreg.pyx":17
+  /* "redtoreg.pyx":18
  *     nlats = len(lonsperlat)
  *     npts = len(redgrid)
  *     if lonsperlat.sum() != npts:             # <<<<<<<<<<<<<<
  *         msg='size of reduced grid does not match number of data values'
  *         raise ValueError(msg)
  */
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_lonsperlat), __pyx_n_s__sum); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_lonsperlat), __pyx_n_s_sum); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = PyInt_FromLong(__pyx_v_npts); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = NULL;
+  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
+    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+    if (likely(__pyx_t_4)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+      __Pyx_INCREF(__pyx_t_4);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_3, function);
+    }
+  }
+  if (__pyx_t_4) {
+    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  } else {
+    __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  }
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v_npts); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   if (__pyx_t_5) {
 
-    /* "redtoreg.pyx":18
+    /* "redtoreg.pyx":19
  *     npts = len(redgrid)
  *     if lonsperlat.sum() != npts:
  *         msg='size of reduced grid does not match number of data values'             # <<<<<<<<<<<<<<
  *         raise ValueError(msg)
  *     reggrid = missval*np.ones((nlats,nlons),np.double)
  */
-    __Pyx_INCREF(((PyObject *)__pyx_kp_s_1));
-    __pyx_v_msg = ((PyObject *)__pyx_kp_s_1);
+    __Pyx_INCREF(__pyx_kp_s_size_of_reduced_grid_does_not_ma);
+    __pyx_v_msg = __pyx_kp_s_size_of_reduced_grid_does_not_ma;
 
-    /* "redtoreg.pyx":19
+    /* "redtoreg.pyx":20
  *     if lonsperlat.sum() != npts:
  *         msg='size of reduced grid does not match number of data values'
  *         raise ValueError(msg)             # <<<<<<<<<<<<<<
  *     reggrid = missval*np.ones((nlats,nlons),np.double)
  *     # get data buffers and cast to desired type.
  */
-    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_INCREF(__pyx_v_msg);
     PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_msg);
     __Pyx_GIVEREF(__pyx_v_msg);
-    __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L3;
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
-  __pyx_L3:;
 
-  /* "redtoreg.pyx":20
+  /* "redtoreg.pyx":21
  *         msg='size of reduced grid does not match number of data values'
  *         raise ValueError(msg)
  *     reggrid = missval*np.ones((nlats,nlons),np.double)             # <<<<<<<<<<<<<<
  *     # get data buffers and cast to desired type.
  *     lonsptr = <long *>lonsperlat.data
  */
-  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__ones); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = PyInt_FromLong(__pyx_v_nlats); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ones); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
-  __Pyx_GIVEREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_t_4 = __Pyx_PyInt_From_long(__pyx_v_nlats); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
+  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
+  __Pyx_GIVEREF(__pyx_t_4);
   __Pyx_INCREF(__pyx_v_nlons);
-  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_nlons);
+  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_nlons);
   __Pyx_GIVEREF(__pyx_v_nlons);
-  __pyx_t_2 = 0;
-  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__double); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_6);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_3));
-  __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
-  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_6);
+  __pyx_t_4 = 0;
+  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_double); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_7);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_t_4 = NULL;
+  __pyx_t_1 = 0;
+  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_4)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_4);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+      __pyx_t_1 = 1;
+    }
+  }
+  __pyx_t_8 = PyTuple_New(2+__pyx_t_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_8);
+  if (__pyx_t_4) {
+    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
+  }
+  PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_1, __pyx_t_6);
   __Pyx_GIVEREF(__pyx_t_6);
-  __pyx_t_3 = 0;
+  PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_1, __pyx_t_7);
+  __Pyx_GIVEREF(__pyx_t_7);
   __pyx_t_6 = 0;
-  __pyx_t_6 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_6);
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
-  __pyx_t_2 = PyNumber_Multiply(__pyx_v_missval, __pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_7 = 0;
+  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = PyNumber_Multiply(__pyx_v_missval, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_v_reggrid = ((PyArrayObject *)__pyx_t_2);
   __pyx_t_2 = 0;
 
-  /* "redtoreg.pyx":22
+  /* "redtoreg.pyx":23
  *     reggrid = missval*np.ones((nlats,nlons),np.double)
  *     # get data buffers and cast to desired type.
  *     lonsptr = <long *>lonsperlat.data             # <<<<<<<<<<<<<<
@@ -1453,7 +1416,7 @@ static PyObject *__pyx_pf_8redtoreg__redtoreg(CYTHON_UNUSED PyObject *__pyx_self
  */
   __pyx_v_lonsptr = ((long *)__pyx_v_lonsperlat->data);
 
-  /* "redtoreg.pyx":23
+  /* "redtoreg.pyx":24
  *     # get data buffers and cast to desired type.
  *     lonsptr = <long *>lonsperlat.data
  *     redgrdptr = <double *>redgrid.data             # <<<<<<<<<<<<<<
@@ -1462,7 +1425,7 @@ static PyObject *__pyx_pf_8redtoreg__redtoreg(CYTHON_UNUSED PyObject *__pyx_self
  */
   __pyx_v_redgrdptr = ((double *)__pyx_v_redgrid->data);
 
-  /* "redtoreg.pyx":24
+  /* "redtoreg.pyx":25
  *     lonsptr = <long *>lonsperlat.data
  *     redgrdptr = <double *>redgrid.data
  *     reggrdptr = <double *>reggrid.data             # <<<<<<<<<<<<<<
@@ -1471,17 +1434,17 @@ static PyObject *__pyx_pf_8redtoreg__redtoreg(CYTHON_UNUSED PyObject *__pyx_self
  */
   __pyx_v_reggrdptr = ((double *)__pyx_v_reggrid->data);
 
-  /* "redtoreg.pyx":25
+  /* "redtoreg.pyx":26
  *     redgrdptr = <double *>redgrid.data
  *     reggrdptr = <double *>reggrid.data
  *     missvl = <double>missval             # <<<<<<<<<<<<<<
  *     # iterate over full grid, do linear interpolation.
  *     n = 0
  */
-  __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_v_missval); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_v_missvl = ((double)__pyx_t_7);
+  __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_v_missval); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_v_missvl = ((double)__pyx_t_9);
 
-  /* "redtoreg.pyx":27
+  /* "redtoreg.pyx":28
  *     missvl = <double>missval
  *     # iterate over full grid, do linear interpolation.
  *     n = 0             # <<<<<<<<<<<<<<
@@ -1490,7 +1453,7 @@ static PyObject *__pyx_pf_8redtoreg__redtoreg(CYTHON_UNUSED PyObject *__pyx_self
  */
   __pyx_v_n = 0;
 
-  /* "redtoreg.pyx":28
+  /* "redtoreg.pyx":29
  *     # iterate over full grid, do linear interpolation.
  *     n = 0
  *     indx = 0             # <<<<<<<<<<<<<<
@@ -1499,17 +1462,17 @@ static PyObject *__pyx_pf_8redtoreg__redtoreg(CYTHON_UNUSED PyObject *__pyx_self
  */
   __pyx_v_indx = 0;
 
-  /* "redtoreg.pyx":29
+  /* "redtoreg.pyx":30
  *     n = 0
  *     indx = 0
  *     for j from 0 <= j < nlats:             # <<<<<<<<<<<<<<
  *         ilons = lonsptr[j]
  *         flons = <double>ilons
  */
-  __pyx_t_8 = __pyx_v_nlats;
-  for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) {
+  __pyx_t_10 = __pyx_v_nlats;
+  for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_10; __pyx_v_j++) {
 
-    /* "redtoreg.pyx":30
+    /* "redtoreg.pyx":31
  *     indx = 0
  *     for j from 0 <= j < nlats:
  *         ilons = lonsptr[j]             # <<<<<<<<<<<<<<
@@ -1518,7 +1481,7 @@ static PyObject *__pyx_pf_8redtoreg__redtoreg(CYTHON_UNUSED PyObject *__pyx_self
  */
     __pyx_v_ilons = (__pyx_v_lonsptr[__pyx_v_j]);
 
-    /* "redtoreg.pyx":31
+    /* "redtoreg.pyx":32
  *     for j from 0 <= j < nlats:
  *         ilons = lonsptr[j]
  *         flons = <double>ilons             # <<<<<<<<<<<<<<
@@ -1527,33 +1490,33 @@ static PyObject *__pyx_pf_8redtoreg__redtoreg(CYTHON_UNUSED PyObject *__pyx_self
  */
     __pyx_v_flons = ((double)__pyx_v_ilons);
 
-    /* "redtoreg.pyx":32
+    /* "redtoreg.pyx":33
  *         ilons = lonsptr[j]
  *         flons = <double>ilons
  *         for i from 0 <= i < nlons:             # <<<<<<<<<<<<<<
  *             # zxi is the grid index (relative to the reduced grid)
  *             # of the i'th point on the full grid.
  */
-    __pyx_t_9 = __Pyx_PyInt_AsLong(__pyx_v_nlons); if (unlikely((__pyx_t_9 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_9; __pyx_v_i++) {
+    __pyx_t_11 = __Pyx_PyInt_As_long(__pyx_v_nlons); if (unlikely((__pyx_t_11 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_11; __pyx_v_i++) {
 
-      /* "redtoreg.pyx":35
+      /* "redtoreg.pyx":36
  *             # zxi is the grid index (relative to the reduced grid)
  *             # of the i'th point on the full grid.
  *             zxi = i * flons / nlons # goes from 0 to ilons             # <<<<<<<<<<<<<<
  *             im = <long>zxi
  *             zdx = zxi - <double>im
  */
-      __pyx_t_2 = PyFloat_FromDouble((__pyx_v_i * __pyx_v_flons)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_2 = PyFloat_FromDouble((__pyx_v_i * __pyx_v_flons)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_2);
-      __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_v_nlons); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_6);
+      __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_v_nlons); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-      __pyx_v_zxi = __pyx_t_7;
+      __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __pyx_v_zxi = __pyx_t_9;
 
-      /* "redtoreg.pyx":36
+      /* "redtoreg.pyx":37
  *             # of the i'th point on the full grid.
  *             zxi = i * flons / nlons # goes from 0 to ilons
  *             im = <long>zxi             # <<<<<<<<<<<<<<
@@ -1562,7 +1525,7 @@ static PyObject *__pyx_pf_8redtoreg__redtoreg(CYTHON_UNUSED PyObject *__pyx_self
  */
       __pyx_v_im = ((long)__pyx_v_zxi);
 
-      /* "redtoreg.pyx":37
+      /* "redtoreg.pyx":38
  *             zxi = i * flons / nlons # goes from 0 to ilons
  *             im = <long>zxi
  *             zdx = zxi - <double>im             # <<<<<<<<<<<<<<
@@ -1571,7 +1534,7 @@ static PyObject *__pyx_pf_8redtoreg__redtoreg(CYTHON_UNUSED PyObject *__pyx_self
  */
       __pyx_v_zdx = (__pyx_v_zxi - ((double)__pyx_v_im));
 
-      /* "redtoreg.pyx":38
+      /* "redtoreg.pyx":39
  *             im = <long>zxi
  *             zdx = zxi - <double>im
  *             if ilons != 0:             # <<<<<<<<<<<<<<
@@ -1581,81 +1544,83 @@ static PyObject *__pyx_pf_8redtoreg__redtoreg(CYTHON_UNUSED PyObject *__pyx_self
       __pyx_t_5 = ((__pyx_v_ilons != 0) != 0);
       if (__pyx_t_5) {
 
-        /* "redtoreg.pyx":39
+        /* "redtoreg.pyx":40
  *             zdx = zxi - <double>im
  *             if ilons != 0:
  *                 im = (im + ilons)%ilons             # <<<<<<<<<<<<<<
  *                 ip = (im + 1 + ilons)%ilons
  *                 # if one of the nearest values is missing, use nearest
  */
-        __pyx_t_10 = (__pyx_v_im + __pyx_v_ilons);
+        __pyx_t_12 = (__pyx_v_im + __pyx_v_ilons);
         if (unlikely(__pyx_v_ilons == 0)) {
           #ifdef WITH_THREAD
           PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
           #endif
-          PyErr_Format(PyExc_ZeroDivisionError, "integer division or modulo by zero");
+          PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
           #ifdef WITH_THREAD
           PyGILState_Release(__pyx_gilstate_save);
           #endif
-          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         }
-        __pyx_v_im = __Pyx_mod_long(__pyx_t_10, __pyx_v_ilons);
+        __pyx_v_im = __Pyx_mod_long(__pyx_t_12, __pyx_v_ilons);
 
-        /* "redtoreg.pyx":40
+        /* "redtoreg.pyx":41
  *             if ilons != 0:
  *                 im = (im + ilons)%ilons
  *                 ip = (im + 1 + ilons)%ilons             # <<<<<<<<<<<<<<
  *                 # if one of the nearest values is missing, use nearest
  *                 # neighbor interpolation.
  */
-        __pyx_t_10 = ((__pyx_v_im + 1) + __pyx_v_ilons);
+        __pyx_t_12 = ((__pyx_v_im + 1) + __pyx_v_ilons);
         if (unlikely(__pyx_v_ilons == 0)) {
           #ifdef WITH_THREAD
           PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
           #endif
-          PyErr_Format(PyExc_ZeroDivisionError, "integer division or modulo by zero");
+          PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
           #ifdef WITH_THREAD
           PyGILState_Release(__pyx_gilstate_save);
           #endif
-          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         }
-        __pyx_v_ip = __Pyx_mod_long(__pyx_t_10, __pyx_v_ilons);
+        __pyx_v_ip = __Pyx_mod_long(__pyx_t_12, __pyx_v_ilons);
 
-        /* "redtoreg.pyx":43
+        /* "redtoreg.pyx":44
  *                 # if one of the nearest values is missing, use nearest
  *                 # neighbor interpolation.
  *                 if redgrdptr[indx+im] == missvl or\             # <<<<<<<<<<<<<<
  *                    redgrdptr[indx+ip] == missvl:
  *                     if zdx < 0.5:
  */
-        __pyx_t_5 = (((__pyx_v_redgrdptr[(__pyx_v_indx + __pyx_v_im)]) == __pyx_v_missvl) != 0);
-        if (!__pyx_t_5) {
+        __pyx_t_13 = (((__pyx_v_redgrdptr[(__pyx_v_indx + __pyx_v_im)]) == __pyx_v_missvl) != 0);
+        if (!__pyx_t_13) {
+        } else {
+          __pyx_t_5 = __pyx_t_13;
+          goto __pyx_L10_bool_binop_done;
+        }
 
-          /* "redtoreg.pyx":44
+        /* "redtoreg.pyx":45
  *                 # neighbor interpolation.
  *                 if redgrdptr[indx+im] == missvl or\
  *                    redgrdptr[indx+ip] == missvl:             # <<<<<<<<<<<<<<
  *                     if zdx < 0.5:
  *                         reggrdptr[n] = redgrdptr[indx+im]
  */
-          __pyx_t_11 = (((__pyx_v_redgrdptr[(__pyx_v_indx + __pyx_v_ip)]) == __pyx_v_missvl) != 0);
-          __pyx_t_12 = __pyx_t_11;
-        } else {
-          __pyx_t_12 = __pyx_t_5;
-        }
-        if (__pyx_t_12) {
+        __pyx_t_13 = (((__pyx_v_redgrdptr[(__pyx_v_indx + __pyx_v_ip)]) == __pyx_v_missvl) != 0);
+        __pyx_t_5 = __pyx_t_13;
+        __pyx_L10_bool_binop_done:;
+        if (__pyx_t_5) {
 
-          /* "redtoreg.pyx":45
+          /* "redtoreg.pyx":46
  *                 if redgrdptr[indx+im] == missvl or\
  *                    redgrdptr[indx+ip] == missvl:
  *                     if zdx < 0.5:             # <<<<<<<<<<<<<<
  *                         reggrdptr[n] = redgrdptr[indx+im]
  *                     else:
  */
-          __pyx_t_12 = ((__pyx_v_zdx < 0.5) != 0);
-          if (__pyx_t_12) {
+          __pyx_t_5 = ((__pyx_v_zdx < 0.5) != 0);
+          if (__pyx_t_5) {
 
-            /* "redtoreg.pyx":46
+            /* "redtoreg.pyx":47
  *                    redgrdptr[indx+ip] == missvl:
  *                     if zdx < 0.5:
  *                         reggrdptr[n] = redgrdptr[indx+im]             # <<<<<<<<<<<<<<
@@ -1663,11 +1628,11 @@ static PyObject *__pyx_pf_8redtoreg__redtoreg(CYTHON_UNUSED PyObject *__pyx_self
  *                         reggrdptr[n] = redgrdptr[indx+ip]
  */
             (__pyx_v_reggrdptr[__pyx_v_n]) = (__pyx_v_redgrdptr[(__pyx_v_indx + __pyx_v_im)]);
-            goto __pyx_L10;
+            goto __pyx_L12;
           }
           /*else*/ {
 
-            /* "redtoreg.pyx":48
+            /* "redtoreg.pyx":49
  *                         reggrdptr[n] = redgrdptr[indx+im]
  *                     else:
  *                         reggrdptr[n] = redgrdptr[indx+ip]             # <<<<<<<<<<<<<<
@@ -1676,12 +1641,12 @@ static PyObject *__pyx_pf_8redtoreg__redtoreg(CYTHON_UNUSED PyObject *__pyx_self
  */
             (__pyx_v_reggrdptr[__pyx_v_n]) = (__pyx_v_redgrdptr[(__pyx_v_indx + __pyx_v_ip)]);
           }
-          __pyx_L10:;
+          __pyx_L12:;
           goto __pyx_L9;
         }
         /*else*/ {
 
-          /* "redtoreg.pyx":50
+          /* "redtoreg.pyx":51
  *                         reggrdptr[n] = redgrdptr[indx+ip]
  *                 else: # linear interpolation.
  *                     reggrdptr[n] = redgrdptr[indx+im]*(1.-zdx) +\             # <<<<<<<<<<<<<<
@@ -1695,7 +1660,7 @@ static PyObject *__pyx_pf_8redtoreg__redtoreg(CYTHON_UNUSED PyObject *__pyx_self
       }
       __pyx_L8:;
 
-      /* "redtoreg.pyx":52
+      /* "redtoreg.pyx":53
  *                     reggrdptr[n] = redgrdptr[indx+im]*(1.-zdx) +\
  *                                    redgrdptr[indx+ip]*zdx
  *             n = n + 1             # <<<<<<<<<<<<<<
@@ -1705,7 +1670,7 @@ static PyObject *__pyx_pf_8redtoreg__redtoreg(CYTHON_UNUSED PyObject *__pyx_self
       __pyx_v_n = (__pyx_v_n + 1);
     }
 
-    /* "redtoreg.pyx":53
+    /* "redtoreg.pyx":54
  *                                    redgrdptr[indx+ip]*zdx
  *             n = n + 1
  *         indx = indx + ilons             # <<<<<<<<<<<<<<
@@ -1714,7 +1679,7 @@ static PyObject *__pyx_pf_8redtoreg__redtoreg(CYTHON_UNUSED PyObject *__pyx_self
     __pyx_v_indx = (__pyx_v_indx + __pyx_v_ilons);
   }
 
-  /* "redtoreg.pyx":54
+  /* "redtoreg.pyx":55
  *             n = n + 1
  *         indx = indx + ilons
  *     return reggrid             # <<<<<<<<<<<<<<
@@ -1724,13 +1689,22 @@ static PyObject *__pyx_pf_8redtoreg__redtoreg(CYTHON_UNUSED PyObject *__pyx_self
   __pyx_r = ((PyObject *)__pyx_v_reggrid);
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "redtoreg.pyx":3
+ * import numpy as np
+ * cimport numpy as npc
+ * def _redtoreg(object nlonsin, npc.ndarray lonsperlat, npc.ndarray redgrid, \             # <<<<<<<<<<<<<<
+ *               object missval):
+ *     """
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_2);
   __Pyx_XDECREF(__pyx_t_3);
   __Pyx_XDECREF(__pyx_t_4);
   __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_XDECREF(__pyx_t_8);
   __Pyx_AddTraceback("redtoreg._redtoreg", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_r = NULL;
   __pyx_L0:;
@@ -1742,6 +1716,14 @@ static PyObject *__pyx_pf_8redtoreg__redtoreg(CYTHON_UNUSED PyObject *__pyx_self
   return __pyx_r;
 }
 
+/* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":194
+ *         # experimental exception made for __getbuffer__ and __releasebuffer__
+ *         # -- the details of this may change.
+ *         def __getbuffer__(ndarray self, Py_buffer* info, int flags):             # <<<<<<<<<<<<<<
+ *             # This implementation of getbuffer is geared towards Cython
+ *             # requirements, and does not yet fullfill the PEP.
+ */
+
 /* Python wrapper */
 static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
 static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
@@ -1749,18 +1731,12 @@ static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
   __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "numpy.pxd":194
- *         # experimental exception made for __getbuffer__ and __releasebuffer__
- *         # -- the details of this may change.
- *         def __getbuffer__(ndarray self, Py_buffer* info, int flags):             # <<<<<<<<<<<<<<
- *             # This implementation of getbuffer is geared towards Cython
- *             # requirements, and does not yet fullfill the PEP.
- */
-
 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
   int __pyx_v_copy_shape;
   int __pyx_v_i;
@@ -1776,13 +1752,11 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
   __Pyx_RefNannyDeclarations
   int __pyx_t_1;
   int __pyx_t_2;
-  int __pyx_t_3;
-  PyObject *__pyx_t_4 = NULL;
+  PyObject *__pyx_t_3 = NULL;
+  int __pyx_t_4;
   int __pyx_t_5;
-  int __pyx_t_6;
-  int __pyx_t_7;
-  PyObject *__pyx_t_8 = NULL;
-  char *__pyx_t_9;
+  PyObject *__pyx_t_6 = NULL;
+  char *__pyx_t_7;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
@@ -1792,7 +1766,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
     __Pyx_GIVEREF(__pyx_v_info->obj);
   }
 
-  /* "numpy.pxd":200
+  /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":200
  *             # of flags
  * 
  *             if info == NULL: return             # <<<<<<<<<<<<<<
@@ -1803,11 +1777,9 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
   if (__pyx_t_1) {
     __pyx_r = 0;
     goto __pyx_L0;
-    goto __pyx_L3;
   }
-  __pyx_L3:;
 
-  /* "numpy.pxd":203
+  /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":203
  * 
  *             cdef int copy_shape, i, ndim
  *             cdef int endian_detector = 1             # <<<<<<<<<<<<<<
@@ -1816,7 +1788,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
   __pyx_v_endian_detector = 1;
 
-  /* "numpy.pxd":204
+  /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":204
  *             cdef int copy_shape, i, ndim
  *             cdef int endian_detector = 1
  *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)             # <<<<<<<<<<<<<<
@@ -1825,7 +1797,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
   __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
 
-  /* "numpy.pxd":206
+  /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":206
  *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
  * 
  *             ndim = PyArray_NDIM(self)             # <<<<<<<<<<<<<<
@@ -1834,7 +1806,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
   __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);
 
-  /* "numpy.pxd":208
+  /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":208
  *             ndim = PyArray_NDIM(self)
  * 
  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
@@ -1844,7 +1816,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
   __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
   if (__pyx_t_1) {
 
-    /* "numpy.pxd":209
+    /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":209
  * 
  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
  *                 copy_shape = 1             # <<<<<<<<<<<<<<
@@ -1856,7 +1828,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
   }
   /*else*/ {
 
-    /* "numpy.pxd":211
+    /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":211
  *                 copy_shape = 1
  *             else:
  *                 copy_shape = 0             # <<<<<<<<<<<<<<
@@ -1867,87 +1839,87 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
   }
   __pyx_L4:;
 
-  /* "numpy.pxd":213
+  /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":213
  *                 copy_shape = 0
  * 
  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)             # <<<<<<<<<<<<<<
  *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
  *                 raise ValueError(u"ndarray is not C contiguous")
  */
-  __pyx_t_1 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0);
-  if (__pyx_t_1) {
+  __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0);
+  if (__pyx_t_2) {
+  } else {
+    __pyx_t_1 = __pyx_t_2;
+    goto __pyx_L6_bool_binop_done;
+  }
 
-    /* "numpy.pxd":214
+  /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":214
  * 
  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
  *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):             # <<<<<<<<<<<<<<
  *                 raise ValueError(u"ndarray is not C contiguous")
  * 
  */
-    __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0);
-    __pyx_t_3 = __pyx_t_2;
-  } else {
-    __pyx_t_3 = __pyx_t_1;
-  }
-  if (__pyx_t_3) {
+  __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0);
+  __pyx_t_1 = __pyx_t_2;
+  __pyx_L6_bool_binop_done:;
+  if (__pyx_t_1) {
 
-    /* "numpy.pxd":215
+    /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":215
  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
  *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
  *                 raise ValueError(u"ndarray is not C contiguous")             # <<<<<<<<<<<<<<
  * 
  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  */
-    __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L5;
   }
-  __pyx_L5:;
 
-  /* "numpy.pxd":217
+  /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":217
  *                 raise ValueError(u"ndarray is not C contiguous")
  * 
  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)             # <<<<<<<<<<<<<<
  *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
  *                 raise ValueError(u"ndarray is not Fortran contiguous")
  */
-  __pyx_t_3 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0);
-  if (__pyx_t_3) {
+  __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0);
+  if (__pyx_t_2) {
+  } else {
+    __pyx_t_1 = __pyx_t_2;
+    goto __pyx_L9_bool_binop_done;
+  }
 
-    /* "numpy.pxd":218
+  /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":218
  * 
  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):             # <<<<<<<<<<<<<<
  *                 raise ValueError(u"ndarray is not Fortran contiguous")
  * 
  */
-    __pyx_t_1 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0);
-    __pyx_t_2 = __pyx_t_1;
-  } else {
-    __pyx_t_2 = __pyx_t_3;
-  }
-  if (__pyx_t_2) {
+  __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0);
+  __pyx_t_1 = __pyx_t_2;
+  __pyx_L9_bool_binop_done:;
+  if (__pyx_t_1) {
 
-    /* "numpy.pxd":219
+    /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":219
  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
  *                 raise ValueError(u"ndarray is not Fortran contiguous")             # <<<<<<<<<<<<<<
  * 
  *             info.buf = PyArray_DATA(self)
  */
-    __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L6;
   }
-  __pyx_L6:;
 
-  /* "numpy.pxd":221
+  /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":221
  *                 raise ValueError(u"ndarray is not Fortran contiguous")
  * 
  *             info.buf = PyArray_DATA(self)             # <<<<<<<<<<<<<<
@@ -1956,7 +1928,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
   __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);
 
-  /* "numpy.pxd":222
+  /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":222
  * 
  *             info.buf = PyArray_DATA(self)
  *             info.ndim = ndim             # <<<<<<<<<<<<<<
@@ -1965,17 +1937,17 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
   __pyx_v_info->ndim = __pyx_v_ndim;
 
-  /* "numpy.pxd":223
+  /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":223
  *             info.buf = PyArray_DATA(self)
  *             info.ndim = ndim
  *             if copy_shape:             # <<<<<<<<<<<<<<
  *                 # Allocate new buffer for strides and shape info.
  *                 # This is allocated as one block, strides first.
  */
-  __pyx_t_2 = (__pyx_v_copy_shape != 0);
-  if (__pyx_t_2) {
+  __pyx_t_1 = (__pyx_v_copy_shape != 0);
+  if (__pyx_t_1) {
 
-    /* "numpy.pxd":226
+    /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":226
  *                 # Allocate new buffer for strides and shape info.
  *                 # This is allocated as one block, strides first.
  *                 info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2)             # <<<<<<<<<<<<<<
@@ -1984,7 +1956,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
     __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2)));
 
-    /* "numpy.pxd":227
+    /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":227
  *                 # This is allocated as one block, strides first.
  *                 info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2)
  *                 info.shape = info.strides + ndim             # <<<<<<<<<<<<<<
@@ -1993,18 +1965,18 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
     __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
 
-    /* "numpy.pxd":228
+    /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":228
  *                 info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2)
  *                 info.shape = info.strides + ndim
  *                 for i in range(ndim):             # <<<<<<<<<<<<<<
  *                     info.strides[i] = PyArray_STRIDES(self)[i]
  *                     info.shape[i] = PyArray_DIMS(self)[i]
  */
-    __pyx_t_5 = __pyx_v_ndim;
-    for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
-      __pyx_v_i = __pyx_t_6;
+    __pyx_t_4 = __pyx_v_ndim;
+    for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
+      __pyx_v_i = __pyx_t_5;
 
-      /* "numpy.pxd":229
+      /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":229
  *                 info.shape = info.strides + ndim
  *                 for i in range(ndim):
  *                     info.strides[i] = PyArray_STRIDES(self)[i]             # <<<<<<<<<<<<<<
@@ -2013,7 +1985,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
       (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);
 
-      /* "numpy.pxd":230
+      /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":230
  *                 for i in range(ndim):
  *                     info.strides[i] = PyArray_STRIDES(self)[i]
  *                     info.shape[i] = PyArray_DIMS(self)[i]             # <<<<<<<<<<<<<<
@@ -2022,11 +1994,11 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
       (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
     }
-    goto __pyx_L7;
+    goto __pyx_L11;
   }
   /*else*/ {
 
-    /* "numpy.pxd":232
+    /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":232
  *                     info.shape[i] = PyArray_DIMS(self)[i]
  *             else:
  *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)             # <<<<<<<<<<<<<<
@@ -2035,7 +2007,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
     __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));
 
-    /* "numpy.pxd":233
+    /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":233
  *             else:
  *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
  *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)             # <<<<<<<<<<<<<<
@@ -2044,9 +2016,9 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
     __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
   }
-  __pyx_L7:;
+  __pyx_L11:;
 
-  /* "numpy.pxd":234
+  /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":234
  *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
  *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
  *             info.suboffsets = NULL             # <<<<<<<<<<<<<<
@@ -2055,7 +2027,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
   __pyx_v_info->suboffsets = NULL;
 
-  /* "numpy.pxd":235
+  /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":235
  *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
  *             info.suboffsets = NULL
  *             info.itemsize = PyArray_ITEMSIZE(self)             # <<<<<<<<<<<<<<
@@ -2064,7 +2036,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
   __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);
 
-  /* "numpy.pxd":236
+  /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":236
  *             info.suboffsets = NULL
  *             info.itemsize = PyArray_ITEMSIZE(self)
  *             info.readonly = not PyArray_ISWRITEABLE(self)             # <<<<<<<<<<<<<<
@@ -2073,7 +2045,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
   __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));
 
-  /* "numpy.pxd":239
+  /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":239
  * 
  *             cdef int t
  *             cdef char* f = NULL             # <<<<<<<<<<<<<<
@@ -2082,19 +2054,19 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
   __pyx_v_f = NULL;
 
-  /* "numpy.pxd":240
+  /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":240
  *             cdef int t
  *             cdef char* f = NULL
  *             cdef dtype descr = self.descr             # <<<<<<<<<<<<<<
  *             cdef list stack
  *             cdef int offset
  */
-  __pyx_t_4 = ((PyObject *)__pyx_v_self->descr);
-  __Pyx_INCREF(__pyx_t_4);
-  __pyx_v_descr = ((PyArray_Descr *)__pyx_t_4);
-  __pyx_t_4 = 0;
+  __pyx_t_3 = ((PyObject *)__pyx_v_self->descr);
+  __Pyx_INCREF(__pyx_t_3);
+  __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3);
+  __pyx_t_3 = 0;
 
-  /* "numpy.pxd":244
+  /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":244
  *             cdef int offset
  * 
  *             cdef bint hasfields = PyDataType_HASFIELDS(descr)             # <<<<<<<<<<<<<<
@@ -2103,7 +2075,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
   __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr);
 
-  /* "numpy.pxd":246
+  /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":246
  *             cdef bint hasfields = PyDataType_HASFIELDS(descr)
  * 
  *             if not hasfields and not copy_shape:             # <<<<<<<<<<<<<<
@@ -2112,14 +2084,16 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
   __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0);
   if (__pyx_t_2) {
-    __pyx_t_3 = ((!(__pyx_v_copy_shape != 0)) != 0);
-    __pyx_t_1 = __pyx_t_3;
   } else {
     __pyx_t_1 = __pyx_t_2;
+    goto __pyx_L15_bool_binop_done;
   }
+  __pyx_t_2 = ((!(__pyx_v_copy_shape != 0)) != 0);
+  __pyx_t_1 = __pyx_t_2;
+  __pyx_L15_bool_binop_done:;
   if (__pyx_t_1) {
 
-    /* "numpy.pxd":248
+    /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":248
  *             if not hasfields and not copy_shape:
  *                 # do not call releasebuffer
  *                 info.obj = None             # <<<<<<<<<<<<<<
@@ -2131,11 +2105,11 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
     __Pyx_GOTREF(__pyx_v_info->obj);
     __Pyx_DECREF(__pyx_v_info->obj);
     __pyx_v_info->obj = Py_None;
-    goto __pyx_L10;
+    goto __pyx_L14;
   }
   /*else*/ {
 
-    /* "numpy.pxd":251
+    /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":251
  *             else:
  *                 # need to call releasebuffer
  *                 info.obj = self             # <<<<<<<<<<<<<<
@@ -2148,9 +2122,9 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
     __Pyx_DECREF(__pyx_v_info->obj);
     __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
   }
-  __pyx_L10:;
+  __pyx_L14:;
 
-  /* "numpy.pxd":253
+  /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":253
  *                 info.obj = self
  * 
  *             if not hasfields:             # <<<<<<<<<<<<<<
@@ -2160,68 +2134,69 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
   __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0);
   if (__pyx_t_1) {
 
-    /* "numpy.pxd":254
+    /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":254
  * 
  *             if not hasfields:
  *                 t = descr.type_num             # <<<<<<<<<<<<<<
  *                 if ((descr.byteorder == c'>' and little_endian) or
  *                     (descr.byteorder == c'<' and not little_endian)):
  */
-    __pyx_t_5 = __pyx_v_descr->type_num;
-    __pyx_v_t = __pyx_t_5;
+    __pyx_t_4 = __pyx_v_descr->type_num;
+    __pyx_v_t = __pyx_t_4;
 
-    /* "numpy.pxd":255
+    /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":255
  *             if not hasfields:
  *                 t = descr.type_num
  *                 if ((descr.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
  *                     (descr.byteorder == c'<' and not little_endian)):
  *                     raise ValueError(u"Non-native byte order not supported")
  */
-    __pyx_t_1 = ((__pyx_v_descr->byteorder == '>') != 0);
-    if (__pyx_t_1) {
-      __pyx_t_2 = (__pyx_v_little_endian != 0);
+    __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0);
+    if (!__pyx_t_2) {
+      goto __pyx_L20_next_or;
     } else {
-      __pyx_t_2 = __pyx_t_1;
     }
+    __pyx_t_2 = (__pyx_v_little_endian != 0);
     if (!__pyx_t_2) {
-
-      /* "numpy.pxd":256
+    } else {
+      __pyx_t_1 = __pyx_t_2;
+      goto __pyx_L19_bool_binop_done;
+    }
+    __pyx_L20_next_or:;
+
+    /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":256
  *                 t = descr.type_num
  *                 if ((descr.byteorder == c'>' and little_endian) or
  *                     (descr.byteorder == c'<' and not little_endian)):             # <<<<<<<<<<<<<<
  *                     raise ValueError(u"Non-native byte order not supported")
  *                 if   t == NPY_BYTE:        f = "b"
  */
-      __pyx_t_1 = ((__pyx_v_descr->byteorder == '<') != 0);
-      if (__pyx_t_1) {
-        __pyx_t_3 = ((!(__pyx_v_little_endian != 0)) != 0);
-        __pyx_t_7 = __pyx_t_3;
-      } else {
-        __pyx_t_7 = __pyx_t_1;
-      }
-      __pyx_t_1 = __pyx_t_7;
+    __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0);
+    if (__pyx_t_2) {
     } else {
       __pyx_t_1 = __pyx_t_2;
+      goto __pyx_L19_bool_binop_done;
     }
+    __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0);
+    __pyx_t_1 = __pyx_t_2;
+    __pyx_L19_bool_binop_done:;
     if (__pyx_t_1) {
 
-      /* "numpy.pxd":257
+      /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":257
  *                 if ((descr.byteorder == c'>' and little_endian) or
  *                     (descr.byteorder == c'<' and not little_endian)):
  *                     raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
  *                 if   t == NPY_BYTE:        f = "b"
  *                 elif t == NPY_UBYTE:       f = "B"
  */
-      __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_7), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
       {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      goto __pyx_L12;
     }
-    __pyx_L12:;
 
-    /* "numpy.pxd":274
+    /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":274
  *                 elif t == NPY_CDOUBLE:     f = "Zd"
  *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
  *                 elif t == NPY_OBJECT:      f = "O"             # <<<<<<<<<<<<<<
@@ -2230,7 +2205,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
     switch (__pyx_v_t) {
 
-      /* "numpy.pxd":258
+      /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":258
  *                     (descr.byteorder == c'<' and not little_endian)):
  *                     raise ValueError(u"Non-native byte order not supported")
  *                 if   t == NPY_BYTE:        f = "b"             # <<<<<<<<<<<<<<
@@ -2238,10 +2213,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  *                 elif t == NPY_SHORT:       f = "h"
  */
       case NPY_BYTE:
-      __pyx_v_f = __pyx_k__b;
+      __pyx_v_f = __pyx_k_b;
       break;
 
-      /* "numpy.pxd":259
+      /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":259
  *                     raise ValueError(u"Non-native byte order not supported")
  *                 if   t == NPY_BYTE:        f = "b"
  *                 elif t == NPY_UBYTE:       f = "B"             # <<<<<<<<<<<<<<
@@ -2249,10 +2224,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  *                 elif t == NPY_USHORT:      f = "H"
  */
       case NPY_UBYTE:
-      __pyx_v_f = __pyx_k__B;
+      __pyx_v_f = __pyx_k_B;
       break;
 
-      /* "numpy.pxd":260
+      /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":260
  *                 if   t == NPY_BYTE:        f = "b"
  *                 elif t == NPY_UBYTE:       f = "B"
  *                 elif t == NPY_SHORT:       f = "h"             # <<<<<<<<<<<<<<
@@ -2260,10 +2235,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  *                 elif t == NPY_INT:         f = "i"
  */
       case NPY_SHORT:
-      __pyx_v_f = __pyx_k__h;
+      __pyx_v_f = __pyx_k_h;
       break;
 
-      /* "numpy.pxd":261
+      /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":261
  *                 elif t == NPY_UBYTE:       f = "B"
  *                 elif t == NPY_SHORT:       f = "h"
  *                 elif t == NPY_USHORT:      f = "H"             # <<<<<<<<<<<<<<
@@ -2271,10 +2246,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  *                 elif t == NPY_UINT:        f = "I"
  */
       case NPY_USHORT:
-      __pyx_v_f = __pyx_k__H;
+      __pyx_v_f = __pyx_k_H;
       break;
 
-      /* "numpy.pxd":262
+      /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":262
  *                 elif t == NPY_SHORT:       f = "h"
  *                 elif t == NPY_USHORT:      f = "H"
  *                 elif t == NPY_INT:         f = "i"             # <<<<<<<<<<<<<<
@@ -2282,10 +2257,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  *                 elif t == NPY_LONG:        f = "l"
  */
       case NPY_INT:
-      __pyx_v_f = __pyx_k__i;
+      __pyx_v_f = __pyx_k_i;
       break;
 
-      /* "numpy.pxd":263
+      /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":263
  *                 elif t == NPY_USHORT:      f = "H"
  *                 elif t == NPY_INT:         f = "i"
  *                 elif t == NPY_UINT:        f = "I"             # <<<<<<<<<<<<<<
@@ -2293,10 +2268,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  *                 elif t == NPY_ULONG:       f = "L"
  */
       case NPY_UINT:
-      __pyx_v_f = __pyx_k__I;
+      __pyx_v_f = __pyx_k_I;
       break;
 
-      /* "numpy.pxd":264
+      /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":264
  *                 elif t == NPY_INT:         f = "i"
  *                 elif t == NPY_UINT:        f = "I"
  *                 elif t == NPY_LONG:        f = "l"             # <<<<<<<<<<<<<<
@@ -2304,10 +2279,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  *                 elif t == NPY_LONGLONG:    f = "q"
  */
       case NPY_LONG:
-      __pyx_v_f = __pyx_k__l;
+      __pyx_v_f = __pyx_k_l;
       break;
 
-      /* "numpy.pxd":265
+      /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":265
  *                 elif t == NPY_UINT:        f = "I"
  *                 elif t == NPY_LONG:        f = "l"
  *                 elif t == NPY_ULONG:       f = "L"             # <<<<<<<<<<<<<<
@@ -2315,10 +2290,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  *                 elif t == NPY_ULONGLONG:   f = "Q"
  */
       case NPY_ULONG:
-      __pyx_v_f = __pyx_k__L;
+      __pyx_v_f = __pyx_k_L;
       break;
 
-      /* "numpy.pxd":266
+      /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":266
  *                 elif t == NPY_LONG:        f = "l"
  *                 elif t == NPY_ULONG:       f = "L"
  *                 elif t == NPY_LONGLONG:    f = "q"             # <<<<<<<<<<<<<<
@@ -2326,10 +2301,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  *                 elif t == NPY_FLOAT:       f = "f"
  */
       case NPY_LONGLONG:
-      __pyx_v_f = __pyx_k__q;
+      __pyx_v_f = __pyx_k_q;
       break;
 
-      /* "numpy.pxd":267
+      /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":267
  *                 elif t == NPY_ULONG:       f = "L"
  *                 elif t == NPY_LONGLONG:    f = "q"
  *                 elif t == NPY_ULONGLONG:   f = "Q"             # <<<<<<<<<<<<<<
@@ -2337,10 +2312,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  *                 elif t == NPY_DOUBLE:      f = "d"
  */
       case NPY_ULONGLONG:
-      __pyx_v_f = __pyx_k__Q;
+      __pyx_v_f = __pyx_k_Q;
       break;
 
-      /* "numpy.pxd":268
+      /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":268
  *                 elif t == NPY_LONGLONG:    f = "q"
  *                 elif t == NPY_ULONGLONG:   f = "Q"
  *                 elif t == NPY_FLOAT:       f = "f"             # <<<<<<<<<<<<<<
@@ -2348,10 +2323,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  *                 elif t == NPY_LONGDOUBLE:  f = "g"
  */
       case NPY_FLOAT:
-      __pyx_v_f = __pyx_k__f;
+      __pyx_v_f = __pyx_k_f;
       break;
 
-      /* "numpy.pxd":269
+      /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":269
  *                 elif t == NPY_ULONGLONG:   f = "Q"
  *                 elif t == NPY_FLOAT:       f = "f"
  *                 elif t == NPY_DOUBLE:      f = "d"             # <<<<<<<<<<<<<<
@@ -2359,10 +2334,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  *                 elif t == NPY_CFLOAT:      f = "Zf"
  */
       case NPY_DOUBLE:
-      __pyx_v_f = __pyx_k__d;
+      __pyx_v_f = __pyx_k_d;
       break;
 
-      /* "numpy.pxd":270
+      /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":270
  *                 elif t == NPY_FLOAT:       f = "f"
  *                 elif t == NPY_DOUBLE:      f = "d"
  *                 elif t == NPY_LONGDOUBLE:  f = "g"             # <<<<<<<<<<<<<<
@@ -2370,10 +2345,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  *                 elif t == NPY_CDOUBLE:     f = "Zd"
  */
       case NPY_LONGDOUBLE:
-      __pyx_v_f = __pyx_k__g;
+      __pyx_v_f = __pyx_k_g;
       break;
 
-      /* "numpy.pxd":271
+      /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":271
  *                 elif t == NPY_DOUBLE:      f = "d"
  *                 elif t == NPY_LONGDOUBLE:  f = "g"
  *                 elif t == NPY_CFLOAT:      f = "Zf"             # <<<<<<<<<<<<<<
@@ -2381,10 +2356,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
  */
       case NPY_CFLOAT:
-      __pyx_v_f = __pyx_k__Zf;
+      __pyx_v_f = __pyx_k_Zf;
       break;
 
-      /* "numpy.pxd":272
+      /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":272
  *                 elif t == NPY_LONGDOUBLE:  f = "g"
  *                 elif t == NPY_CFLOAT:      f = "Zf"
  *                 elif t == NPY_CDOUBLE:     f = "Zd"             # <<<<<<<<<<<<<<
@@ -2392,10 +2367,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  *                 elif t == NPY_OBJECT:      f = "O"
  */
       case NPY_CDOUBLE:
-      __pyx_v_f = __pyx_k__Zd;
+      __pyx_v_f = __pyx_k_Zd;
       break;
 
-      /* "numpy.pxd":273
+      /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":273
  *                 elif t == NPY_CFLOAT:      f = "Zf"
  *                 elif t == NPY_CDOUBLE:     f = "Zd"
  *                 elif t == NPY_CLONGDOUBLE: f = "Zg"             # <<<<<<<<<<<<<<
@@ -2403,10 +2378,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  *                 else:
  */
       case NPY_CLONGDOUBLE:
-      __pyx_v_f = __pyx_k__Zg;
+      __pyx_v_f = __pyx_k_Zg;
       break;
 
-      /* "numpy.pxd":274
+      /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":274
  *                 elif t == NPY_CDOUBLE:     f = "Zd"
  *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
  *                 elif t == NPY_OBJECT:      f = "O"             # <<<<<<<<<<<<<<
@@ -2414,37 +2389,37 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  */
       case NPY_OBJECT:
-      __pyx_v_f = __pyx_k__O;
+      __pyx_v_f = __pyx_k_O;
       break;
       default:
 
-      /* "numpy.pxd":276
+      /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":276
  *                 elif t == NPY_OBJECT:      f = "O"
  *                 else:
  *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)             # <<<<<<<<<<<<<<
  *                 info.format = f
  *                 return
  */
-      __pyx_t_4 = PyInt_FromLong(__pyx_v_t); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __pyx_t_8 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_8), __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(((PyObject *)__pyx_t_8));
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_8));
-      __Pyx_GIVEREF(((PyObject *)__pyx_t_8));
-      __pyx_t_8 = 0;
-      __pyx_t_8 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-      __Pyx_Raise(__pyx_t_8, 0, 0, 0);
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+      __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_6);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6);
+      __Pyx_GIVEREF(__pyx_t_6);
+      __pyx_t_6 = 0;
+      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_6);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_Raise(__pyx_t_6, 0, 0, 0);
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
       {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       break;
     }
 
-    /* "numpy.pxd":277
+    /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":277
  *                 else:
  *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  *                 info.format = f             # <<<<<<<<<<<<<<
@@ -2453,7 +2428,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
     __pyx_v_info->format = __pyx_v_f;
 
-    /* "numpy.pxd":278
+    /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":278
  *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  *                 info.format = f
  *                 return             # <<<<<<<<<<<<<<
@@ -2462,11 +2437,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
     __pyx_r = 0;
     goto __pyx_L0;
-    goto __pyx_L11;
   }
   /*else*/ {
 
-    /* "numpy.pxd":280
+    /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":280
  *                 return
  *             else:
  *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)             # <<<<<<<<<<<<<<
@@ -2475,7 +2449,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
     __pyx_v_info->format = ((char *)malloc(255));
 
-    /* "numpy.pxd":281
+    /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":281
  *             else:
  *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)
  *                 info.format[0] = c'^' # Native data types, manual alignment             # <<<<<<<<<<<<<<
@@ -2484,7 +2458,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
     (__pyx_v_info->format[0]) = '^';
 
-    /* "numpy.pxd":282
+    /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":282
  *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)
  *                 info.format[0] = c'^' # Native data types, manual alignment
  *                 offset = 0             # <<<<<<<<<<<<<<
@@ -2493,17 +2467,17 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
     __pyx_v_offset = 0;
 
-    /* "numpy.pxd":285
- *                 f = _util_dtypestring(descr, info.format + 1,
+    /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":283
+ *                 info.format[0] = c'^' # Native data types, manual alignment
+ *                 offset = 0
+ *                 f = _util_dtypestring(descr, info.format + 1,             # <<<<<<<<<<<<<<
  *                                       info.format + _buffer_format_string_len,
- *                                       &offset)             # <<<<<<<<<<<<<<
- *                 f[0] = c'\0' # Terminate format string
- * 
+ *                                       &offset)
  */
-    __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 255), (&__pyx_v_offset)); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_v_f = __pyx_t_9;
+    __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 255), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_v_f = __pyx_t_7;
 
-    /* "numpy.pxd":286
+    /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":286
  *                                       info.format + _buffer_format_string_len,
  *                                       &offset)
  *                 f[0] = c'\0' # Terminate format string             # <<<<<<<<<<<<<<
@@ -2512,13 +2486,21 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
  */
     (__pyx_v_f[0]) = '\x00';
   }
-  __pyx_L11:;
 
+  /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":194
+ *         # experimental exception made for __getbuffer__ and __releasebuffer__
+ *         # -- the details of this may change.
+ *         def __getbuffer__(ndarray self, Py_buffer* info, int flags):             # <<<<<<<<<<<<<<
+ *             # This implementation of getbuffer is geared towards Cython
+ *             # requirements, and does not yet fullfill the PEP.
+ */
+
+  /* function exit code */
   __pyx_r = 0;
   goto __pyx_L0;
   __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_XDECREF(__pyx_t_8);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_6);
   __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_r = -1;
   if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) {
@@ -2537,29 +2519,31 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
   return __pyx_r;
 }
 
+/* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":288
+ *                 f[0] = c'\0' # Terminate format string
+ * 
+ *         def __releasebuffer__(ndarray self, Py_buffer* info):             # <<<<<<<<<<<<<<
+ *             if PyArray_HASFIELDS(self):
+ *                 stdlib.free(info.format)
+ */
+
 /* Python wrapper */
 static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
 static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
   __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
 }
 
-/* "numpy.pxd":288
- *                 f[0] = c'\0' # Terminate format string
- * 
- *         def __releasebuffer__(ndarray self, Py_buffer* info):             # <<<<<<<<<<<<<<
- *             if PyArray_HASFIELDS(self):
- *                 stdlib.free(info.format)
- */
-
 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
   __Pyx_RefNannyDeclarations
   int __pyx_t_1;
   __Pyx_RefNannySetupContext("__releasebuffer__", 0);
 
-  /* "numpy.pxd":289
+  /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":289
  * 
  *         def __releasebuffer__(ndarray self, Py_buffer* info):
  *             if PyArray_HASFIELDS(self):             # <<<<<<<<<<<<<<
@@ -2569,7 +2553,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s
   __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0);
   if (__pyx_t_1) {
 
-    /* "numpy.pxd":290
+    /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":290
  *         def __releasebuffer__(ndarray self, Py_buffer* info):
  *             if PyArray_HASFIELDS(self):
  *                 stdlib.free(info.format)             # <<<<<<<<<<<<<<
@@ -2581,7 +2565,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s
   }
   __pyx_L3:;
 
-  /* "numpy.pxd":291
+  /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":291
  *             if PyArray_HASFIELDS(self):
  *                 stdlib.free(info.format)
  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
@@ -2591,7 +2575,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s
   __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
   if (__pyx_t_1) {
 
-    /* "numpy.pxd":292
+    /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":292
  *                 stdlib.free(info.format)
  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
  *                 stdlib.free(info.strides)             # <<<<<<<<<<<<<<
@@ -2603,10 +2587,19 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s
   }
   __pyx_L4:;
 
+  /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":288
+ *                 f[0] = c'\0' # Terminate format string
+ * 
+ *         def __releasebuffer__(ndarray self, Py_buffer* info):             # <<<<<<<<<<<<<<
+ *             if PyArray_HASFIELDS(self):
+ *                 stdlib.free(info.format)
+ */
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
 }
 
-/* "numpy.pxd":768
+/* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":768
  * ctypedef npy_cdouble     complex_t
  * 
  * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
@@ -2623,7 +2616,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
 
-  /* "numpy.pxd":769
+  /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":769
  * 
  * cdef inline object PyArray_MultiIterNew1(a):
  *     return PyArray_MultiIterNew(1, <void*>a)             # <<<<<<<<<<<<<<
@@ -2637,8 +2630,15 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":768
+ * ctypedef npy_cdouble     complex_t
+ * 
+ * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
+ *     return PyArray_MultiIterNew(1, <void*>a)
+ * 
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
@@ -2649,7 +2649,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__
   return __pyx_r;
 }
 
-/* "numpy.pxd":771
+/* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":771
  *     return PyArray_MultiIterNew(1, <void*>a)
  * 
  * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
@@ -2666,7 +2666,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
 
-  /* "numpy.pxd":772
+  /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":772
  * 
  * cdef inline object PyArray_MultiIterNew2(a, b):
  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)             # <<<<<<<<<<<<<<
@@ -2680,8 +2680,15 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":771
+ *     return PyArray_MultiIterNew(1, <void*>a)
+ * 
+ * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
+ *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
+ * 
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
@@ -2692,7 +2699,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__
   return __pyx_r;
 }
 
-/* "numpy.pxd":774
+/* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":774
  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
  * 
  * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
@@ -2709,7 +2716,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
 
-  /* "numpy.pxd":775
+  /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":775
  * 
  * cdef inline object PyArray_MultiIterNew3(a, b, c):
  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)             # <<<<<<<<<<<<<<
@@ -2723,8 +2730,15 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":774
+ *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
+ * 
+ * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
+ *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
+ * 
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
@@ -2735,7 +2749,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__
   return __pyx_r;
 }
 
-/* "numpy.pxd":777
+/* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":777
  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
  * 
  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
@@ -2752,7 +2766,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
 
-  /* "numpy.pxd":778
+  /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":778
  * 
  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)             # <<<<<<<<<<<<<<
@@ -2766,8 +2780,15 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":777
+ *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
+ * 
+ * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
+ *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
+ * 
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
@@ -2778,7 +2799,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__
   return __pyx_r;
 }
 
-/* "numpy.pxd":780
+/* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":780
  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
  * 
  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
@@ -2795,7 +2816,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
 
-  /* "numpy.pxd":781
+  /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":781
  * 
  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)             # <<<<<<<<<<<<<<
@@ -2809,8 +2830,15 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
+  /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":780
+ *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
+ * 
+ * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
+ *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
+ * 
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
@@ -2821,7 +2849,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__
   return __pyx_r;
 }
 
-/* "numpy.pxd":783
+/* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":783
  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
  * 
  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:             # <<<<<<<<<<<<<<
@@ -2843,20 +2871,17 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
   Py_ssize_t __pyx_t_2;
   PyObject *__pyx_t_3 = NULL;
   PyObject *__pyx_t_4 = NULL;
-  PyObject *__pyx_t_5 = NULL;
-  PyObject *(*__pyx_t_6)(PyObject *);
+  int __pyx_t_5;
+  int __pyx_t_6;
   int __pyx_t_7;
-  int __pyx_t_8;
-  int __pyx_t_9;
-  int __pyx_t_10;
-  long __pyx_t_11;
-  char *__pyx_t_12;
+  long __pyx_t_8;
+  char *__pyx_t_9;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("_util_dtypestring", 0);
 
-  /* "numpy.pxd":790
+  /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":790
  *     cdef int delta_offset
  *     cdef tuple i
  *     cdef int endian_detector = 1             # <<<<<<<<<<<<<<
@@ -2865,7 +2890,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
  */
   __pyx_v_endian_detector = 1;
 
-  /* "numpy.pxd":791
+  /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":791
  *     cdef tuple i
  *     cdef int endian_detector = 1
  *     cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)             # <<<<<<<<<<<<<<
@@ -2874,18 +2899,18 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
  */
   __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
 
-  /* "numpy.pxd":794
+  /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":794
  *     cdef tuple fields
  * 
  *     for childname in descr.names:             # <<<<<<<<<<<<<<
  *         fields = descr.fields[childname]
  *         child, new_offset = fields
  */
-  if (unlikely(((PyObject *)__pyx_v_descr->names) == Py_None)) {
+  if (unlikely(__pyx_v_descr->names == Py_None)) {
     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
     {__pyx_filename = __pyx_f[1]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
-  __pyx_t_1 = ((PyObject *)__pyx_v_descr->names); __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
+  __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
   for (;;) {
     if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
     #if CYTHON_COMPILING_IN_CPYTHON
@@ -2893,33 +2918,31 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
     #else
     __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     #endif
-    __Pyx_XDECREF(__pyx_v_childname);
-    __pyx_v_childname = __pyx_t_3;
+    __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
     __pyx_t_3 = 0;
 
-    /* "numpy.pxd":795
+    /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":795
  * 
  *     for childname in descr.names:
  *         fields = descr.fields[childname]             # <<<<<<<<<<<<<<
  *         child, new_offset = fields
  * 
  */
-    __pyx_t_3 = PyObject_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (!__pyx_t_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = PyObject_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
     __Pyx_GOTREF(__pyx_t_3);
-    if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected tuple, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_XDECREF(((PyObject *)__pyx_v_fields));
-    __pyx_v_fields = ((PyObject*)__pyx_t_3);
+    if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
     __pyx_t_3 = 0;
 
-    /* "numpy.pxd":796
+    /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":796
  *     for childname in descr.names:
  *         fields = descr.fields[childname]
  *         child, new_offset = fields             # <<<<<<<<<<<<<<
  * 
- *         if (end - f) - (new_offset - offset[0]) < 15:
+ *         if (end - f) - <int>(new_offset - offset[0]) < 15:
  */
-    if (likely(PyTuple_CheckExact(((PyObject *)__pyx_v_fields)))) {
-      PyObject* sequence = ((PyObject *)__pyx_v_fields);
+    if (likely(__pyx_v_fields != Py_None)) {
+      PyObject* sequence = __pyx_v_fields;
       #if CYTHON_COMPILING_IN_CPYTHON
       Py_ssize_t size = Py_SIZE(sequence);
       #else
@@ -2941,78 +2964,47 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
       __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_4);
       #endif
-    } else if (1) {
+    } else {
       __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    } else
-    {
-      Py_ssize_t index = -1;
-      __pyx_t_5 = PyObject_GetIter(((PyObject *)__pyx_v_fields)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext;
-      index = 0; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
-      __Pyx_GOTREF(__pyx_t_3);
-      index = 1; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed;
-      __Pyx_GOTREF(__pyx_t_4);
-      if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_6 = NULL;
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      goto __pyx_L6_unpacking_done;
-      __pyx_L5_unpacking_failed:;
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_6 = NULL;
-      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_L6_unpacking_done:;
     }
     if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_XDECREF(((PyObject *)__pyx_v_child));
-    __pyx_v_child = ((PyArray_Descr *)__pyx_t_3);
+    __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
     __pyx_t_3 = 0;
-    __Pyx_XDECREF(__pyx_v_new_offset);
-    __pyx_v_new_offset = __pyx_t_4;
+    __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
     __pyx_t_4 = 0;
 
-    /* "numpy.pxd":798
+    /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":798
  *         child, new_offset = fields
  * 
- *         if (end - f) - (new_offset - offset[0]) < 15:             # <<<<<<<<<<<<<<
+ *         if (end - f) - <int>(new_offset - offset[0]) < 15:             # <<<<<<<<<<<<<<
  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
  * 
  */
-    __pyx_t_4 = PyInt_FromLong((__pyx_v_end - __pyx_v_f)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_3 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_5 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_int_15, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    if (__pyx_t_7) {
+    __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0);
+    if (__pyx_t_6) {
 
-      /* "numpy.pxd":799
+      /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":799
  * 
- *         if (end - f) - (new_offset - offset[0]) < 15:
+ *         if (end - f) - <int>(new_offset - offset[0]) < 15:
  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")             # <<<<<<<<<<<<<<
  * 
  *         if ((child.byteorder == c'>' and little_endian) or
  */
-      __pyx_t_5 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_10), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __Pyx_Raise(__pyx_t_5, 0, 0, 0);
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
       {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      goto __pyx_L7;
     }
-    __pyx_L7:;
 
-    /* "numpy.pxd":801
+    /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":801
  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
  * 
  *         if ((child.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
@@ -3020,50 +3012,51 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
  *             raise ValueError(u"Non-native byte order not supported")
  */
     __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0);
-    if (__pyx_t_7) {
-      __pyx_t_8 = (__pyx_v_little_endian != 0);
+    if (!__pyx_t_7) {
+      goto __pyx_L8_next_or;
+    } else {
+    }
+    __pyx_t_7 = (__pyx_v_little_endian != 0);
+    if (!__pyx_t_7) {
     } else {
-      __pyx_t_8 = __pyx_t_7;
+      __pyx_t_6 = __pyx_t_7;
+      goto __pyx_L7_bool_binop_done;
     }
-    if (!__pyx_t_8) {
+    __pyx_L8_next_or:;
 
-      /* "numpy.pxd":802
+    /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":802
  * 
  *         if ((child.byteorder == c'>' and little_endian) or
  *             (child.byteorder == c'<' and not little_endian)):             # <<<<<<<<<<<<<<
  *             raise ValueError(u"Non-native byte order not supported")
  *             # One could encode it in the format string and have Cython
  */
-      __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 0);
-      if (__pyx_t_7) {
-        __pyx_t_9 = ((!(__pyx_v_little_endian != 0)) != 0);
-        __pyx_t_10 = __pyx_t_9;
-      } else {
-        __pyx_t_10 = __pyx_t_7;
-      }
-      __pyx_t_7 = __pyx_t_10;
+    __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 0);
+    if (__pyx_t_7) {
     } else {
-      __pyx_t_7 = __pyx_t_8;
+      __pyx_t_6 = __pyx_t_7;
+      goto __pyx_L7_bool_binop_done;
     }
-    if (__pyx_t_7) {
+    __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
+    __pyx_t_6 = __pyx_t_7;
+    __pyx_L7_bool_binop_done:;
+    if (__pyx_t_6) {
 
-      /* "numpy.pxd":803
+      /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":803
  *         if ((child.byteorder == c'>' and little_endian) or
  *             (child.byteorder == c'<' and not little_endian)):
  *             raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
  *             # One could encode it in the format string and have Cython
  *             # complain instead, BUT: < and > in format strings also imply
  */
-      __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_11), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __Pyx_Raise(__pyx_t_5, 0, 0, 0);
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
       {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      goto __pyx_L8;
     }
-    __pyx_L8:;
 
-    /* "numpy.pxd":813
+    /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":813
  * 
  *         # Output padding bytes
  *         while offset[0] < new_offset:             # <<<<<<<<<<<<<<
@@ -3071,15 +3064,15 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
  *             f += 1
  */
     while (1) {
-      __pyx_t_5 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (!__pyx_t_7) break;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      if (!__pyx_t_6) break;
 
-      /* "numpy.pxd":814
+      /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":814
  *         # Output padding bytes
  *         while offset[0] < new_offset:
  *             f[0] = 120 # "x"; pad byte             # <<<<<<<<<<<<<<
@@ -3088,7 +3081,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
  */
       (__pyx_v_f[0]) = 120;
 
-      /* "numpy.pxd":815
+      /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":815
  *         while offset[0] < new_offset:
  *             f[0] = 120 # "x"; pad byte
  *             f += 1             # <<<<<<<<<<<<<<
@@ -3097,413 +3090,410 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
  */
       __pyx_v_f = (__pyx_v_f + 1);
 
-      /* "numpy.pxd":816
+      /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":816
  *             f[0] = 120 # "x"; pad byte
  *             f += 1
  *             offset[0] += 1             # <<<<<<<<<<<<<<
  * 
  *         offset[0] += child.itemsize
  */
-      __pyx_t_11 = 0;
-      (__pyx_v_offset[__pyx_t_11]) = ((__pyx_v_offset[__pyx_t_11]) + 1);
+      __pyx_t_8 = 0;
+      (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1);
     }
 
-    /* "numpy.pxd":818
+    /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":818
  *             offset[0] += 1
  * 
  *         offset[0] += child.itemsize             # <<<<<<<<<<<<<<
  * 
  *         if not PyDataType_HASFIELDS(child):
  */
-    __pyx_t_11 = 0;
-    (__pyx_v_offset[__pyx_t_11]) = ((__pyx_v_offset[__pyx_t_11]) + __pyx_v_child->elsize);
+    __pyx_t_8 = 0;
+    (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize);
 
-    /* "numpy.pxd":820
+    /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":820
  *         offset[0] += child.itemsize
  * 
  *         if not PyDataType_HASFIELDS(child):             # <<<<<<<<<<<<<<
  *             t = child.type_num
  *             if end - f < 5:
  */
-    __pyx_t_7 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
-    if (__pyx_t_7) {
+    __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
+    if (__pyx_t_6) {
 
-      /* "numpy.pxd":821
+      /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":821
  * 
  *         if not PyDataType_HASFIELDS(child):
  *             t = child.type_num             # <<<<<<<<<<<<<<
  *             if end - f < 5:
  *                 raise RuntimeError(u"Format string allocated too short.")
  */
-      __pyx_t_3 = PyInt_FromLong(__pyx_v_child->type_num); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __Pyx_XDECREF(__pyx_v_t);
-      __pyx_v_t = __pyx_t_3;
-      __pyx_t_3 = 0;
+      __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
+      __pyx_t_4 = 0;
 
-      /* "numpy.pxd":822
+      /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":822
  *         if not PyDataType_HASFIELDS(child):
  *             t = child.type_num
  *             if end - f < 5:             # <<<<<<<<<<<<<<
  *                 raise RuntimeError(u"Format string allocated too short.")
  * 
  */
-      __pyx_t_7 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
-      if (__pyx_t_7) {
+      __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
+      if (__pyx_t_6) {
 
-        /* "numpy.pxd":823
+        /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":823
  *             t = child.type_num
  *             if end - f < 5:
  *                 raise RuntimeError(u"Format string allocated too short.")             # <<<<<<<<<<<<<<
  * 
  *             # Until ticket #99 is fixed, use integers to avoid warnings
  */
-        __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_13), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_3);
-        __Pyx_Raise(__pyx_t_3, 0, 0, 0);
-        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_4);
+        __Pyx_Raise(__pyx_t_4, 0, 0, 0);
+        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
         {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        goto __pyx_L12;
       }
-      __pyx_L12:;
 
-      /* "numpy.pxd":826
+      /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":826
  * 
  *             # Until ticket #99 is fixed, use integers to avoid warnings
  *             if   t == NPY_BYTE:        f[0] =  98 #"b"             # <<<<<<<<<<<<<<
  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
  */
-      __pyx_t_3 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_7) {
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 98;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":827
+      /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":827
  *             # Until ticket #99 is fixed, use integers to avoid warnings
  *             if   t == NPY_BYTE:        f[0] =  98 #"b"
  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"             # <<<<<<<<<<<<<<
  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
  */
-      __pyx_t_5 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (__pyx_t_7) {
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 66;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":828
+      /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":828
  *             if   t == NPY_BYTE:        f[0] =  98 #"b"
  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
  *             elif t == NPY_SHORT:       f[0] = 104 #"h"             # <<<<<<<<<<<<<<
  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
  *             elif t == NPY_INT:         f[0] = 105 #"i"
  */
-      __pyx_t_3 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_7) {
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 104;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":829
+      /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":829
  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
  *             elif t == NPY_USHORT:      f[0] =  72 #"H"             # <<<<<<<<<<<<<<
  *             elif t == NPY_INT:         f[0] = 105 #"i"
  *             elif t == NPY_UINT:        f[0] =  73 #"I"
  */
-      __pyx_t_5 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (__pyx_t_7) {
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 72;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":830
+      /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":830
  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
  *             elif t == NPY_INT:         f[0] = 105 #"i"             # <<<<<<<<<<<<<<
  *             elif t == NPY_UINT:        f[0] =  73 #"I"
  *             elif t == NPY_LONG:        f[0] = 108 #"l"
  */
-      __pyx_t_3 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_7) {
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 105;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":831
+      /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":831
  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
  *             elif t == NPY_INT:         f[0] = 105 #"i"
  *             elif t == NPY_UINT:        f[0] =  73 #"I"             # <<<<<<<<<<<<<<
  *             elif t == NPY_LONG:        f[0] = 108 #"l"
  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
  */
-      __pyx_t_5 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (__pyx_t_7) {
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 73;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":832
+      /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":832
  *             elif t == NPY_INT:         f[0] = 105 #"i"
  *             elif t == NPY_UINT:        f[0] =  73 #"I"
  *             elif t == NPY_LONG:        f[0] = 108 #"l"             # <<<<<<<<<<<<<<
  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
  */
-      __pyx_t_3 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_7) {
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 108;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":833
+      /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":833
  *             elif t == NPY_UINT:        f[0] =  73 #"I"
  *             elif t == NPY_LONG:        f[0] = 108 #"l"
  *             elif t == NPY_ULONG:       f[0] = 76  #"L"             # <<<<<<<<<<<<<<
  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
  */
-      __pyx_t_5 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (__pyx_t_7) {
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 76;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":834
+      /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":834
  *             elif t == NPY_LONG:        f[0] = 108 #"l"
  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"             # <<<<<<<<<<<<<<
  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
  */
-      __pyx_t_3 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_7) {
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 113;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":835
+      /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":835
  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"             # <<<<<<<<<<<<<<
  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
  */
-      __pyx_t_5 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (__pyx_t_7) {
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 81;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":836
+      /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":836
  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"             # <<<<<<<<<<<<<<
  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
  */
-      __pyx_t_3 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_7) {
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 102;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":837
+      /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":837
  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"             # <<<<<<<<<<<<<<
  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
  */
-      __pyx_t_5 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (__pyx_t_7) {
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 100;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":838
+      /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":838
  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"             # <<<<<<<<<<<<<<
  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
  */
-      __pyx_t_3 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_7) {
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 103;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":839
+      /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":839
  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf             # <<<<<<<<<<<<<<
  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
  */
-      __pyx_t_5 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (__pyx_t_7) {
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 90;
         (__pyx_v_f[1]) = 102;
         __pyx_v_f = (__pyx_v_f + 1);
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":840
+      /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":840
  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd             # <<<<<<<<<<<<<<
  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
  */
-      __pyx_t_3 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_7) {
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 90;
         (__pyx_v_f[1]) = 100;
         __pyx_v_f = (__pyx_v_f + 1);
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":841
+      /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":841
  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg             # <<<<<<<<<<<<<<
  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
  *             else:
  */
-      __pyx_t_5 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (__pyx_t_7) {
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 90;
         (__pyx_v_f[1]) = 103;
         __pyx_v_f = (__pyx_v_f + 1);
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
 
-      /* "numpy.pxd":842
+      /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":842
  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"             # <<<<<<<<<<<<<<
  *             else:
  *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  */
-      __pyx_t_3 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_7) {
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 79;
-        goto __pyx_L13;
+        goto __pyx_L15;
       }
       /*else*/ {
 
-        /* "numpy.pxd":844
+        /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":844
  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
  *             else:
  *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)             # <<<<<<<<<<<<<<
  *             f += 1
  *         else:
  */
-        __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_8), __pyx_v_t); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(((PyObject *)__pyx_t_5));
-        __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_3);
+        __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_4);
+        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
+        __Pyx_GIVEREF(__pyx_t_3);
+        __pyx_t_3 = 0;
+        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         __Pyx_GOTREF(__pyx_t_3);
-        PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_5));
-        __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
-        __pyx_t_5 = 0;
-        __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_5);
-        __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-        __Pyx_Raise(__pyx_t_5, 0, 0, 0);
-        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+        __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
         {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       }
-      __pyx_L13:;
+      __pyx_L15:;
 
-      /* "numpy.pxd":845
+      /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":845
  *             else:
  *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  *             f += 1             # <<<<<<<<<<<<<<
@@ -3511,25 +3501,33 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
  *             # Cython ignores struct boundary information ("T{...}"),
  */
       __pyx_v_f = (__pyx_v_f + 1);
-      goto __pyx_L11;
+      goto __pyx_L13;
     }
     /*else*/ {
 
-      /* "numpy.pxd":849
+      /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":849
  *             # Cython ignores struct boundary information ("T{...}"),
  *             # so don't output it
  *             f = _util_dtypestring(child, f, end, offset)             # <<<<<<<<<<<<<<
  *     return f
  * 
  */
-      __pyx_t_12 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_12 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_v_f = __pyx_t_12;
+      __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_v_f = __pyx_t_9;
     }
-    __pyx_L11:;
+    __pyx_L13:;
+
+    /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":794
+ *     cdef tuple fields
+ * 
+ *     for childname in descr.names:             # <<<<<<<<<<<<<<
+ *         fields = descr.fields[childname]
+ *         child, new_offset = fields
+ */
   }
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "numpy.pxd":850
+  /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":850
  *             # so don't output it
  *             f = _util_dtypestring(child, f, end, offset)
  *     return f             # <<<<<<<<<<<<<<
@@ -3539,13 +3537,19 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
   __pyx_r = __pyx_v_f;
   goto __pyx_L0;
 
-  __pyx_r = 0;
-  goto __pyx_L0;
+  /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":783
+ *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
+ * 
+ * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:             # <<<<<<<<<<<<<<
+ *     # Recursive utility function used in __getbuffer__ to get format
+ *     # string. The new location in the format string is returned.
+ */
+
+  /* function exit code */
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_XDECREF(__pyx_t_3);
   __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_XDECREF(__pyx_t_5);
   __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_r = NULL;
   __pyx_L0:;
@@ -3558,7 +3562,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
   return __pyx_r;
 }
 
-/* "numpy.pxd":965
+/* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":966
  * 
  * 
  * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
@@ -3573,7 +3577,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
   int __pyx_t_2;
   __Pyx_RefNannySetupContext("set_array_base", 0);
 
-  /* "numpy.pxd":967
+  /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":968
  * cdef inline void set_array_base(ndarray arr, object base):
  *      cdef PyObject* baseptr
  *      if base is None:             # <<<<<<<<<<<<<<
@@ -3584,7 +3588,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
   __pyx_t_2 = (__pyx_t_1 != 0);
   if (__pyx_t_2) {
 
-    /* "numpy.pxd":968
+    /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":969
  *      cdef PyObject* baseptr
  *      if base is None:
  *          baseptr = NULL             # <<<<<<<<<<<<<<
@@ -3596,7 +3600,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
   }
   /*else*/ {
 
-    /* "numpy.pxd":970
+    /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":971
  *          baseptr = NULL
  *      else:
  *          Py_INCREF(base) # important to do this before decref below!             # <<<<<<<<<<<<<<
@@ -3605,7 +3609,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
  */
     Py_INCREF(__pyx_v_base);
 
-    /* "numpy.pxd":971
+    /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":972
  *      else:
  *          Py_INCREF(base) # important to do this before decref below!
  *          baseptr = <PyObject*>base             # <<<<<<<<<<<<<<
@@ -3616,7 +3620,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
   }
   __pyx_L3:;
 
-  /* "numpy.pxd":972
+  /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":973
  *          Py_INCREF(base) # important to do this before decref below!
  *          baseptr = <PyObject*>base
  *      Py_XDECREF(arr.base)             # <<<<<<<<<<<<<<
@@ -3625,7 +3629,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
  */
   Py_XDECREF(__pyx_v_arr->base);
 
-  /* "numpy.pxd":973
+  /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":974
  *          baseptr = <PyObject*>base
  *      Py_XDECREF(arr.base)
  *      arr.base = baseptr             # <<<<<<<<<<<<<<
@@ -3634,10 +3638,19 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
  */
   __pyx_v_arr->base = __pyx_v_baseptr;
 
+  /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":966
+ * 
+ * 
+ * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
+ *      cdef PyObject* baseptr
+ *      if base is None:
+ */
+
+  /* function exit code */
   __Pyx_RefNannyFinishContext();
 }
 
-/* "numpy.pxd":975
+/* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":976
  *      arr.base = baseptr
  * 
  * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
@@ -3651,7 +3664,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
   int __pyx_t_1;
   __Pyx_RefNannySetupContext("get_array_base", 0);
 
-  /* "numpy.pxd":976
+  /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":977
  * 
  * cdef inline object get_array_base(ndarray arr):
  *     if arr.base is NULL:             # <<<<<<<<<<<<<<
@@ -3661,7 +3674,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
   __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0);
   if (__pyx_t_1) {
 
-    /* "numpy.pxd":977
+    /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":978
  * cdef inline object get_array_base(ndarray arr):
  *     if arr.base is NULL:
  *         return None             # <<<<<<<<<<<<<<
@@ -3672,11 +3685,10 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
     __Pyx_INCREF(Py_None);
     __pyx_r = Py_None;
     goto __pyx_L0;
-    goto __pyx_L3;
   }
   /*else*/ {
 
-    /* "numpy.pxd":979
+    /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":980
  *         return None
  *     else:
  *         return <object>arr.base             # <<<<<<<<<<<<<<
@@ -3686,9 +3698,16 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
     __pyx_r = ((PyObject *)__pyx_v_arr->base);
     goto __pyx_L0;
   }
-  __pyx_L3:;
 
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":976
+ *      arr.base = baseptr
+ * 
+ * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
+ *     if arr.base is NULL:
+ *         return None
+ */
+
+  /* function exit code */
   __pyx_L0:;
   __Pyx_XGIVEREF(__pyx_r);
   __Pyx_RefNannyFinishContext();
@@ -3706,7 +3725,7 @@ static struct PyModuleDef __pyx_moduledef = {
   #else
     PyModuleDef_HEAD_INIT,
   #endif
-    __Pyx_NAMESTR("redtoreg"),
+    "redtoreg",
     0, /* m_doc */
     -1, /* m_size */
     __pyx_methods /* m_methods */,
@@ -3718,56 +3737,56 @@ static struct PyModuleDef __pyx_moduledef = {
 #endif
 
 static __Pyx_StringTabEntry __pyx_string_tab[] = {
-  {&__pyx_kp_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0},
-  {&__pyx_kp_u_12, __pyx_k_12, sizeof(__pyx_k_12), 0, 1, 0, 0},
-  {&__pyx_kp_s_16, __pyx_k_16, sizeof(__pyx_k_16), 0, 0, 1, 0},
-  {&__pyx_kp_u_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 1, 0, 0},
-  {&__pyx_kp_u_4, __pyx_k_4, sizeof(__pyx_k_4), 0, 1, 0, 0},
-  {&__pyx_kp_u_6, __pyx_k_6, sizeof(__pyx_k_6), 0, 1, 0, 0},
-  {&__pyx_kp_u_8, __pyx_k_8, sizeof(__pyx_k_8), 0, 1, 0, 0},
-  {&__pyx_kp_u_9, __pyx_k_9, sizeof(__pyx_k_9), 0, 1, 0, 0},
-  {&__pyx_n_s__RuntimeError, __pyx_k__RuntimeError, sizeof(__pyx_k__RuntimeError), 0, 0, 1, 1},
-  {&__pyx_n_s__ValueError, __pyx_k__ValueError, sizeof(__pyx_k__ValueError), 0, 0, 1, 1},
-  {&__pyx_n_s____import__, __pyx_k____import__, sizeof(__pyx_k____import__), 0, 0, 1, 1},
-  {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1},
-  {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1},
-  {&__pyx_n_s___redtoreg, __pyx_k___redtoreg, sizeof(__pyx_k___redtoreg), 0, 0, 1, 1},
-  {&__pyx_n_s__double, __pyx_k__double, sizeof(__pyx_k__double), 0, 0, 1, 1},
-  {&__pyx_n_s__flons, __pyx_k__flons, sizeof(__pyx_k__flons), 0, 0, 1, 1},
-  {&__pyx_n_s__i, __pyx_k__i, sizeof(__pyx_k__i), 0, 0, 1, 1},
-  {&__pyx_n_s__ilons, __pyx_k__ilons, sizeof(__pyx_k__ilons), 0, 0, 1, 1},
-  {&__pyx_n_s__im, __pyx_k__im, sizeof(__pyx_k__im), 0, 0, 1, 1},
-  {&__pyx_n_s__indx, __pyx_k__indx, sizeof(__pyx_k__indx), 0, 0, 1, 1},
-  {&__pyx_n_s__ip, __pyx_k__ip, sizeof(__pyx_k__ip), 0, 0, 1, 1},
-  {&__pyx_n_s__j, __pyx_k__j, sizeof(__pyx_k__j), 0, 0, 1, 1},
-  {&__pyx_n_s__lonsperlat, __pyx_k__lonsperlat, sizeof(__pyx_k__lonsperlat), 0, 0, 1, 1},
-  {&__pyx_n_s__lonsptr, __pyx_k__lonsptr, sizeof(__pyx_k__lonsptr), 0, 0, 1, 1},
-  {&__pyx_n_s__missval, __pyx_k__missval, sizeof(__pyx_k__missval), 0, 0, 1, 1},
-  {&__pyx_n_s__missvl, __pyx_k__missvl, sizeof(__pyx_k__missvl), 0, 0, 1, 1},
-  {&__pyx_n_s__msg, __pyx_k__msg, sizeof(__pyx_k__msg), 0, 0, 1, 1},
-  {&__pyx_n_s__n, __pyx_k__n, sizeof(__pyx_k__n), 0, 0, 1, 1},
-  {&__pyx_n_s__nlats, __pyx_k__nlats, sizeof(__pyx_k__nlats), 0, 0, 1, 1},
-  {&__pyx_n_s__nlons, __pyx_k__nlons, sizeof(__pyx_k__nlons), 0, 0, 1, 1},
-  {&__pyx_n_s__nlonsin, __pyx_k__nlonsin, sizeof(__pyx_k__nlonsin), 0, 0, 1, 1},
-  {&__pyx_n_s__np, __pyx_k__np, sizeof(__pyx_k__np), 0, 0, 1, 1},
-  {&__pyx_n_s__npts, __pyx_k__npts, sizeof(__pyx_k__npts), 0, 0, 1, 1},
-  {&__pyx_n_s__numpy, __pyx_k__numpy, sizeof(__pyx_k__numpy), 0, 0, 1, 1},
-  {&__pyx_n_s__ones, __pyx_k__ones, sizeof(__pyx_k__ones), 0, 0, 1, 1},
-  {&__pyx_n_s__range, __pyx_k__range, sizeof(__pyx_k__range), 0, 0, 1, 1},
-  {&__pyx_n_s__redgrdptr, __pyx_k__redgrdptr, sizeof(__pyx_k__redgrdptr), 0, 0, 1, 1},
-  {&__pyx_n_s__redgrid, __pyx_k__redgrid, sizeof(__pyx_k__redgrid), 0, 0, 1, 1},
-  {&__pyx_n_s__redtoreg, __pyx_k__redtoreg, sizeof(__pyx_k__redtoreg), 0, 0, 1, 1},
-  {&__pyx_n_s__reggrdptr, __pyx_k__reggrdptr, sizeof(__pyx_k__reggrdptr), 0, 0, 1, 1},
-  {&__pyx_n_s__reggrid, __pyx_k__reggrid, sizeof(__pyx_k__reggrid), 0, 0, 1, 1},
-  {&__pyx_n_s__sum, __pyx_k__sum, sizeof(__pyx_k__sum), 0, 0, 1, 1},
-  {&__pyx_n_s__zdx, __pyx_k__zdx, sizeof(__pyx_k__zdx), 0, 0, 1, 1},
-  {&__pyx_n_s__zxi, __pyx_k__zxi, sizeof(__pyx_k__zxi), 0, 0, 1, 1},
+  {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0},
+  {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0},
+  {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0},
+  {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
+  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
+  {&__pyx_kp_s_Volumes_User_jwhitaker_python_p, __pyx_k_Volumes_User_jwhitaker_python_p, sizeof(__pyx_k_Volumes_User_jwhitaker_python_p), 0, 0, 1, 0},
+  {&__pyx_n_s_double, __pyx_k_double, sizeof(__pyx_k_double), 0, 0, 1, 1},
+  {&__pyx_n_s_flons, __pyx_k_flons, sizeof(__pyx_k_flons), 0, 0, 1, 1},
+  {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
+  {&__pyx_n_s_ilons, __pyx_k_ilons, sizeof(__pyx_k_ilons), 0, 0, 1, 1},
+  {&__pyx_n_s_im, __pyx_k_im, sizeof(__pyx_k_im), 0, 0, 1, 1},
+  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
+  {&__pyx_n_s_indx, __pyx_k_indx, sizeof(__pyx_k_indx), 0, 0, 1, 1},
+  {&__pyx_n_s_ip, __pyx_k_ip, sizeof(__pyx_k_ip), 0, 0, 1, 1},
+  {&__pyx_n_s_j, __pyx_k_j, sizeof(__pyx_k_j), 0, 0, 1, 1},
+  {&__pyx_n_s_lonsperlat, __pyx_k_lonsperlat, sizeof(__pyx_k_lonsperlat), 0, 0, 1, 1},
+  {&__pyx_n_s_lonsptr, __pyx_k_lonsptr, sizeof(__pyx_k_lonsptr), 0, 0, 1, 1},
+  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
+  {&__pyx_n_s_missval, __pyx_k_missval, sizeof(__pyx_k_missval), 0, 0, 1, 1},
+  {&__pyx_n_s_missvl, __pyx_k_missvl, sizeof(__pyx_k_missvl), 0, 0, 1, 1},
+  {&__pyx_n_s_msg, __pyx_k_msg, sizeof(__pyx_k_msg), 0, 0, 1, 1},
+  {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1},
+  {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0},
+  {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0},
+  {&__pyx_n_s_nlats, __pyx_k_nlats, sizeof(__pyx_k_nlats), 0, 0, 1, 1},
+  {&__pyx_n_s_nlons, __pyx_k_nlons, sizeof(__pyx_k_nlons), 0, 0, 1, 1},
+  {&__pyx_n_s_nlonsin, __pyx_k_nlonsin, sizeof(__pyx_k_nlonsin), 0, 0, 1, 1},
+  {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
+  {&__pyx_n_s_npts, __pyx_k_npts, sizeof(__pyx_k_npts), 0, 0, 1, 1},
+  {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
+  {&__pyx_n_s_ones, __pyx_k_ones, sizeof(__pyx_k_ones), 0, 0, 1, 1},
+  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
+  {&__pyx_n_s_redgrdptr, __pyx_k_redgrdptr, sizeof(__pyx_k_redgrdptr), 0, 0, 1, 1},
+  {&__pyx_n_s_redgrid, __pyx_k_redgrid, sizeof(__pyx_k_redgrid), 0, 0, 1, 1},
+  {&__pyx_n_s_redtoreg, __pyx_k_redtoreg, sizeof(__pyx_k_redtoreg), 0, 0, 1, 1},
+  {&__pyx_n_s_redtoreg_2, __pyx_k_redtoreg_2, sizeof(__pyx_k_redtoreg_2), 0, 0, 1, 1},
+  {&__pyx_n_s_reggrdptr, __pyx_k_reggrdptr, sizeof(__pyx_k_reggrdptr), 0, 0, 1, 1},
+  {&__pyx_n_s_reggrid, __pyx_k_reggrid, sizeof(__pyx_k_reggrid), 0, 0, 1, 1},
+  {&__pyx_kp_s_size_of_reduced_grid_does_not_ma, __pyx_k_size_of_reduced_grid_does_not_ma, sizeof(__pyx_k_size_of_reduced_grid_does_not_ma), 0, 0, 1, 0},
+  {&__pyx_n_s_sum, __pyx_k_sum, sizeof(__pyx_k_sum), 0, 0, 1, 1},
+  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
+  {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0},
+  {&__pyx_n_s_zdx, __pyx_k_zdx, sizeof(__pyx_k_zdx), 0, 0, 1, 1},
+  {&__pyx_n_s_zxi, __pyx_k_zxi, sizeof(__pyx_k_zxi), 0, 0, 1, 1},
   {0, 0, 0, 0, 0, 0, 0}
 };
 static int __Pyx_InitCachedBuiltins(void) {
-  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s__range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s__RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   return 0;
   __pyx_L1_error:;
   return -1;
@@ -3777,71 +3796,71 @@ static int __Pyx_InitCachedConstants(void) {
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
 
-  /* "numpy.pxd":215
+  /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":215
  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
  *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
  *                 raise ValueError(u"ndarray is not C contiguous")             # <<<<<<<<<<<<<<
  * 
  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  */
-  __pyx_k_tuple_3 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_u_2)); if (unlikely(!__pyx_k_tuple_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_3);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_3));
+  __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple_);
+  __Pyx_GIVEREF(__pyx_tuple_);
 
-  /* "numpy.pxd":219
+  /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":219
  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
  *                 raise ValueError(u"ndarray is not Fortran contiguous")             # <<<<<<<<<<<<<<
  * 
  *             info.buf = PyArray_DATA(self)
  */
-  __pyx_k_tuple_5 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_u_4)); if (unlikely(!__pyx_k_tuple_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_5);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_5));
+  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__2);
+  __Pyx_GIVEREF(__pyx_tuple__2);
 
-  /* "numpy.pxd":257
+  /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":257
  *                 if ((descr.byteorder == c'>' and little_endian) or
  *                     (descr.byteorder == c'<' and not little_endian)):
  *                     raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
  *                 if   t == NPY_BYTE:        f = "b"
  *                 elif t == NPY_UBYTE:       f = "B"
  */
-  __pyx_k_tuple_7 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_u_6)); if (unlikely(!__pyx_k_tuple_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_7);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_7));
+  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__3);
+  __Pyx_GIVEREF(__pyx_tuple__3);
 
-  /* "numpy.pxd":799
+  /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":799
  * 
- *         if (end - f) - (new_offset - offset[0]) < 15:
+ *         if (end - f) - <int>(new_offset - offset[0]) < 15:
  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")             # <<<<<<<<<<<<<<
  * 
  *         if ((child.byteorder == c'>' and little_endian) or
  */
-  __pyx_k_tuple_10 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_u_9)); if (unlikely(!__pyx_k_tuple_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_10);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_10));
+  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__4);
+  __Pyx_GIVEREF(__pyx_tuple__4);
 
-  /* "numpy.pxd":803
+  /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":803
  *         if ((child.byteorder == c'>' and little_endian) or
  *             (child.byteorder == c'<' and not little_endian)):
  *             raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
  *             # One could encode it in the format string and have Cython
  *             # complain instead, BUT: < and > in format strings also imply
  */
-  __pyx_k_tuple_11 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_u_6)); if (unlikely(!__pyx_k_tuple_11)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_11);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_11));
+  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__5);
+  __Pyx_GIVEREF(__pyx_tuple__5);
 
-  /* "numpy.pxd":823
+  /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":823
  *             t = child.type_num
  *             if end - f < 5:
  *                 raise RuntimeError(u"Format string allocated too short.")             # <<<<<<<<<<<<<<
  * 
  *             # Until ticket #99 is fixed, use integers to avoid warnings
  */
-  __pyx_k_tuple_13 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_u_12)); if (unlikely(!__pyx_k_tuple_13)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_k_tuple_13);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_13));
+  __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_tuple__6);
+  __Pyx_GIVEREF(__pyx_tuple__6);
 
   /* "redtoreg.pyx":3
  * import numpy as np
@@ -3850,10 +3869,10 @@ static int __Pyx_InitCachedConstants(void) {
  *               object missval):
  *     """
  */
-  __pyx_k_tuple_14 = PyTuple_Pack(23, ((PyObject *)__pyx_n_s__nlonsin), ((PyObject *)__pyx_n_s__lonsperlat), ((PyObject *)__pyx_n_s__redgrid), ((PyObject *)__pyx_n_s__missval), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__j), ((PyObject *)__pyx_n_s__n), ((PyObject *)__pyx_n_s__im), ((PyObject *)__pyx_n_s__ip), ((PyObject *)__pyx_n_s__indx), ((PyObject *)__pyx_n_s__ilons), ((PyObject *)__pyx_n_s__nlats), ((PyObject *)__pyx_n_s__npts), ((PyObject *)__pyx_n_s__zxi), ((PyObject *)__py [...]
-  __Pyx_GOTREF(__pyx_k_tuple_14);
-  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_14));
-  __pyx_k_codeobj_15 = (PyObject*)__Pyx_PyCode_New(4, 0, 23, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_16, __pyx_n_s___redtoreg, 3, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_tuple__7 = PyTuple_Pack(23, __pyx_n_s_nlonsin, __pyx_n_s_lonsperlat, __pyx_n_s_redgrid, __pyx_n_s_missval, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_n, __pyx_n_s_im, __pyx_n_s_ip, __pyx_n_s_indx, __pyx_n_s_ilons, __pyx_n_s_nlats, __pyx_n_s_npts, __pyx_n_s_zxi, __pyx_n_s_zdx, __pyx_n_s_flons, __pyx_n_s_missvl, __pyx_n_s_reggrid, __pyx_n_s_redgrdptr, __pyx_n_s_reggrdptr, __pyx_n_s_lonsptr, __pyx_n_s_nlons, __pyx_n_s_msg); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx [...]
+  __Pyx_GOTREF(__pyx_tuple__7);
+  __Pyx_GIVEREF(__pyx_tuple__7);
+  __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(4, 0, 23, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Volumes_User_jwhitaker_python_p, __pyx_n_s_redtoreg, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_RefNannyFinishContext();
   return 0;
   __pyx_L1_error:;
@@ -3863,7 +3882,6 @@ static int __Pyx_InitCachedConstants(void) {
 
 static int __Pyx_InitGlobals(void) {
   if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __pyx_int_15 = PyInt_FromLong(15); if (unlikely(!__pyx_int_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
   return 0;
   __pyx_L1_error:;
   return -1;
@@ -3913,34 +3931,34 @@ PyMODINIT_FUNC PyInit_redtoreg(void)
   #endif
   /*--- Module creation code ---*/
   #if PY_MAJOR_VERSION < 3
-  __pyx_m = Py_InitModule4(__Pyx_NAMESTR("redtoreg"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
+  __pyx_m = Py_InitModule4("redtoreg", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
   #else
   __pyx_m = PyModule_Create(&__pyx_moduledef);
   #endif
   if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   Py_INCREF(__pyx_d);
-  #if PY_MAJOR_VERSION >= 3
-  {
-    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    if (!PyDict_GetItemString(modules, "redtoreg")) {
-      if (unlikely(PyDict_SetItemString(modules, "redtoreg", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    }
-  }
-  #endif
-  __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   #if CYTHON_COMPILING_IN_PYPY
   Py_INCREF(__pyx_b);
   #endif
-  if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
   /*--- Initialize various global constants etc. ---*/
   if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
   if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   #endif
   if (__pyx_module_is_main_redtoreg) {
-    if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+  }
+  #if PY_MAJOR_VERSION >= 3
+  {
+    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (!PyDict_GetItemString(modules, "redtoreg")) {
+      if (unlikely(PyDict_SetItemString(modules, "redtoreg", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    }
   }
+  #endif
   /*--- Builtin init code ---*/
   if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   /*--- Constants init code ---*/
@@ -3971,9 +3989,9 @@ PyMODINIT_FUNC PyInit_redtoreg(void)
  * cimport numpy as npc
  * def _redtoreg(object nlonsin, npc.ndarray lonsperlat, npc.ndarray redgrid, \
  */
-  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__numpy), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s__np, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
   /* "redtoreg.pyx":3
@@ -3983,9 +4001,9 @@ PyMODINIT_FUNC PyInit_redtoreg(void)
  *               object missval):
  *     """
  */
-  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8redtoreg_1_redtoreg, NULL, __pyx_n_s__redtoreg); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8redtoreg_1_redtoreg, NULL, __pyx_n_s_redtoreg_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s___redtoreg, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_redtoreg, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
   /* "redtoreg.pyx":1
@@ -3994,22 +4012,27 @@ PyMODINIT_FUNC PyInit_redtoreg(void)
  * def _redtoreg(object nlonsin, npc.ndarray lonsperlat, npc.ndarray redgrid, \
  */
   __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s____test__, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "numpy.pxd":975
+  /* "../../../../../Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/Cython-0.21.1-py2.7-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":976
  *      arr.base = baseptr
  * 
  * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
  *     if arr.base is NULL:
  *         return None
  */
+
+  /*--- Wrapped vars code ---*/
+
   goto __pyx_L0;
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   if (__pyx_m) {
-    __Pyx_AddTraceback("init redtoreg", __pyx_clineno, __pyx_lineno, __pyx_filename);
+    if (__pyx_d) {
+      __Pyx_AddTraceback("init redtoreg", __pyx_clineno, __pyx_lineno, __pyx_filename);
+    }
     Py_DECREF(__pyx_m); __pyx_m = 0;
   } else if (!PyErr_Occurred()) {
     PyErr_SetString(PyExc_ImportError, "init redtoreg");
@@ -4038,7 +4061,7 @@ end:
     Py_XDECREF(m);
     return (__Pyx_RefNannyAPIStruct *)r;
 }
-#endif /* CYTHON_REFNANNY */
+#endif
 
 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
     PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
@@ -4047,7 +4070,7 @@ static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
 #if PY_MAJOR_VERSION >= 3
             "name '%U' is not defined", name);
 #else
-            "name '%s' is not defined", PyString_AS_STRING(name));
+            "name '%.200s' is not defined", PyString_AS_STRING(name));
 #endif
     }
     return result;
@@ -4073,7 +4096,7 @@ static void __Pyx_RaiseArgtupleInvalid(
         more_or_less = "exactly";
     }
     PyErr_Format(PyExc_TypeError,
-                 "%s() takes %s %" CYTHON_FORMAT_SSIZE_T "d positional argument%s (%" CYTHON_FORMAT_SSIZE_T "d given)",
+                 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
                  func_name, more_or_less, num_expected,
                  (num_expected == 1) ? "" : "s", num_found);
 }
@@ -4177,12 +4200,12 @@ arg_passed_twice:
     goto bad;
 invalid_keyword_type:
     PyErr_Format(PyExc_TypeError,
-        "%s() keywords must be strings", function_name);
+        "%.200s() keywords must be strings", function_name);
     goto bad;
 invalid_keyword:
     PyErr_Format(PyExc_TypeError,
     #if PY_MAJOR_VERSION < 3
-        "%s() got an unexpected keyword argument '%s'",
+        "%.200s() got an unexpected keyword argument '%.200s'",
         function_name, PyString_AsString(key));
     #else
         "%s() got an unexpected keyword argument '%U'",
@@ -4192,42 +4215,131 @@ bad:
     return -1;
 }
 
-static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
+static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) {
+    PyErr_Format(PyExc_TypeError,
+        "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
+        name, type->tp_name, Py_TYPE(obj)->tp_name);
+}
+static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
     const char *name, int exact)
 {
-    if (!type) {
-        PyErr_Format(PyExc_SystemError, "Missing type object");
+    if (unlikely(!type)) {
+        PyErr_SetString(PyExc_SystemError, "Missing type object");
         return 0;
     }
     if (none_allowed && obj == Py_None) return 1;
     else if (exact) {
-        if (Py_TYPE(obj) == type) return 1;
+        if (likely(Py_TYPE(obj) == type)) return 1;
+        #if PY_MAJOR_VERSION == 2
+        else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
+        #endif
     }
     else {
-        if (PyObject_TypeCheck(obj, type)) return 1;
+        if (likely(PyObject_TypeCheck(obj, type))) return 1;
     }
-    PyErr_Format(PyExc_TypeError,
-        "Argument '%s' has incorrect type (expected %s, got %s)",
-        name, type->tp_name, Py_TYPE(obj)->tp_name);
+    __Pyx_RaiseArgumentTypeInvalid(name, obj, type);
     return 0;
 }
 
-static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
 #if CYTHON_COMPILING_IN_CPYTHON
-    PyObject *tmp_type, *tmp_value, *tmp_tb;
-    PyThreadState *tstate = PyThreadState_GET();
-    tmp_type = tstate->curexc_type;
-    tmp_value = tstate->curexc_value;
-    tmp_tb = tstate->curexc_traceback;
-    tstate->curexc_type = type;
-    tstate->curexc_value = value;
-    tstate->curexc_traceback = tb;
-    Py_XDECREF(tmp_type);
-    Py_XDECREF(tmp_value);
-    Py_XDECREF(tmp_tb);
-#else
-    PyErr_Restore(type, value, tb);
-#endif
+static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
+    PyObject *result;
+    ternaryfunc call = func->ob_type->tp_call;
+    if (unlikely(!call))
+        return PyObject_Call(func, arg, kw);
+    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
+        return NULL;
+    result = (*call)(func, arg, kw);
+    Py_LeaveRecursiveCall();
+    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
+        PyErr_SetString(
+            PyExc_SystemError,
+            "NULL result without error in PyObject_Call");
+    }
+    return result;
+}
+#endif
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
+    PyObject *self, *result;
+    PyCFunction cfunc;
+    cfunc = PyCFunction_GET_FUNCTION(func);
+    self = PyCFunction_GET_SELF(func);
+    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
+        return NULL;
+    result = cfunc(self, arg);
+    Py_LeaveRecursiveCall();
+    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
+        PyErr_SetString(
+            PyExc_SystemError,
+            "NULL result without error in PyObject_Call");
+    }
+    return result;
+}
+#endif
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
+    PyObject *result;
+    PyObject *args = PyTuple_New(1);
+    if (unlikely(!args)) return NULL;
+    Py_INCREF(arg);
+    PyTuple_SET_ITEM(args, 0, arg);
+    result = __Pyx_PyObject_Call(func, args, NULL);
+    Py_DECREF(args);
+    return result;
+}
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
+#ifdef __Pyx_CyFunction_USED
+    if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
+#else
+    if (likely(PyCFunction_Check(func))) {
+#endif
+        if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
+            return __Pyx_PyObject_CallMethO(func, arg);
+        }
+    }
+    return __Pyx__PyObject_CallOneArg(func, arg);
+}
+#else
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
+    PyObject* args = PyTuple_Pack(1, arg);
+    return (likely(args)) ? __Pyx_PyObject_Call(func, args, NULL) : NULL;
+}
+#endif
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
+#ifdef __Pyx_CyFunction_USED
+    if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
+#else
+    if (likely(PyCFunction_Check(func))) {
+#endif
+        if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
+            return __Pyx_PyObject_CallMethO(func, NULL);
+        }
+    }
+    return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
+}
+#endif
+
+static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
+#if CYTHON_COMPILING_IN_CPYTHON
+    PyObject *tmp_type, *tmp_value, *tmp_tb;
+    PyThreadState *tstate = PyThreadState_GET();
+    tmp_type = tstate->curexc_type;
+    tmp_value = tstate->curexc_value;
+    tmp_tb = tstate->curexc_traceback;
+    tstate->curexc_type = type;
+    tstate->curexc_value = value;
+    tstate->curexc_traceback = tb;
+    Py_XDECREF(tmp_type);
+    Py_XDECREF(tmp_value);
+    Py_XDECREF(tmp_tb);
+#else
+    PyErr_Restore(type, value, tb);
+#endif
 }
 static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
 #if CYTHON_COMPILING_IN_CPYTHON
@@ -4261,11 +4373,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
             goto raise_error;
         }
     }
-    #if PY_VERSION_HEX < 0x02050000
-    if (PyClass_Check(type)) {
-    #else
     if (PyType_Check(type)) {
-    #endif
 #if CYTHON_COMPILING_IN_PYPY
         if (!value) {
             Py_INCREF(Py_None);
@@ -4280,17 +4388,6 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
             goto raise_error;
         }
         value = type;
-        #if PY_VERSION_HEX < 0x02050000
-        if (PyInstance_Check(type)) {
-            type = (PyObject*) ((PyInstanceObject*)type)->in_class;
-            Py_INCREF(type);
-        } else {
-            type = 0;
-            PyErr_SetString(PyExc_TypeError,
-                "raise: exception must be an old-style class or instance");
-            goto raise_error;
-        }
-        #else
         type = (PyObject*) Py_TYPE(type);
         Py_INCREF(type);
         if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
@@ -4298,7 +4395,6 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
                 "raise: exception class must be a subclass of BaseException");
             goto raise_error;
         }
-        #endif
     }
     __Pyx_ErrRestore(type, value, tb);
     return;
@@ -4308,7 +4404,7 @@ raise_error:
     Py_XDECREF(tb);
     return;
 }
-#else /* Python 3+ */
+#else
 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
     PyObject* owned_instance = NULL;
     if (tb == Py_None) {
@@ -4329,27 +4425,40 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject
         value = type;
         type = (PyObject*) Py_TYPE(value);
     } else if (PyExceptionClass_Check(type)) {
-        PyObject *args;
-        if (!value)
-            args = PyTuple_New(0);
-        else if (PyTuple_Check(value)) {
-            Py_INCREF(value);
-            args = value;
-        } else
-            args = PyTuple_Pack(1, value);
-        if (!args)
-            goto bad;
-        owned_instance = PyEval_CallObject(type, args);
-        Py_DECREF(args);
-        if (!owned_instance)
-            goto bad;
-        value = owned_instance;
-        if (!PyExceptionInstance_Check(value)) {
-            PyErr_Format(PyExc_TypeError,
-                         "calling %R should have returned an instance of "
-                         "BaseException, not %R",
-                         type, Py_TYPE(value));
-            goto bad;
+        PyObject *instance_class = NULL;
+        if (value && PyExceptionInstance_Check(value)) {
+            instance_class = (PyObject*) Py_TYPE(value);
+            if (instance_class != type) {
+                if (PyObject_IsSubclass(instance_class, type)) {
+                    type = instance_class;
+                } else {
+                    instance_class = NULL;
+                }
+            }
+        }
+        if (!instance_class) {
+            PyObject *args;
+            if (!value)
+                args = PyTuple_New(0);
+            else if (PyTuple_Check(value)) {
+                Py_INCREF(value);
+                args = value;
+            } else
+                args = PyTuple_Pack(1, value);
+            if (!args)
+                goto bad;
+            owned_instance = PyObject_Call(type, args, NULL);
+            Py_DECREF(args);
+            if (!owned_instance)
+                goto bad;
+            value = owned_instance;
+            if (!PyExceptionInstance_Check(value)) {
+                PyErr_Format(PyExc_TypeError,
+                             "calling %R should have returned an instance of "
+                             "BaseException, not %R",
+                             type, Py_TYPE(value));
+                goto bad;
+            }
         }
     } else {
         PyErr_SetString(PyExc_TypeError,
@@ -4381,6 +4490,13 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject
     }
     PyErr_SetObject(type, value);
     if (tb) {
+#if CYTHON_COMPILING_IN_PYPY
+        PyObject *tmp_type, *tmp_value, *tmp_tb;
+        PyErr_Fetch(tmp_type, tmp_value, tmp_tb);
+        Py_INCREF(tb);
+        PyErr_Restore(tmp_type, tmp_value, tb);
+        Py_XDECREF(tmp_tb);
+#else
         PyThreadState *tstate = PyThreadState_GET();
         PyObject* tmp_tb = tstate->curexc_traceback;
         if (tb != tmp_tb) {
@@ -4388,6 +4504,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject
             tstate->curexc_traceback = tb;
             Py_XDECREF(tmp_tb);
         }
+#endif
     }
 bad:
     Py_XDECREF(owned_instance);
@@ -4399,7 +4516,7 @@ static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
     PyObject *result;
 #if CYTHON_COMPILING_IN_CPYTHON
     result = PyDict_GetItem(__pyx_d, name);
-    if (result) {
+    if (likely(result)) {
         Py_INCREF(result);
     } else {
 #else
@@ -4414,7 +4531,7 @@ static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
 
 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
     if (unlikely(!type)) {
-        PyErr_Format(PyExc_SystemError, "Missing type object");
+        PyErr_SetString(PyExc_SystemError, "Missing type object");
         return 0;
     }
     if (likely(PyObject_TypeCheck(obj, type)))
@@ -4437,7 +4554,7 @@ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
 
 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
     PyErr_Format(PyExc_ValueError,
-                 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%s to unpack",
+                 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
                  index, (index == 1) ? "" : "s");
 }
 
@@ -4445,49 +4562,163 @@ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
 }
 
-static CYTHON_INLINE int __Pyx_IterFinish(void) {
-#if CYTHON_COMPILING_IN_CPYTHON
-    PyThreadState *tstate = PyThreadState_GET();
-    PyObject* exc_type = tstate->curexc_type;
-    if (unlikely(exc_type)) {
-        if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) {
-            PyObject *exc_value, *exc_tb;
-            exc_value = tstate->curexc_value;
-            exc_tb = tstate->curexc_traceback;
-            tstate->curexc_type = 0;
-            tstate->curexc_value = 0;
-            tstate->curexc_traceback = 0;
-            Py_DECREF(exc_type);
-            Py_XDECREF(exc_value);
-            Py_XDECREF(exc_tb);
-            return 0;
+static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
+    int start = 0, mid = 0, end = count - 1;
+    if (end >= 0 && code_line > entries[end].code_line) {
+        return count;
+    }
+    while (start < end) {
+        mid = (start + end) / 2;
+        if (code_line < entries[mid].code_line) {
+            end = mid;
+        } else if (code_line > entries[mid].code_line) {
+             start = mid + 1;
         } else {
-            return -1;
+            return mid;
         }
     }
-    return 0;
-#else
-    if (unlikely(PyErr_Occurred())) {
-        if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
-            PyErr_Clear();
-            return 0;
-        } else {
-            return -1;
+    if (code_line <= entries[mid].code_line) {
+        return mid;
+    } else {
+        return mid + 1;
+    }
+}
+static PyCodeObject *__pyx_find_code_object(int code_line) {
+    PyCodeObject* code_object;
+    int pos;
+    if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
+        return NULL;
+    }
+    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
+    if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
+        return NULL;
+    }
+    code_object = __pyx_code_cache.entries[pos].code_object;
+    Py_INCREF(code_object);
+    return code_object;
+}
+static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
+    int pos, i;
+    __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
+    if (unlikely(!code_line)) {
+        return;
+    }
+    if (unlikely(!entries)) {
+        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
+        if (likely(entries)) {
+            __pyx_code_cache.entries = entries;
+            __pyx_code_cache.max_count = 64;
+            __pyx_code_cache.count = 1;
+            entries[0].code_line = code_line;
+            entries[0].code_object = code_object;
+            Py_INCREF(code_object);
         }
+        return;
     }
-    return 0;
-#endif
+    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
+    if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
+        PyCodeObject* tmp = entries[pos].code_object;
+        entries[pos].code_object = code_object;
+        Py_DECREF(tmp);
+        return;
+    }
+    if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
+        int new_max = __pyx_code_cache.max_count + 64;
+        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
+            __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
+        if (unlikely(!entries)) {
+            return;
+        }
+        __pyx_code_cache.entries = entries;
+        __pyx_code_cache.max_count = new_max;
+    }
+    for (i=__pyx_code_cache.count; i>pos; i--) {
+        entries[i] = entries[i-1];
+    }
+    entries[pos].code_line = code_line;
+    entries[pos].code_object = code_object;
+    __pyx_code_cache.count++;
+    Py_INCREF(code_object);
 }
 
-static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
-    if (unlikely(retval)) {
-        Py_DECREF(retval);
-        __Pyx_RaiseTooManyValuesError(expected);
-        return -1;
-    } else {
-        return __Pyx_IterFinish();
+#include "compile.h"
+#include "frameobject.h"
+#include "traceback.h"
+static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
+            const char *funcname, int c_line,
+            int py_line, const char *filename) {
+    PyCodeObject *py_code = 0;
+    PyObject *py_srcfile = 0;
+    PyObject *py_funcname = 0;
+    #if PY_MAJOR_VERSION < 3
+    py_srcfile = PyString_FromString(filename);
+    #else
+    py_srcfile = PyUnicode_FromString(filename);
+    #endif
+    if (!py_srcfile) goto bad;
+    if (c_line) {
+        #if PY_MAJOR_VERSION < 3
+        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
+        #else
+        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
+        #endif
     }
-    return 0;
+    else {
+        #if PY_MAJOR_VERSION < 3
+        py_funcname = PyString_FromString(funcname);
+        #else
+        py_funcname = PyUnicode_FromString(funcname);
+        #endif
+    }
+    if (!py_funcname) goto bad;
+    py_code = __Pyx_PyCode_New(
+        0,
+        0,
+        0,
+        0,
+        0,
+        __pyx_empty_bytes, /*PyObject *code,*/
+        __pyx_empty_tuple, /*PyObject *consts,*/
+        __pyx_empty_tuple, /*PyObject *names,*/
+        __pyx_empty_tuple, /*PyObject *varnames,*/
+        __pyx_empty_tuple, /*PyObject *freevars,*/
+        __pyx_empty_tuple, /*PyObject *cellvars,*/
+        py_srcfile,   /*PyObject *filename,*/
+        py_funcname,  /*PyObject *name,*/
+        py_line,
+        __pyx_empty_bytes  /*PyObject *lnotab*/
+    );
+    Py_DECREF(py_srcfile);
+    Py_DECREF(py_funcname);
+    return py_code;
+bad:
+    Py_XDECREF(py_srcfile);
+    Py_XDECREF(py_funcname);
+    return NULL;
+}
+static void __Pyx_AddTraceback(const char *funcname, int c_line,
+                               int py_line, const char *filename) {
+    PyCodeObject *py_code = 0;
+    PyFrameObject *py_frame = 0;
+    py_code = __pyx_find_code_object(c_line ? c_line : py_line);
+    if (!py_code) {
+        py_code = __Pyx_CreateCodeObjectForTraceback(
+            funcname, c_line, py_line, filename);
+        if (!py_code) goto bad;
+        __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
+    }
+    py_frame = PyFrame_New(
+        PyThreadState_GET(), /*PyThreadState *tstate,*/
+        py_code,             /*PyCodeObject *code,*/
+        __pyx_d,      /*PyObject *globals,*/
+        0                    /*PyObject *locals*/
+    );
+    if (!py_frame) goto bad;
+    py_frame->f_lineno = py_line;
+    PyTraceBack_Here(py_frame);
+bad:
+    Py_XDECREF(py_code);
+    Py_XDECREF(py_frame);
 }
 
 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
@@ -4498,7 +4729,7 @@ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
     PyObject *list;
     #if PY_VERSION_HEX < 0x03030000
     PyObject *py_import;
-    py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s____import__);
+    py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
     if (!py_import)
         goto bad;
     #endif
@@ -4516,7 +4747,6 @@ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
     empty_dict = PyDict_New();
     if (!empty_dict)
         goto bad;
-    #if PY_VERSION_HEX >= 0x02050000
     {
         #if PY_MAJOR_VERSION >= 3
         if (level == -1) {
@@ -4538,7 +4768,7 @@ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
                     PyErr_Clear();
                 }
             }
-            level = 0; /* try absolute import on failure */
+            level = 0;
         }
         #endif
         if (!module) {
@@ -4555,14 +4785,6 @@ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
             #endif
         }
     }
-    #else
-    if (level>0) {
-        PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4.");
-        goto bad;
-    }
-    module = PyObject_CallFunctionObjArgs(py_import,
-        name, global_dict, empty_dict, list, NULL);
-    #endif
 bad:
     #if PY_VERSION_HEX < 0x03030000
     Py_XDECREF(py_import);
@@ -4572,6 +4794,148 @@ bad:
     return module;
 }
 
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
+    const long neg_one = (long) -1, const_zero = 0;
+    const int is_unsigned = neg_one > const_zero;
+    if (is_unsigned) {
+        if (sizeof(long) < sizeof(long)) {
+            return PyInt_FromLong((long) value);
+        } else if (sizeof(long) <= sizeof(unsigned long)) {
+            return PyLong_FromUnsignedLong((unsigned long) value);
+        } else if (sizeof(long) <= sizeof(unsigned long long)) {
+            return PyLong_FromUnsignedLongLong((unsigned long long) value);
+        }
+    } else {
+        if (sizeof(long) <= sizeof(long)) {
+            return PyInt_FromLong((long) value);
+        } else if (sizeof(long) <= sizeof(long long)) {
+            return PyLong_FromLongLong((long long) value);
+        }
+    }
+    {
+        int one = 1; int little = (int)*(unsigned char *)&one;
+        unsigned char *bytes = (unsigned char *)&value;
+        return _PyLong_FromByteArray(bytes, sizeof(long),
+                                     little, !is_unsigned);
+    }
+}
+
+#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)       \
+    {                                                                     \
+        func_type value = func_value;                                     \
+        if (sizeof(target_type) < sizeof(func_type)) {                    \
+            if (unlikely(value != (func_type) (target_type) value)) {     \
+                func_type zero = 0;                                       \
+                if (is_unsigned && unlikely(value < zero))                \
+                    goto raise_neg_overflow;                              \
+                else                                                      \
+                    goto raise_overflow;                                  \
+            }                                                             \
+        }                                                                 \
+        return (target_type) value;                                       \
+    }
+
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+  #include "longintrepr.h"
+ #endif
+#endif
+
+static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
+    const long neg_one = (long) -1, const_zero = 0;
+    const int is_unsigned = neg_one > const_zero;
+#if PY_MAJOR_VERSION < 3
+    if (likely(PyInt_Check(x))) {
+        if (sizeof(long) < sizeof(long)) {
+            __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
+        } else {
+            long val = PyInt_AS_LONG(x);
+            if (is_unsigned && unlikely(val < 0)) {
+                goto raise_neg_overflow;
+            }
+            return (long) val;
+        }
+    } else
+#endif
+    if (likely(PyLong_Check(x))) {
+        if (is_unsigned) {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+            switch (Py_SIZE(x)) {
+                case  0: return 0;
+                case  1: __PYX_VERIFY_RETURN_INT(long, digit, ((PyLongObject*)x)->ob_digit[0]);
+            }
+ #endif
+#endif
+            if (unlikely(Py_SIZE(x) < 0)) {
+                goto raise_neg_overflow;
+            }
+            if (sizeof(long) <= sizeof(unsigned long)) {
+                __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong(x))
+            } else if (sizeof(long) <= sizeof(unsigned long long)) {
+                __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong(x))
+            }
+        } else {
+#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+ #if CYTHON_USE_PYLONG_INTERNALS
+            switch (Py_SIZE(x)) {
+                case  0: return 0;
+                case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +(((PyLongObject*)x)->ob_digit[0]));
+                case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
+            }
+ #endif
+#endif
+            if (sizeof(long) <= sizeof(long)) {
+                __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong(x))
+            } else if (sizeof(long) <= sizeof(long long)) {
+                __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong(x))
+            }
+        }
+        {
+#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
+            PyErr_SetString(PyExc_RuntimeError,
+                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
+#else
+            long val;
+            PyObject *v = __Pyx_PyNumber_Int(x);
+ #if PY_MAJOR_VERSION < 3
+            if (likely(v) && !PyLong_Check(v)) {
+                PyObject *tmp = v;
+                v = PyNumber_Long(tmp);
+                Py_DECREF(tmp);
+            }
+ #endif
+            if (likely(v)) {
+                int one = 1; int is_little = (int)*(unsigned char *)&one;
+                unsigned char *bytes = (unsigned char *)&val;
+                int ret = _PyLong_AsByteArray((PyLongObject *)v,
+                                              bytes, sizeof(val),
+                                              is_little, !is_unsigned);
+                Py_DECREF(v);
+                if (likely(!ret))
+                    return val;
+            }
+#endif
+            return (long) -1;
+        }
+    } else {
+        long val;
+        PyObject *tmp = __Pyx_PyNumber_Int(x);
+        if (!tmp) return (long) -1;
+        val = __Pyx_PyInt_As_long(tmp);
+        Py_DECREF(tmp);
+        return val;
+    }
+raise_overflow:
+    PyErr_SetString(PyExc_OverflowError,
+        "value too large to convert to long");
+    return (long) -1;
+raise_neg_overflow:
+    PyErr_SetString(PyExc_OverflowError,
+        "can't convert negative value to long");
+    return (long) -1;
+}
+
 #if CYTHON_CCOMPLEX
   #ifdef __cplusplus
     static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
@@ -4780,592 +5144,157 @@ bad:
                         z.imag = 0;
                         return z;
                     case 1:
-                        return a;
-                    case 2:
-                        z = __Pyx_c_prod(a, a);
-                        return __Pyx_c_prod(a, a);
-                    case 3:
-                        z = __Pyx_c_prod(a, a);
-                        return __Pyx_c_prod(z, a);
-                    case 4:
-                        z = __Pyx_c_prod(a, a);
-                        return __Pyx_c_prod(z, z);
-                }
-            }
-            if (a.imag == 0) {
-                if (a.real == 0) {
-                    return a;
-                }
-                r = a.real;
-                theta = 0;
-            } else {
-                r = __Pyx_c_abs(a);
-                theta = atan2(a.imag, a.real);
-            }
-            lnr = log(r);
-            z_r = exp(lnr * b.real - theta * b.imag);
-            z_theta = theta * b.real + lnr * b.imag;
-            z.real = z_r * cos(z_theta);
-            z.imag = z_r * sin(z_theta);
-            return z;
-        }
-    #endif
-#endif
-
-static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) {
-    const unsigned char neg_one = (unsigned char)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(unsigned char) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(unsigned char)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to unsigned char" :
-                    "value too large to convert to unsigned char");
-            }
-            return (unsigned char)-1;
-        }
-        return (unsigned char)val;
-    }
-    return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x);
-}
-
-static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) {
-    const unsigned short neg_one = (unsigned short)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(unsigned short) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(unsigned short)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to unsigned short" :
-                    "value too large to convert to unsigned short");
-            }
-            return (unsigned short)-1;
-        }
-        return (unsigned short)val;
-    }
-    return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x);
-}
-
-static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) {
-    const unsigned int neg_one = (unsigned int)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(unsigned int) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(unsigned int)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to unsigned int" :
-                    "value too large to convert to unsigned int");
-            }
-            return (unsigned int)-1;
-        }
-        return (unsigned int)val;
-    }
-    return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x);
-}
-
-static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) {
-    const char neg_one = (char)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(char) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(char)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to char" :
-                    "value too large to convert to char");
-            }
-            return (char)-1;
-        }
-        return (char)val;
-    }
-    return (char)__Pyx_PyInt_AsLong(x);
-}
-
-static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) {
-    const short neg_one = (short)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(short) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(short)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to short" :
-                    "value too large to convert to short");
-            }
-            return (short)-1;
-        }
-        return (short)val;
-    }
-    return (short)__Pyx_PyInt_AsLong(x);
-}
-
-static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) {
-    const int neg_one = (int)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(int) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(int)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to int" :
-                    "value too large to convert to int");
-            }
-            return (int)-1;
-        }
-        return (int)val;
-    }
-    return (int)__Pyx_PyInt_AsLong(x);
-}
-
-static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) {
-    const signed char neg_one = (signed char)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(signed char) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(signed char)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to signed char" :
-                    "value too large to convert to signed char");
-            }
-            return (signed char)-1;
-        }
-        return (signed char)val;
-    }
-    return (signed char)__Pyx_PyInt_AsSignedLong(x);
-}
-
-static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) {
-    const signed short neg_one = (signed short)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(signed short) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(signed short)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to signed short" :
-                    "value too large to convert to signed short");
-            }
-            return (signed short)-1;
-        }
-        return (signed short)val;
-    }
-    return (signed short)__Pyx_PyInt_AsSignedLong(x);
-}
-
-static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) {
-    const signed int neg_one = (signed int)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(signed int) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(signed int)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to signed int" :
-                    "value too large to convert to signed int");
-            }
-            return (signed int)-1;
-        }
-        return (signed int)val;
-    }
-    return (signed int)__Pyx_PyInt_AsSignedLong(x);
-}
-
-static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) {
-    const int neg_one = (int)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (sizeof(int) < sizeof(long)) {
-        long val = __Pyx_PyInt_AsLong(x);
-        if (unlikely(val != (long)(int)val)) {
-            if (!unlikely(val == -1 && PyErr_Occurred())) {
-                PyErr_SetString(PyExc_OverflowError,
-                    (is_unsigned && unlikely(val < 0)) ?
-                    "can't convert negative value to int" :
-                    "value too large to convert to int");
-            }
-            return (int)-1;
-        }
-        return (int)val;
-    }
-    return (int)__Pyx_PyInt_AsLong(x);
-}
-
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
-#include "longintrepr.h"
-#endif
-#endif
-static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) {
-    const unsigned long neg_one = (unsigned long)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-#if PY_MAJOR_VERSION < 3
-    if (likely(PyInt_Check(x))) {
-        long val = PyInt_AS_LONG(x);
-        if (is_unsigned && unlikely(val < 0)) {
-            PyErr_SetString(PyExc_OverflowError,
-                            "can't convert negative value to unsigned long");
-            return (unsigned long)-1;
-        }
-        return (unsigned long)val;
-    } else
-#endif
-    if (likely(PyLong_Check(x))) {
-        if (is_unsigned) {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(unsigned long)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return (unsigned long) ((PyLongObject*)x)->ob_digit[0];
-                }
-            }
-#endif
-#endif
-            if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to unsigned long");
-                return (unsigned long)-1;
-            }
-            return (unsigned long)PyLong_AsUnsignedLong(x);
-        } else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(unsigned long)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return +(unsigned long) ((PyLongObject*)x)->ob_digit[0];
-                    case -1: return -(unsigned long) ((PyLongObject*)x)->ob_digit[0];
-                }
-            }
-#endif
-#endif
-            return (unsigned long)PyLong_AsLong(x);
-        }
-    } else {
-        unsigned long val;
-        PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (unsigned long)-1;
-        val = __Pyx_PyInt_AsUnsignedLong(tmp);
-        Py_DECREF(tmp);
-        return val;
-    }
-}
-
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
-#include "longintrepr.h"
-#endif
-#endif
-static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) {
-    const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-#if PY_MAJOR_VERSION < 3
-    if (likely(PyInt_Check(x))) {
-        long val = PyInt_AS_LONG(x);
-        if (is_unsigned && unlikely(val < 0)) {
-            PyErr_SetString(PyExc_OverflowError,
-                            "can't convert negative value to unsigned PY_LONG_LONG");
-            return (unsigned PY_LONG_LONG)-1;
-        }
-        return (unsigned PY_LONG_LONG)val;
-    } else
-#endif
-    if (likely(PyLong_Check(x))) {
-        if (is_unsigned) {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(unsigned PY_LONG_LONG)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return (unsigned PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
-                }
-            }
-#endif
-#endif
-            if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to unsigned PY_LONG_LONG");
-                return (unsigned PY_LONG_LONG)-1;
-            }
-            return (unsigned PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
-        } else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(unsigned PY_LONG_LONG)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return +(unsigned PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
-                    case -1: return -(unsigned PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
-                }
-            }
-#endif
-#endif
-            return (unsigned PY_LONG_LONG)PyLong_AsLongLong(x);
-        }
-    } else {
-        unsigned PY_LONG_LONG val;
-        PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (unsigned PY_LONG_LONG)-1;
-        val = __Pyx_PyInt_AsUnsignedLongLong(tmp);
-        Py_DECREF(tmp);
-        return val;
-    }
-}
-
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
-#include "longintrepr.h"
-#endif
-#endif
-static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) {
-    const long neg_one = (long)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-#if PY_MAJOR_VERSION < 3
-    if (likely(PyInt_Check(x))) {
-        long val = PyInt_AS_LONG(x);
-        if (is_unsigned && unlikely(val < 0)) {
-            PyErr_SetString(PyExc_OverflowError,
-                            "can't convert negative value to long");
-            return (long)-1;
-        }
-        return (long)val;
-    } else
-#endif
-    if (likely(PyLong_Check(x))) {
-        if (is_unsigned) {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(long)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return (long) ((PyLongObject*)x)->ob_digit[0];
-                }
-            }
-#endif
-#endif
-            if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to long");
-                return (long)-1;
-            }
-            return (long)PyLong_AsUnsignedLong(x);
-        } else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(long)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return +(long) ((PyLongObject*)x)->ob_digit[0];
-                    case -1: return -(long) ((PyLongObject*)x)->ob_digit[0];
-                }
-            }
-#endif
-#endif
-            return (long)PyLong_AsLong(x);
-        }
-    } else {
-        long val;
-        PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (long)-1;
-        val = __Pyx_PyInt_AsLong(tmp);
-        Py_DECREF(tmp);
-        return val;
-    }
-}
-
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
-#include "longintrepr.h"
-#endif
-#endif
-static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) {
-    const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-#if PY_MAJOR_VERSION < 3
-    if (likely(PyInt_Check(x))) {
-        long val = PyInt_AS_LONG(x);
-        if (is_unsigned && unlikely(val < 0)) {
-            PyErr_SetString(PyExc_OverflowError,
-                            "can't convert negative value to PY_LONG_LONG");
-            return (PY_LONG_LONG)-1;
-        }
-        return (PY_LONG_LONG)val;
-    } else
-#endif
-    if (likely(PyLong_Check(x))) {
-        if (is_unsigned) {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(PY_LONG_LONG)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return (PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
+                        return a;
+                    case 2:
+                        z = __Pyx_c_prod(a, a);
+                        return __Pyx_c_prod(a, a);
+                    case 3:
+                        z = __Pyx_c_prod(a, a);
+                        return __Pyx_c_prod(z, a);
+                    case 4:
+                        z = __Pyx_c_prod(a, a);
+                        return __Pyx_c_prod(z, z);
                 }
             }
-#endif
-#endif
-            if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to PY_LONG_LONG");
-                return (PY_LONG_LONG)-1;
-            }
-            return (PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
-        } else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(PY_LONG_LONG)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return +(PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
-                    case -1: return -(PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
+            if (a.imag == 0) {
+                if (a.real == 0) {
+                    return a;
                 }
+                r = a.real;
+                theta = 0;
+            } else {
+                r = __Pyx_c_abs(a);
+                theta = atan2(a.imag, a.real);
             }
+            lnr = log(r);
+            z_r = exp(lnr * b.real - theta * b.imag);
+            z_theta = theta * b.real + lnr * b.imag;
+            z.real = z_r * cos(z_theta);
+            z.imag = z_r * sin(z_theta);
+            return z;
+        }
+    #endif
 #endif
-#endif
-            return (PY_LONG_LONG)PyLong_AsLongLong(x);
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
+    const int neg_one = (int) -1, const_zero = 0;
+    const int is_unsigned = neg_one > const_zero;
+    if (is_unsigned) {
+        if (sizeof(int) < sizeof(long)) {
+            return PyInt_FromLong((long) value);
+        } else if (sizeof(int) <= sizeof(unsigned long)) {
+            return PyLong_FromUnsignedLong((unsigned long) value);
+        } else if (sizeof(int) <= sizeof(unsigned long long)) {
+            return PyLong_FromUnsignedLongLong((unsigned long long) value);
         }
     } else {
-        PY_LONG_LONG val;
-        PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (PY_LONG_LONG)-1;
-        val = __Pyx_PyInt_AsLongLong(tmp);
-        Py_DECREF(tmp);
-        return val;
+        if (sizeof(int) <= sizeof(long)) {
+            return PyInt_FromLong((long) value);
+        } else if (sizeof(int) <= sizeof(long long)) {
+            return PyLong_FromLongLong((long long) value);
+        }
+    }
+    {
+        int one = 1; int little = (int)*(unsigned char *)&one;
+        unsigned char *bytes = (unsigned char *)&value;
+        return _PyLong_FromByteArray(bytes, sizeof(int),
+                                     little, !is_unsigned);
     }
 }
 
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
-#include "longintrepr.h"
-#endif
-#endif
-static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) {
-    const signed long neg_one = (signed long)-1, const_zero = 0;
+static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
+    const int neg_one = (int) -1, const_zero = 0;
     const int is_unsigned = neg_one > const_zero;
 #if PY_MAJOR_VERSION < 3
     if (likely(PyInt_Check(x))) {
-        long val = PyInt_AS_LONG(x);
-        if (is_unsigned && unlikely(val < 0)) {
-            PyErr_SetString(PyExc_OverflowError,
-                            "can't convert negative value to signed long");
-            return (signed long)-1;
+        if (sizeof(int) < sizeof(long)) {
+            __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
+        } else {
+            long val = PyInt_AS_LONG(x);
+            if (is_unsigned && unlikely(val < 0)) {
+                goto raise_neg_overflow;
+            }
+            return (int) val;
         }
-        return (signed long)val;
     } else
 #endif
     if (likely(PyLong_Check(x))) {
         if (is_unsigned) {
 #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(signed long)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return (signed long) ((PyLongObject*)x)->ob_digit[0];
-                }
+ #if CYTHON_USE_PYLONG_INTERNALS
+            switch (Py_SIZE(x)) {
+                case  0: return 0;
+                case  1: __PYX_VERIFY_RETURN_INT(int, digit, ((PyLongObject*)x)->ob_digit[0]);
             }
-#endif
+ #endif
 #endif
             if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to signed long");
-                return (signed long)-1;
+                goto raise_neg_overflow;
+            }
+            if (sizeof(int) <= sizeof(unsigned long)) {
+                __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong(x))
+            } else if (sizeof(int) <= sizeof(unsigned long long)) {
+                __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong(x))
             }
-            return (signed long)PyLong_AsUnsignedLong(x);
         } else {
 #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(signed long)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return +(signed long) ((PyLongObject*)x)->ob_digit[0];
-                    case -1: return -(signed long) ((PyLongObject*)x)->ob_digit[0];
-                }
+ #if CYTHON_USE_PYLONG_INTERNALS
+            switch (Py_SIZE(x)) {
+                case  0: return 0;
+                case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +(((PyLongObject*)x)->ob_digit[0]));
+                case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
             }
+ #endif
 #endif
-#endif
-            return (signed long)PyLong_AsLong(x);
-        }
-    } else {
-        signed long val;
-        PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (signed long)-1;
-        val = __Pyx_PyInt_AsSignedLong(tmp);
-        Py_DECREF(tmp);
-        return val;
-    }
-}
-
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
-#include "longintrepr.h"
-#endif
-#endif
-static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) {
-    const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-#if PY_MAJOR_VERSION < 3
-    if (likely(PyInt_Check(x))) {
-        long val = PyInt_AS_LONG(x);
-        if (is_unsigned && unlikely(val < 0)) {
-            PyErr_SetString(PyExc_OverflowError,
-                            "can't convert negative value to signed PY_LONG_LONG");
-            return (signed PY_LONG_LONG)-1;
-        }
-        return (signed PY_LONG_LONG)val;
-    } else
-#endif
-    if (likely(PyLong_Check(x))) {
-        if (is_unsigned) {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(signed PY_LONG_LONG)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return (signed PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
-                }
+            if (sizeof(int) <= sizeof(long)) {
+                __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong(x))
+            } else if (sizeof(int) <= sizeof(long long)) {
+                __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong(x))
             }
-#endif
-#endif
-            if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to signed PY_LONG_LONG");
-                return (signed PY_LONG_LONG)-1;
+        }
+        {
+#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
+            PyErr_SetString(PyExc_RuntimeError,
+                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
+#else
+            int val;
+            PyObject *v = __Pyx_PyNumber_Int(x);
+ #if PY_MAJOR_VERSION < 3
+            if (likely(v) && !PyLong_Check(v)) {
+                PyObject *tmp = v;
+                v = PyNumber_Long(tmp);
+                Py_DECREF(tmp);
             }
-            return (signed PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
-        } else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(signed PY_LONG_LONG)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return +(signed PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
-                    case -1: return -(signed PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
-                }
+ #endif
+            if (likely(v)) {
+                int one = 1; int is_little = (int)*(unsigned char *)&one;
+                unsigned char *bytes = (unsigned char *)&val;
+                int ret = _PyLong_AsByteArray((PyLongObject *)v,
+                                              bytes, sizeof(val),
+                                              is_little, !is_unsigned);
+                Py_DECREF(v);
+                if (likely(!ret))
+                    return val;
             }
 #endif
-#endif
-            return (signed PY_LONG_LONG)PyLong_AsLongLong(x);
+            return (int) -1;
         }
     } else {
-        signed PY_LONG_LONG val;
+        int val;
         PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (signed PY_LONG_LONG)-1;
-        val = __Pyx_PyInt_AsSignedLongLong(tmp);
+        if (!tmp) return (int) -1;
+        val = __Pyx_PyInt_As_int(tmp);
         Py_DECREF(tmp);
         return val;
     }
+raise_overflow:
+    PyErr_SetString(PyExc_OverflowError,
+        "value too large to convert to int");
+    return (int) -1;
+raise_neg_overflow:
+    PyErr_SetString(PyExc_OverflowError,
+        "can't convert negative value to int");
+    return (int) -1;
 }
 
 static int __Pyx_check_binary_version(void) {
@@ -5378,11 +5307,7 @@ static int __Pyx_check_binary_version(void) {
                       "compiletime version %s of module '%.100s' "
                       "does not match runtime version %s",
                       ctversion, __Pyx_MODULE_NAME, rtversion);
-        #if PY_VERSION_HEX < 0x02050000
-        return PyErr_Warn(NULL, message);
-        #else
         return PyErr_WarnEx(NULL, message, 1);
-        #endif
     }
     return 0;
 }
@@ -5432,7 +5357,7 @@ static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class
         goto bad;
     if (!PyType_Check(result)) {
         PyErr_Format(PyExc_TypeError,
-            "%s.%s is not a type object",
+            "%.200s.%.200s is not a type object",
             module_name, class_name);
         goto bad;
     }
@@ -5452,15 +5377,11 @@ static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class
         PyOS_snprintf(warning, sizeof(warning),
             "%s.%s size changed, may indicate binary incompatibility",
             module_name, class_name);
-        #if PY_VERSION_HEX < 0x02050000
-        if (PyErr_Warn(NULL, warning) < 0) goto bad;
-        #else
         if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
-        #endif
     }
     else if ((size_t)basicsize != size) {
         PyErr_Format(PyExc_ValueError,
-            "%s.%s has the wrong size, try recompiling",
+            "%.200s.%.200s has the wrong size, try recompiling",
             module_name, class_name);
         goto bad;
     }
@@ -5472,168 +5393,6 @@ bad:
 }
 #endif
 
-static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
-    int start = 0, mid = 0, end = count - 1;
-    if (end >= 0 && code_line > entries[end].code_line) {
-        return count;
-    }
-    while (start < end) {
-        mid = (start + end) / 2;
-        if (code_line < entries[mid].code_line) {
-            end = mid;
-        } else if (code_line > entries[mid].code_line) {
-             start = mid + 1;
-        } else {
-            return mid;
-        }
-    }
-    if (code_line <= entries[mid].code_line) {
-        return mid;
-    } else {
-        return mid + 1;
-    }
-}
-static PyCodeObject *__pyx_find_code_object(int code_line) {
-    PyCodeObject* code_object;
-    int pos;
-    if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
-        return NULL;
-    }
-    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
-    if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
-        return NULL;
-    }
-    code_object = __pyx_code_cache.entries[pos].code_object;
-    Py_INCREF(code_object);
-    return code_object;
-}
-static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
-    int pos, i;
-    __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
-    if (unlikely(!code_line)) {
-        return;
-    }
-    if (unlikely(!entries)) {
-        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
-        if (likely(entries)) {
-            __pyx_code_cache.entries = entries;
-            __pyx_code_cache.max_count = 64;
-            __pyx_code_cache.count = 1;
-            entries[0].code_line = code_line;
-            entries[0].code_object = code_object;
-            Py_INCREF(code_object);
-        }
-        return;
-    }
-    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
-    if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
-        PyCodeObject* tmp = entries[pos].code_object;
-        entries[pos].code_object = code_object;
-        Py_DECREF(tmp);
-        return;
-    }
-    if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
-        int new_max = __pyx_code_cache.max_count + 64;
-        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
-            __pyx_code_cache.entries, new_max*sizeof(__Pyx_CodeObjectCacheEntry));
-        if (unlikely(!entries)) {
-            return;
-        }
-        __pyx_code_cache.entries = entries;
-        __pyx_code_cache.max_count = new_max;
-    }
-    for (i=__pyx_code_cache.count; i>pos; i--) {
-        entries[i] = entries[i-1];
-    }
-    entries[pos].code_line = code_line;
-    entries[pos].code_object = code_object;
-    __pyx_code_cache.count++;
-    Py_INCREF(code_object);
-}
-
-#include "compile.h"
-#include "frameobject.h"
-#include "traceback.h"
-static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
-            const char *funcname, int c_line,
-            int py_line, const char *filename) {
-    PyCodeObject *py_code = 0;
-    PyObject *py_srcfile = 0;
-    PyObject *py_funcname = 0;
-    #if PY_MAJOR_VERSION < 3
-    py_srcfile = PyString_FromString(filename);
-    #else
-    py_srcfile = PyUnicode_FromString(filename);
-    #endif
-    if (!py_srcfile) goto bad;
-    if (c_line) {
-        #if PY_MAJOR_VERSION < 3
-        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
-        #else
-        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
-        #endif
-    }
-    else {
-        #if PY_MAJOR_VERSION < 3
-        py_funcname = PyString_FromString(funcname);
-        #else
-        py_funcname = PyUnicode_FromString(funcname);
-        #endif
-    }
-    if (!py_funcname) goto bad;
-    py_code = __Pyx_PyCode_New(
-        0,            /*int argcount,*/
-        0,            /*int kwonlyargcount,*/
-        0,            /*int nlocals,*/
-        0,            /*int stacksize,*/
-        0,            /*int flags,*/
-        __pyx_empty_bytes, /*PyObject *code,*/
-        __pyx_empty_tuple, /*PyObject *consts,*/
-        __pyx_empty_tuple, /*PyObject *names,*/
-        __pyx_empty_tuple, /*PyObject *varnames,*/
-        __pyx_empty_tuple, /*PyObject *freevars,*/
-        __pyx_empty_tuple, /*PyObject *cellvars,*/
-        py_srcfile,   /*PyObject *filename,*/
-        py_funcname,  /*PyObject *name,*/
-        py_line,      /*int firstlineno,*/
-        __pyx_empty_bytes  /*PyObject *lnotab*/
-    );
-    Py_DECREF(py_srcfile);
-    Py_DECREF(py_funcname);
-    return py_code;
-bad:
-    Py_XDECREF(py_srcfile);
-    Py_XDECREF(py_funcname);
-    return NULL;
-}
-static void __Pyx_AddTraceback(const char *funcname, int c_line,
-                               int py_line, const char *filename) {
-    PyCodeObject *py_code = 0;
-    PyObject *py_globals = 0;
-    PyFrameObject *py_frame = 0;
-    py_code = __pyx_find_code_object(c_line ? c_line : py_line);
-    if (!py_code) {
-        py_code = __Pyx_CreateCodeObjectForTraceback(
-            funcname, c_line, py_line, filename);
-        if (!py_code) goto bad;
-        __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
-    }
-    py_globals = PyModule_GetDict(__pyx_m);
-    if (!py_globals) goto bad;
-    py_frame = PyFrame_New(
-        PyThreadState_GET(), /*PyThreadState *tstate,*/
-        py_code,             /*PyCodeObject *code,*/
-        py_globals,          /*PyObject *globals,*/
-        0                    /*PyObject *locals*/
-    );
-    if (!py_frame) goto bad;
-    py_frame->f_lineno = py_line;
-    PyTraceBack_Here(py_frame);
-bad:
-    Py_XDECREF(py_code);
-    Py_XDECREF(py_frame);
-}
-
 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
     while (t->p) {
         #if PY_MAJOR_VERSION < 3
@@ -5644,7 +5403,7 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
         } else {
             *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
         }
-        #else  /* Python 3+ has unicode identifiers */
+        #else
         if (t->is_unicode | t->is_str) {
             if (t->intern) {
                 *t->p = PyUnicode_InternFromString(t->s);
@@ -5664,8 +5423,8 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
     return 0;
 }
 
-static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char* c_str) {
-    return __Pyx_PyUnicode_FromStringAndSize(c_str, strlen(c_str));
+static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
+    return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
 }
 static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
     Py_ssize_t ignore;
@@ -5694,29 +5453,35 @@ static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_
                 }
             }
         }
-#endif /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/
+#endif
         *length = PyBytes_GET_SIZE(defenc);
         return defenc_c;
-#else /* PY_VERSION_HEX < 0x03030000 */
-        if (PyUnicode_READY(o) == -1) return NULL;
+#else
+        if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
         if (PyUnicode_IS_ASCII(o)) {
-            *length = PyUnicode_GET_DATA_SIZE(o);
+            *length = PyUnicode_GET_LENGTH(o);
             return PyUnicode_AsUTF8(o);
         } else {
             PyUnicode_AsASCIIString(o);
             return NULL;
         }
-#else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */
+#else
         return PyUnicode_AsUTF8AndSize(o, length);
-#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */
-#endif /* PY_VERSION_HEX < 0x03030000 */
+#endif
+#endif
+    } else
+#endif
+#if !CYTHON_COMPILING_IN_PYPY
+    if (PyByteArray_Check(o)) {
+        *length = PyByteArray_GET_SIZE(o);
+        return PyByteArray_AS_STRING(o);
     } else
-#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII  || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */
+#endif
     {
         char* result;
         int r = PyBytes_AsStringAndSize(o, &result, length);
-        if (r < 0) {
+        if (unlikely(r < 0)) {
             return NULL;
         } else {
             return result;
@@ -5761,7 +5526,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
     if (!PyLong_Check(res)) {
 #endif
       PyErr_Format(PyExc_TypeError,
-                   "__%s__ returned non-%s (type %.200s)",
+                   "__%.4s__ returned non-%.4s (type %.200s)",
                    name, name, Py_TYPE(res)->tp_name);
       Py_DECREF(res);
       return NULL;
@@ -5775,34 +5540,31 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
 }
 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
   Py_ssize_t ival;
-  PyObject* x = PyNumber_Index(b);
+  PyObject *x;
+#if PY_MAJOR_VERSION < 3
+  if (likely(PyInt_CheckExact(b)))
+      return PyInt_AS_LONG(b);
+#endif
+  if (likely(PyLong_CheckExact(b))) {
+    #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
+     #if CYTHON_USE_PYLONG_INTERNALS
+       switch (Py_SIZE(b)) {
+       case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0];
+       case  0: return 0;
+       case  1: return ((PyLongObject*)b)->ob_digit[0];
+       }
+     #endif
+    #endif
+    return PyLong_AsSsize_t(b);
+  }
+  x = PyNumber_Index(b);
   if (!x) return -1;
   ival = PyInt_AsSsize_t(x);
   Py_DECREF(x);
   return ival;
 }
 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
-#if PY_VERSION_HEX < 0x02050000
-   if (ival <= LONG_MAX)
-       return PyInt_FromLong((long)ival);
-   else {
-       unsigned char *bytes = (unsigned char *) &ival;
-       int one = 1; int little = (int)*(unsigned char*)&one;
-       return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0);
-   }
-#else
-   return PyInt_FromSize_t(ival);
-#endif
-}
-static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) {
-   unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x);
-   if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) {
-       if ((val != (unsigned PY_LONG_LONG)-1) || !PyErr_Occurred())
-           PyErr_SetString(PyExc_OverflowError,
-                           "value too large to convert to size_t");
-       return (size_t)-1;
-   }
-   return (size_t)val;
+    return PyInt_FromSize_t(ival);
 }
 
 
diff --git a/redtoreg.pyx b/redtoreg.pyx
index a18f50b..d4e7435 100644
--- a/redtoreg.pyx
+++ b/redtoreg.pyx
@@ -9,7 +9,8 @@ def _redtoreg(object nlonsin, npc.ndarray lonsperlat, npc.ndarray redgrid, \
     cdef long i, j, n, im, ip, indx, ilons, nlats, npts
     cdef double zxi, zdx, flons, missvl
     cdef npc.ndarray reggrid
-    cdef double *redgrdptr, *reggrdptr
+    cdef double *redgrdptr
+    cdef double *reggrdptr
     cdef long *lonsptr
     nlons = nlonsin
     nlats = len(lonsperlat)
diff --git a/setup.cfg b/setup.cfg
new file mode 100644
index 0000000..b649458
--- /dev/null
+++ b/setup.cfg
@@ -0,0 +1,31 @@
+# Rename this file to setup.cfg to set pygrib's
+# build options. 
+# Follow instructions below for editing.
+[directories]
+# uncomment and set to grib_api install location.
+# Include files should be located in grib_api_dir/include and
+# the library should be located in grib_api_dir/lib.
+# If the libraries and include files are installed in separate locations,
+# use grib_api_libdir and grib_api_incdir to specify the locations
+# separately.  
+grib_api_dir = /opt/local
+# if grib_api was built with jasper support for JPEG200,
+# uncomment and set to jasper lib install location.
+# If the libraries and include files are installed in separate locations,
+# use jasper_libdir and jasper_incdir.
+jasper_dir = /opt/local
+# if grib_api was built with openjpeg support for JPEG200,
+# uncomment and set to openjpeg lib install location.
+# If the libraries and include files are installed in separate locations,
+# use openjpeg_libdir and openjpeg_incdir.
+openjpeg_dir = /opt/local
+# if grib_api was built with png support,
+# uncomment and set to png lib install location.
+# If the libraries and include files are installed in separate locations,
+# use png_libdir and png_incdir.
+png_dir = /usr
+# if grib_api was built with png support,
+# uncomment and set to zlib install location.
+zlib_dir = /usr
+# install man pages for command line utilities here
+#man_dir = /usr/local/man
diff --git a/setup.py b/setup.py
index 636214e..4ddd8a6 100755
--- a/setup.py
+++ b/setup.py
@@ -147,12 +147,12 @@ else:
 
 
 setup(name = "pygrib",
-      version = "1.9.9",
+      version = "2.0.0",
       description       = "Python module for reading/writing GRIB files",
       author            = "Jeff Whitaker",
       author_email      = "jeffrey.s.whitaker at noaa.gov",
-      url               = "http://code.google.com/p/pygrib",
-      download_url      = "http://code.google.com/p/pygrib/downloads/list",
+      url               = "https://github.com/jswhit/pygrib",
+      download_url      = "http://python.org/pypi/pygrib",
       scripts =
       ['utils/grib_list','utils/grib_repack','utils/cnvgrib1to2','utils/cnvgrib2to1'],
       ext_modules       = [pygribext,g2clibext,redtoregext],
diff --git a/utils/grib_list b/utils/grib_list
index fa901da..00aa908 100755
--- a/utils/grib_list
+++ b/utils/grib_list
@@ -29,11 +29,11 @@ else:
         for k in grb.keys():
             if k.startswith('mars'): continue
             if k in ['values','codedValues','packedValues','unpackedValues']: continue
-            if grb.is_missing(k):
+            if grb.is_missing(k) and k not in ['analDate','validDate']:
                 sys.stdout.write('%s = MISSING\n' % k)
             else:
                 try:
-                    v = grb[k]
+                    v = getattr(grb,k)
                     sys.stdout.write('%s = %s\n'%(k,v))
                 except:
                     sys.stdout.write('%s = NOT FOUND\n'%k)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/pygrib.git



More information about the debian-science-commits mailing list