Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

ex25.rst 2.3 KB

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
  1. .. _example_25:
  2. (25) Global distribution of antipodes
  3. -------------------------------------
  4. As promised in Example :ref:`example_23`, we will study
  5. antipodes. The antipode of a point at :math:`(\phi, \lambda)` is the
  6. point at :math:`(-\phi, \lambda + 180)`. We seek an answer to the
  7. question that has plagued so many for so long: Given the distribution of
  8. land and ocean, how often is the antipode of a point on land also on
  9. land? And what about marine antipodes? We use :doc:`grdlandmask </grdlandmask>` and
  10. :doc:`grdmath </grdmath>` to map these distributions and
  11. calculate the area of the Earth (in percent) that goes with each of the
  12. three possibilities. To make sense of our
  13. :doc:`grdmath </grdmath>` equations below, note that we
  14. first calculate a grid that is +1 when a point and its antipode is on
  15. land, -1 if both are in the ocean, and 0 elsewhere. We then seek to
  16. calculate the area distribution of dry antipodes by only pulling out the
  17. nodes that equal +1. As each point represent an area approximated by
  18. :math:`\Delta \phi \times \Delta \lambda` where the
  19. :math:`\Delta \lambda` term's actual dimension depends on
  20. :math:`\cos (\phi)`, we need to allow for that shrinkage, normalize our
  21. sum to that of the whole area of the Earth, and finally convert that
  22. ratio to percent. Since the :math:`\Delta \lambda`, :math:`\Delta \phi`
  23. terms appear twice in these expressions they cancel out, leaving the
  24. somewhat intractable expressions below where the sum of
  25. :math:`\cos (\phi)` for all :math:`\phi` is known to equal :math:`2N_y / \pi`:
  26. In the end we obtain a funny-looking map depicting the antipodal
  27. distribution as well as displaying in legend form the requested
  28. percentages. Note that the script is
  29. set to evaluate a global 30 minute grid for expediency (*D = 30*),
  30. hence several smaller land masses that do have terrestrial antipodes do
  31. not show up. If you want a more accurate map you can set the parameter
  32. *D* to a smaller increment (try 5 and wait a few minutes).
  33. The call to :doc:`grdimage </grdimage>` includes the
  34. ``-Sn`` to suspend interpolation and only return the value of the
  35. nearest neighbor. This option is particularly practical for plotting
  36. categorical data, like these, that should not be interpolated.
  37. .. literalinclude:: /_verbatim/ex25.txt
  38. :language: bash
  39. .. figure:: /_images/ex25.*
  40. :width: 500 px
  41. :align: center
  42. Global distribution of antipodes.
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...