Skip to content

Commit

Permalink
Only set Conventions = CF-1.7 attribute for NetCDF grid type
Browse files Browse the repository at this point in the history
Remove hardcoded attribute that was only meant for NetCDF files, so that GeoTIFF files won't have it.
  • Loading branch information
weiji14 committed Jun 20, 2024
1 parent a3c6c14 commit 5888e10
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pygmt/datatypes/header.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 5888e10

Please sign in to comment.