Skip to content

Commit 5888e10

Browse files
committed
Only set Conventions = CF-1.7 attribute for NetCDF grid type
Remove hardcoded attribute that was only meant for NetCDF files, so that GeoTIFF files won't have it.
1 parent a3c6c14 commit 5888e10

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pygmt/datatypes/header.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,8 @@ def data_attrs(self) -> dict[str, Any]:
203203
Attributes for the data variable from the grid header.
204204
"""
205205
attrs: dict[str, Any] = {}
206-
attrs["Conventions"] = "CF-1.7"
206+
if self.type == 18: # Grid file format: ns = GMT netCDF format
207+
attrs["Conventions"] = "CF-1.7"
207208
attrs["title"] = self.title.decode()
208209
attrs["history"] = self.command.decode()
209210
attrs["description"] = self.remark.decode()

0 commit comments

Comments
 (0)