@@ -305,7 +305,7 @@ function create_profile_screenshot!(Profile::ProfileData, DataSet::NamedTuple)
305305 else
306306 # we do not have this implemented
307307 # error("horizontal profiles not yet implemented")
308- end
308+ end
309309 end
310310 Profile. SurfData = tmp # assign to profile data structure
311311 return
@@ -390,35 +390,29 @@ end
390390
391391
392392"""
393- extract_ProfileData!(Profile::ProfileData,VolData::GeoData, SurfData::NamedTuple, PointData::NamedTuple, ScreenshotData::NamedTuple ; DimsVolCross=(100,100),Depth_extent=nothing,DimsSurfCross=(100,),section_width=50)
393+ extract_ProfileData!(Profile::ProfileData,VolData::GeoData, SurfData::NamedTuple, PointData::NamedTuple; DimsVolCross=(100,100),Depth_extent=nothing,DimsSurfCross=(100,),section_width=50, ScreenshotData=nothing )
394394
395395Extracts data along a vertical or horizontal profile
396396"""
397- function extract_ProfileData! (Profile:: ProfileData , VolData:: Union{Nothing, GeoData} = nothing , SurfData:: NamedTuple = NamedTuple (), PointData:: NamedTuple = NamedTuple (),ScreenshotData:: NamedTuple = NamedTuple (); DimsVolCross = (100 , 100 ), Depth_extent = nothing , DimsSurfCross = (100 ,), section_width = 50 km)
397+ function extract_ProfileData! (Profile:: ProfileData , VolData:: Union{Nothing, GeoData} = nothing , SurfData:: NamedTuple = NamedTuple (), PointData:: NamedTuple = NamedTuple (); DimsVolCross = (100 , 100 ), Depth_extent = nothing , DimsSurfCross = (100 ,), section_width = 50 km, ScreenshotData = nothing )
398+
399+ return extract_ProfileData! (Profile, VolData, SurfData, PointData, ScreenshotData; DimsVolCross = DimsVolCross, Depth_extent = Depth_extent, DimsSurfCross = DimsSurfCross, section_width = section_width)
400+ end
401+
402+ # Internal method - called by the main method with ScreenshotData as positional argument
403+ function extract_ProfileData! (Profile:: ProfileData , VolData:: Union{Nothing, GeoData} , SurfData:: NamedTuple , PointData:: NamedTuple , ScreenshotData:: Union{Nothing, NamedTuple} ; DimsVolCross = (100 , 100 ), Depth_extent = nothing , DimsSurfCross = (100 ,), section_width = 50 km)
398404
399405 if ! isnothing (VolData)
400406 create_profile_volume! (Profile, VolData; DimsVolCross = DimsVolCross, Depth_extent = Depth_extent)
401407 end
402408 create_profile_surface! (Profile, SurfData, DimsSurfCross = DimsSurfCross)
403409 create_profile_point! (Profile, PointData, section_width = section_width)
404- if ! isempty (ScreenshotData)
410+ if ! isnothing (ScreenshotData)
405411 create_profile_screenshot! (Profile, ScreenshotData)
406412 end
407413 return nothing
408414end
409415
410- """
411- extract_ProfileData!(Profile::ProfileData,VolData::GeoData, SurfData::NamedTuple, PointData::NamedTuple; DimsVolCross=(100,100),Depth_extent=nothing,DimsSurfCross=(100,),section_width=50)
412-
413- Extracts data along a vertical or horizontal profile.
414- """
415- function extract_ProfileData! (Profile:: ProfileData , VolData:: Union{Nothing, GeoData} = nothing , SurfData:: NamedTuple = NamedTuple (), PointData:: NamedTuple = NamedTuple (); DimsVolCross = (100 , 100 ), Depth_extent = nothing , DimsSurfCross = (100 ,), section_width = 50 km)
416-
417- # call the actual function to extract the profile data
418- extract_ProfileData! (Profile, VolData, SurfData, PointData,NamedTuple (); DimsVolCross = DimsVolCross, Depth_extent = Depth_extent, DimsSurfCross = DimsSurfCross, section_width = section_width)
419- return nothing
420- end
421-
422416
423417
424418
@@ -468,7 +462,7 @@ function extract_ProfileData(ProfileCoordFile::String, ProfileNumber::Int64, Dat
468462
469463 # project data onto profile:
470464 extract_ProfileData! (
471- profile, VolData_combined, SurfData, PointData,
465+ profile, VolData_combined, SurfData, PointData;
472466 DimsVolCross = DimsVolCross, DimsSurfCross = DimsSurfCross,
473467 Depth_extent = DepthVol, section_width = WidthPointProfile
474468 )
0 commit comments