diff --git a/pygmt/datatypes/header.py b/pygmt/datatypes/header.py index 04e10ac0c72..ab109521131 100644 --- a/pygmt/datatypes/header.py +++ b/pygmt/datatypes/header.py @@ -203,7 +203,8 @@ 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 == 18: # Grid file format: ns = GMT netCDF format + attrs["Conventions"] = "CF-1.7" attrs["title"] = self.title.decode() attrs["history"] = self.command.decode() attrs["description"] = self.remark.decode()