Skip to content

Commit

Permalink
add test_basinmask
Browse files Browse the repository at this point in the history
  • Loading branch information
ggebbie committed Mar 19, 2024
1 parent 5802cff commit b0b054a
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions test/test_basinmask.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# for testing, put everything in the data directory
diagpath = datadir() #diagdir(expt)
# print output here
path_out = datadir() #sig1dir(expt)
!isdir(path_out) && mkdir(path_out)

pathout = datadir() #regpolesdir(expt)
!isdir(pathout) && mkdir(pathout)

maskname = ["Pacific","South China Sea","East China Sea","Okhotsk Sea","Java Sea","Japan Sea","Timor Sea"]
hemisphere = :both
Lsmooth = 5
southlat = -15
northlat = 15

msk = basin_mask(maskname,γ,southlat=southlat,northlat=northlat)
@test maximum(msk) == 1.0
@test minimum(msk) == 0.0

@test iszero(maximum(nancount(msk)))
@test sum(nancount(MeshArrays.mask(msk,NaN,0.0))) > 0

msk_smooth = basin_mask(maskname,γ,southlat=southlat,northlat=northlat,Lsmooth=Lsmooth)
maximum(nancount(msk_smooth))
# any values between 0 and 1? yes.
@test maximum(MeshArrays.mask(msk,0.0)) > maximum(MeshArrays.mask(msk_smooth,0.0)) # smooth always less than 1

0 comments on commit b0b054a

Please sign in to comment.