Bug #1115

use of pssolar near equinox results in error

Added by Eelco about 1 month ago. Updated about 1 month ago.

Status:ClosedStart date:2017-06-17
Priority:NormalDue date:
Assignee:Paul% Done:


Target version:Candidate for next bugfix release
Affected version:5.x-svn Platform:Mac OS X


I am creating an animation of the whole Earth in orthographic projection showing the terminator using pssolar. When I try to render the frames for some times close to the (spring) equinox, I get the following cryptic error message:

% gmt pssolar -JG50/50/3c -Rg -Td+d2010-03-21T08:00:00.000 -Ggray > test.ps
pssolar: Error: Two points in input list are antipodal - great circle resampling is not unique!
pssolar: Error: Fix input data or use project -A to generate athe desired great circle by providing an azimuth.

If the date/time is set to slightly earlier or later, there is no problem. I have also tried some other projections, and they also provide no problem.

I would not know what to do with the suggestion in the second line of the error message.

I am using GMT 5.4.1, which is not yet listed in the "affected versions" dropdown.

pssolar_test.mp4 - pssolar test movie (MP4) (371 KB) Eelco, 2017-06-19 18:46


#1 Updated by Paul about 1 month ago

  • Status changed from New to In Progress

Our algorithm that converts the polygon to include polar caps gets fooled here. The first two points in the internal data are
61.808328927 -90
151.81039971 -89.0067015529
so since it it touching the pole it is flagged as a polar cap. Later, this involves doing a detour to the pole but we end up going to the wrong pole... Will investigate.
You can try

gmt pssolar -Td+d2010-03-21T08:00:00.000 -M | gmt psxy -JH0/15c -Rg -Baf -Gred > t.ps

Does that give the right answer? I know it is not your projection of choice but curious if the polygon is correct.

#2 Updated by Eelco about 1 month ago

Thanks for your explanation. And yes, using other projections, such as your example, the polygon looks fine to me.

I have attached an example of what I'm trying to achieve. I'm using pssolar to create a semi-transparent overlay of the part of the Earth that is in shadow. But at solstice it seems the entire Earth is in sunlight, when using this projection. A couple of hours later (not included to keep the movie file small), the shadow reappears.

#3 Updated by Paul about 1 month ago

I see, so you are tracing the a satellite's orbit over the rotating earth? We will try to track down if the problem originates in the polygon made in pssolar or in the plotting machinery that deals with clipping etc due to projections.

#4 Updated by Paul about 1 month ago

  • Assignee set to Paul
  • Target version set to Candidate for next bugfix release
  • % Done changed from 0 to 50

I think I fixed it (at least this particular case). See if r18403 works for you.

#5 Updated by Eelco about 1 month ago

Yes, it works like a charm now!

Many thanks, Eelco

#6 Updated by Paul about 1 month ago

  • Status changed from In Progress to Closed
  • % Done changed from 50 to 100

Thanks, closed as fixed.

Also available in: Atom PDF