matplotlib / basemap

Plot on map projections (with coastlines and political boundaries) using matplotlib
MIT License
775 stars 392 forks source link

geos projection cannot cross pole #361

Closed sfinkens closed 2 years ago

sfinkens commented 7 years ago

Defining a Basemap in geostationary projection,

>>> from mpl_toolkits.basemap import Basemap
>>> Basemap(projection='geos', lon_0=0)

fails in basemap-1.1.0 with the following error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "...lib/python2.7/site-packages/mpl_toolkits/basemap/__init__.py", line 1109, in __init__
self._readboundarydata('gshhs',as_polygons=True)
  File "...lib/python2.7/site-packages/mpl_toolkits/basemap/__init__.py", line 1241, in _readboundarydata
raise ValueError('%s projection cannot cross pole'%(self.projection))
ValueError: geos projection cannot cross pole
WeatherGod commented 7 years ago

How did you install Basemap and it's accompanying data? The data was updated in 1.1.0 as well as a few tweaks to the loading code. I never tested the loading code against the old data, so there might be some incompatibilities.

On Jul 4, 2017 12:36 PM, "Stephan Finkensieper" notifications@github.com wrote:

Defining a Basemap in geostationary projection,

from mpl_toolkits.basemap import Basemap Basemap(projection='geos', lon_0=0)

fails in basemap-1.1.0 with the following error:

Traceback (most recent call last): File "", line 1, in File "...lib/python2.7/site-packages/mpl_toolkits/basemap/init.py", line 1109, in init self._readboundarydata('gshhs',as_polygons=True) File "...lib/python2.7/site-packages/mpl_toolkits/basemap/init.py", line 1241, in _readboundarydata raise ValueError('%s projection cannot cross pole'%(self.projection)) ValueError: geos projection cannot cross pole

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/matplotlib/basemap/issues/361, or mute the thread https://github.com/notifications/unsubscribe-auth/AARy-E7eYi2cB2pe4U9YHz63KXGKMimXks5sKmoLgaJpZM4ONi57 .

sfinkens commented 7 years ago

I used

pip install --prefix=$PREFIX git+https://github.com/matplotlib/basemap.git
WeatherGod commented 7 years ago

Do you have the same problem if installing from conda-forge?

On Jul 5, 2017 3:04 AM, "Stephan Finkensieper" notifications@github.com wrote:

I used

pip install --prefix=$PREFIX git+https://github.com/matplotlib/basemap.git

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/matplotlib/basemap/issues/361#issuecomment-313019253, or mute the thread https://github.com/notifications/unsubscribe-auth/AARy-HCnKU5gCAyBeEVStKmaunkPs2yDks5sKzV6gaJpZM4ONi57 .

sfinkens commented 7 years ago

Unfortunately I can't use conda due to legal issues...

WeatherGod commented 7 years ago

uhm, ok. I take it that there is a long an complicated story behind that. I'll see if I can reproduce the problem, but right now, conda is the preferred method of installing packages that have non-python dependencies (namely, libgeos).

On Mon, Jul 10, 2017 at 3:03 AM, Stephan Finkensieper < notifications@github.com> wrote:

Unfortunately I can't use conda due to legal issues...

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/matplotlib/basemap/issues/361#issuecomment-314022571, or mute the thread https://github.com/notifications/unsubscribe-auth/AARy-FMTcoQi3sSrw_8435e_hCL9za5vks5sMczJgaJpZM4ONi57 .

sfinkens commented 7 years ago

Indeed :) Thank you very much for your effort! I linked basemap against geos-3.6.1, whose test suite passes.

WeatherGod commented 7 years ago

basemap's test suite? yeah, that isn't very definitive because it isn't extensive at all. The better exercise is to run the examples (needs netcdf4 package, though).

On Mon, Jul 10, 2017 at 10:22 AM, Stephan Finkensieper < notifications@github.com> wrote:

Indeed :) Thank you very much for your effort! I linked basemap against geos-3.6.1, whose test suite passes.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/matplotlib/basemap/issues/361#issuecomment-314120743, or mute the thread https://github.com/notifications/unsubscribe-auth/AARy-PREUXRx9vqdfhi-xnGjbEjJ6DCyks5sMjOIgaJpZM4ONi57 .

sfinkens commented 7 years ago

Aha, the geos definition in examples/test.py,

m = Basemap(projection='geos',
            rsphere=(6378137.00,6356752.3142),
            resolution='c',
            area_thresh=10000.,
            lon_0=0,
            satellite_height=35785831)

works fine. Removing the rsphere argument causes the error again.

WeatherGod commented 7 years ago

Interesting. I guess that makes some sense, but perhaps a better default behavior could be defined?

On Tue, Jul 11, 2017 at 3:03 AM, Stephan Finkensieper < notifications@github.com> wrote:

Aha, the geos definition in examples/test.py,

m = Basemap(projection='geos', rsphere=(6378137.00,6356752.3142), resolution='c', area_thresh=10000., lon_0=0, satellite_height=35785831)

works fine. Removing the rsphere argument causes the error again.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/matplotlib/basemap/issues/361#issuecomment-314354073, or mute the thread https://github.com/notifications/unsubscribe-auth/AARy-Il9J89UxjaL8-J17vcNphaVdryUks5sMx44gaJpZM4ONi57 .

sfinkens commented 7 years ago

Hmm, I don't see why a geostationary projection would not be defined for a spherical earth?

WeatherGod commented 7 years ago

it might be expecting a tuple and erroring on a float or something

I'll look into it tomorrow

On Tue, Jul 11, 2017 at 11:24 AM, Stephan Finkensieper < notifications@github.com> wrote:

Hmm, I don't see why a geostationary projection would not be defined for a spherical earth?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/matplotlib/basemap/issues/361#issuecomment-314480076, or mute the thread https://github.com/notifications/unsubscribe-auth/AARy-L6VKrCkNSVVOTMhFM8yQjAJtamsks5sM5OrgaJpZM4ONi57 .

sebhahn commented 5 years ago

just stumbled on this issue myself, any progress?

Rigonz commented 5 years ago

Same for me: removing the parameter rsphere=(6378137.00,6356752.3142) triggers the error, but including it brings no result. In fact, reducing the satellite's height by a factor of 100 kills my kernel (first time ever!)

ebo commented 5 years ago

I can confirm that this is still the case for Baseline-1.2.0 and geos-3.6.2. Adding rsphere=(6378137.00,6356752.3142) fixes the problem.

Rehan418 commented 4 years ago

Aha, the geos definition in examples/test.py,

m = Basemap(projection='geos',
            rsphere=(6378137.00,6356752.3142),
            resolution='c',
            area_thresh=10000.,
            lon_0=0,
            satellite_height=35785831)

works fine. Removing the rsphere argument causes the error again.

It worked for me.thank you.

AlisonVilela commented 3 years ago

Aha, the geos definition in examples/test.py,

m = Basemap(projection='geos',
            rsphere=(6378137.00,6356752.3142),
            resolution='c',
            area_thresh=10000.,
            lon_0=0,
            satellite_height=35785831)

works fine. Removing the rsphere argument causes the error again.

It worked for me too. Thank you!