Skip to content

Commit

Permalink
Tilted grid show
Browse files Browse the repository at this point in the history
  • Loading branch information
natgeo-wong committed Jul 26, 2024
1 parent 96a0f23 commit 4bf7fc8
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/extract/show.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,25 @@ function show(io::IO, grd::RectGrid)
)
end

function show(io::IO, grd::TiltGrid)
nlon = length(grd.ilon)
nlat = length(grd.ilat)
mask = grd.mask
print(
io,
"The Polygonal Grid has the following properties:\n",
" Grid Bounds (grid) : ", grd.grid, '\n',
" Longitude Indices (ilon) : ", grd.ilon, '\n',
" Latitude Indices (ilat) : ", grd.ilat, '\n',
" Longitude Points (lon) : ", grd.lon, '\n',
" Latitude Points (lat) : ", grd.lat, '\n',
" Rotated X Points (rotX) : ", grd.rotX, '\n',
" Rotated Y Points (rotX) : ", grd.rotY, '\n',
" Region Size (nlon * nlat) : $(nlon) lon points x $(nlat) lat points\n",
" Region Mask (sum(mask) / (nlon * nlat)) : $(sum(isone.(mask))) / $(nlon*nlat)\n"
)
end

function show(io::IO, grd::PolyGrid)
nlon = length(grd.ilon)
nlat = length(grd.ilat)
Expand Down

0 comments on commit 4bf7fc8

Please sign in to comment.