Skip to content

Commit

Permalink
Debug grid extraction for 3D and 4D
Browse files Browse the repository at this point in the history
  • Loading branch information
natgeo-wong committed Jun 22, 2023
1 parent 99e2679 commit 7c3ae0f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "GeoRegions"
uuid = "b001f823-fa75-4bff-bf55-6610c8f3688a"
authors = ["natgeo-wong <[email protected]>"]
version = "5.1.2"
version = "5.1.3"

[deps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Expand Down
6 changes: 3 additions & 3 deletions src/ExtractGrid.jl
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ function extractGrid(
ilat = ggrd.ilat; nlat = length(ggrd.ilat)
n3D = size(odata,3)
mask = ggrd.mask
ndata = zeros(nlon,nlat)
ndata = zeros(nlon,nlat,n3D)
for i3D = 1 : n3D, glat in 1 : nlat, glon in 1 : nlon
ndata[glon,glat,i3D] = odata[ilon[glon],ilat[glat],i3D] * mask[glon,glat]
end
Expand Down Expand Up @@ -179,7 +179,7 @@ function extractGrid(
ilat = ggrd.ilat; nlat = length(ggrd.ilat)
n3D = size(odata,3)
n4D = size(odata,4)
ndata = zeros(nlon,nlat,n3D)
ndata = zeros(nlon,nlat,n3D,n4D)
for i4D = 1 : n4D, i3D = 1 : n3D, glat in 1 : nlat, glon in 1 : nlon
ndata[glon,glat,i3D,i4D] = odata[ilon[glon],ilat[glat],i3D,i4D]
end
Expand Down Expand Up @@ -216,7 +216,7 @@ function extractGrid(
n3D = size(odata,3)
n4D = size(odata,4)
mask = ggrd.mask
ndata = zeros(nlon,nlat)
ndata = zeros(nlon,nlat,n3D,n4D)
for i4D = 1 : n4D, i3D = 1 : n3D, glat in 1 : nlat, glon in 1 : nlon
ndata[glon,glat,i3D,i4D] = odata[ilon[glon],ilat[glat],i3D,i4D] * mask[glon,glat]
end
Expand Down

2 comments on commit 7c3ae0f

@natgeo-wong
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register

Release Notes:

  • Debug grid extraction

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/86034

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v5.1.3 -m "<description of version>" 7c3ae0fc84ed88888384f1c1660ece1eb3663aa2
git push origin v5.1.3

Please sign in to comment.