2
2
# this is ProfileProcessing.jl
3
3
# It contains functions and type definitions to gather selected data for given profiles
4
4
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
7
7
import Base: show
8
8
9
9
"""
@@ -251,11 +251,11 @@ end
251
251
252
252
253
253
"""
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)
255
255
256
256
Creates 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
257
257
"""
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 )
259
259
260
260
if Profile. vertical
261
261
# take a vertical cross section
276
276
277
277
278
278
# ## 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 ,))
280
280
num_datasets = length (DataSet)
281
281
282
282
tmp = NamedTuple () # initialize empty one
@@ -309,9 +309,8 @@ function CreateProfileSurface!(Profile::ProfileData, DataSet::NamedTuple; DimsSu
309
309
end
310
310
311
311
312
-
313
312
# ## 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)
315
314
num_datasets = length (DataSet)
316
315
317
316
tmp = NamedTuple () # initialize empty one
@@ -349,17 +348,17 @@ end
349
348
350
349
351
350
"""
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)
353
352
354
353
Extracts data along a vertical or horizontal profile
355
354
"""
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)
357
356
358
357
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)
360
359
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)
363
362
364
363
return nothing
365
364
end
@@ -384,11 +383,11 @@ end
384
383
385
384
# this is mostly for backwards compatibility
386
385
"""
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)
388
387
389
388
This is a convenience function (mostly for backwards compatibility with the MATLAB GUI) that loads the data from file & projects it onto a profile
390
389
"""
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)
392
391
393
392
# read profile
394
393
profile_list = read_picked_profiles (ProfileCoordFile)
@@ -409,7 +408,7 @@ function extract_ProfileData(ProfileCoordFile::String,ProfileNumber::Int64,DataS
409
408
VolData_combined = combine_vol_data (VolData)
410
409
411
410
# project data onto profile:
412
- extract_ProfileData ! (profile, VolData_combined, SurfData, PointData,
411
+ extract_profile_data ! (profile, VolData_combined, SurfData, PointData,
413
412
DimsVolCross= DimsVolCross, DimsSurfCross= DimsSurfCross,
414
413
Depth_extent= DepthVol, section_width= WidthPointProfile)
415
414
421
420
422
421
# Boris: I don't know exactly in which format you have your current files;
423
422
### 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)
425
424
426
425
# start and end points are saved in a text file
427
426
profile_data = readdlm(ProfileCoordFile,skipstart=1,',')
@@ -446,13 +445,13 @@ function extract_ProfileData(ProfileCoordFile,ProfileNumber,DataSetName,DataSetF
446
445
ind_point = findall( x -> x .== "Point", DataSetType)
447
446
448
447
# 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)
450
449
451
450
# 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)
453
452
454
453
# 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)
456
455
457
456
return Profile
458
457
end
@@ -480,7 +479,7 @@ function create_ProfileData(file_profiles,file_datasets;Depth_extent=(-300,0),Di
480
479
for iprofile = 1:length(ProfileNumber)
481
480
482
481
# 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)
484
483
485
484
# 3. save data as JLD2
486
485
fn = "Profile"*string(ProfileNumber[iprofile])
0 commit comments