-
Notifications
You must be signed in to change notification settings - Fork 361
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Basemap fails with Mollweide projection across prime meridian or negative longitude defining both central meridian and range #8403
Comments
👋 Thanks for opening your first issue here! Please make sure you filled out the template with as much detail as possible. You might also want to take a look at our contributing guidelines and code of conduct. |
The equivalent GMT commands also fail. So I'm transfering the issue to the upstream GMT repository. The equivalent GMT commands are:
|
👋 Thanks for opening your first issue here! Please make sure you filled out the template with as much detail as possible. We appreciate that you took the time to contribute! Please make sure you read our Contributing Guide and abide by our Code of Conduct. |
Thanks @thomasAmorrow for your detailed report! I can reproduce this issue with GMT 6.5.0, but it worked with GMT 6.4.0. The analogous issue occurs with the Hammer (H) projection. The projections N, Kf, Ks, I, and R seem to work. Depending on how fast you need this map and if you do not need any features or bug fixes of GMT 6.5.0, you may want to consider setting up a conda environment with PyGMT and GMT 6.4.0 (, even it is generally recommended to use the latest versions). For me, the following code works with GMT 6.4.0, but fails with GMT 6.5.0 (the same holds for the equivalent GMT commands by @seisman in comment #8403 (comment)): import pygmt
dict_J_R = {
"0/180/0/90": "W30/10c", # Works
"-180/0/0/90": "W-30/10c", # Fails with GMT 6.5.0
"-20/180/0/90": "W30/10c", # Works
"-180/20/0/90": "W-30/10c", # Fails with GMT 6.5.0
}
fig = pygmt.Figure()
for panel in dict_J_R.keys():
fig.basemap(
region=panel,
projection=dict_J_R[panel],
frame=["afg", f"+tJ={dict_J_R[panel]}, R={panel}"],
)
fig.shift_origin(xshift="+w+1c")
fig.show()
# fig.savefig(fname="mollweide_subregion.png") |
Hmm, we are having an issue with central longitudes in [0 360] and regions in [-180 180]. For some reason the central longitude is converted to [0 360] and a test saying
fails. For the moment the solution is to give the -R in [0 360]. e.g., this works
|
Description of the problem
Basemap fails when creating a Molleweide projection that crosses 0 longitude and when creating a Molleweide projection with a negative longitude central meridian and negative longitude for E/W range arguments.
Interestingly, it succeeds when defining a negative longitude central meridian and a positive E/W range.
This might be two separate issues, one associated with crossing 0 longitude and the other somehow associated with using negative longitude for range E/W, but I can't disentangle them. 6 examples included, the last 3 fail with the same error message.
The actual need I have is to create a map in a Molleweide projection defined by a central meridian west of 0 longitude and with a range that spans across 0 longitude.
Minimal Complete Verifiable Example
Full error message
System information
The text was updated successfully, but these errors were encountered: