<p dir="auto">Hi,</p>
<p dir="auto">Just realized that I am restating the already reported issue<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="401279565" data-permission-text="Title is private" data-url="https://github.com/scipy/scipy/issues/9704" data-hovercard-type="issue" data-hovercard-url="/scipy/scipy/issues/9704/hovercard" href="https://github.com/scipy/scipy/issues/9704">#9704</a></p>
<p dir="auto">In the documentation of<br>
domain of argument of scipy.interpolate.RectSphereBivariateSpline(u, v, r, s=0.0, pole_continuity=False, pole_values=None, pole_exact=False, pole_flat=False)<br>
on page<br>
<a href="https://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.RectSphereBivariateSpline.html" rel="nofollow">https://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.RectSphereBivariateSpline.html</a><br>
it states that the domain of the 2nd argument v should be [-pi, pi). However, when invoking<br>
RectSphereBivariateSpline.ev(self, theta, phi, dtheta=0, dphi=0)<br>
documented on page<br>
<a href="https://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.RectSphereBivariateSpline.ev.html" rel="nofollow">https://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.RectSphereBivariateSpline.ev.html</a><br>
the argument phi, which corresponds to the aforementioned v, requires the input within [0, 2pi) rather than [-pi, pi).</p>
<p dir="auto">Would you double check the domains of the angular arguments and make sure that the functions and their documentations all have consistent domains for the angles? Thanks!</p>
<p dir="auto">The RectSphereBivariateSpline interpolation function cannot be evaluated for negative degrees longitude, which is actually supported by the underlying interpolation library. The cause is that SphereBivariateSpline, the baseclass to RectSphereBivariateSpline, raises ValueErrors for negative lon-values. This is appropriate for the two other classes that subclass SphereBivariateSpline, but not RectSphereBivariateSpline.</p>
<p dir="auto">One solution could be to create call methods for the two other Sphere-classes and move the checks on lat/lon from SphereBivariateSpline into these.</p>
<p dir="auto">If that seems viable I could create a pull-request.</p>
<h3 dir="auto">Reproducing code example:</h3>

<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="from scipy.interpolate import RectSphereBivariateSpline
import numpy as np

lats = np.array([25, 30, 35, 40, 45])
lons = np.array([-90, -85, -80, -75, -70])

mesh = np.meshgrid(lats, lons)
data = mesh[0] + mesh[1] # lon + lat value

lat_r = np.radians(lats)
lon_r = np.radians(lons)

interpolator = RectSphereBivariateSpline(lat_r, lon_r, data)

query_lat = np.radians(np.array([35, 37.5]))
query_lon = np.radians(np.array([-80, -77.5]))

data_interp = interpolator(query_lat, query_lon)"><pre class="notranslate"><code class="notranslate">from scipy.interpolate import RectSphereBivariateSpline
import numpy as np

lats = np.array([25, 30, 35, 40, 45])
lons = np.array([-90, -85, -80, -75, -70])

mesh = np.meshgrid(lats, lons)
data = mesh[0] + mesh[1] # lon + lat value

lat_r = np.radians(lats)
lon_r = np.radians(lons)

interpolator = RectSphereBivariateSpline(lat_r, lon_r, data)

query_lat = np.radians(np.array([35, 37.5]))
query_lon = np.radians(np.array([-80, -77.5]))

data_interp = interpolator(query_lat, query_lon)
</code></pre></div>
<h3 dir="auto">Error message:</h3>

<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
&lt;ipython-input-1-49ec0a78db0b&gt; in &lt;module&gt;()
     16 query_lon = np.radians(np.array([-80, -77.5]))
     17 
---&gt; 18 data_interp = interpolator(query_lat, query_lon)

~/anaconda3/lib/python3.6/site-packages/scipy/interpolate/fitpack2.py in __call__(self, theta, phi, dtheta, dphi, grid)
   1263             raise ValueError(&quot;requested theta out of bounds.&quot;)
   1264         if phi.size &gt; 0 and (phi.min() &lt; 0. or phi.max() &gt; 2. * np.pi):
-&gt; 1265             raise ValueError(&quot;requested phi out of bounds.&quot;)
   1266 
   1267         return _BivariateSplineBase.__call__(self, theta, phi,

ValueError: requested phi out of bounds."><pre class="notranslate"><code class="notranslate">---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
&lt;ipython-input-1-49ec0a78db0b&gt; in &lt;module&gt;()
     16 query_lon = np.radians(np.array([-80, -77.5]))
     17 
---&gt; 18 data_interp = interpolator(query_lat, query_lon)

~/anaconda3/lib/python3.6/site-packages/scipy/interpolate/fitpack2.py in __call__(self, theta, phi, dtheta, dphi, grid)
   1263             raise ValueError("requested theta out of bounds.")
   1264         if phi.size &gt; 0 and (phi.min() &lt; 0. or phi.max() &gt; 2. * np.pi):
-&gt; 1265             raise ValueError("requested phi out of bounds.")
   1266 
   1267         return _BivariateSplineBase.__call__(self, theta, phi,

ValueError: requested phi out of bounds.
</code></pre></div>
<h3 dir="auto">Scipy/Numpy/Python version information:</h3>
<p dir="auto">1.1.0 1.14.3 sys.version_info(major=3, minor=6, micro=5, releaselevel='final', serial=0)</p>