@@ -41,33 +41,25 @@ class GMTRemoteDataset(NamedTuple):
41
41
42
42
Attributes
43
43
----------
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
51
47
The units of the values in the DataArray.
52
48
resolutions : dict
53
49
Dictionary of available resolution as keys and Resolution objects as values.
54
50
extra_attributes : dict
55
51
A dictionary of extra or unique attributes of the dataset.
56
52
"""
57
53
58
- title : str
59
- name : str
60
- long_name : str
54
+ description : str
61
55
units : str | None
62
56
resolutions : dict [str , Resolution ]
63
57
extra_attributes : dict
64
58
65
59
66
60
datasets = {
67
61
"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" ,
71
63
units = "Myr" ,
72
64
extra_attributes = {"horizontal_datum" : "WGS84" },
73
65
resolutions = {
@@ -84,10 +76,8 @@ class GMTRemoteDataset(NamedTuple):
84
76
"01m" : Resolution ("01m" , registrations = ["gridline" ], tiled = True ),
85
77
},
86
78
),
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" ,
91
81
units = "mGal" ,
92
82
extra_attributes = {"horizontal_datum" : "WGS84" },
93
83
resolutions = {
@@ -104,10 +94,30 @@ class GMTRemoteDataset(NamedTuple):
104
94
"01m" : Resolution ("01m" , registrations = ["pixel" ], tiled = True ),
105
95
},
106
96
),
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
+ ),
107
119
"earth_geoid" : GMTRemoteDataset (
108
- title = "Earth geoid" ,
109
- name = "earth_geoid" ,
110
- long_name = "EGM2008 Earth Geoid" ,
120
+ description = "EGM2008 Earth geoid" ,
111
121
units = "m" ,
112
122
extra_attributes = {"horizontal_datum" : "WGS84" },
113
123
resolutions = {
@@ -124,10 +134,30 @@ class GMTRemoteDataset(NamedTuple):
124
134
"01m" : Resolution ("01m" , registrations = ["gridline" ], tiled = True ),
125
135
},
126
136
),
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" ,
131
161
units = "nT" ,
132
162
extra_attributes = {"horizontal_datum" : "WGS84" },
133
163
resolutions = {
@@ -144,9 +174,7 @@ class GMTRemoteDataset(NamedTuple):
144
174
},
145
175
),
146
176
"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" ,
150
178
units = None ,
151
179
extra_attributes = {"horizontal_datum" : "WGS84" },
152
180
resolutions = {
@@ -165,34 +193,8 @@ class GMTRemoteDataset(NamedTuple):
165
193
"15s" : Resolution ("15s" ),
166
194
},
167
195
),
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
- ),
192
196
"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" ,
196
198
units = "Eotvos" ,
197
199
extra_attributes = {"horizontal_datum" : "WGS84" },
198
200
resolutions = {
@@ -210,9 +212,7 @@ class GMTRemoteDataset(NamedTuple):
210
212
},
211
213
),
212
214
"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" ,
216
216
units = "nT" ,
217
217
extra_attributes = {"horizontal_datum" : "WGS84" },
218
218
resolutions = {
@@ -228,9 +228,7 @@ class GMTRemoteDataset(NamedTuple):
228
228
},
229
229
),
230
230
"mars_relief" : GMTRemoteDataset (
231
- title = "Mars relief" ,
232
- name = "mars_relief" ,
233
- long_name = "NASA Mars (MOLA) relief" ,
231
+ description = "NASA Mars (MOLA) relief" ,
234
232
units = "meters" ,
235
233
extra_attributes = {},
236
234
resolutions = {
@@ -251,9 +249,7 @@ class GMTRemoteDataset(NamedTuple):
251
249
},
252
250
),
253
251
"moon_relief" : GMTRemoteDataset (
254
- title = "Moon relief" ,
255
- name = "moon_relief" ,
256
- long_name = "USGS Moon (LOLA) relief" ,
252
+ description = "USGS Moon (LOLA) relief" ,
257
253
units = "meters" ,
258
254
extra_attributes = {},
259
255
resolutions = {
@@ -274,9 +270,7 @@ class GMTRemoteDataset(NamedTuple):
274
270
},
275
271
),
276
272
"mercury_relief" : GMTRemoteDataset (
277
- title = "Mercury relief" ,
278
- name = "mercury_relief" ,
279
- long_name = "USGS Mercury relief" ,
273
+ description = "USGS Mercury relief" ,
280
274
units = "meters" ,
281
275
extra_attributes = {},
282
276
resolutions = {
@@ -295,9 +289,7 @@ class GMTRemoteDataset(NamedTuple):
295
289
},
296
290
),
297
291
"pluto_relief" : GMTRemoteDataset (
298
- title = "Pluto relief" ,
299
- name = "pluto_relief" ,
300
- long_name = "USGS Pluto relief" ,
292
+ description = "USGS Pluto relief" ,
301
293
units = "meters" ,
302
294
extra_attributes = {},
303
295
resolutions = {
@@ -316,9 +308,7 @@ class GMTRemoteDataset(NamedTuple):
316
308
},
317
309
),
318
310
"venus_relief" : GMTRemoteDataset (
319
- title = "Venus relief" ,
320
- name = "venus_relief" ,
321
- long_name = "NASA Magellan Venus relief" ,
311
+ description = "NASA Magellan Venus relief" ,
322
312
units = "meters" ,
323
313
extra_attributes = {},
324
314
resolutions = {
@@ -388,7 +378,7 @@ def _load_remote_dataset(
388
378
# Check resolution
389
379
if resolution not in dataset .resolutions :
390
380
raise GMTInvalidInput (
391
- f"Invalid resolution '{ resolution } ' for { dataset .title } dataset. "
381
+ f"Invalid resolution '{ resolution } ' for { dataset .description } dataset. "
392
382
f"Available resolutions are: { ', ' .join (dataset .resolutions )} ."
393
383
)
394
384
resinfo = dataset .resolutions [resolution ]
@@ -401,7 +391,7 @@ def _load_remote_dataset(
401
391
if registration not in resinfo .registrations :
402
392
raise GMTInvalidInput (
403
393
f"{ registration } registration is not available for the "
404
- f"{ resolution } { dataset .title } dataset. Only "
394
+ f"{ resolution } { dataset .description } dataset. Only "
405
395
f"{ resinfo .registrations [0 ]} registration is available."
406
396
)
407
397
else :
@@ -414,7 +404,7 @@ def _load_remote_dataset(
414
404
fname = f"@{ dataset_prefix } { resolution } _{ registration [0 ]} "
415
405
if resinfo .tiled and region is None :
416
406
raise GMTInvalidInput (
417
- f"'region' is required for { dataset .title } resolution '{ resolution } '."
407
+ f"'region' is required for { dataset .description } resolution '{ resolution } '."
418
408
)
419
409
420
410
# Currently, only grids are supported. Will support images in the future.
@@ -434,8 +424,7 @@ def _load_remote_dataset(
434
424
grid .encoding ["source" ] = source
435
425
436
426
# 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
439
428
if dataset .units :
440
429
grid .attrs ["units" ] = dataset .units
441
430
for key , value in dataset .extra_attributes .items ():
0 commit comments