You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Matrix as grid with changing central meridian doesn't work well for gridline grids #3844
So 1-2 days go by, an automatic OS update happened over night, so GMT_LIBRARY_PATH was unset. However, I am missing another step before I can sy import pygmt, something about switching from base to pygmt or a setup step?
Start this session with a clean slate: Any gmt.conf files in the usual search path directories are ignored [Default starts session with the prevailing user settings].
So back to the original issue: Since we are passing reference we simply use the grid. It gets projected, in gmt_grd_project there will be loops over input and output nodes (you remember this from last week). So there will be two sets of meridians taht are used (lon = -180 and lon = 180) which are exactly the same. So those should technically be given a 0.5 weight so that in averaging many nodes they should not count more. Normally (i.e., grdfiles) we do not see this (or possibly never noticed) because we read int the grid with rotation, so the repeated columns are at the two separate sides. Now they show up in the middle.
I will see if ti is possibly to insert the weight of 0.5.
Since the history file is read in GMT_Create_Session, it has already been ingested when begin -C is parsed. Thus, I need to reset the history. I could not recreate the problem on the command line, so suspect it is interfering with the matri/grdimage stuff.
There should be no instances where an old gmt.history file should be used by a new modern script, -C or not. I think I will always reset history when gmt begin is called. It is different for the settings.
Activity
PaulWessel commentedon Aug 5, 2020
Will look tomorrow. I know the issue: When we rotate the central longitude the repeated columns at -180 and 180 need to collapse to one.
PaulWessel commentedon Aug 5, 2020
So 1-2 days go by, an automatic OS update happened over night, so GMT_LIBRARY_PATH was unset. However, I am missing another step before I can sy import pygmt, something about switching from base to pygmt or a setup step?
seisman commentedon Aug 5, 2020
Yes, you need to activate your conda environment by
conda activate pygmt.PaulWessel commentedon Aug 5, 2020
??? My outputs look like this (with master):
seisman commentedon Aug 5, 2020
The script generates 4 figures. Which one?
PaulWessel commentedon Aug 5, 2020
They are all like that (just a sliver near the boundary), I think this one was matrix_g.png
seisman commentedon Aug 5, 2020
This makes no sense. Perhaps try
pygmt.show_versions()and see if you're using the correct GMT or PyGMT version?PaulWessel commentedon Aug 5, 2020
Makes perfect sense. There was an old gmt.history in the directory I started python:
GMT 6 Session common arguments shelf
BEGIN GMT 6.2.0
B 0g10
J M
JM M15c
JQ Q15/6i
R -115/-100/55/60
@l 1
END
and the python script latched onto that. SHould not pygmt start a new session and no gmt.history is used?
seisman commentedon Aug 5, 2020
You mean the gmt begin -C?
Does it also ignore gmt.history?
PaulWessel commentedon Aug 5, 2020
So back to the original issue: Since we are passing reference we simply use the grid. It gets projected, in gmt_grd_project there will be loops over input and output nodes (you remember this from last week). So there will be two sets of meridians taht are used (lon = -180 and lon = 180) which are exactly the same. So those should technically be given a 0.5 weight so that in averaging many nodes they should not count more. Normally (i.e., grdfiles) we do not see this (or possibly never noticed) because we read int the grid with rotation, so the repeated columns are at the two separate sides. Now they show up in the middle.
I will see if ti is possibly to insert the weight of 0.5.
PaulWessel commentedon Aug 5, 2020
If you start with begin -C then clearly we leak that through. Give it a test bu using my history file above and confirm the problem.
PaulWessel commentedon Aug 5, 2020
Testing a fix for this. Now it passes:
Normalized Absolute
============ ==========
Red: 0.0054440957 1.4
Green: 0.0035965496 0.9
Blue: 0.0052102560 1.3
Total: 0.0048207923 1.2
versus before it was
Green: 0.0050802491 1.3
Blue: 0.0066723388 1.7
Total: 0.0065441590 1.7
All tests still pass so I am making a PR.
PaulWessel commentedon Aug 5, 2020
Since the history file is read in GMT_Create_Session, it has already been ingested when begin -C is parsed. Thus, I need to reset the history. I could not recreate the problem on the command line, so suspect it is interfering with the matri/grdimage stuff.
PaulWessel commentedon Aug 5, 2020
There should be no instances where an old gmt.history file should be used by a new modern script, -C or not. I think I will always reset history when gmt begin is called. It is different for the settings.
Ignore classic history when modern session starts
Ignore classic history when modern session starts (#3851)
Ignore classic history when modern session starts (#3851)
Ignore classic history when modern session starts (#3851) (#3852)
seisman commentedon Aug 6, 2020
Closed by #3849.