Skip to content

Commit

Permalink
fixing test failing because of broken download urls, fixing formating…
Browse files Browse the repository at this point in the history
… and removing files at the end
  • Loading branch information
AtilaSaraiva committed Jul 25, 2024
1 parent ee5b447 commit 52dc480
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 18 deletions.
3 changes: 3 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
using SeisMain
using Test

include("test_IO.jl")
include("test_bin.jl")
include("test_patch.jl")
24 changes: 16 additions & 8 deletions test/test_IO.jl
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
using SeisMain
using Test

#From USGS, National Petroleum Reserve - Alaska Data Archive
#https://energy.usgs.gov/GeochemistryGeophysics/SeismicDataProcessingInterpretation/NPRASeismicDataArchive.aspx#3862174-data-

download("http://certmapper.cr.usgs.gov/data/NPRA/seismic/1976/125_76/PROCESSED/125_76_PT2_PR.SGY","125_76.SGY")

download_if_needed("https://saigfileserver.physics.ualberta.ca/static/Datasets/Testing/16_81_PT1_PR.SGY", "16_81_PT1_PR.SGY", sha256sum="54791e8626215d36f6ebcecc3039da2fd74f3472518f47d8e8137c81c2ccfc2f")

SegyToSeis("125_76.SGY","125_76")
d,h,ext = SeisRead("125_76")
SegyToSeis("16_81_PT1_PR.SGY","16_81_PT1_PR")
d,h,ext = SeisRead("16_81_PT1_PR")
imx = SeisMain.ExtractHeader(h,"imx")
println("size(d)=",size(d))
println("imx=",imx)
SeisWrite("125_76_copy",d,h,ext)
SeisWrite("16_81_PT1_PR_copy",d,h,ext)

for file in (
"16_81_PT1_PR",
"16_81_PT1_PR.SGY",
"16_81_PT1_PR@data@",
"16_81_PT1_PR@headers@",
"16_81_PT1_PR_copy",
"16_81_PT1_PR_copy@data@",
"16_81_PT1_PR_copy@headers@",
)
rm(joinpath(@__DIR__, file))
end
18 changes: 12 additions & 6 deletions test/test_bin.jl
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
using SeisMain
using Test

println("Testing test_bin.jl")

download("http://seismic.physics.ualberta.ca/data/prestack_section.su","section.su");
download_if_needed("https://saigfileserver.physics.ualberta.ca/static/Datasets/Testing/prestack_section.su", "section.su", sha256sum="8baaf281a36dcd5656e07e728bf97e0c1b513302b12206efbb24c3edb34d9ec8");

SegyToSeis("section.su","section",format="su",input_type="ieee");

param1 = Dict( :dmx=>15, :dmy=>15, :dh=>30, :daz=>45 );

param2 = Dict(:style=>"mxmyhaz", :min_imx=>10,:max_imx=>100, :min_imy=>35, :max_imy=>45,
:min_ih=>1, :max_ih=>6, :min_iaz=>0, :max_iaz=>7);

Expand All @@ -22,4 +19,13 @@ db,hb,eb=SeisRead("section_bin");

N =size(db)

@test N == (251, 91, 11, 6, 8)
@test N == (251, 91, 11, 6, 8)

for file in (
"section",
"section@data@",
"section@headers@",
"section.su",
)
rm(joinpath(@__DIR__, file))
end
18 changes: 14 additions & 4 deletions test/test_patch.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
using SeisMain
using Test

param2 = Dict(:style=>"mxmyhaz", :min_imx=>10,:max_imx=>100, :min_imy=>35, :max_imy=>45,
:min_ih=>1, :max_ih=>6, :min_iaz=>0, :max_iaz=>7);

Expand All @@ -20,4 +17,17 @@ df,hf,ef=SeisRead(file_final);

alpha = maximum(db-df)

@test alpha < 0.1
@test alpha < 0.1

for file in (
"section_bin",
"section_bin_final",
"patch_1",
"patch_2",
"patch_3",
"patch_4",
)
rm(joinpath(@__DIR__, file))
rm(joinpath(@__DIR__, file*"@data@"))
rm(joinpath(@__DIR__, file*"@headers@"))
end

0 comments on commit 52dc480

Please sign in to comment.