From 95d4c2c20cda7b89834b8273d99a97d4b430e577 Mon Sep 17 00:00:00 2001 From: Boris Kaus Date: Tue, 18 Mar 2025 16:02:58 +0100 Subject: [PATCH 1/9] update version numbers --- Project.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Project.toml b/Project.toml index 1401171..80e4c1c 100644 --- a/Project.toml +++ b/Project.toml @@ -26,11 +26,11 @@ UrlDownload = "856ac37a-3032-4c1c-9122-f86d88358c8b" Dash = "1.3.0" DashBootstrapComponents = "1.4.1" DelimitedFiles = "1" -GeophysicalModelGenerator = "0.5.4" +GeophysicalModelGenerator = "0.6, 0.7" HTTP = "1.0" -JLD2 = "0.4" +JLD2 = "0.4, 0.5" JSON3 = "1" -Meshes = "0.30" +Meshes = "0.30 - 0.40" PlotlyJS = "0.18" Statistics = "1.9" UrlDownload = "1.0.1" From c4016281d3f2e54b46740df5111d7ec293bbe3c1 Mon Sep 17 00:00:00 2001 From: Boris Kaus Date: Tue, 18 Mar 2025 16:03:39 +0100 Subject: [PATCH 2/9] add Moho surfaces --- src/GMG_Tomo/Default_datasets.jl | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/GMG_Tomo/Default_datasets.jl b/src/GMG_Tomo/Default_datasets.jl index 26662c4..763e6e6 100644 --- a/src/GMG_Tomo/Default_datasets.jl +++ b/src/GMG_Tomo/Default_datasets.jl @@ -65,11 +65,17 @@ function Default_datasets(;dir="") push!(Datasets, GMG_Dataset("Mroczek2022_Moho_Grid_AD","Surface","https://seafile.rlp.net/f/12c120c5724745e2b27b/?dl=1", false)) push!(Datasets, GMG_Dataset("Mroczek2022_Moho_Grid_EU","Surface","https://seafile.rlp.net/f/483d9c7c808a4087ba9e/?dl=1", false)) push!(Datasets, GMG_Dataset("Mroczek2022_Moho_Grid_PA","Surface","https://seafile.rlp.net/f/217eaf5c87d14adcb9c9/?dl=1", false)) - push!(Datasets, GMG_Dataset("EUCrust_07","Surface","https://seafile.rlp.net/f/10f867e410bb4d95b3fe/?dl=1", false)) + push!(Datasets, GMG_Dataset("EUCrust_07_old","Surface","https://seafile.rlp.net/f/10f867e410bb4d95b3fe/?dl=1", false)) push!(Datasets, GMG_Dataset("Spada2013_Moho_Adria","Surface","https://seafile.rlp.net/f/f4fd12f8bcf2460099d4/?dl=1", false)) push!(Datasets, GMG_Dataset("Spada2013_Moho_Europe","Surface","https://seafile.rlp.net/f/10c06397c23a4611bf5e/?dl=1", false)) push!(Datasets, GMG_Dataset("Spada2013_Moho_Tyrrhenia","Surface","https://seafile.rlp.net/f/f3833ae6d0474b34b88c/?dl=1", false)) - + + push!(Datasets, GMG_Dataset("EUCrust_07", "Surface","https://seafile.rlp.net/f/a0cd969dab184f34ac07/?dl=1", false)) + push!(Datasets, GMG_Dataset("MohoEUCrust", "Surface","https://seafile.rlp.net/f/61c3bce2b0f949fdb7bc/?dl=1", false)) + push!(Datasets, GMG_Dataset("EUCrust_08", "Surface","https://seafile.rlp.net/f/45d5fd297eba4e9d9849/?dl=1", false)) + push!(Datasets, GMG_Dataset("Grad09_EU", "Surface","https://seafile.rlp.net/f/d42b694387f0458b840e/?dl=1", false)) + push!(Datasets, GMG_Dataset("Grad07_EU", "Surface","https://seafile.rlp.net/f/8ca2a3b40b2a41a5858d/?dl=1", false)) + # Other surfaces push!(Datasets, GMG_Dataset("Spooner2020_Consolidated_Sediments","Surface", "https://seafile.rlp.net/f/26253974062243e0b115/?dl=1", false)) push!(Datasets, GMG_Dataset("Spooner2020_UpperCrust","Surface", "https://seafile.rlp.net/f/17b497c66dde47289abf/?dl=1", false)) From 22210f5ea2d510cd168eb4cb38629350725977a8 Mon Sep 17 00:00:00 2001 From: Boris Kaus Date: Tue, 18 Mar 2025 16:03:51 +0100 Subject: [PATCH 3/9] update routines to new GMG version --- playground/ex3_CrossSection.jl | 2 +- src/GMG_Tomo/ReadSVG_geomIO.jl | 2 +- src/GMG_Tomo/Tab_Setup_Callbacks.jl | 2 +- src/GMG_Tomo/utils.jl | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/playground/ex3_CrossSection.jl b/playground/ex3_CrossSection.jl index 3a12ecf..9b8e9f1 100644 --- a/playground/ex3_CrossSection.jl +++ b/playground/ex3_CrossSection.jl @@ -21,7 +21,7 @@ function PrepCrossSection(lonvec, latvec, depths,liftlons,liftlone,liftlats,lift # create crosssection n = 100 - X,Y,Z = XYZGrid(LinRange(lons, lone, n), LinRange(lats, late, n), LinRange(ze, zs, n)); + X,Y,Z = xyz_grid(LinRange(lons, lone, n), LinRange(lats, late, n), LinRange(ze, zs, n)); cross = GeoData(X, Y, Z, (ran = zeros(size(Z)),)); STup = @lift ($liftlons,$liftlats) diff --git a/src/GMG_Tomo/ReadSVG_geomIO.jl b/src/GMG_Tomo/ReadSVG_geomIO.jl index d4a9682..1ff1823 100644 --- a/src/GMG_Tomo/ReadSVG_geomIO.jl +++ b/src/GMG_Tomo/ReadSVG_geomIO.jl @@ -153,7 +153,7 @@ end """ Curves = parse_SVG(fname::String; is_inkscape=true, verbose=true) -This parses an SVG file; reads all thr curves on the file and transforms them to real coordinates and finally puts the results (with 3D curves) into a NamedTuple +This parses an SVG file; reads all the curves on the file and transforms them to real coordinates and finally puts the results (with 3D curves) into a NamedTuple """ function parse_SVG(fname::String; is_inkscape=true, verbose=true) diff --git a/src/GMG_Tomo/Tab_Setup_Callbacks.jl b/src/GMG_Tomo/Tab_Setup_Callbacks.jl index 87a48c6..7445ee7 100644 --- a/src/GMG_Tomo/Tab_Setup_Callbacks.jl +++ b/src/GMG_Tomo/Tab_Setup_Callbacks.jl @@ -63,7 +63,7 @@ callback!(app, Output("setup-button", "n_clicks"), lat = extrema(DataTopo.lat.val) lon = extrema(DataTopo.lon.val) depth = (-500,0) - DataTomo = combine_VolData(DataVol; lat=lat, lon=lon, depth=depth, dims=(100,100,100)) + DataTomo = combine_vol_data(DataVol; lat=lat, lon=lon, depth=depth, dims=(100,100,100)) # Initial cross-section start_val, end_val = extract_start_end_values(start_value, end_value) diff --git a/src/GMG_Tomo/utils.jl b/src/GMG_Tomo/utils.jl index 59e542d..b7a33d4 100644 --- a/src/GMG_Tomo/utils.jl +++ b/src/GMG_Tomo/utils.jl @@ -75,7 +75,7 @@ function ProfileUser(; number=0, lon = sort([start_lonlat[1], end_lonlat[1]]) lat = sort([start_lonlat[2], end_lonlat[2]]) - Lon,Lat,Depth = XYZGrid(range(lon...,10), range(lat...,10), range(-100,0,10)) + Lon,Lat,Depth = xyz_grid(range(lon...,10), range(lat...,10), range(-100,0,10)) FakeData = GeoData(Lon,Lat,Depth, (Data=Depth,)) CrossFake = CrossSection(FakeData, Start=start_lonlat, End=end_lonlat, dims=(10,10)) From 2753690f4d9805c2b2438e0db65500399e283232 Mon Sep 17 00:00:00 2001 From: Boris Kaus Date: Tue, 18 Mar 2025 16:16:43 +0100 Subject: [PATCH 4/9] update functions due to update GMG version --- playground/Dash/utils.jl | 6 ++--- .../Marcel/JuliaGTKMakie/ProfileProcessing.jl | 16 ++++++------- playground/Marcel/PickingWorkflow.jl | 2 +- playground/Marcel/ProfileProcessing.jl | 16 ++++++------- playground/ex3_CrossSection.jl | 12 +++++----- src/GMG_Tomo/GMG_TomoData_Plots.jl | 4 ++-- src/GMG_Tomo/utils.jl | 24 +++++++++---------- 7 files changed, 40 insertions(+), 40 deletions(-) diff --git a/playground/Dash/utils.jl b/playground/Dash/utils.jl index 72609ae..d62d38a 100644 --- a/playground/Dash/utils.jl +++ b/playground/Dash/utils.jl @@ -57,12 +57,12 @@ Extracts a cross-section from a tomographic dataset and returns this as cartesia function get_cross_section(DataAlps::GeoData, start_value=(10,41), end_value=(10,49), field=:dVp_paf21) # retrieve the cross-section in GeoData format - cross = CrossSection(DataAlps, Start=start_value, End=end_value, Interpolate=true) + cross = cross_section(DataAlps, Start=start_value, End=end_value, Interpolate=true) # transfer it to cartesian data p = ProjectionPoint(Lon=minimum(cross.lon.val),Lat=minimum(cross.lat.val)); - cross_cart = Convert2CartData(cross,p) - x_cross = FlattenCrossSection(cross_cart); + cross_cart = convert2CartData(cross,p) + x_cross = flatten_cross_section(cross_cart); x_cart = x_cross[:,1]; z_cart = cross_cart.z.val[1,:,1] diff --git a/playground/Marcel/JuliaGTKMakie/ProfileProcessing.jl b/playground/Marcel/JuliaGTKMakie/ProfileProcessing.jl index 79dea36..c93e0d2 100644 --- a/playground/Marcel/JuliaGTKMakie/ProfileProcessing.jl +++ b/playground/Marcel/JuliaGTKMakie/ProfileProcessing.jl @@ -2,7 +2,7 @@ # this is ProfileProcessing.jl # It contains functions and type definitions to gather selected data for given profiles -export ProfileData, ExtractProfileData +export ProfileData, extract_ProfileData # load packages using GeophysicalModelGenerator @@ -63,7 +63,7 @@ function CreateProfileVolume!(Profile,DataSetName,DataSetFile,DimsVolCross,Depth tmp_load = load(DataSetFile[idata]) # this gives us a dict with a key that is the name if the data set and the values as the GeoData structure tmp_load = collect(values(tmp_load)) # this gives us a vector with a single GeoData entry data_tmp = tmp_load[1] # and now we extract that entry... - cross_tmp = CrossSection(data_tmp,dims=DimsVolCross,Start=Profile.start_point,End=Profile.end_point,Depth_extent=DepthVol) # create the cross section + cross_tmp = cross_section(data_tmp,dims=DimsVolCross,Start=Profile.start_point,End=Profile.end_point,Depth_extent=DepthVol) # create the cross section # store profile coordinates and field data on first go if idata==1 @@ -103,7 +103,7 @@ function CreateProfileVolume!(Profile,DataSetName,DataSetFile,DimsVolCross,Depth tmp = GeophysicalModelGenerator.GeoData(lon_vol,lat_vol,depth_vol,fields_vol) # flatten cross section and add this data to the structure - x_profile = FlattenCrossSection(tmp,Start=Profile.start_point) + x_profile = flatten_cross_section(tmp,Start=Profile.start_point) tmp = AddField(tmp,"x_profile",x_profile) Profile.VolData = tmp # assign to Profile data structure @@ -123,9 +123,9 @@ function CreateProfileSurface!(Profile,DataSetName,DataSetFile,DimsSurfCross) tmp_load = load(DataSetFile[idata]) # this gives us a dict with a key that is the name if the data set and the values as the GeoData structure tmp_load = collect(values(tmp_load)) # this gives us a vector with a single GeoData entry data_tmp = tmp_load[1] # and now we extract that entry... - tmp[idata] = CrossSection(data_tmp, dims=DimsSurfCross,Start=Profile.start_point,End=Profile.end_point) # create the cross section + tmp[idata] = cross_section(data_tmp, dims=DimsSurfCross,Start=Profile.start_point,End=Profile.end_point) # create the cross section # flatten cross section and add this data to the structure - x_profile = FlattenCrossSection(tmp[idata],Start=Profile.start_point) + x_profile = flatten_cross_section(tmp[idata],Start=Profile.start_point) tmp[idata] = AddField(tmp[idata],"x_profile",x_profile) # add the data set name as an attribute (not required if there is proper metadata, but odds are that there is not) tmp[idata].atts["dataset"] = DataSetName[idata] @@ -147,9 +147,9 @@ function CreateProfilePoint!(Profile,DataSetName,DataSetFile,WidthPointProfile) tmp_load = load(DataSetFile[idata]) # this gives us a dict with a key that is the name if the data set and the values as the GeoData structure tmp_load = collect(values(tmp_load)) # this gives us a vector with a single GeoData entry data_tmp = tmp_load[1] # and now we extract that entry... - tmp[idata] = CrossSection(data_tmp,Start=Profile.start_point,End=Profile.end_point,section_width = WidthPointProfile) # create the cross section + tmp[idata] = cross_section(data_tmp,Start=Profile.start_point,End=Profile.end_point,section_width = WidthPointProfile) # create the cross section # flatten cross section and add this data to the structure - x_profile = FlattenCrossSection(tmp[idata],Start=Profile.start_point) + x_profile = flatten_cross_section(tmp[idata],Start=Profile.start_point) tmp[idata] = AddField(tmp[idata],"x_profile",x_profile) # add the data set name as an attribute (not required if there is proper metadata, but odds are that there is not) tmp[idata].atts["dataset"] = DataSetName[idata] @@ -161,7 +161,7 @@ function CreateProfilePoint!(Profile,DataSetName,DataSetFile,WidthPointProfile) end ### wrapper function to process everything -function ExtractProfileData(ProfileCoordFile,ProfileNumber,DataSetName,DataSetFile,DataSetType,DimsVolCross,DepthVol,DimsSurfCross,WidthPointProfile) +function extract_ProfileData(ProfileCoordFile,ProfileNumber,DataSetName,DataSetFile,DataSetType,DimsVolCross,DepthVol,DimsSurfCross,WidthPointProfile) # start and end points are saved in a text file profile_data = readdlm(ProfileCoordFile,skipstart=1,',') diff --git a/playground/Marcel/PickingWorkflow.jl b/playground/Marcel/PickingWorkflow.jl index 43a31ac..3dbe236 100644 --- a/playground/Marcel/PickingWorkflow.jl +++ b/playground/Marcel/PickingWorkflow.jl @@ -67,7 +67,7 @@ WidthPointProfile = 20km # 2. process the profiles include("ProfileProcessing.jl") -ExtractedData = ExtractProfileData(ProfileCoordFile,ProfileNumber,DataSetName,DataSetFile,DataSetType,DimsVolCross,DimsSurfCross,WidthPointProfile) +ExtractedData = extract_ProfileData(ProfileCoordFile,ProfileNumber,DataSetName,DataSetFile,DataSetType,DimsVolCross,DimsSurfCross,WidthPointProfile) # 3. save data as MATLAB fn = "Profile"*string(ProfileNumber) diff --git a/playground/Marcel/ProfileProcessing.jl b/playground/Marcel/ProfileProcessing.jl index 55dddce..e4b61d5 100644 --- a/playground/Marcel/ProfileProcessing.jl +++ b/playground/Marcel/ProfileProcessing.jl @@ -2,7 +2,7 @@ # this is ProfileProcessing.jl # It contains functions and type definitions to gather selected data for given profiles -export ProfileData, ExtractProfileData +export ProfileData, extract_ProfileData # load packages using GeophysicalModelGenerator @@ -60,7 +60,7 @@ function CreateProfileVolume!(Profile,DataSetName,DataSetFile,DimsVolCross) tmp_load = load(DataSetFile[idata]) # this gives us a dict with a key that is the name if the data set and the values as the GeoData structure tmp_load = collect(values(tmp_load)) # this gives us a vector with a single GeoData entry data_tmp = tmp_load[1] # and now we extract that entry... - cross_tmp = CrossSection(data_tmp,dims=DimsVolCross,Start=Profile.start_point,End=Profile.end_point) # create the cross section + cross_tmp = cross_section(data_tmp,dims=DimsVolCross,Start=Profile.start_point,End=Profile.end_point) # create the cross section # store profile coordinates and field data on first go if idata==1 @@ -100,7 +100,7 @@ function CreateProfileVolume!(Profile,DataSetName,DataSetFile,DimsVolCross) tmp = GeoData(lon_vol,lat_vol,depth_vol,fields_vol) # flatten cross section and add this data to the structure - x_profile = FlattenCrossSection(tmp,Start=Profile.start_point) + x_profile = flatten_cross_section(tmp,Start=Profile.start_point) tmp = AddField(tmp,"x_profile",x_profile) Profile.VolData = tmp # assign to Profile data structure @@ -117,9 +117,9 @@ function CreateProfileSurface!(Profile,DataSetName,DataSetFile,DimsSurfCross) tmp_load = load(DataSetFile[idata]) # this gives us a dict with a key that is the name if the data set and the values as the GeoData structure tmp_load = collect(values(tmp_load)) # this gives us a vector with a single GeoData entry data_tmp = tmp_load[1] # and now we extract that entry... - tmp[idata] = CrossSection(data_tmp, dims=DimsSurfCross,Start=Profile.start_point,End=Profile.end_point) # create the cross section + tmp[idata] = cross_section(data_tmp, dims=DimsSurfCross,Start=Profile.start_point,End=Profile.end_point) # create the cross section # flatten cross section and add this data to the structure - x_profile = FlattenCrossSection(tmp[idata],Start=Profile.start_point) + x_profile = flatten_cross_section(tmp[idata],Start=Profile.start_point) tmp[idata] = AddField(tmp[idata],"x_profile",x_profile) # add the data set name as an attribute (not required if there is proper metadata, but odds are that there is not) tmp[idata].atts["dataset"] = DataSetName[idata] @@ -141,9 +141,9 @@ function CreateProfilePoint!(Profile,DataSetName,DataSetFile,WidthPointProfile) tmp_load = load(DataSetFile[idata]) # this gives us a dict with a key that is the name if the data set and the values as the GeoData structure tmp_load = collect(values(tmp_load)) # this gives us a vector with a single GeoData entry data_tmp = tmp_load[1] # and now we extract that entry... - tmp[idata] = CrossSection(data_tmp,Start=Profile.start_point,End=Profile.end_point,section_width = WidthPointProfile) # create the cross section + tmp[idata] = cross_section(data_tmp,Start=Profile.start_point,End=Profile.end_point,section_width = WidthPointProfile) # create the cross section # flatten cross section and add this data to the structure - x_profile = FlattenCrossSection(tmp[idata],Start=Profile.start_point) + x_profile = flatten_cross_section(tmp[idata],Start=Profile.start_point) tmp[idata] = AddField(tmp[idata],"x_profile",x_profile) # add the data set name as an attribute (not required if there is proper metadata, but odds are that there is not) tmp[idata].atts["dataset"] = DataSetName[idata] @@ -155,7 +155,7 @@ function CreateProfilePoint!(Profile,DataSetName,DataSetFile,WidthPointProfile) end ### wrapper function to process everything -function ExtractProfileData(ProfileCoordFile,ProfileNumber,DataSetName,DataSetFile,DataSetType,DimsVolCross,DimsSurfCross,WidthPointProfile) +function extract_ProfileData(ProfileCoordFile,ProfileNumber,DataSetName,DataSetFile,DataSetType,DimsVolCross,DimsSurfCross,WidthPointProfile) # start and end points are saved in a text file profile_data = readdlm(ProfileCoordFile,skipstart=1,',') diff --git a/playground/ex3_CrossSection.jl b/playground/ex3_CrossSection.jl index 9b8e9f1..0d4366d 100644 --- a/playground/ex3_CrossSection.jl +++ b/playground/ex3_CrossSection.jl @@ -6,10 +6,10 @@ using GLMakie, ColorSchemes, JLD2, GeophysicalModelGenerator, Interpolations, Li # a toggle selectes either vertical or horizontal crossection # the postion of the vertical crossection can be selected in the Topograpgy plot in the upper right corner # --> press "v" and then left mouseclick to select the startpoint of the cross section and "b" + left mouseclick for the End point (first press the key, then to the mouseclick while the key is still pressed!) -# the depth of the horizontal crosssection is changed by pressing "h" and "up arrow" key or "down arrow" key,respectively +# the depth of the horizontal cross_section is changed by pressing "h" and "up arrow" key or "down arrow" key,respectively -# this functions ouptuts all the information needed to plot a crosssection (LonLat values of Crossection, interpolated data, Topography) +# this functions ouptuts all the information needed to plot a cross_section (LonLat values of Crossection, interpolated data, Topography) function PrepCrossSection(lonvec, latvec, depths,liftlons,liftlone,liftlats,liftlate,data,lonT,latT,dataTopo) lons = lonvec[1] @@ -19,7 +19,7 @@ function PrepCrossSection(lonvec, latvec, depths,liftlons,liftlone,liftlats,lift zs = depths[1] ze = depths[end] - # create crosssection + # create cross_section n = 100 X,Y,Z = xyz_grid(LinRange(lons, lone, n), LinRange(lats, late, n), LinRange(ze, zs, n)); cross = GeoData(X, Y, Z, (ran = zeros(size(Z)),)); @@ -27,7 +27,7 @@ function PrepCrossSection(lonvec, latvec, depths,liftlons,liftlone,liftlats,lift STup = @lift ($liftlons,$liftlats) ETup = @lift ($liftlone,$liftlate) - surf = @lift CrossSection(cross, Start = $STup, End = $ETup,Interpolate=true) + surf = @lift cross_section(cross, Start = $STup, End = $ETup,Interpolate=true) t1 = @lift NumValue($surf.lon); t1 = @lift $t1[:,:,1]; t2 = @lift NumValue($surf.lat); t2 = @lift $t2[:,:,1]; t3 = @lift NumValue($surf.depth); t3 = @lift $t3[:,:,1]; @@ -169,12 +169,12 @@ function make_plot() length_sli = @lift length($depthr) ################################# - #### horizontal crosssection #### + #### horizontal cross_section #### ################################# # toggle toggle1 = Toggle(fig, active = false) - lab1 = Label(fig, lift(xtog -> xtog ? "Horizontal Crosssection visible" : "Vertical Crosssection invisible", toggle1.active)) + lab1 = Label(fig, lift(xtog -> xtog ? "Horizontal cross_section visible" : "Vertical cross_section invisible", toggle1.active)) # update location of point Hup = (Keyboard.h, Keyboard.up) diff --git a/src/GMG_Tomo/GMG_TomoData_Plots.jl b/src/GMG_Tomo/GMG_TomoData_Plots.jl index addee2d..f15b046 100644 --- a/src/GMG_Tomo/GMG_TomoData_Plots.jl +++ b/src/GMG_Tomo/GMG_TomoData_Plots.jl @@ -94,7 +94,7 @@ function plot_cross(AppData, profile; # Compute the cross-section. Profile = ProfileData(profile); # create a GMG structure for the profile - Profile, PlotCross = ExtractProfileData(Profile, AppData, field; section_width=section_width) # project data onto the profile + Profile, PlotCross = extract_ProfileData(Profile, AppData, field; section_width=section_width) # project data onto the profile colorscale = colormaps[Symbol(colormap)]; @@ -284,7 +284,7 @@ function plot_3D_data(AppData; for i in selected_cross profile = AppData.AppDataUser.Profiles[i+1] Profile = ProfileData(profile); # create a GMG structure for the profile - Profile, _ = ExtractProfileData(Profile, AppData, field; section_width=section_width) # project data onto the profile + Profile, _ = extract_ProfileData(Profile, AppData, field; section_width=section_width) # project data onto the profile vol = Profile.VolData.fields[field] x = Profile.VolData.lon.val[:,:] diff --git a/src/GMG_Tomo/utils.jl b/src/GMG_Tomo/utils.jl index b7a33d4..f96ee52 100644 --- a/src/GMG_Tomo/utils.jl +++ b/src/GMG_Tomo/utils.jl @@ -2,7 +2,7 @@ using GeophysicalModelGenerator, JLD2 #using GMT import Base:show -import GeophysicalModelGenerator: load_GMG, ProfileData, ExtractProfileData +import GeophysicalModelGenerator: load_GMG, ProfileData, extract_ProfileData """ @@ -78,9 +78,9 @@ function ProfileUser(; number=0, Lon,Lat,Depth = xyz_grid(range(lon...,10), range(lat...,10), range(-100,0,10)) FakeData = GeoData(Lon,Lat,Depth, (Data=Depth,)) - CrossFake = CrossSection(FakeData, Start=start_lonlat, End=end_lonlat, dims=(10,10)) + CrossFake = cross_section(FakeData, Start=start_lonlat, End=end_lonlat, dims=(10,10)) - x_cart = FlattenCrossSection(CrossFake) + x_cart = flatten_cross_section(CrossFake) end_cart = x_cart[end] else end_cart = nothing @@ -121,13 +121,13 @@ function ProfileData(prof::ProfileUser) end """ - Prof, PlotData = ExtractProfileData(Prof::ProfileData, AppData::NamedTuple, field; section_width=50km) + Prof, PlotData = extract_ProfileData(Prof::ProfileData, AppData::NamedTuple, field; section_width=50km) Helper function to project data onto the profile `Prof`. Also returns the data to plot this cross-section """ -function ExtractProfileData(Profile::ProfileData, AppData::NamedTuple, field::Symbol; section_width=50km) +function extract_ProfileData(Profile::ProfileData, AppData::NamedTuple, field::Symbol; section_width=50km) - ExtractProfileData!(Profile, AppData.DataTomo, AppData.DataSurfaces, AppData.DataPoints, section_width=section_width) + extract_ProfileData!(Profile, AppData.DataTomo, AppData.DataSurfaces, AppData.DataPoints, section_width=section_width) if Profile.vertical PlotData = (x_cart = Profile.VolData.fields.x_profile[:,1], z_cart=Profile.VolData.depth.val[1,:]) else @@ -148,12 +148,12 @@ function get_cross_section(AppData::NamedTuple, profile::ProfileUser, field=:Dat # retrieve the cross-section in GeoData format if profile.vertical == true # extract vertical profile - cross = CrossSection(AppData.DataTomo, Start=profile.start_lonlat, End=profile.end_lonlat, Interpolate=true) + cross = cross_section(AppData.DataTomo, Start=profile.start_lonlat, End=profile.end_lonlat, Interpolate=true) # transfer it to cartesian data p = ProjectionPoint(Lon=minimum(cross.lon.val),Lat=minimum(cross.lat.val)); - cross_cart = Convert2CartData(cross,p) - x_cross = FlattenCrossSection(cross_cart); + cross_cart = convert2CartData(cross,p) + x_cross = flatten_cross_section(cross_cart); x_cart = x_cross[:,1,1]; z_cart = cross_cart.z.val[1,:,1] profile.start_cart = x_cart[1] @@ -165,7 +165,7 @@ function get_cross_section(AppData::NamedTuple, profile::ProfileUser, field=:Dat data = cross_cart.fields[field][:,:,1]' else - cross = CrossSection(AppData.DataTomo, Depth_level=-profile.depth, Interpolate=true) + cross = cross_section(AppData.DataTomo, Depth_level=-profile.depth, Interpolate=true) cross_cart = cross; x_cart = cross_cart.lon.val[:,1] z_cart = cross_cart.lat.val[1,:] @@ -420,8 +420,8 @@ function image_from_screenshot(screenshot::GeoData) # Transfer 2 cartesian data p = ProjectionPoint(Lon=minimum(screenshot.lon.val),Lat=minimum(screenshot.lat.val)); - ss_cart = Convert2CartData(screenshot,p) - x_ss = FlattenCrossSection(ss_cart); + ss_cart = convert2CartData(screenshot,p) + x_ss = flatten_cross_section(ss_cart); x_cart = x_ss[1,:]; z_cart = ss_cart.z.val[:,1] From b00935be2bd213dc93148c9b0475e7d3fee92d18 Mon Sep 17 00:00:00 2001 From: Boris Kaus Date: Tue, 18 Mar 2025 17:01:02 +0100 Subject: [PATCH 5/9] add Vp,Vs, seismic and topo data --- src/GMG_Tomo/Default_datasets.jl | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/src/GMG_Tomo/Default_datasets.jl b/src/GMG_Tomo/Default_datasets.jl index 763e6e6..7ee6b9f 100644 --- a/src/GMG_Tomo/Default_datasets.jl +++ b/src/GMG_Tomo/Default_datasets.jl @@ -26,18 +26,42 @@ function Default_datasets(;dir="") push!(Datasets, GMG_Dataset("NEWTON21_anisotropic_Vp","Volume","https://seafile.rlp.net/f/7862a29a1f44405bbebd/?dl=1", false)) push!(Datasets, GMG_Dataset("Menichelli2023_Vp","Volume","https://seafile.rlp.net/f/84a5b5e5eec04c2b98e3/?dl=1", false)) + push!(Datasets, GMG_Dataset("GyPSuMS_Global_Vp","Volume","https://seafile.rlp.net/f/10721a3c4fbe4a81bcae/?dl=1", false)) + push!(Datasets, GMG_Dataset("Rappisi2022_iso_Vp","Volume","https://seafile.rlp.net/f/e787e08216384d2683f4/?dl=1", false)) + push!(Datasets, GMG_Dataset("Rappisi2022_slabs_Vp","Volume","https://seafile.rlp.net/f/607765fcd47c46ce8ed5/?dl=1", false)) + push!(Datasets, GMG_Dataset("Rappisi2022_Vp","Volume","https://seafile.rlp.net/f/5b89d5e1289f492b8a28/?dl=1", false)) + push!(Datasets, GMG_Dataset("Lippitsch2003_2_Vp","Volume","https://seafile.rlp.net/f/266fb30910c048119f4f/?dl=1", false)) + push!(Datasets, GMG_Dataset("MIT08_Pwave","Volume","https://seafile.rlp.net/f/bda0cb39537641e9a1e5/?dl=1", false)) + push!(Datasets, GMG_Dataset("Koulakov_Europe_Vp","Volume","https://seafile.rlp.net/f/e8f9e8c6506a4304bc1d/?dl=1", false)) + push!(Datasets, GMG_Dataset("HMSL-P06_percent_Vp","Volume","https://seafile.rlp.net/f/fdd495e109b34d14a768/?dl=1", false)) + push!(Datasets, GMG_Dataset("Giacomuzzi_2023_Vp","Volume","https://seafile.rlp.net/f/ca8eb5385bd24fc8ad5c/?dl=1", false)) + push!(Datasets, GMG_Dataset("Diehl2009_Vp","Volume","https://seafile.rlp.net/f/b9f1ed56565f4d02ab09/?dl=1", false)) + push!(Datasets, GMG_Dataset("Amaru2007_Vp","Volume","https://seafile.rlp.net/f/70052f317315479bb4ce/?dl=1", false)) + + # Vs: push!(Datasets, GMG_Dataset("CSEM_Vs","Volume","https://seafile.rlp.net/f/4bde77eb63fe4740b5de/?dl=1", false)) push!(Datasets, GMG_Dataset("ElSharkawy_Vs","Volume","https://seafile.rlp.net/f/c7eb8d7a24d648b6af3f/?dl=1", false)) push!(Datasets, GMG_Dataset("Kaestle2018_Vs","Volume","https://seafile.rlp.net/f/36145dfa7dce4d9b8eeb/?dl=1", false)) push!(Datasets, GMG_Dataset("Koulakov2009_Vs","Volume","https://seafile.rlp.net/f/980e7fc6b9134434bb6a/?dl=1", false)) push!(Datasets, GMG_Dataset("Kind_ReceiverFunctions","Volume","https://seafile.rlp.net/f/2c34b58b03bc4259aecb/?dl=1", false)) - - + push!(Datasets, GMG_Dataset("CaPaREA2023_Crust_Timko_Vs","Volume","https://seafile.rlp.net/f/89d1f97f1c574701b0ac/?dl=1", false)) + push!(Datasets, GMG_Dataset("CaPaREA2023_Mantle_Timko_Vs","Volume","https://seafile.rlp.net/f/a0bc30b88446437199ed/?dl=1", false)) + push!(Datasets, GMG_Dataset("CaPaREA2023_abs_Timko_Vs","Volume","https://seafile.rlp.net/f/fab7ce65d89d4826bfa3/?dl=1", false)) + push!(Datasets, GMG_Dataset("REVEAL_rel_avg_AK135_Vs","Volume","https://seafile.rlp.net/f/52ff0b02f689412c973d/?dl=1", false)) + push!(Datasets, GMG_Dataset("GyPSuMS_Global_Vs","Volume","https://seafile.rlp.net/f/db7dbdf8131a4253957a/?dl=1", false)) + push!(Datasets, GMG_Dataset("CAM2022_Vs","Volume","https://seafile.rlp.net/f/3ba88f5359af47bca42a/?dl=1", false)) + push!(Datasets, GMG_Dataset("CSEM_Europe_Vs","Volume","https://seafile.rlp.net/f/6e05832d0b454fb4941d/?dl=1", false)) + push!(Datasets, GMG_Dataset("LSP_Eucrust1_0_Vs","Volume","https://seafile.rlp.net/f/f8a7abd3e54f470895d4/?dl=1", false)) + push!(Datasets, GMG_Dataset("Fichtner_CSEM_Vs","Volume","https://seafile.rlp.net/f/0016408107f14046aebe/?dl=1", false)) + push!(Datasets, GMG_Dataset("CSEM_Europe_Vs","Volume","https://seafile.rlp.net/f/fdc6204b200d42689395/?dl=1", false)) + push!(Datasets, GMG_Dataset("3DLGL-TPESv_Global_Vs","Volume","https://seafile.rlp.net/f/8bb33587aaa840c98d2a/?dl=1", false)) + push!(Datasets, GMG_Dataset("SAVANI_US_Global_Vs","Volume","https://seafile.rlp.net/f/2e503d2a917e439cb141/?dl=1", false)) # Topography push!(Datasets, GMG_Dataset("AlpsTopo","Topography",joinpath(dir,"src/AlpsTopo.jld2"), true)) + push!(Datasets, GMG_Dataset("topography","Topography","https://seafile.rlp.net/f/3edb4a0531c14dc687ef/?dl=1", false)) # Screenshots push!(Datasets, GMG_Dataset("Handy_etal_SE_ProfileA","Screenshot","https://seafile.rlp.net/f/516015cb6d6442bdb96c/?dl=1", false)) @@ -87,7 +111,9 @@ function Default_datasets(;dir="") push!(Datasets, GMG_Dataset("AlpArraySeis","Point","https://seafile.rlp.net/f/87d565882eda40689666/?dl=1", false)) push!(Datasets, GMG_Dataset("ISC","Point","https://seafile.rlp.net/f/fed98ad058df4f2c8d28/?dl=1", false)) push!(Datasets, GMG_Dataset("CLASS","Point","https://seafile.rlp.net/f/4c574d9610b34b34ad9a/?dl=1", false)) - + push!(Datasets, GMG_Dataset("isc24_MedS","Point","https://seafile.rlp.net/f/d800de0823b142a099b5/?dl=1", false)) + push!(Datasets, GMG_Dataset("Najafabadi2021","Point","https://seafile.rlp.net/f/a57aeed44d23443f9bf3/?dl=1", false)) + return Datasets From cf9044d81d7a6d13f6f2f6aa7a4591c8c2a643c4 Mon Sep 17 00:00:00 2001 From: Boris Kaus Date: Wed, 19 Mar 2025 16:54:57 +0100 Subject: [PATCH 6/9] add SAVANI_Medit_Vs --- src/GMG_Tomo/Default_datasets.jl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/GMG_Tomo/Default_datasets.jl b/src/GMG_Tomo/Default_datasets.jl index 7ee6b9f..37f7d95 100644 --- a/src/GMG_Tomo/Default_datasets.jl +++ b/src/GMG_Tomo/Default_datasets.jl @@ -53,11 +53,13 @@ function Default_datasets(;dir="") push!(Datasets, GMG_Dataset("GyPSuMS_Global_Vs","Volume","https://seafile.rlp.net/f/db7dbdf8131a4253957a/?dl=1", false)) push!(Datasets, GMG_Dataset("CAM2022_Vs","Volume","https://seafile.rlp.net/f/3ba88f5359af47bca42a/?dl=1", false)) push!(Datasets, GMG_Dataset("CSEM_Europe_Vs","Volume","https://seafile.rlp.net/f/6e05832d0b454fb4941d/?dl=1", false)) + #push!(Datasets, GMG_Dataset("CSEM_Europe_Vs","Volume","https://seafile.rlp.net/f/fdc6204b200d42689395/?dl=1", false)) push!(Datasets, GMG_Dataset("LSP_Eucrust1_0_Vs","Volume","https://seafile.rlp.net/f/f8a7abd3e54f470895d4/?dl=1", false)) push!(Datasets, GMG_Dataset("Fichtner_CSEM_Vs","Volume","https://seafile.rlp.net/f/0016408107f14046aebe/?dl=1", false)) - push!(Datasets, GMG_Dataset("CSEM_Europe_Vs","Volume","https://seafile.rlp.net/f/fdc6204b200d42689395/?dl=1", false)) push!(Datasets, GMG_Dataset("3DLGL-TPESv_Global_Vs","Volume","https://seafile.rlp.net/f/8bb33587aaa840c98d2a/?dl=1", false)) push!(Datasets, GMG_Dataset("SAVANI_US_Global_Vs","Volume","https://seafile.rlp.net/f/2e503d2a917e439cb141/?dl=1", false)) + push!(Datasets, GMG_Dataset("SAVANI_Medit_Vs","Volume","https://seafile.rlp.net/f/fb08038c8f524231a389/?dl=1", false)) + # Topography push!(Datasets, GMG_Dataset("AlpsTopo","Topography",joinpath(dir,"src/AlpsTopo.jld2"), true)) From 378c410521f14d88364a4a727c7ba2eabb5692fa Mon Sep 17 00:00:00 2001 From: Boris Kaus Date: Wed, 19 Mar 2025 16:57:51 +0100 Subject: [PATCH 7/9] added SAVANI_Alps_Vs --- src/GMG_Tomo/Default_datasets.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GMG_Tomo/Default_datasets.jl b/src/GMG_Tomo/Default_datasets.jl index 37f7d95..60ed23a 100644 --- a/src/GMG_Tomo/Default_datasets.jl +++ b/src/GMG_Tomo/Default_datasets.jl @@ -59,7 +59,7 @@ function Default_datasets(;dir="") push!(Datasets, GMG_Dataset("3DLGL-TPESv_Global_Vs","Volume","https://seafile.rlp.net/f/8bb33587aaa840c98d2a/?dl=1", false)) push!(Datasets, GMG_Dataset("SAVANI_US_Global_Vs","Volume","https://seafile.rlp.net/f/2e503d2a917e439cb141/?dl=1", false)) push!(Datasets, GMG_Dataset("SAVANI_Medit_Vs","Volume","https://seafile.rlp.net/f/fb08038c8f524231a389/?dl=1", false)) - + push!(Datasets, GMG_Dataset("SAVANI_Alps_Vs","Volume","https://seafile.rlp.net/f/808bb834e0f04be1bf17/?dl=1", false)) # Topography push!(Datasets, GMG_Dataset("AlpsTopo","Topography",joinpath(dir,"src/AlpsTopo.jld2"), true)) From af64fb1585574ebf48a8dd08087c324ce8d40213 Mon Sep 17 00:00:00 2001 From: Boris Kaus Date: Mon, 19 May 2025 14:02:25 +0200 Subject: [PATCH 8/9] synthetic dataset --- src/GMG_Tomo/Default_datasets.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/src/GMG_Tomo/Default_datasets.jl b/src/GMG_Tomo/Default_datasets.jl index 60ed23a..3b57d1d 100644 --- a/src/GMG_Tomo/Default_datasets.jl +++ b/src/GMG_Tomo/Default_datasets.jl @@ -60,6 +60,7 @@ function Default_datasets(;dir="") push!(Datasets, GMG_Dataset("SAVANI_US_Global_Vs","Volume","https://seafile.rlp.net/f/2e503d2a917e439cb141/?dl=1", false)) push!(Datasets, GMG_Dataset("SAVANI_Medit_Vs","Volume","https://seafile.rlp.net/f/fb08038c8f524231a389/?dl=1", false)) push!(Datasets, GMG_Dataset("SAVANI_Alps_Vs","Volume","https://seafile.rlp.net/f/808bb834e0f04be1bf17/?dl=1", false)) + push!(Datasets, GMG_Dataset("Schuler25_Med_SynVs","Volume","https://seafile.rlp.net/f/a22a9f7433344878a3f2/?dl=1", false)) # Topography push!(Datasets, GMG_Dataset("AlpsTopo","Topography",joinpath(dir,"src/AlpsTopo.jld2"), true)) From 770092d6673be242560e1abe75c6e1da0a692a1e Mon Sep 17 00:00:00 2001 From: Boris Kaus Date: Mon, 19 May 2025 14:23:32 +0200 Subject: [PATCH 9/9] update --- src/GMG_Tomo/Default_datasets.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GMG_Tomo/Default_datasets.jl b/src/GMG_Tomo/Default_datasets.jl index 3b57d1d..623590d 100644 --- a/src/GMG_Tomo/Default_datasets.jl +++ b/src/GMG_Tomo/Default_datasets.jl @@ -60,7 +60,7 @@ function Default_datasets(;dir="") push!(Datasets, GMG_Dataset("SAVANI_US_Global_Vs","Volume","https://seafile.rlp.net/f/2e503d2a917e439cb141/?dl=1", false)) push!(Datasets, GMG_Dataset("SAVANI_Medit_Vs","Volume","https://seafile.rlp.net/f/fb08038c8f524231a389/?dl=1", false)) push!(Datasets, GMG_Dataset("SAVANI_Alps_Vs","Volume","https://seafile.rlp.net/f/808bb834e0f04be1bf17/?dl=1", false)) - push!(Datasets, GMG_Dataset("Schuler25_Med_SynVs","Volume","https://seafile.rlp.net/f/a22a9f7433344878a3f2/?dl=1", false)) + push!(Datasets, GMG_Dataset("Schuler25_Med_SynVs","Volume","https://seafile.rlp.net/f/daee5b214a3d418fb258/?dl=1", false)) # Topography push!(Datasets, GMG_Dataset("AlpsTopo","Topography",joinpath(dir,"src/AlpsTopo.jld2"), true))