November 2018
Beginner to intermediate
214 pages
5h 2m
English
We will make a basemap and apply to it a terminator called date-time. The terminator is a division on the Earth's surface between day and night. Use the nightshade method that basemap provides and call utcnow, as shown here:
# Terminator 2: Judgement Datetime (nightshade)from datetime import datetimem = Basemap()setup_map(m)m.nightshade(datetime.utcnow())plt.show()
We see that it is daytime in Europe and night time in Asia or Australia, and, hence, we can see the curve of the Earth's surface.
To use a different projection, we will use projection= 'ortho', lan_0=0, lon_0=0, as shown in the following code:
# Terminator 2: Judgement Datetime (nightshade)from datetime import datetimem = Basemap(projection='ortho', ...
Read now
Unlock full access