title: Inexplicable "divide by zero" RuntimeWarning with numpy masked arrays
body: <p>I am encountering a divide by zero Runtime Warning in Numpy, and I cannot understand why.</p>
  
  <p>I am talking the inverse (elementwise) of a masked array, and none of the valid values of the array are close to 0.</p>
  
  <p>In the following formula: exct and rpol are scalars, and geocentp is a masked array (so temp and Rearth are going to be masked array too).</p>
  
  <pre><code>temp = sqrt(1. - exct ** 2. * cos(geocentp)**2.)
  print temp.count()
  print temp.min(), temp.max()
  
  Rearth = rpol / temp
  print Rearth.count()
  print Rearth.min(), Rearth.max()
  </code></pre>
  
  <p>The print output is:</p>
  
  <pre><code>5680418
  0.996616 0.999921
  5680418
  6357.09 6378.17
  </code></pre>
  
  <p>And still, I get the Warning:</p>
  
  <pre><code>seviri_lst_toolbox.py:1174: RuntimeWarning: divide by zero encountered in divide
    Rearth = rpol / temp
  </code></pre>
  
  <p>This is weird, right? The usual behaviour of a masked array is that masked values are not divided. If a division by zero on a valid value occurs, the value is masked, which is not the case as the 'count()' gives the exact number of valid values before and after the division...</p>
  
  <p>I'm lost... Anybody has an idea?</p>
  
  <hr>
  
  <p>EDIT:
  Following the answer of RomanGotsiy, I could get rid of the warning by changing the float numerator for a masked array:</p>
  
  <pre><code>Rearth = rpol * np.ma.ones(geocentp.shape, dtype=np.float32) / temp
  </code></pre>
  
  <p>But this is clearly not ideal. This matrix (temporarily) created overloads my memory. Is there another way to get around that?</p>