22# this is ProfileProcessing.jl
33# It contains functions and type definitions to gather selected data for given profiles
44
5- export ProfileData, extract_ProfileData , create_ProfileData, GMG_Dataset, load_dataset_file, combine_vol_data
6- export extract_ProfileData !, read_picked_profiles
5+ export ProfileData, extract_profile_data , create_ProfileData, GMG_Dataset, load_dataset_file, combine_vol_data
6+ export extract_profile_data !, read_picked_profiles
77import Base: show
88
99"""
@@ -251,11 +251,11 @@ end
251251
252252
253253"""
254- CreateProfileVolume !(Profile::ProfileData, VolData::AbstractGeneralGrid; DimsVolCross::NTuple=(100,100), Depth_extent=nothing)
254+ create_profile_volume !(Profile::ProfileData, VolData::AbstractGeneralGrid; DimsVolCross::NTuple=(100,100), Depth_extent=nothing)
255255
256256Creates a cross-section through a volumetric 3D dataset `VolData` with the data supplied in `Profile`. `Depth_extent` can be the minimum & maximum depth for vertical profiles
257257"""
258- function CreateProfileVolume ! (Profile:: ProfileData , VolData:: AbstractGeneralGrid ; DimsVolCross:: NTuple = (100 ,100 ), Depth_extent= nothing )
258+ function create_profile_volume ! (Profile:: ProfileData , VolData:: AbstractGeneralGrid ; DimsVolCross:: NTuple = (100 ,100 ), Depth_extent= nothing )
259259
260260 if Profile. vertical
261261 # take a vertical cross section
276276
277277
278278# ## internal function to process surface data - contrary to the volume data, we here have to save lon/lat/depth pairs for every surface data set, so we create a NamedTuple of GeoData data sets
279- function CreateProfileSurface ! (Profile:: ProfileData , DataSet:: NamedTuple ; DimsSurfCross= (100 ,))
279+ function create_profile_surface ! (Profile:: ProfileData , DataSet:: NamedTuple ; DimsSurfCross= (100 ,))
280280 num_datasets = length (DataSet)
281281
282282 tmp = NamedTuple () # initialize empty one
@@ -309,9 +309,8 @@ function CreateProfileSurface!(Profile::ProfileData, DataSet::NamedTuple; DimsSu
309309end
310310
311311
312-
313312# ## function to process point data - contrary to the volume data, we here have to save lon/lat/depth pairs for every point data set
314- function CreateProfilePoint ! (Profile:: ProfileData , DataSet:: NamedTuple ; section_width= 50 km)
313+ function create_profile_point ! (Profile:: ProfileData , DataSet:: NamedTuple ; section_width= 50 km)
315314 num_datasets = length (DataSet)
316315
317316 tmp = NamedTuple () # initialize empty one
@@ -349,17 +348,17 @@ end
349348
350349
351350"""
352- extract_ProfileData !(Profile::ProfileData,VolData::GeoData, SurfData::NamedTuple, PointData::NamedTuple; DimsVolCross=(100,100),Depth_extent=nothing,DimsSurfCross=(100,),section_width=50)
351+ extract_profile_data !(Profile::ProfileData,VolData::GeoData, SurfData::NamedTuple, PointData::NamedTuple; DimsVolCross=(100,100),Depth_extent=nothing,DimsSurfCross=(100,),section_width=50)
353352
354353Extracts data along a vertical or horizontal profile
355354"""
356- 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)
355+ function extract_profile_data ! (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)
357356
358357 if ! isnothing (VolData)
359- CreateProfileVolume ! (Profile, VolData; DimsVolCross= DimsVolCross, Depth_extent= Depth_extent)
358+ create_profile_volume ! (Profile, VolData; DimsVolCross= DimsVolCross, Depth_extent= Depth_extent)
360359 end
361- CreateProfileSurface ! (Profile, SurfData, DimsSurfCross= DimsSurfCross)
362- CreateProfilePoint ! (Profile, PointData, section_width= section_width)
360+ create_profile_surface ! (Profile, SurfData, DimsSurfCross= DimsSurfCross)
361+ create_profile_point ! (Profile, PointData, section_width= section_width)
363362
364363 return nothing
365364end
@@ -384,11 +383,11 @@ end
384383
385384# this is mostly for backwards compatibility
386385"""
387- extract_ProfileData (ProfileCoordFile::String,ProfileNumber::Int64,DataSetFile::String; DimsVolCross=(100,100),DepthVol=nothing,DimsSurfCross=(100,),WidthPointProfile=50km)
386+ extract_profile_data (ProfileCoordFile::String,ProfileNumber::Int64,DataSetFile::String; DimsVolCross=(100,100),DepthVol=nothing,DimsSurfCross=(100,),WidthPointProfile=50km)
388387
389388This is a convenience function (mostly for backwards compatibility with the MATLAB GUI) that loads the data from file & projects it onto a profile
390389"""
391- function extract_ProfileData (ProfileCoordFile:: String ,ProfileNumber:: Int64 ,DataSetFile:: String ; DimsVolCross= (100 ,100 ),DepthVol= nothing ,DimsSurfCross= (100 ,),WidthPointProfile= 50 km)
390+ function extract_profile_data (ProfileCoordFile:: String ,ProfileNumber:: Int64 ,DataSetFile:: String ; DimsVolCross= (100 ,100 ),DepthVol= nothing ,DimsSurfCross= (100 ,),WidthPointProfile= 50 km)
392391
393392 # read profile
394393 profile_list = read_picked_profiles (ProfileCoordFile)
@@ -409,7 +408,7 @@ function extract_ProfileData(ProfileCoordFile::String,ProfileNumber::Int64,DataS
409408 VolData_combined = combine_vol_data (VolData)
410409
411410 # project data onto profile:
412- extract_ProfileData ! (profile, VolData_combined, SurfData, PointData,
411+ extract_profile_data ! (profile, VolData_combined, SurfData, PointData,
413412 DimsVolCross= DimsVolCross, DimsSurfCross= DimsSurfCross,
414413 Depth_extent= DepthVol, section_width= WidthPointProfile)
415414
421420
422421# Boris: I don't know exactly in which format you have your current files;
423422### wrapper function to extract data for a single profile
424- function extract_ProfileData (ProfileCoordFile,ProfileNumber,DataSetName,DataSetFile,DataSetType,DimsVolCross,DepthVol,DimsSurfCross,WidthPointProfile)
423+ function extract_profile_data (ProfileCoordFile,ProfileNumber,DataSetName,DataSetFile,DataSetType,DimsVolCross,DepthVol,DimsSurfCross,WidthPointProfile)
425424
426425 # start and end points are saved in a text file
427426 profile_data = readdlm(ProfileCoordFile,skipstart=1,',')
@@ -446,13 +445,13 @@ function extract_ProfileData(ProfileCoordFile,ProfileNumber,DataSetName,DataSetF
446445 ind_point = findall( x -> x .== "Point", DataSetType)
447446
448447 # extract volume data
449- CreateProfileVolume !(Profile,DataSetName[ind_vol],DataSetFile[ind_vol],DimsVolCross,DepthVol)
448+ create_profile_volume !(Profile,DataSetName[ind_vol],DataSetFile[ind_vol],DimsVolCross,DepthVol)
450449
451450 # extract surface data
452- CreateProfileSurface !(Profile,DataSetName[ind_surf],DataSetFile[ind_surf],DimsSurfCross)
451+ create_profile_surface !(Profile,DataSetName[ind_surf],DataSetFile[ind_surf],DimsSurfCross)
453452
454453 # extract point data
455- CreateProfilePoint !(Profile,DataSetName[ind_point],DataSetFile[ind_point],WidthPointProfile)
454+ create_profile_point !(Profile,DataSetName[ind_point],DataSetFile[ind_point],WidthPointProfile)
456455
457456 return Profile
458457end
@@ -480,7 +479,7 @@ function create_ProfileData(file_profiles,file_datasets;Depth_extent=(-300,0),Di
480479 for iprofile = 1:length(ProfileNumber)
481480
482481 # 2. process the profiles
483- ExtractedData = extract_ProfileData (file_profiles,ProfileNumber[iprofile],DataSetName,DataSetFile,DataSetType,DimsVolCross,Depth_extent,DimsSurfCross,WidthPointProfile)
482+ ExtractedData = extract_profile_data (file_profiles,ProfileNumber[iprofile],DataSetName,DataSetFile,DataSetType,DimsVolCross,Depth_extent,DimsSurfCross,WidthPointProfile)
484483
485484 # 3. save data as JLD2
486485 fn = "Profile"*string(ProfileNumber[iprofile])
0 commit comments