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
— Functiondata::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 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"]
GeophysicalModelGenerator.save_GMG
— Functionsave_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
— Functioncross_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
orLat_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 or directly extracted from the data set
- 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 indims
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)
Missing docstring for ProfileData
. Check Documenter's build log for details.
GeophysicalModelGenerator.extract_ProfileData
— Functionextract_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
Missing docstring for create_ProfileData
. Check Documenter's build log for details.
Missing docstring for GMG_Dataset
. Check Documenter's build log for details.
GeophysicalModelGenerator.load_dataset_file
— FunctionDatasets = 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)Active
: Do we want this file to be loaded or not? Optional parameter that defaults totrue
GeophysicalModelGenerator.combine_vol_data
— FunctionVolData_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.
GeophysicalModelGenerator.extract_ProfileData!
— Functionextract_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
GeophysicalModelGenerator.read_picked_profiles
— FunctionThis reads the picked profiles from disk and returns a vector of ProfileData