@@ -41,33 +41,25 @@ class GMTRemoteDataset(NamedTuple):
4141
4242 Attributes
4343 ----------
44- title : str
45- The title of the dataset, used in error messages.
46- name : str
47- The name assigned as an attribute to the DataArray.
48- long_name : str
49- The long name assigned as an attribute to the DataArray.
50- units : str
44+ description : str
45+ The name assigned as an attribute to the DataArray.
46+ units : str, None
5147 The units of the values in the DataArray.
5248 resolutions : dict
5349 Dictionary of available resolution as keys and Resolution objects as values.
5450 extra_attributes : dict
5551 A dictionary of extra or unique attributes of the dataset.
5652 """
5753
58- title : str
59- name : str
60- long_name : str
54+ description : str
6155 units : str | None
6256 resolutions : dict [str , Resolution ]
6357 extra_attributes : dict
6458
6559
6660datasets = {
6761 "earth_age" : GMTRemoteDataset (
68- title = "seafloor age" ,
69- name = "seafloor_age" ,
70- long_name = "age of seafloor crust" ,
62+ description = "EarthByte Earth seafloor crustal age" ,
7163 units = "Myr" ,
7264 extra_attributes = {"horizontal_datum" : "WGS84" },
7365 resolutions = {
@@ -84,10 +76,8 @@ class GMTRemoteDataset(NamedTuple):
8476 "01m" : Resolution ("01m" , registrations = ["gridline" ], tiled = True ),
8577 },
8678 ),
87- "earth_free_air_anomaly" : GMTRemoteDataset (
88- title = "free air anomaly" ,
89- name = "free_air_anomaly" ,
90- long_name = "IGPP Earth Free-Air Anomaly" ,
79+ "earth_faa" : GMTRemoteDataset (
80+ description = "IGPP Earth free-air anomaly" ,
9181 units = "mGal" ,
9282 extra_attributes = {"horizontal_datum" : "WGS84" },
9383 resolutions = {
@@ -104,10 +94,30 @@ class GMTRemoteDataset(NamedTuple):
10494 "01m" : Resolution ("01m" , registrations = ["pixel" ], tiled = True ),
10595 },
10696 ),
97+ "earth_gebco" : GMTRemoteDataset (
98+ description = "GEBCO Earth relief" ,
99+ units = "meters" ,
100+ extra_attributes = {"vertical_datum" : "EGM96" , "horizontal_datum" : "WGS84" },
101+ resolutions = {
102+ "01d" : Resolution ("01d" ),
103+ "30m" : Resolution ("30m" ),
104+ "20m" : Resolution ("20m" ),
105+ "15m" : Resolution ("15m" ),
106+ "10m" : Resolution ("10m" ),
107+ "06m" : Resolution ("06m" ),
108+ "05m" : Resolution ("05m" , tiled = True ),
109+ "04m" : Resolution ("04m" , tiled = True ),
110+ "03m" : Resolution ("03m" , tiled = True ),
111+ "02m" : Resolution ("02m" , tiled = True ),
112+ "01m" : Resolution ("01m" , tiled = True ),
113+ "30s" : Resolution ("30s" , tiled = True ),
114+ "15s" : Resolution ("15s" , registrations = ["pixel" ], tiled = True ),
115+ "03s" : Resolution ("03s" , registrations = ["gridline" ], tiled = True ),
116+ "01s" : Resolution ("01s" , registrations = ["gridline" ], tiled = True ),
117+ },
118+ ),
107119 "earth_geoid" : GMTRemoteDataset (
108- title = "Earth geoid" ,
109- name = "earth_geoid" ,
110- long_name = "EGM2008 Earth Geoid" ,
120+ description = "EGM2008 Earth geoid" ,
111121 units = "m" ,
112122 extra_attributes = {"horizontal_datum" : "WGS84" },
113123 resolutions = {
@@ -124,10 +134,30 @@ class GMTRemoteDataset(NamedTuple):
124134 "01m" : Resolution ("01m" , registrations = ["gridline" ], tiled = True ),
125135 },
126136 ),
127- "earth_magnetic_anomaly" : GMTRemoteDataset (
128- title = "Earth magnetic anomaly" ,
129- name = "magnetic_anomaly" ,
130- long_name = "Earth magnetic anomaly" ,
137+ "earth_igpp" : GMTRemoteDataset (
138+ description = "IGPP Earth relief" ,
139+ units = "meters" ,
140+ extra_attributes = {"vertical_datum" : "EGM96" , "horizontal_datum" : "WGS84" },
141+ resolutions = {
142+ "01d" : Resolution ("01d" ),
143+ "30m" : Resolution ("30m" ),
144+ "20m" : Resolution ("20m" ),
145+ "15m" : Resolution ("15m" ),
146+ "10m" : Resolution ("10m" ),
147+ "06m" : Resolution ("06m" ),
148+ "05m" : Resolution ("05m" , tiled = True ),
149+ "04m" : Resolution ("04m" , tiled = True ),
150+ "03m" : Resolution ("03m" , tiled = True ),
151+ "02m" : Resolution ("02m" , tiled = True ),
152+ "01m" : Resolution ("01m" , tiled = True ),
153+ "30s" : Resolution ("30s" , tiled = True ),
154+ "15s" : Resolution ("15s" , registrations = ["pixel" ], tiled = True ),
155+ "03s" : Resolution ("03s" , registrations = ["gridline" ], tiled = True ),
156+ "01s" : Resolution ("01s" , registrations = ["gridline" ], tiled = True ),
157+ },
158+ ),
159+ "earth_mag" : GMTRemoteDataset (
160+ description = "EMAG2 Earth Magnetic Anomaly Model" ,
131161 units = "nT" ,
132162 extra_attributes = {"horizontal_datum" : "WGS84" },
133163 resolutions = {
@@ -144,9 +174,7 @@ class GMTRemoteDataset(NamedTuple):
144174 },
145175 ),
146176 "earth_mask" : GMTRemoteDataset (
147- title = "Earth mask" ,
148- name = "earth_mask" ,
149- long_name = "Mask of land and water features" ,
177+ description = "GSHHG Earth mask" ,
150178 units = None ,
151179 extra_attributes = {"horizontal_datum" : "WGS84" },
152180 resolutions = {
@@ -165,34 +193,8 @@ class GMTRemoteDataset(NamedTuple):
165193 "15s" : Resolution ("15s" ),
166194 },
167195 ),
168- "earth_relief" : GMTRemoteDataset (
169- title = "Earth relief" ,
170- name = "elevation" ,
171- long_name = "Earth elevation relative to the geoid" ,
172- units = "meters" ,
173- extra_attributes = {"vertical_datum" : "EGM96" , "horizontal_datum" : "WGS84" },
174- resolutions = {
175- "01d" : Resolution ("01d" ),
176- "30m" : Resolution ("30m" ),
177- "20m" : Resolution ("20m" ),
178- "15m" : Resolution ("15m" ),
179- "10m" : Resolution ("10m" ),
180- "06m" : Resolution ("06m" ),
181- "05m" : Resolution ("05m" , tiled = True ),
182- "04m" : Resolution ("04m" , tiled = True ),
183- "03m" : Resolution ("03m" , tiled = True ),
184- "02m" : Resolution ("02m" , tiled = True ),
185- "01m" : Resolution ("01m" , tiled = True ),
186- "30s" : Resolution ("30s" , tiled = True ),
187- "15s" : Resolution ("15s" , registrations = ["pixel" ], tiled = True ),
188- "03s" : Resolution ("03s" , registrations = ["gridline" ], tiled = True ),
189- "01s" : Resolution ("01s" , registrations = ["gridline" ], tiled = True ),
190- },
191- ),
192196 "earth_vgg" : GMTRemoteDataset (
193- title = "Earth vertical gravity gradient" ,
194- name = "earth_vgg" ,
195- long_name = "IGPP Earth Vertical Gravity Gradient" ,
197+ description = "IGPP Earth vertical gravity gradient" ,
196198 units = "Eotvos" ,
197199 extra_attributes = {"horizontal_datum" : "WGS84" },
198200 resolutions = {
@@ -210,9 +212,7 @@ class GMTRemoteDataset(NamedTuple):
210212 },
211213 ),
212214 "earth_wdmam" : GMTRemoteDataset (
213- title = "WDMAM magnetic anomaly" ,
214- name = "wdmam" ,
215- long_name = "World Digital Magnetic Anomaly Map" ,
215+ description = "WDMAM World Digital Magnetic Anomaly Map" ,
216216 units = "nT" ,
217217 extra_attributes = {"horizontal_datum" : "WGS84" },
218218 resolutions = {
@@ -228,9 +228,7 @@ class GMTRemoteDataset(NamedTuple):
228228 },
229229 ),
230230 "mars_relief" : GMTRemoteDataset (
231- title = "Mars relief" ,
232- name = "mars_relief" ,
233- long_name = "NASA Mars (MOLA) relief" ,
231+ description = "NASA Mars (MOLA) relief" ,
234232 units = "meters" ,
235233 extra_attributes = {},
236234 resolutions = {
@@ -251,9 +249,7 @@ class GMTRemoteDataset(NamedTuple):
251249 },
252250 ),
253251 "moon_relief" : GMTRemoteDataset (
254- title = "Moon relief" ,
255- name = "moon_relief" ,
256- long_name = "USGS Moon (LOLA) relief" ,
252+ description = "USGS Moon (LOLA) relief" ,
257253 units = "meters" ,
258254 extra_attributes = {},
259255 resolutions = {
@@ -274,9 +270,7 @@ class GMTRemoteDataset(NamedTuple):
274270 },
275271 ),
276272 "mercury_relief" : GMTRemoteDataset (
277- title = "Mercury relief" ,
278- name = "mercury_relief" ,
279- long_name = "USGS Mercury relief" ,
273+ description = "USGS Mercury relief" ,
280274 units = "meters" ,
281275 extra_attributes = {},
282276 resolutions = {
@@ -295,9 +289,7 @@ class GMTRemoteDataset(NamedTuple):
295289 },
296290 ),
297291 "pluto_relief" : GMTRemoteDataset (
298- title = "Pluto relief" ,
299- name = "pluto_relief" ,
300- long_name = "USGS Pluto relief" ,
292+ description = "USGS Pluto relief" ,
301293 units = "meters" ,
302294 extra_attributes = {},
303295 resolutions = {
@@ -316,9 +308,7 @@ class GMTRemoteDataset(NamedTuple):
316308 },
317309 ),
318310 "venus_relief" : GMTRemoteDataset (
319- title = "Venus relief" ,
320- name = "venus_relief" ,
321- long_name = "NASA Magellan Venus relief" ,
311+ description = "NASA Magellan Venus relief" ,
322312 units = "meters" ,
323313 extra_attributes = {},
324314 resolutions = {
@@ -388,7 +378,7 @@ def _load_remote_dataset(
388378 # Check resolution
389379 if resolution not in dataset .resolutions :
390380 raise GMTInvalidInput (
391- f"Invalid resolution '{ resolution } ' for { dataset .title } dataset. "
381+ f"Invalid resolution '{ resolution } ' for { dataset .description } dataset. "
392382 f"Available resolutions are: { ', ' .join (dataset .resolutions )} ."
393383 )
394384 resinfo = dataset .resolutions [resolution ]
@@ -401,7 +391,7 @@ def _load_remote_dataset(
401391 if registration not in resinfo .registrations :
402392 raise GMTInvalidInput (
403393 f"{ registration } registration is not available for the "
404- f"{ resolution } { dataset .title } dataset. Only "
394+ f"{ resolution } { dataset .description } dataset. Only "
405395 f"{ resinfo .registrations [0 ]} registration is available."
406396 )
407397 else :
@@ -414,7 +404,7 @@ def _load_remote_dataset(
414404 fname = f"@{ dataset_prefix } { resolution } _{ registration [0 ]} "
415405 if resinfo .tiled and region is None :
416406 raise GMTInvalidInput (
417- f"'region' is required for { dataset .title } resolution '{ resolution } '."
407+ f"'region' is required for { dataset .description } resolution '{ resolution } '."
418408 )
419409
420410 # Currently, only grids are supported. Will support images in the future.
@@ -434,8 +424,7 @@ def _load_remote_dataset(
434424 grid .encoding ["source" ] = source
435425
436426 # Add some metadata to the grid
437- grid .name = dataset .name
438- grid .attrs ["long_name" ] = dataset .long_name
427+ grid .attrs ["description" ] = dataset .description
439428 if dataset .units :
440429 grid .attrs ["units" ] = dataset .units
441430 for key , value in dataset .extra_attributes .items ():
0 commit comments