title: Differences in projecting satellite images with cartopy and pyresample
body: <p>I have written a python script to project and overlay geostationary satellite images from the university of Dundee so the resulting image can be used for xplanet to render the surface of the earth. The source code of the tool can be found at <a href="https://github.com/jmozmoz/cloudmap/tree/cartopy" rel="nofollow">https://github.com/jmozmoz/cloudmap/tree/cartopy</a> (this is the branch with cartopy support)</p>
  
  <p>The tool support two different python libraries to project the geostationary images on a flat map: pyresample and cartopy. </p>
  
  <p>I have found the following differences/problems:</p>
  
  <ol>
  <li>pyresample is much faster than cartopy (depending on the size of the output image up to a factor of 10)</li>
  <li>The output images differ: The results using pyresample show a stronger contrast. 
  For examples see the debug directory at <a href="https://github.com/jmozmoz/cloudmap/tree/cartopy/debug" rel="nofollow">https://github.com/jmozmoz/cloudmap/tree/cartopy/debug</a></li>
  <li><p>If the multiprocessing library is used to do the projection in parallel, the cartopy version crashes with the following error message:</p>
  
  <pre><code>Fatal Python error: PyEval_RestoreThread: NULL tstate
  </code></pre></li>
  </ol>
  
  <p>So why is cartopy so much slower? Is pyresample doing the work in C code? Should cartopy support multiprocessing? And how to fix the problem with the contrast?</p>
  
  <p>Thank you for your help</p>