Profile processing
We have number of routines that makes it easier to read various datasets into GMG & create profiles through that data The routines provided here have the following functionality:
Read datasets (remote or local) that contains volumetric, surface, point, topograpy or screenshot data
Define a profile (horizontal, vertical) with space for (projected) data
Project earthquake (point) data onto the profile or intersect surfaces with a vertical profile (e.g., Moho data)
GeophysicalModelGenerator.load_GMG Function
data::NamedTuple = load_GMG(data::GMG_Dataset)Loads a dataset specified in GMG_Dataset data and returns it as a named tuple
Data = load_GMG(Datasets::Vector{GMG_Dataset})This loads all the active datasets in Datasets, and returns a NamedTuple with Volume, Surface, Point, Screenshot and Topography data
load_GMG(filename::String, dir=pwd(); maxattempts=5)Loads a GeoData/CartData/UTMData data set from jld2 file filename Note: the filename can also be a remote url, in which case the file is downloaded to a temporary file, loaded and the temporary file removed again. We make maxattempts attempts to download it before giving up.
Example 1 - Load local file
julia> data = load_GMG("test")
GeoData
size : (4, 3, 3)
lon ϵ [ 1.0 : 10.0]
lat ϵ [ 11.0 : 19.0]
depth ϵ [ -20.0 : -10.0]
fields : (:DataFieldName,)
attributes: ["note"]Example 2 - remote download
julia> url = "https://seafile.rlp.net/f/10f867e410bb4d95b3fe/?dl=1"
julia> load_GMG(url)
GeoData
size : (149, 242, 1)
lon ϵ [ -24.875 : 35.375]
lat ϵ [ 34.375 : 71.375]
depth ϵ [ -11.76 : -34.7]
fields : (:MohoDepth,)
attributes: ["author", "year"]GeophysicalModelGenerator.save_GMG Function
save_GMG(filename::String, data::Union{GeoData, CartDat, UTMData}; dir=pwd())Saves the dataset data to a JLD2 file (name without extension) in the directory dir
Example
julia> Lon3D,Lat3D,Depth3D = lonlatdepth_grid(1.0:3:10.0, 11.0:4:20.0, (-20:5:-10)*km);
julia> Data_set = GeophysicalModelGenerator.GeoData(Lon3D,Lat3D,Depth3D,(DataFieldName=Depth3D,))
julia> save_GMG("test",Data_set)GeophysicalModelGenerator.cross_section Function
cross_section(DataSet::AbstractGeneralGrid; dims=(100,100), Interpolate=nothing, Depth_level=nothing, Lat_level=nothing, Lon_level=nothing, Start=nothing, End=nothing, Depth_extent=nothing, section_width=50km)Creates a cross-section through a GeoData object.
Cross-sections can be horizontal (map view at a given depth), if
Depth_levelis specifiedThey can also be vertical, either by specifying
Lon_levelorLat_level(for a fixed lon/lat), or by defining bothStart=(lon,lat)&End=(lon,lat)points.Depending on the type of input data (volume, surface or point data), cross sections will be created in a different manner:
Volume data: data will be interpolated or directly extracted from the data set.
Surface data: surface data will be interpolated
Point data: data will be projected to the chosen profile. Only data within a chosen distance (default is 50 km) will be used
Interpolateindicates whether we want to simply extract the data from a volumetric data set (default) or whether we want to linearly interpolate it on a new grid, which has dimensions as specified indims. Surface data are always interpolated (Interpolate=falsethrows an error); point data ignoreInterpolate.section_widthis the width of the band around the profile within which point data are projected onto it. It can be given with length units; a plain number is in km.Depth_levelandDepth_extentcan be given with length units; plain numbers are in km.
Example:
julia> Lon,Lat,Depth = lonlatdepth_grid(10:20,30:40,(-300:25:0)km);
julia> Data = Depth*2; # some data
julia> Vx,Vy,Vz = ustrip(Data*3),ustrip(Data*4),ustrip(Data*5);
julia> Data_set3D = GeoData(Lon,Lat,Depth,(Depthdata=Data,LonData=Lon, Velocity=(Vx,Vy,Vz)));
julia> Data_cross = cross_section(Data_set3D, Depth_level=-100km)
GeoData
size : (11, 11, 1)
lon ϵ [ 10.0 : 20.0]
lat ϵ [ 30.0 : 40.0]
depth ϵ [ -100.0 km : -100.0 km]
fields: (:Depthdata, :LonData, :Velocity)Missing docstring.
Missing docstring for ProfileData. Check Documenter's build log for details.
GeophysicalModelGenerator.extract_ProfileData Function
extract_ProfileData(ProfileCoordFile::String,ProfileNumber::Int64,DataSetFile::String; DimsVolCross=(100,100),DepthVol=nothing,DimsSurfCross=(100,),WidthPointProfile=50km)This is a convenience function (used by the MATLAB GUI) that loads the data from file & projects it onto a profile. The first volumetric dataset is cut along the profile and the others are interpolated at its points, with fields named <dataset>_<field>; surface, point, screenshot and topography datasets are projected as well. If the dataset file lists no volumetric dataset, VolData of the returned profile remains nothing.
Missing docstring.
Missing docstring for GMG_Dataset. Check Documenter's build log for details.
GeophysicalModelGenerator.load_dataset_file Function
Datasets = load_dataset_file(file_datasets::String)This loads a CSV textfile that lists datasets, which is expected to have the following format:
Name,Location,Type,[Active]AlpArray,./Seismicity/ALPARRAY/AlpArraySeis.jld2,Point, true
Plomerova2022,https://seafile.rlp.net/f/abccb8d3302b4ef5af17/?dl=1,Volume
Note that the first line of the file is skipped.
Here, the meaning of the variables is:
Name: The name of the dataset to be loadedLocation: the location of the file (directory and filename) on your local machine, or an url where we can download the file from the web. The url is expected to start with "http".Type: type of the dataset (Volume, Surface, Point, Screenshot, Topography)Active: Do we want this file to be loaded or not? Optional parameter that defaults totrue
A file with fewer than 3 or more than 4 columns throws an error.
sourceGeophysicalModelGenerator.combine_vol_data Function
VolData_combined = combine_vol_data(VolData::NamedTuple; lat=nothing, lon=nothing, depth=nothing, dims=(100,100,100), dataset_preferred = 1)This takes different volumetric datasets (specified in VolData) & merges them into a single one. You need to either provide the "reference" dataset within the NamedTuple (dataset_preferred), or the lat/lon/depth and dimensions of the new dataset. VolData must contain at least one dataset.
GeophysicalModelGenerator.extract_ProfileData! Function
extract_ProfileData!(Profile::ProfileData, VolData=nothing, SurfData=nothing, PointData=nothing; DimsVolCross=(100,100), Depth_extent=nothing, DimsSurfCross=(100,), section_width=50km, ScreenshotData=nothing, TopoData=nothing)Extracts data along a vertical or horizontal profile. VolData can be a GeoData/AbstractGeneralGrid or a NamedTuple of those; the other data sets are NamedTuples. Any data argument can be nothing or empty (NamedTuple() or ()), in which case it is skipped.
GeophysicalModelGenerator.read_picked_profiles Function
This reads the picked profiles from disk and returns a vector of ProfileData
source