diff --git a/src/ProfileProcessing.jl b/src/ProfileProcessing.jl index c4795b774..ddc9e2cec 100644 --- a/src/ProfileProcessing.jl +++ b/src/ProfileProcessing.jl @@ -35,7 +35,7 @@ mutable struct ProfileData ScreenshotData::Union{Nothing, NamedTuple} function ProfileData(; kwargs...) # this constructor allows to define only certain fields and leave the others blank - K = new(true, nothing, nothing, nothing, nothing, nothing, nothing) + K = new(true, nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing) for (key, value) in kwargs # make sure that start and end point are given as tuples of Float64 if key == Symbol("start_lonlat") @@ -617,14 +617,12 @@ function extract_ProfileData(ProfileCoordFile::String, ProfileNumber::Int64, Dat # load all Data VolData, SurfData, PointData, ScreenshotData, TopoData = load_GMG(Datasets_all) - # merge VolData: - VolData_combined = combine_vol_data(VolData) - - # project data onto profile: + # project data onto profile (volume datasets are processed individually, without merging them first): extract_ProfileData!( - profile, VolData_combined, SurfData, PointData; + profile, VolData, SurfData, PointData; DimsVolCross = DimsVolCross, DimsSurfCross = DimsSurfCross, - Depth_extent = DepthVol, section_width = WidthPointProfile + Depth_extent = DepthVol, section_width = WidthPointProfile, + ScreenshotData = ScreenshotData, TopoData = TopoData ) return profile diff --git a/test/test_ProfileProcessing.jl b/test/test_ProfileProcessing.jl index 040198d8a..7c21e2fc0 100644 --- a/test/test_ProfileProcessing.jl +++ b/test/test_ProfileProcessing.jl @@ -53,6 +53,9 @@ VolData_combined2 = combine_vol_data(Data.Volume, dims = (50, 51, 52)) VolData_combined3 = combine_vol_data(Data.Volume, lon = (1, 22), lat = (40, 52), dims = (50, 51, 52)) @test isnan(VolData_combined3.fields.Hua2017_Vp[1000]) +# ProfileData has a TopoData field, which is empty by default +@test isnothing(ProfileData(depth = -10).TopoData) + # Define horizontal & vertical profiles prof1 = ProfileData(start_lonlat = (5, 45), end_lonlat = (15, 49)) prof2 = ProfileData(depth = -100)