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_GMGFunction
data::NamedTuple = load_GMG(data::GMG_Dataset)

Loads a dataset specified in GMG_Dataset data and returns it as a named tuple

source
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

source
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 we first download that file to a temporary directory before opening it. 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"]
source
GeophysicalModelGenerator.save_GMGFunction
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)
source
GeophysicalModelGenerator.cross_sectionFunction
cross_section(DataSet::AbstractGeneralGrid; dims=(100,100), Interpolate=false, 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_level is specified
  • They can also be vertical, either by specifying Lon_level or Lat_level (for a fixed lon/lat), or by defining both Start=(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:
  1. Volume data: data will be interpolated or directly extracted from the data set.
  2. Surface data: surface data will be interpolated or directly extracted from the data set
  3. Point data: data will be projected to the chosen profile. Only data within a chosen distance (default is 50 km) will be used
  • Interpolate indicates whether we want to simply extract the data from the data set (default) or whether we want to linearly interpolate it on a new grid, which has dimensions as specified in dims NOTE: THIS ONLY APPLIES TO VOLUMETRIC AND SURFACE DATA SETS
  • 'section_width' indicates the maximal distance within which point data will be projected to the profile

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)
source
Missing docstring.

Missing docstring for ProfileData. Check Documenter's build log for details.

GeophysicalModelGenerator.extract_ProfileDataFunction
extract_ProfileData(ProfileCoordFile::String,ProfileNumber::Int64,DataSetFile::String; DimsVolCross=(100,100),DepthVol=nothing,DimsSurfCross=(100,),WidthPointProfile=50km)

This is a convenience function (mostly for backwards compatibility with the MATLAB GUI) that loads the data from file & projects it onto a profile

source
Missing docstring.

Missing docstring for create_ProfileData. Check Documenter's build log for details.

Missing docstring.

Missing docstring for GMG_Dataset. Check Documenter's build log for details.

GeophysicalModelGenerator.load_dataset_fileFunction
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 loaded
  • Location: 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)
  • Active: Do we want this file to be loaded or not? Optional parameter that defaults to true
source
GeophysicalModelGenerator.combine_vol_dataFunction
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.

source
GeophysicalModelGenerator.extract_ProfileData!Function
extract_ProfileData!(Profile::ProfileData,VolData::GeoData, SurfData::NamedTuple, PointData::NamedTuple; DimsVolCross=(100,100),Depth_extent=nothing,DimsSurfCross=(100,),section_width=50)

Extracts data along a vertical or horizontal profile

source