Helper functions
JUDI provides numerous helper and utility functions need for seismic modeling and inversion.
Ricker wavelet
Create a 1D Ricker wavelet:
JUDI.ricker_wavelet
— Methodsource(tmax, dt, f0)
Create seismic Ricker wavelet of length tmax
(in milliseconds) with sampling interval dt
(in milliseonds)
and central frequency f0
(in kHz).
Compute CFL time stepping interval
Calculate the time stepping interval based on the CFL condition
calculate_dt
Compute number of computational time steps
Estimate the number of computational time steps. Required for calculating the dimensions of the matrix-free linear modeling operators:
JUDI.get_computational_nt
— Functionget_computational_nt(srcGeometry, recGeoemtry, model; dt=nothing)
Estimate the number of computational time steps. Required for calculating the dimensions
of the matrix-free linear modeling operators. srcGeometry
and recGeometry
are source
and receiver geometries of type Geometry
and model
is the model structure of type Model
.
get_computational_nt(Geoemtry, model; dt=nothing)
Estimate the number of computational time steps. Required for calculating the dimensions
of the matrix-free linear modeling operators. srcGeometry
and recGeometry
are source
and receiver geometries of type Geometry
and model
is the model structure of type Model
.
Set up 3D acquisition grid
Helper function to create a regular acquisition grid for a 3D survey.
setup_3D_grid
Data interpolation
Time interpolation for source/receiver data using splines. For modeling, the data is interpolated automatically onto the computational time axis, so generally, these functions are not needed for users.
JUDI.time_resample
— Functiontime_resample(data, geometry_in, dt_new)
Resample the input data with sinc interpolation from the current time sampling (geometrtyin) to the new time sampling `dtnew`.
Parameters
data
: Data to be reampled. If data is a matrix, resamples each column.geometry_in
: Geometry on whichdata
is defined.dt_new
: New time sampling rate to interpolate onto.
time_resample(data, dt_in, dt_new)
Resample the input data with sinc interpolation from the current time sampling dtin to the new time sampling `dtnew`.
Parameters
data
: Data to be reampled. If data is a matrix, resamples each column.dt_in
: Time sampling of inputdt_new
: New time sampling rate to interpolate onto.
time_resample(data, dt_in, geometry_in)
Resample the input data with sinc interpolation from the current time sampling (dtin) to the new time sampling `geometryout`.
Parameters
data
: Data to be reampled. If data is a matrix, resamples each column.geometry_out
: Geometry on whichdata
is to be interpolated.dt_in
: Time sampling rate of thedata.
Generate and sample from frequency distribution
Create a probability distribution with the shape of the source spectrum from which we can draw random frequencies.
JUDI.generate_distribution
— Functiongenerate_distribution(x; src_no=1)
Generates a probability distribution for the discrete input judiVector x
.
Parameters
x
: judiVector. Usualy a source with a single trace per source position.src_no
: Index of the source to select out ofx
We can draw random samples from dist
by passing it values between 0 and 1:
# Draw a single random frequency
f = dist(rand(1))
# Draw 10 random frequencies
f = dist(rand(10))
Alternatively, we can use the function:
f = select_frequencies(dist; fmin=0f0, fmax=Inf, nf=1)
to draw nf
number of frequencies for a given distribution dist
in the frequency range of fmin
to fmax
(both in kHz).
Read data from out of core container
In the case where a judiVector
is out of core (points to a segy file) it is possible to convert it or part of it into an in core judiVecor
with the get_data
function.
d_ic = get_data(d_ooc, inds)
where inds
is either a single index, a list of index or a range of index.