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, ExtractProfileData, CreateProfileData , GMG_Dataset, Load_Dataset_file , combine_VolData
6
- export ExtractProfileData !, ReadPickedProfiles
5
+ export ProfileData, extractProfileData, createProfileData , GMG_Dataset, load_Dataset_file , combine_VolData
6
+ export extractProfileData !, readPickedProfiles
7
7
import Base: show
8
8
9
9
"""
133
133
134
134
"""
135
135
136
- Datasets = Load_Dataset_file (file_datasets::String)
136
+ Datasets = load_Dataset_file (file_datasets::String)
137
137
138
138
This loads a CSV textfile that lists datasets, which is expected to have the following format:
139
139
@@ -149,7 +149,7 @@ Here, the meaning of the variables is:
149
149
- `Active`: Do we want this file to be loaded or not? Optional parameter that defaults to `true`
150
150
151
151
"""
152
- function Load_Dataset_file (file_datasets:: String )
152
+ function load_Dataset_file (file_datasets:: String )
153
153
datasets = readdlm (file_datasets,' ,' ,skipstart = 1 ); # read information on datasets to be used from text file
154
154
n = size (datasets,1 )
155
155
@@ -349,11 +349,11 @@ end
349
349
350
350
351
351
"""
352
- ExtractProfileData !(Profile::ProfileData,VolData::GeoData, SurfData::NamedTuple, PointData::NamedTuple; DimsVolCross=(100,100),Depth_extent=nothing,DimsSurfCross=(100,),section_width=50)
352
+ extractProfileData !(Profile::ProfileData,VolData::GeoData, SurfData::NamedTuple, PointData::NamedTuple; DimsVolCross=(100,100),Depth_extent=nothing,DimsSurfCross=(100,),section_width=50)
353
353
354
354
Extracts data along a vertical or horizontal profile
355
355
"""
356
- function ExtractProfileData ! (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)
356
+ function extractProfileData ! (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
357
358
358
if ! isnothing (VolData)
359
359
CreateProfileVolume! (Profile, VolData; DimsVolCross= DimsVolCross, Depth_extent= Depth_extent)
367
367
"""
368
368
This reads the picked profiles from disk and returns a vector of ProfileData
369
369
"""
370
- function ReadPickedProfiles (ProfileCoordFile:: String )
370
+ function readPickedProfiles (ProfileCoordFile:: String )
371
371
372
372
profiles = Vector {ProfileData} ()
373
373
profile_data = readdlm (ProfileCoordFile,skipstart= 1 ,' ,' )
@@ -384,14 +384,14 @@ end
384
384
385
385
# this is mostly for backwards compatibility
386
386
"""
387
- ExtractProfileData (ProfileCoordFile::String,ProfileNumber::Int64,DataSetFile::String; DimsVolCross=(100,100),DepthVol=nothing,DimsSurfCross=(100,),WidthPointProfile=50km)
387
+ extractProfileData (ProfileCoordFile::String,ProfileNumber::Int64,DataSetFile::String; DimsVolCross=(100,100),DepthVol=nothing,DimsSurfCross=(100,),WidthPointProfile=50km)
388
388
389
389
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
390
"""
391
- function ExtractProfileData (ProfileCoordFile:: String ,ProfileNumber:: Int64 ,DataSetFile:: String ; DimsVolCross= (100 ,100 ),DepthVol= nothing ,DimsSurfCross= (100 ,),WidthPointProfile= 50 km)
391
+ function extractProfileData (ProfileCoordFile:: String ,ProfileNumber:: Int64 ,DataSetFile:: String ; DimsVolCross= (100 ,100 ),DepthVol= nothing ,DimsSurfCross= (100 ,),WidthPointProfile= 50 km)
392
392
393
393
# read profile
394
- profile_list = ReadPickedProfiles (ProfileCoordFile)
394
+ profile_list = readPickedProfiles (ProfileCoordFile)
395
395
profile = profile_list[ProfileNumber]
396
396
397
397
println (" lon start " , profile. start_lonlat[1 ])
@@ -400,7 +400,7 @@ function ExtractProfileData(ProfileCoordFile::String,ProfileNumber::Int64,DataSe
400
400
println (" lat end " , profile. end_lonlat[2 ])
401
401
402
402
# read all datasets:
403
- Datasets_all = Load_Dataset_file (DataSetFile)
403
+ Datasets_all = load_Dataset_file (DataSetFile)
404
404
405
405
# load all Data
406
406
VolData, SurfData, PointData, ScreenshotData, TopoData = load_GMG (Datasets_all)
@@ -409,7 +409,7 @@ function ExtractProfileData(ProfileCoordFile::String,ProfileNumber::Int64,DataSe
409
409
VolData_combined = combine_VolData (VolData)
410
410
411
411
# project data onto profile:
412
- ExtractProfileData ! (profile, VolData_combined, SurfData, PointData,
412
+ extractProfileData ! (profile, VolData_combined, SurfData, PointData,
413
413
DimsVolCross= DimsVolCross, DimsSurfCross= DimsSurfCross,
414
414
Depth_extent= DepthVol, section_width= WidthPointProfile)
415
415
421
421
422
422
# Boris: I don't know exactly in which format you have your current files;
423
423
### wrapper function to extract data for a single profile
424
- function ExtractProfileData (ProfileCoordFile,ProfileNumber,DataSetName,DataSetFile,DataSetType,DimsVolCross,DepthVol,DimsSurfCross,WidthPointProfile)
424
+ function extractProfileData (ProfileCoordFile,ProfileNumber,DataSetName,DataSetFile,DataSetType,DimsVolCross,DepthVol,DimsSurfCross,WidthPointProfile)
425
425
426
426
# start and end points are saved in a text file
427
427
profile_data = readdlm(ProfileCoordFile,skipstart=1,',')
463
463
### currently, the function is quite slow, as the different data sets are reloaded for each profile.
464
464
### a faster way would be to load one data set and create the profiles from it and then move on to the next one. However, this would require to hold all the profile data in memory, which may be a bit much...
465
465
466
- function CreateProfileData (file_profiles,file_datasets;Depth_extent=(-300,0),DimsVolCross=(500,300),DimsSurfCross = (100,),WidthPointProfile = 20km)
466
+ function createProfileData (file_profiles,file_datasets;Depth_extent=(-300,0),DimsVolCross=(500,300),DimsSurfCross = (100,),WidthPointProfile = 20km)
467
467
# get the number of profiles
468
468
profile_data = readdlm(file_profiles,skipstart=1,',')
469
469
NUM = convert.(Int,profile_data[:,1]);
@@ -480,7 +480,7 @@ function CreateProfileData(file_profiles,file_datasets;Depth_extent=(-300,0),Dim
480
480
for iprofile = 1:length(ProfileNumber)
481
481
482
482
# 2. process the profiles
483
- ExtractedData = ExtractProfileData (file_profiles,ProfileNumber[iprofile],DataSetName,DataSetFile,DataSetType,DimsVolCross,Depth_extent,DimsSurfCross,WidthPointProfile)
483
+ ExtractedData = extractProfileData (file_profiles,ProfileNumber[iprofile],DataSetName,DataSetFile,DataSetType,DimsVolCross,Depth_extent,DimsSurfCross,WidthPointProfile)
484
484
485
485
# 3. save data as JLD2
486
486
fn = "Profile"*string(ProfileNumber[iprofile])
0 commit comments