Skip to content
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

Set hinge to zero in gallery example plot #408

Merged
merged 2 commits into from
May 11, 2023

Conversation

Esteban82
Copy link
Member

@Esteban82 Esteban82 commented May 11, 2023

Set the hinge (white color) to zero in the gallery example plot for the global topo-free gravity disturbances.

At the beginnig of the scripts says: "The gravity disturbance is the observed gravity minus the normal gravity (boule.Ellipsoid.normal_gravity). The signal that is left is assumed to be due to the differences between the actual Earth and the reference ellipsoid." So, the value 0 has a special meaning.

But, in the figure the hinge (white color) of the CPT is around 100. I think that it should be in 0.

To fix it, I propose to force the hinge at 0 (+h0).

At the beginnig of the scripts says: "The gravity disturbance is the observed gravity minus the normal gravity (boule.Ellipsoid.normal_gravity). The signal that is left is assumed to be due to the differences between the actual Earth and the reference ellipsoid." So, the value 0 has a special meaning. 

But, in the figure the hinge (white color) of the CPT is around 100. I think that it should be in 0.

To fix it, I propose to force the hinge at 0 (+h0).
@santisoler
Copy link
Member

Nice catch @Esteban82! Now I'm thinking if we should use the polar cmap instead, as it's the one being used for the gravity disturbance example (https://www.fatiando.org/harmonica/latest/gallery/gravity_disturbance.html#sphx-glr-gallery-gravity-disturbance-py).

@santisoler
Copy link
Member

I just updated this branch after I merged #409 to main. Now tests should pass here as well.

@Esteban82
Copy link
Member Author

we should use the polar

Probably yes for a paper. But for the gallery I think it is better to have figures with differents colors.

@santisoler santisoler changed the title Update gravity_disturbance_topofree.py Set hinge to zero in gallery example plot of topo-free gravity disturbances May 11, 2023
@santisoler santisoler changed the title Set hinge to zero in gallery example plot of topo-free gravity disturbances Set hinge to zero in gallery example plot of topo-free disturbances May 11, 2023
@santisoler santisoler changed the title Set hinge to zero in gallery example plot of topo-free disturbances Set hinge to zero in gallery example plot May 11, 2023
@santisoler santisoler merged commit 1da8196 into fatiando:main May 11, 2023
@santisoler
Copy link
Member

Thanks @Esteban82 for the contribution!

@Esteban82 Esteban82 deleted the patch-2 branch May 11, 2023 21:29
@santisoler
Copy link
Member

@Esteban82 I was checking the most recent build of the topo-free disturbance and noticed that the hinge is not set to zero: https://www.fatiando.org/harmonica/dev/gallery/gravity_disturbance_topofree.html#sphx-glr-gallery-gravity-disturbance-topofree-py

I was wondering if there was any change in pygmt that makes the hinge not be centered around zero even when using cmap="vik+h0". Do you know what's going on?

@Esteban82
Copy link
Member Author

Hi Santi! Recently I had the same impression that something happened to the hinge. I will check it.

@leouieda
Copy link
Member

I've also been having this issue in my classes. I think it may be a GMT bug. When using makcpt the hinge works but not when letting GMT make the cpt automatically.

@Esteban82
Copy link
Member Author

I already reported the bug (GenericMappingTools/gmt#8102).

@Esteban82
Copy link
Member Author

@santisoler the bug was solved in the master version.

@santisoler
Copy link
Member

Awesome response time! Thanks a lot @Esteban82!

I was also thinking that for PyGMT it would probably be nice to have some argument to set the hinge to zero, besides of adding "+h0" to the colormap. I think is hard to find out how to do it by reading the docs. But this should probably worth opening an issue on PyGMT.

Thanks again for taking care of this issue! Looking forward to see the next release of GMT and see the Harmonica docs updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants