Skip to content

Commit

Permalink
Modification of GMT_utils.jl and test_GMT.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
adbayonao committed Jan 27, 2025
1 parent 42e233f commit 6284a62
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion ext/GMT_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,13 @@ function import_GeoTIFF(fname::String; fieldname = :layer1, negative = false, is
if length(size(G.image)) == 3
data = permutedims(G.image, [2, 1, 3])
elseif length(size(G.image)) == 2
data[:, :, 1] = G.image'
if size(G.image)==(nx,ny)
data[:,:,1] = G.image
elseif size(G.image)==(ny,nx)
data[:,:,1] = G.image'

Check warning on line 164 in ext/GMT_utils.jl

View check run for this annotation

Codecov / codecov/patch

ext/GMT_utils.jl#L163-L164

Added lines #L163 - L164 were not covered by tests
else
error("unknown size; ")

Check warning on line 166 in ext/GMT_utils.jl

View check run for this annotation

Codecov / codecov/patch

ext/GMT_utils.jl#L166

Added line #L166 was not covered by tests
end
end

end
Expand Down
2 changes: 1 addition & 1 deletion test/test_GMT.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ test_fwd = import_GeoTIFF("test_files/length_fwd.tif", fieldname = :forward)
@test maximum(test_fwd.fields.forward) 33.17775km

test2 = import_GeoTIFF("test_files/UTM2GTIF.TIF")
@test test2.fields.layer1[20, 20] == 105.0
@test test2.fields.layer1[20, 20] == 233.0

0 comments on commit 6284a62

Please sign in to comment.