From 5f96b77203da0c276687c8a4d6ab8e091206d348 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= <94163266+yvonnefroehlich@users.noreply.github.com> Date: Tue, 24 Sep 2024 09:14:18 +0200 Subject: [PATCH 01/11] DOC/projections: Simplify links in the projection table by using the titles of the examples (#3407) Co-authored-by: Dongdong Tian --- doc/techref/projections.md | 62 +++++++++---------- examples/projections/azim/azim_equidistant.py | 4 +- .../azim/azim_general_perspective.py | 6 +- .../azim/azim_general_stereographic.py | 4 +- examples/projections/azim/azim_gnomonic.py | 4 +- examples/projections/azim/azim_lambert.py | 4 +- .../projections/azim/azim_orthographic.py | 4 +- examples/projections/conic/conic_albers.py | 4 +- .../projections/conic/conic_equidistant.py | 4 +- examples/projections/conic/conic_lambert.py | 2 +- examples/projections/conic/polyconic.py | 2 +- examples/projections/cyl/cyl_cassini.py | 4 +- examples/projections/cyl/cyl_equal_area.py | 4 +- examples/projections/cyl/cyl_equidistant.py | 4 +- examples/projections/cyl/cyl_mercator.py | 4 +- examples/projections/cyl/cyl_miller.py | 4 +- .../projections/cyl/cyl_oblique_mercator_1.py | 4 +- .../projections/cyl/cyl_oblique_mercator_2.py | 4 +- .../projections/cyl/cyl_oblique_mercator_3.py | 4 +- examples/projections/cyl/cyl_stereographic.py | 4 +- .../cyl/cyl_transverse_mercator.py | 4 +- .../cyl/cyl_universal_transverse_mercator.py | 4 +- examples/projections/misc/misc_eckertIV.py | 4 +- examples/projections/misc/misc_eckertVI.py | 4 +- examples/projections/misc/misc_hammer.py | 4 +- examples/projections/misc/misc_mollweide.py | 4 +- examples/projections/misc/misc_robinson.py | 4 +- examples/projections/misc/misc_sinusoidal.py | 4 +- .../projections/misc/misc_van_der_grinten.py | 4 +- .../projections/misc/misc_winkel_tripel.py | 4 +- 30 files changed, 88 insertions(+), 88 deletions(-) diff --git a/doc/techref/projections.md b/doc/techref/projections.md index ac28f305847..16d659f5372 100644 --- a/doc/techref/projections.md +++ b/doc/techref/projections.md @@ -16,34 +16,34 @@ The table below shows the projection codes for the 31 GMT map projections: | PyGMT Projection Argument | Projection Name | | --- | --- | -| **A**{{ lon0 }}/{{ lat0 }}[/*horizon*]/*width* | {doc}`Lambert azimuthal equal area ` | -| **B**{{ lon0 }}/{{ lat0 }}/{{ lat1 }}/{{ lat2 }}/*width* | {doc}`Albers conic equal area ` | -| **C**{{ lon0 }}/{{ lat0 }}/*width* | {doc}`Cassini cylindrical ` | -| **Cyl_stere**/[{{ lon0 }}/[{{ lat0 }}/]]*width* | {doc}`Cylindrical stereographic ` | -| **D**{{ lon0 }}/{{ lat0 }}/{{ lat1 }}/{{ lat2 }}/*width* | {doc}`Equidistant conic ` | -| **E**{{ lon0 }}/{{ lat0 }}[/*horizon*]/*width* | {doc}`Azimuthal equidistant ` | -| **F**{{ lon0 }}/{{ lat0 }}[/*horizon*]/*width* | {doc}`Azimuthal gnomonic ` | -| **G**{{ lon0 }}/{{ lat0 }}[/*horizon*]/*width* | {doc}`Azimuthal orthographic ` | -| **G**{{ lon0 }}/{{ lat0 }}/*width*[**+a***azimuth*][**+t***tilt*][**+v***vwidth*/*vheight*][**+w***twist*][**+z***altitude*] | {doc}`General perspective ` | -| **H**[{{ lon0 }}/]*width* | {doc}`Hammer equal area ` | -| **I**[{{ lon0 }}/]*width* | {doc}`Sinusoidal equal area ` | -| **J**[{{ lon0 }}/]*width* | {doc}`Miller cylindrical ` | -| **Kf**[{{ lon0 }}/]*width* | {doc}`Eckert IV equal area ` | -| **Ks**[{{ lon0 }}/]*width* | {doc}`Eckert VI equal area ` | -| **L**{{ lon0 }}/{{ lat0 }}/{{ lat1 }}/{{ lat2 }}/*width* | {doc}`Lambert conic conformal ` | -| **M**[{{ lon0 }}/[{{ lat0 }}/]]*width* | {doc}`Mercator cylindrical ` | -| **N**[{{ lon0 }}/]*width* | {doc}`Robinson ` | -| **Oa**{{ lon0 }}/{{ lat0 }}/*azimuth*/*width*[**+v**] | {doc}`Oblique Mercator, 1: origin and azimuth ` | -| **Ob**{{ lon0 }}/{{ lat0 }}/{{ lon1 }}/{{ lat1 }}/*width*[**+v**] | {doc}`Oblique Mercator, 2: two points ` | -| **Oc**{{ lon0 }}/{{ lat0 }}/{{ lonp }}/{{ latp }}/*width*[**+v**] | {doc}`Oblique Mercator, 3: origin and pole ` | -| **P***width*[**+a**][**+f**[**e**\|**p**\|*radius*]][**+r***offset*][**+t***origin*][**+z**[**p**\|*radius*]] | {doc}`Polar ` [azimuthal] ({math}`\theta, r`) (or cylindrical) | -| **Poly**/[{{ lon0 }}/[{{ lat0 }}/]]*width* | {doc}`Polyconic ` | -| **Q**[{{ lon0 }}/[{{ lat0 }}/]]*width* | {doc}`Equidistant cylindrica ` | -| **R**[{{ lon0 }}/]*width* | {doc}`Winkel Tripel ` | -| **S**{{ lon0 }}/{{ lat0 }}[/*horizon*]/*width* | {doc}`General stereographic ` | -| **T**{{ lon0 }}[/{{ lat0 }}]/*width* | {doc}`Transverse Mercator ` | -| **U***zone*/*width* | {doc}`Universal Transverse Mercator (UTM) ` | -| **V**[{{ lon0 }}/]*width* | {doc}`Van der Grinten ` | -| **W**[{{ lon0 }}/]*width* | {doc}`Mollweide ` | -| **X***width*[**l**\|**p***exp*\|**T**\|**t**][/*height*[**l**\|**p***exp*\|**T**\|**t**]][**d**] | {doc}`Linear `, {doc}`logarithmic `, {doc}`power `, and time | -| **Y**{{ lon0 }}/{{ lat0 }}/*width* | {doc}`Cylindrical equal area ` | +| **A**{{ lon0 }}/{{ lat0 }}[/*horizon*]/*width* | {doc}`/projections/azim/azim_lambert` | +| **B**{{ lon0 }}/{{ lat0 }}/{{ lat1 }}/{{ lat2 }}/*width* | {doc}`/projections/conic/conic_albers` | +| **C**{{ lon0 }}/{{ lat0 }}/*width* | {doc}`/projections/cyl/cyl_cassini` | +| **Cyl_stere**/[{{ lon0 }}/[{{ lat0 }}/]]*width* | {doc}`/projections/cyl/cyl_stereographic` | +| **D**{{ lon0 }}/{{ lat0 }}/{{ lat1 }}/{{ lat2 }}/*width* | {doc}`/projections/conic/conic_equidistant` | +| **E**{{ lon0 }}/{{ lat0 }}[/*horizon*]/*width* | {doc}`/projections/azim/azim_equidistant` | +| **F**{{ lon0 }}/{{ lat0 }}[/*horizon*]/*width* | {doc}`/projections/azim/azim_gnomonic` | +| **G**{{ lon0 }}/{{ lat0 }}[/*horizon*]/*width* | {doc}`/projections/azim/azim_orthographic` | +| **G**{{ lon0 }}/{{ lat0 }}/*width*[**+a***azimuth*][**+t***tilt*][**+v***vwidth*/*vheight*][**+w***twist*][**+z***altitude*] | {doc}`/projections/azim/azim_general_perspective` | +| **H**[{{ lon0 }}/]*width* | {doc}`/projections/misc/misc_hammer` | +| **I**[{{ lon0 }}/]*width* | {doc}`/projections/misc/misc_sinusoidal` | +| **J**[{{ lon0 }}/]*width* | {doc}`/projections/cyl/cyl_miller` | +| **Kf**[{{ lon0 }}/]*width* | {doc}`/projections/misc/misc_eckertIV` | +| **Ks**[{{ lon0 }}/]*width* | {doc}`/projections/misc/misc_eckertVI` | +| **L**{{ lon0 }}/{{ lat0 }}/{{ lat1 }}/{{ lat2 }}/*width* | {doc}`/projections/conic/conic_lambert` | +| **M**[{{ lon0 }}/[{{ lat0 }}/]]*width* | {doc}`/projections/cyl/cyl_mercator` | +| **N**[{{ lon0 }}/]*width* | {doc}`/projections/misc/misc_robinson` | +| **Oa**{{ lon0 }}/{{ lat0 }}/*azimuth*/*width*[**+v**] | {doc}`/projections/cyl/cyl_oblique_mercator_1` | +| **Ob**{{ lon0 }}/{{ lat0 }}/{{ lon1 }}/{{ lat1 }}/*width*[**+v**] | {doc}`/projections/cyl/cyl_oblique_mercator_2` | +| **Oc**{{ lon0 }}/{{ lat0 }}/{{ lonp }}/{{ latp }}/*width*[**+v**] | {doc}`/projections/cyl/cyl_oblique_mercator_3` | +| **P***width*[**+a**][**+f**[**e**\|**p**\|*radius*]][**+r***offset*][**+t***origin*][**+z**[**p**\|*radius*]] | Polar {doc}`azimuthal ` ({math}`\theta, r`) or cylindrical | +| **Poly**/[{{ lon0 }}/[{{ lat0 }}/]]*width* | {doc}`/projections/conic/polyconic` | +| **Q**[{{ lon0 }}/[{{ lat0 }}/]]*width* | {doc}`/projections/cyl/cyl_equidistant` | +| **R**[{{ lon0 }}/]*width* | {doc}`/projections/misc/misc_winkel_tripel` | +| **S**{{ lon0 }}/{{ lat0 }}[/*horizon*]/*width* | {doc}`/projections/azim/azim_general_stereographic` | +| **T**{{ lon0 }}[/{{ lat0 }}]/*width* | {doc}`/projections/cyl/cyl_transverse_mercator` | +| **U***zone*/*width* | {doc}`/projections/cyl/cyl_universal_transverse_mercator` | +| **V**[{{ lon0 }}/]*width* | {doc}`/projections/misc/misc_van_der_grinten` | +| **W**[{{ lon0 }}/]*width* | {doc}`/projections/misc/misc_mollweide` | +| **X***width*[**l**\|**p***exp*\|**T**\|**t**][/*height*[**l**\|**p***exp*\|**T**\|**t**]][**d**] | Cartesian {doc}`linear `, {doc}`logarithmic `, {doc}`power `, and time | +| **Y**{{ lon0 }}/{{ lat0 }}/*width* | {doc}`/projections/cyl/cyl_equal_area` | diff --git a/examples/projections/azim/azim_equidistant.py b/examples/projections/azim/azim_equidistant.py index f6a1d7af890..bda1eb03cbf 100644 --- a/examples/projections/azim/azim_equidistant.py +++ b/examples/projections/azim/azim_equidistant.py @@ -1,6 +1,6 @@ r""" -Azimuthal Equidistant -===================== +Azimuthal equidistant projection +================================ The main advantage of this projection is that distances from the projection center are displayed in correct proportions. Also directions measured from the diff --git a/examples/projections/azim/azim_general_perspective.py b/examples/projections/azim/azim_general_perspective.py index 3a4d565835c..784aadfdb74 100644 --- a/examples/projections/azim/azim_general_perspective.py +++ b/examples/projections/azim/azim_general_perspective.py @@ -1,8 +1,8 @@ r""" -General Perspective -=================== +Perspective projection +====================== -The general perspective projection imitates the view of the Earth from a finite +The perspective projection imitates the view of the Earth from a finite point in space. In a full view of the earth one third of its surface area can be seen. diff --git a/examples/projections/azim/azim_general_stereographic.py b/examples/projections/azim/azim_general_stereographic.py index 9b16c32c214..6b527acb994 100644 --- a/examples/projections/azim/azim_general_stereographic.py +++ b/examples/projections/azim/azim_general_stereographic.py @@ -1,6 +1,6 @@ r""" -General Stereographic -===================== +General stereographic projection +================================ This map projection is a conformal, azimuthal projection. It is mainly used with a projection center in one of the poles. Then meridians appear as straight diff --git a/examples/projections/azim/azim_gnomonic.py b/examples/projections/azim/azim_gnomonic.py index 632c4430e9f..3fdfe813c85 100644 --- a/examples/projections/azim/azim_gnomonic.py +++ b/examples/projections/azim/azim_gnomonic.py @@ -1,6 +1,6 @@ r""" -Gnomonic -======== +Gnomonic projection +=================== The point of perspective of the gnomonic projection lies at the center of the Earth. As a consequence great circles (orthodromes) on the surface of the Earth diff --git a/examples/projections/azim/azim_lambert.py b/examples/projections/azim/azim_lambert.py index 7768c73bae1..e4f0359848c 100644 --- a/examples/projections/azim/azim_lambert.py +++ b/examples/projections/azim/azim_lambert.py @@ -1,6 +1,6 @@ r""" -Lambert Azimuthal Equal Area -============================ +Lambert azimuthal equal-area projection +======================================= This projection was developed by Johann Heinrich Lambert in 1772 and is typically used for mapping large regions like continents and hemispheres. It is diff --git a/examples/projections/azim/azim_orthographic.py b/examples/projections/azim/azim_orthographic.py index a51557c682d..0583adc46a3 100644 --- a/examples/projections/azim/azim_orthographic.py +++ b/examples/projections/azim/azim_orthographic.py @@ -1,6 +1,6 @@ r""" -Orthographic -============ +Orthographic projection +======================= This is a perspective projection like the general perspective, but with the difference that the point of perspective lies in infinite distance. diff --git a/examples/projections/conic/conic_albers.py b/examples/projections/conic/conic_albers.py index 0db955534b7..e09ca9e42f9 100644 --- a/examples/projections/conic/conic_albers.py +++ b/examples/projections/conic/conic_albers.py @@ -1,6 +1,6 @@ r""" -Albers Conic Equal Area -======================= +Albers conic equal-area projection +================================== This projection, developed by Heinrich C. Albers in 1805, is predominantly used to map regions of large east-west extent, in particular the United States. It diff --git a/examples/projections/conic/conic_equidistant.py b/examples/projections/conic/conic_equidistant.py index 00eb0d42510..d00c879b2b9 100644 --- a/examples/projections/conic/conic_equidistant.py +++ b/examples/projections/conic/conic_equidistant.py @@ -1,6 +1,6 @@ r""" -Equidistant conic -================= +Equidistant conic projection +============================ The equidistant conic projection was described by the Greek philosopher Claudius Ptolemy about A.D. 150. It is neither conformal or equal-area, but diff --git a/examples/projections/conic/conic_lambert.py b/examples/projections/conic/conic_lambert.py index 4af1171b02d..92eaf9d78d3 100644 --- a/examples/projections/conic/conic_lambert.py +++ b/examples/projections/conic/conic_lambert.py @@ -1,5 +1,5 @@ r""" -Lambert Conic Conformal Projection +Lambert conic conformal projection ================================== This conic projection was designed by the Alsatian mathematician Johann diff --git a/examples/projections/conic/polyconic.py b/examples/projections/conic/polyconic.py index 59606937108..ddf661ee2a5 100644 --- a/examples/projections/conic/polyconic.py +++ b/examples/projections/conic/polyconic.py @@ -1,5 +1,5 @@ r""" -Polyconic Projection +Polyconic projection ==================== The polyconic projection, in Europe usually referred to as the American diff --git a/examples/projections/cyl/cyl_cassini.py b/examples/projections/cyl/cyl_cassini.py index 9986286fcb0..0cfef5d6530 100644 --- a/examples/projections/cyl/cyl_cassini.py +++ b/examples/projections/cyl/cyl_cassini.py @@ -1,6 +1,6 @@ r""" -Cassini Cylindrical -============================ +Cassini cylindrical projection +============================== This cylindrical projection was developed in 1745 by César-François Cassini de Thury for the survey of France. It is occasionally called Cassini-Soldner since diff --git a/examples/projections/cyl/cyl_equal_area.py b/examples/projections/cyl/cyl_equal_area.py index 25be7dd1b2f..ac429beae28 100644 --- a/examples/projections/cyl/cyl_equal_area.py +++ b/examples/projections/cyl/cyl_equal_area.py @@ -1,6 +1,6 @@ r""" -Cylindrical equal-area -====================== +Cylindrical equal-area projection +================================= This cylindrical projection is actually several projections, depending on what latitude is selected as the standard parallel. However, they are all equal area diff --git a/examples/projections/cyl/cyl_equidistant.py b/examples/projections/cyl/cyl_equidistant.py index 0aaba052696..dad092e167a 100644 --- a/examples/projections/cyl/cyl_equidistant.py +++ b/examples/projections/cyl/cyl_equidistant.py @@ -1,6 +1,6 @@ r""" -Cylindrical equidistant -======================= +Cylindrical equidistant projection +================================== This simple cylindrical projection is really a linear scaling of longitudes and latitudes. The most common form is the Plate Carrée projection, where the diff --git a/examples/projections/cyl/cyl_mercator.py b/examples/projections/cyl/cyl_mercator.py index 8ee02b2661f..8e654af00f1 100644 --- a/examples/projections/cyl/cyl_mercator.py +++ b/examples/projections/cyl/cyl_mercator.py @@ -1,6 +1,6 @@ r""" -Mercator -======== +Mercator projection +=================== The Mercator projection takes its name from the Flemish cartographer Gheert Cremer, better known as Gerardus Mercator, who presented it in 1569. The diff --git a/examples/projections/cyl/cyl_miller.py b/examples/projections/cyl/cyl_miller.py index 706f9dfb5aa..ebfaed19770 100644 --- a/examples/projections/cyl/cyl_miller.py +++ b/examples/projections/cyl/cyl_miller.py @@ -1,6 +1,6 @@ r""" -Miller cylindrical -================== +Miller cylindrical projection +============================= This cylindrical projection, presented by Osborn Maitland Miller of the American Geographic Society in 1942, is neither equal nor conformal. All diff --git a/examples/projections/cyl/cyl_oblique_mercator_1.py b/examples/projections/cyl/cyl_oblique_mercator_1.py index c83089b39ba..5d5973a51cf 100644 --- a/examples/projections/cyl/cyl_oblique_mercator_1.py +++ b/examples/projections/cyl/cyl_oblique_mercator_1.py @@ -1,6 +1,6 @@ r""" -Oblique Mercator, 1: origin and azimuth -======================================= +Oblique Mercator projection, 1: origin and azimuth +================================================== Oblique configurations of the cylinder give rise to the oblique Mercator projection. It is particularly useful when mapping regions of large lateral diff --git a/examples/projections/cyl/cyl_oblique_mercator_2.py b/examples/projections/cyl/cyl_oblique_mercator_2.py index 28f50939ba6..bf4bb555691 100644 --- a/examples/projections/cyl/cyl_oblique_mercator_2.py +++ b/examples/projections/cyl/cyl_oblique_mercator_2.py @@ -1,6 +1,6 @@ r""" -Oblique Mercator, 2: two points -=============================== +Oblique Mercator projection, 2: two points +========================================== Oblique configurations of the cylinder give rise to the oblique Mercator projection. It is particularly useful when mapping regions of large lateral diff --git a/examples/projections/cyl/cyl_oblique_mercator_3.py b/examples/projections/cyl/cyl_oblique_mercator_3.py index 5e5d48664ca..af55e8f51e5 100644 --- a/examples/projections/cyl/cyl_oblique_mercator_3.py +++ b/examples/projections/cyl/cyl_oblique_mercator_3.py @@ -1,6 +1,6 @@ r""" -Oblique Mercator, 3: origin and pole -==================================== +Oblique Mercator projection, 3: origin and pole +=============================================== Oblique configurations of the cylinder give rise to the oblique Mercator projection. It is particularly useful when mapping regions of large lateral diff --git a/examples/projections/cyl/cyl_stereographic.py b/examples/projections/cyl/cyl_stereographic.py index 41e2e21e3e0..00079d29823 100644 --- a/examples/projections/cyl/cyl_stereographic.py +++ b/examples/projections/cyl/cyl_stereographic.py @@ -1,6 +1,6 @@ r""" -Cylindrical Stereographic -========================= +Cylindrical stereographic projection +==================================== The cylindrical stereographic projections are certainly not as notable as other cylindrical projections, but are still used because of their relative diff --git a/examples/projections/cyl/cyl_transverse_mercator.py b/examples/projections/cyl/cyl_transverse_mercator.py index 14b1faecb49..62c7988ebc2 100644 --- a/examples/projections/cyl/cyl_transverse_mercator.py +++ b/examples/projections/cyl/cyl_transverse_mercator.py @@ -1,6 +1,6 @@ r""" -Transverse Mercator -=================== +Transverse Mercator projection +============================== The transverse Mercator was invented by Johann Heinrich Lambert in 1772. In this projection the cylinder touches a meridian along which there is no diff --git a/examples/projections/cyl/cyl_universal_transverse_mercator.py b/examples/projections/cyl/cyl_universal_transverse_mercator.py index 1cd0556c303..815eb2fe639 100644 --- a/examples/projections/cyl/cyl_universal_transverse_mercator.py +++ b/examples/projections/cyl/cyl_universal_transverse_mercator.py @@ -1,6 +1,6 @@ r""" -Universal Transverse Mercator -============================= +Universal Transverse Mercator projection +======================================== A particular subset of the :doc:`transverse Merctor ` diff --git a/examples/projections/misc/misc_eckertIV.py b/examples/projections/misc/misc_eckertIV.py index d4b6c754f86..6880ebbd513 100644 --- a/examples/projections/misc/misc_eckertIV.py +++ b/examples/projections/misc/misc_eckertIV.py @@ -1,6 +1,6 @@ r""" -Eckert IV -========= +Eckert IV equal-area projection +=============================== The Eckert IV projection, presented by the German cartographer Max Eckert-Greiffendorff in 1906, is a pseudo-cylindrical equal-area projection. diff --git a/examples/projections/misc/misc_eckertVI.py b/examples/projections/misc/misc_eckertVI.py index 04e0ef06217..1d49feed512 100644 --- a/examples/projections/misc/misc_eckertVI.py +++ b/examples/projections/misc/misc_eckertVI.py @@ -1,6 +1,6 @@ r""" -Eckert VI -========= +Eckert VI equal-area projection +=============================== The Eckert VI projections, presented by the German cartographer Max Eckert-Greiffendorff in 1906, is a pseudo-cylindrical equal-area projection. diff --git a/examples/projections/misc/misc_hammer.py b/examples/projections/misc/misc_hammer.py index 9f0259751a9..db881f30ac9 100644 --- a/examples/projections/misc/misc_hammer.py +++ b/examples/projections/misc/misc_hammer.py @@ -1,6 +1,6 @@ r""" -Hammer -====== +Hammer projection +================= The equal-area Hammer projection, first presented by the German mathematician Ernst von Hammer in 1892, is also known as Hammer-Aitoff (the Aitoff projection diff --git a/examples/projections/misc/misc_mollweide.py b/examples/projections/misc/misc_mollweide.py index 3d2a72cf587..28525c5e6ab 100644 --- a/examples/projections/misc/misc_mollweide.py +++ b/examples/projections/misc/misc_mollweide.py @@ -1,6 +1,6 @@ r""" -Mollweide -========= +Mollweide projection +==================== This pseudo-cylindrical, equal-area projection was developed by the German mathematician and astronomer Karl Brandan Mollweide in 1805. Parallels are diff --git a/examples/projections/misc/misc_robinson.py b/examples/projections/misc/misc_robinson.py index dc9b4c7a9fe..1e33687232e 100644 --- a/examples/projections/misc/misc_robinson.py +++ b/examples/projections/misc/misc_robinson.py @@ -1,6 +1,6 @@ r""" -Robinson -======== +Robinson projection +=================== The Robinson projection, presented by the American geographer and cartographer Arthur H. Robinson in 1963, is a modified cylindrical projection that is diff --git a/examples/projections/misc/misc_sinusoidal.py b/examples/projections/misc/misc_sinusoidal.py index 0b5cb56a96b..af6d484bfd8 100644 --- a/examples/projections/misc/misc_sinusoidal.py +++ b/examples/projections/misc/misc_sinusoidal.py @@ -1,6 +1,6 @@ r""" -Sinusoidal -========== +Sinusoidal projection +===================== The sinusoidal projection is one of the oldest known projections, is equal-area, and has been used since the mid-16th century. It has also been diff --git a/examples/projections/misc/misc_van_der_grinten.py b/examples/projections/misc/misc_van_der_grinten.py index f052cdfed27..a48c5213bed 100644 --- a/examples/projections/misc/misc_van_der_grinten.py +++ b/examples/projections/misc/misc_van_der_grinten.py @@ -1,6 +1,6 @@ r""" -Van der Grinten -=============== +Van der Grinten projection +========================== The Van der Grinten projection, presented by Alphons J. van der Grinten in 1904, is neither equal-area nor conformal. Central meridian and Equator are diff --git a/examples/projections/misc/misc_winkel_tripel.py b/examples/projections/misc/misc_winkel_tripel.py index d72a0a8acbd..301e552858f 100644 --- a/examples/projections/misc/misc_winkel_tripel.py +++ b/examples/projections/misc/misc_winkel_tripel.py @@ -1,6 +1,6 @@ r""" -Winkel Tripel -============= +Winkel Tripel projection +======================== In 1921, the German mathematician Oswald Winkel made a projection that was to strike a compromise between the properties of three elements (area, angle and From 3478729368e200c4375f38bf25aa47eda59c80da Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Tue, 24 Sep 2024 17:14:20 +0800 Subject: [PATCH 02/11] CI: Pin ghostscript<10 for GMT 6.3/6.4 in the GMT Legacy Tests workflow (#3452) --- .github/workflows/ci_tests_legacy.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci_tests_legacy.yaml b/.github/workflows/ci_tests_legacy.yaml index d38e3acde7e..94cb15bef51 100644 --- a/.github/workflows/ci_tests_legacy.yaml +++ b/.github/workflows/ci_tests_legacy.yaml @@ -61,6 +61,7 @@ jobs: create-args: >- python=3.10 gmt=${{ matrix.gmt_version }} + ghostscript<10 numpy pandas<2 xarray From 838b0e1a25149a4c414b896b4c95a7a9b6e10ed6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 25 Sep 2024 10:13:09 +1200 Subject: [PATCH 03/11] Build(deps): Bump pypa/gh-action-pypi-publish from 1.10.1 to 1.10.2 (#3454) Bumps [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish) from 1.10.1 to 1.10.2. - [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases) - [Commits](https://github.com/pypa/gh-action-pypi-publish/compare/v1.10.1...v1.10.2) --- updated-dependencies: - dependency-name: pypa/gh-action-pypi-publish dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/publish-to-pypi.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml index 03777be4b44..edc73395a4c 100644 --- a/.github/workflows/publish-to-pypi.yml +++ b/.github/workflows/publish-to-pypi.yml @@ -75,10 +75,10 @@ jobs: ls -lh dist/ - name: Publish to Test PyPI - uses: pypa/gh-action-pypi-publish@v1.10.1 + uses: pypa/gh-action-pypi-publish@v1.10.2 with: repository-url: https://test.pypi.org/legacy/ - name: Publish to PyPI if: startsWith(github.ref, 'refs/tags') - uses: pypa/gh-action-pypi-publish@v1.10.1 + uses: pypa/gh-action-pypi-publish@v1.10.2 From 9045f46e2a537eed51fdc47e2309ee6d645c4bfc Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Thu, 26 Sep 2024 10:47:48 +0800 Subject: [PATCH 04/11] GeoPandas: Explicitly convert columns with overflow integers avoid OverflowError with fiona 1.10 (#3455) --- pygmt/helpers/tempfile.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pygmt/helpers/tempfile.py b/pygmt/helpers/tempfile.py index 0177f17d435..57a1e370fbf 100644 --- a/pygmt/helpers/tempfile.py +++ b/pygmt/helpers/tempfile.py @@ -153,6 +153,7 @@ def tempfile_from_geojson(geojson): if dtype in {"int", "int64"}: overflow = geojson[col].abs().max() > 2**31 - 1 schema["properties"][col] = "float" if overflow else "int32" + geojson[col] = geojson[col].astype(schema["properties"][col]) ogrgmt_kwargs["schema"] = schema else: # GeoPandas v1.x. # The default engine "pyogrio" doesn't support the 'schema' parameter From 63539262f6edc71ee1c7e99f1179fd115749131e Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Thu, 26 Sep 2024 13:27:57 +0800 Subject: [PATCH 05/11] CI: Add a separate CI job on Ubuntu to test geopandas v0.x (#3420) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Yvonne Fröhlich <94163266+yvonnefroehlich@users.noreply.github.com> Co-authored-by: Wei Ji <23487320+weiji14@users.noreply.github.com> --- .github/workflows/ci_tests.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/ci_tests.yaml b/.github/workflows/ci_tests.yaml index e271c3cd51c..0b0d3d20d79 100644 --- a/.github/workflows/ci_tests.yaml +++ b/.github/workflows/ci_tests.yaml @@ -79,6 +79,15 @@ jobs: pandas-version: '' xarray-version: '' optional-packages: ' contextily geopandas ipython pyarrow rioxarray sphinx-gallery' + # The job below is for testing geopandas v0.x on Ubuntu. + # The python-version here can't be the versions in the matrix.python-version + # defined above. Otherwise, other jobs will be overridden by this one. + - os: 'ubuntu-latest' + python-version: '3.11' # Can't be 3.10 or 3.12. + numpy-version: '1.24' + pandas-version: '' + xarray-version: '' + optional-packages: ' geopandas<1' timeout-minutes: 30 defaults: From 89021cdb1bfea805780612e52ced974e1afdc216 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Thu, 26 Sep 2024 13:56:56 +0800 Subject: [PATCH 06/11] Remove unused CSS classes for style.css (#3453) --- doc/_static/style.css | 51 ------------------------------------------- 1 file changed, 51 deletions(-) diff --git a/doc/_static/style.css b/doc/_static/style.css index 7ab009e31ec..221c9dca37c 100644 --- a/doc/_static/style.css +++ b/doc/_static/style.css @@ -48,38 +48,6 @@ p { font-size: 4em; } -.api-module { - margin-bottom: 80px; -} - -.youtube-embed { - max-width: 600px; - margin-bottom: 24px; -} - -.video-container { - position:relative; - padding-bottom:56.25%; - padding-top:30px; - height:0; - overflow:hidden; -} - -.video-container iframe, .video-container object, .video-container embed { - position:absolute; - top:0; - left:0; - width:100%; - height:100%; -} - -/*.wy-menu-vertical header, .wy-menu-vertical p.caption {*/ - /*font-size: 90%;*/ - /*font-weight: bold;*/ - /*color: #eeeeee;*/ - /*letter-spacing: 0.12em;*/ -/*}*/ - .wy-nav-content { max-width: 1000px; } @@ -137,22 +105,6 @@ html.writer-html5 .rst-content dl.field-list { } } -/* Style for the copy button */ -/* Safe to remove for sphinx-copybutton>0.3.1 - * https://github.com/executablebooks/sphinx-copybutton/pull/107 - */ -a.copybtn { - position: absolute; - top: .2em; - right: .2em; - width: 1.3em; - height: 1.3em; - opacity: .3; - transition: opacity 0.5s; - border: none; - user-select: none; -} - /* Atkinson Hyperlegible regular */ @font-face { font-family: "Atkinson Hyperlegible"; @@ -189,9 +141,6 @@ a.copybtn { .sphx-glr-thumbcontainer { border: solid #d6d6d6 1px!important; text-align: center!important; -} - -.sphx-glr-thumbcontainer { min-height: 240px!important; min-width: 180px!important; } From ac101589f5fc35f0d3b25534af02e858a9205531 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Sat, 28 Sep 2024 14:31:46 +0800 Subject: [PATCH 07/11] SPEC 0: Set minimum supported versions to pandas>=2.0 and xarray>=2023.04 (#3460) --- .github/workflows/ci_tests.yaml | 4 ++-- environment.yml | 4 ++-- pyproject.toml | 4 ++-- requirements.txt | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci_tests.yaml b/.github/workflows/ci_tests.yaml index 0b0d3d20d79..5d2db033abe 100644 --- a/.github/workflows/ci_tests.yaml +++ b/.github/workflows/ci_tests.yaml @@ -71,8 +71,8 @@ jobs: include: - python-version: '3.10' numpy-version: '1.24' - pandas-version: '=1.5' - xarray-version: '=2022.09' + pandas-version: '=2.0' + xarray-version: '=2023.04' optional-packages: '' - python-version: '3.12' numpy-version: '2.1' diff --git a/environment.yml b/environment.yml index 3b8d97b8ca8..85d7c845866 100644 --- a/environment.yml +++ b/environment.yml @@ -8,8 +8,8 @@ dependencies: - gmt=6.5.0 - ghostscript=10.04.0 - numpy>=1.24 - - pandas>=1.5 - - xarray>=2022.09 + - pandas>=2.0 + - xarray>=2023.04 - netCDF4 - packaging # Optional dependencies diff --git a/pyproject.toml b/pyproject.toml index 39571bf590e..74516aefd87 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -31,8 +31,8 @@ classifiers = [ ] dependencies = [ "numpy>=1.24", - "pandas>=1.5", - "xarray>=2022.09", + "pandas>=2.0", + "xarray>=2023.04", "netCDF4", "packaging", ] diff --git a/requirements.txt b/requirements.txt index c718e89cfbb..c74fbb0c511 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ # Required packages numpy>=1.24 -pandas>=1.5 -xarray>=2022.09 +pandas>=2.0 +xarray>=2023.04 netCDF4 packaging From 780f16482c7e179abe67f3441f758a259eb9d724 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= <94163266+yvonnefroehlich@users.noreply.github.com> Date: Sat, 28 Sep 2024 09:07:35 +0200 Subject: [PATCH 08/11] Combine the Oblique Mercator projection pages into one page (#3451) --- doc/techref/projections.md | 6 +- .../projections/cyl/cyl_oblique_mercator.py | 70 +++++++++++++++++++ .../projections/cyl/cyl_oblique_mercator_1.py | 34 --------- .../projections/cyl/cyl_oblique_mercator_2.py | 34 --------- .../projections/cyl/cyl_oblique_mercator_3.py | 33 --------- 5 files changed, 73 insertions(+), 104 deletions(-) create mode 100644 examples/projections/cyl/cyl_oblique_mercator.py delete mode 100644 examples/projections/cyl/cyl_oblique_mercator_1.py delete mode 100644 examples/projections/cyl/cyl_oblique_mercator_2.py delete mode 100644 examples/projections/cyl/cyl_oblique_mercator_3.py diff --git a/doc/techref/projections.md b/doc/techref/projections.md index 16d659f5372..9ca2d9dcef1 100644 --- a/doc/techref/projections.md +++ b/doc/techref/projections.md @@ -33,9 +33,9 @@ The table below shows the projection codes for the 31 GMT map projections: | **L**{{ lon0 }}/{{ lat0 }}/{{ lat1 }}/{{ lat2 }}/*width* | {doc}`/projections/conic/conic_lambert` | | **M**[{{ lon0 }}/[{{ lat0 }}/]]*width* | {doc}`/projections/cyl/cyl_mercator` | | **N**[{{ lon0 }}/]*width* | {doc}`/projections/misc/misc_robinson` | -| **Oa**{{ lon0 }}/{{ lat0 }}/*azimuth*/*width*[**+v**] | {doc}`/projections/cyl/cyl_oblique_mercator_1` | -| **Ob**{{ lon0 }}/{{ lat0 }}/{{ lon1 }}/{{ lat1 }}/*width*[**+v**] | {doc}`/projections/cyl/cyl_oblique_mercator_2` | -| **Oc**{{ lon0 }}/{{ lat0 }}/{{ lonp }}/{{ latp }}/*width*[**+v**] | {doc}`/projections/cyl/cyl_oblique_mercator_3` | +| **Oa**{{ lon0 }}/{{ lat0 }}/*azimuth*/*width*[**+v**] | Oblique Mercator projection: {doc}`1. origin and azimuth ` | +| **Ob**{{ lon0 }}/{{ lat0 }}/{{ lon1 }}/{{ lat1 }}/*width*[**+v**] | Oblique Mercator projection: {doc}`2. two points ` | +| **Oc**{{ lon0 }}/{{ lat0 }}/{{ lonp }}/{{ latp }}/*width*[**+v**] | Oblique Mercator projection: {doc}`3. origin and projection pole ` | | **P***width*[**+a**][**+f**[**e**\|**p**\|*radius*]][**+r***offset*][**+t***origin*][**+z**[**p**\|*radius*]] | Polar {doc}`azimuthal ` ({math}`\theta, r`) or cylindrical | | **Poly**/[{{ lon0 }}/[{{ lat0 }}/]]*width* | {doc}`/projections/conic/polyconic` | | **Q**[{{ lon0 }}/[{{ lat0 }}/]]*width* | {doc}`/projections/cyl/cyl_equidistant` | diff --git a/examples/projections/cyl/cyl_oblique_mercator.py b/examples/projections/cyl/cyl_oblique_mercator.py new file mode 100644 index 00000000000..0942e5183eb --- /dev/null +++ b/examples/projections/cyl/cyl_oblique_mercator.py @@ -0,0 +1,70 @@ +r""" +Oblique Mercator projection +=========================== + +Oblique configurations of the cylinder give rise to the oblique Mercator projection. +It is particularly useful when mapping regions of large lateral extent in an oblique +direction. Both parallels and meridians are complex curves. The projection was +developed in the early 1900s by several workers. + +The projection is set with **o** or **O**. There are three different specification +ways (**a**\|\ **A**, **b**\|\ **B**, **c**\|\ **C**) available. For all three +definitions, the upper case letter mean the projection pole is set in the southern +hemisphere [Default is northern hemisphere]. Align the y-axis with the optional +modifier **+v**. The figure size is set with *scale* or *width*. +""" + +# %% +# 1. Using the origin and azimuth +# ------------------------------- +# +# **oa**\|\ **oA**\ *lon0/lat0/azimuth/scale*\[**+v**] or +# **Oa**\|\ **OA**\ *lon0/lat0/azimuth/width*\[**+v**] +# +# The central meridian is set by *lon0/lat0*. The oblique equator is set by *azimuth*. + +import pygmt + +fig = pygmt.Figure() +fig.coast( + projection="Oa-120/25/-30/3c+v", + # Set bottom left and top right coordinates of the figure with "+r" + region="-122/35/-107/22+r", + frame="afg", + land="gray", +) +fig.show() + + +# %% +# 2. Using two points +# ------------------- +# +# **ob**\|\ **oB**\ *lon0/lat0/lon1/lat1/scale*\ [**+v**] or +# **Ob**\|\ **OB**\ *lon0/lat0/lon1/lat1/width*\ [**+v**] +# +# The central meridian is set by *lon0/lat0*. The oblique equator is set by *lon1/lat1*. + +fig = pygmt.Figure() +fig.coast( + projection="Ob130/35/25/35/3c", region="130/35/145/40+r", frame="afg", land="gray" +) +fig.show() + + +# %% +# 3. Using the origin and projection pole +# --------------------------------------- +# +# **oc**\|\ **oC**\ *lon0/lat0/lonp/latp/scale*\ [**+v**] or +# **Oc**\|\ **OC**\ *lon0/lat0/lonp/latp/width*\ [**+v**] +# +# The central meridian is set by *lon0/lat0*. The projection pole is set by *lonp/latp*. + +fig = pygmt.Figure() +fig.coast( + projection="Oc280/25.5/22/69/4c", region="270/20/305/25+r", frame="afg", land="gray" +) +fig.show() + +# sphinx_gallery_thumbnail_number = 3 diff --git a/examples/projections/cyl/cyl_oblique_mercator_1.py b/examples/projections/cyl/cyl_oblique_mercator_1.py deleted file mode 100644 index 5d5973a51cf..00000000000 --- a/examples/projections/cyl/cyl_oblique_mercator_1.py +++ /dev/null @@ -1,34 +0,0 @@ -r""" -Oblique Mercator projection, 1: origin and azimuth -================================================== - -Oblique configurations of the cylinder give rise to the oblique Mercator -projection. It is particularly useful when mapping regions of large lateral -extent in an oblique direction. Both parallels and meridians are complex -curves. The projection was developed in the early 1900s by several workers. - -**oa**\|\ **oA**\ *lon0/lat0/azimuth/scale*\[**+v**] or -**Oa**\|\ **OA**\ *lon0/lat0/azimuth/width*\[**+v**] - -The projection is set with **o** or **O**. The pole is set in the -northern hemisphere with **a** or the southern hemisphere -with **A**. The central meridian is set by *lon0/lat0*. The oblique equator -is set by *azimuth*. Align the y-axis -with the optional **+v**. The figure size is set with *scale* or *width*. -""" - -# %% -import pygmt - -fig = pygmt.Figure() -# Using the origin and azimuth -fig.coast( - projection="Oa-120/25/-30/6c+v", - # Set bottom left and top right coordinates of the figure with "+r" - region="-122/35/-107/22+r", - frame="afg", - land="gray", - shorelines="1/thin", - water="lightblue", -) -fig.show() diff --git a/examples/projections/cyl/cyl_oblique_mercator_2.py b/examples/projections/cyl/cyl_oblique_mercator_2.py deleted file mode 100644 index bf4bb555691..00000000000 --- a/examples/projections/cyl/cyl_oblique_mercator_2.py +++ /dev/null @@ -1,34 +0,0 @@ -r""" -Oblique Mercator projection, 2: two points -========================================== - -Oblique configurations of the cylinder give rise to the oblique Mercator -projection. It is particularly useful when mapping regions of large lateral -extent in an oblique direction. Both parallels and meridians are complex -curves. The projection was developed in the early 1900s by several workers. - -**ob**\|\ **oB**\ *lon0/lat0/lon1/lat1/scale*\ [**+v**] or -**Ob**\|\ **OB**\ *lon0/lat0/lon1/lat1/width*\ [**+v**] - -The projection is set with **o** or **O**. The pole is set in the -northern hemisphere with **b** or the southern hemisphere -with **B**. The central meridian is set by *lon0/lat0*. The oblique -equator is set by *lon1/lat1*. Align the y-axis -with the optional **+v**. The figure size is set with *scale* or *width*. -""" - -# %% -import pygmt - -fig = pygmt.Figure() -# Using the origin and two points -fig.coast( - projection="Ob130/35/25/35/6c", - # Set bottom left and top right coordinates of the figure with "+r" - region="130/35/145/40+r", - frame="afg", - land="gray", - shorelines="1/thin", - water="lightblue", -) -fig.show() diff --git a/examples/projections/cyl/cyl_oblique_mercator_3.py b/examples/projections/cyl/cyl_oblique_mercator_3.py deleted file mode 100644 index af55e8f51e5..00000000000 --- a/examples/projections/cyl/cyl_oblique_mercator_3.py +++ /dev/null @@ -1,33 +0,0 @@ -r""" -Oblique Mercator projection, 3: origin and pole -=============================================== - -Oblique configurations of the cylinder give rise to the oblique Mercator -projection. It is particularly useful when mapping regions of large lateral -extent in an oblique direction. Both parallels and meridians are complex -curves. The projection was developed in the early 1900s by several workers. - -**oc**\|\ **oC**\ *lon0/lat0/lonp/latp/scale*\ [**+v**] or -**Oc**\|\ **OC**\ *lon0/lat0/lonp/latp/width*\ [**+v**] - -The projection is set with **o** or **O**. The central meridian is set -by *lon0/lat0*. The projection pole is set by *lonp/latp* in option three. -Align the y-axis with the optional **+v**. The figure size is set -with *scale* or *width*. -""" - -# %% -import pygmt - -fig = pygmt.Figure() -# Using the origin and projection pole -fig.coast( - projection="Oc280/25.5/22/69/12c", - # Set bottom left and top right coordinates of the figure with "+r" - region="270/20/305/25+r", - frame="afg", - land="gray", - shorelines="1/thin", - water="lightblue", -) -fig.show() From 911f56b8819b6a0970a827d81ed96412308972cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= <94163266+yvonnefroehlich@users.noreply.github.com> Date: Sat, 28 Sep 2024 09:08:24 +0200 Subject: [PATCH 09/11] Mention breaking change regarding extra quotation marks around text strings in changelog v0.12.0 (#3462) Co-authored-by: Dongdong Tian Co-authored-by: Wei Ji <23487320+weiji14@users.noreply.github.com> --- doc/changes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/changes.md b/doc/changes.md index cc760f4e0f1..9cd4da5adbc 100644 --- a/doc/changes.md +++ b/doc/changes.md @@ -101,6 +101,7 @@ ### Enhancements +* **Breaking**: (Unneeded) extra double quotes around text strings (containing whitespaces) are now considered as part of the text string ([#3132](https://github.com/GenericMappingTools/pygmt/pull/3132), [#3457](https://github.com/GenericMappingTools/pygmt/issues/3457)) * pygmt.project: Add 'output_type' parameter for output in pandas/numpy/file formats ([#3110](https://github.com/GenericMappingTools/pygmt/pull/3110)) * pygmt.grdtrack: Add 'output_type' parameter for output in pandas/numpy/file formats ([#3106](https://github.com/GenericMappingTools/pygmt/pull/3106)) * pygmt.blockm*: Add 'output_type' parameter for output in pandas/numpy/file formats ([#3103](https://github.com/GenericMappingTools/pygmt/pull/3103)) From 015899bc2c2d3d712547576d16831012561e02b8 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Sat, 28 Sep 2024 21:11:54 +0800 Subject: [PATCH 10/11] Add enums GridFormat for GMT grid format ID (#3449) Co-authored-by: Wei Ji <23487320+weiji14@users.noreply.github.com> --- pygmt/enums.py | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 pygmt/enums.py diff --git a/pygmt/enums.py b/pygmt/enums.py new file mode 100644 index 00000000000..7c0984eccb9 --- /dev/null +++ b/pygmt/enums.py @@ -0,0 +1,39 @@ +""" +Enumerations for PyGMT. +""" + +from enum import IntEnum + + +class GridFormat(IntEnum): + """ + Enum for the GMT grid format ID. + + These enums are defined in 'gmt_grdio.h'. + """ + + UNKNOWN = 0 #: Unknown grid format + BF = 1 #: GMT native, C-binary format (32-bit float) + BS = 2 #: GMT native, C-binary format (16-bit integer) + RB = 3 #: SUN rasterfile format (8-bit standard) + BB = 4 #: GMT native, C-binary format (8-bit integer) + BM = 5 #: GMT native, C-binary format (bit-mask) + SF = 6 #: Golden Software Surfer format 6 (32-bit float) + CB = 7 #: GMT netCDF format (8-bit integer, deprecated) + CS = 8 #: GMT netCDF format (16-bit integer, deprecated) + CI = 9 #: GMT netCDF format (32-bit integer, deprecated) + CF = 10 #: GMT netCDF format (32-bit float, deprecated) + CD = 11 #: GMT netCDF format (64-bit float, deprecated) + RF = 12 #: GEODAS grid format GRD98 (NGDC) + BI = 13 #: GMT native, C-binary format (32-bit integer) + BD = 14 #: GMT native, C-binary format (64-bit float) + NB = 15 #: GMT netCDF format (8-bit integer) + NS = 16 #: GMT netCDF format (16-bit integer) + NI = 17 #: GMT netCDF format (32-bit integer) + NF = 18 #: GMT netCDF format (32-bit float) + ND = 19 #: GMT netCDF format (64-bit float) + SD = 20 #: Golden Software Surfer format 7 (64-bit float, read-only) + AF = 21 #: Atlantic Geoscience Center format AGC (32-bit float) + GD = 22 #: Import through GDAL + EI = 23 #: ESRI Arc/Info ASCII Grid Interchange format (ASCII integer) + EF = 24 #: ESRI Arc/Info ASCII Grid Interchange format (ASCII float) From cf48764353255adad7735e0dbd40bf7208f12f64 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Sat, 28 Sep 2024 21:12:46 +0800 Subject: [PATCH 11/11] Set the 'Conventions' attribute to 'CF-1.7' for netCDF grids only (#3463) Co-authored-by: Wei Ji <23487320+weiji14@users.noreply.github.com> --- pygmt/datatypes/header.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pygmt/datatypes/header.py b/pygmt/datatypes/header.py index 04e10ac0c72..d7806e50a24 100644 --- a/pygmt/datatypes/header.py +++ b/pygmt/datatypes/header.py @@ -6,6 +6,7 @@ from typing import Any, ClassVar import numpy as np +from pygmt.enums import GridFormat # Constants for lengths of grid header variables. # @@ -203,7 +204,14 @@ def data_attrs(self) -> dict[str, Any]: Attributes for the data variable from the grid header. """ attrs: dict[str, Any] = {} - attrs["Conventions"] = "CF-1.7" + if self.type in { + GridFormat.NB, + GridFormat.NS, + GridFormat.NI, + GridFormat.NF, + GridFormat.ND, + }: # Only set the 'Conventions' attribute for netCDF. + attrs["Conventions"] = "CF-1.7" attrs["title"] = self.title.decode() attrs["history"] = self.command.decode() attrs["description"] = self.remark.decode()