Skip to content

Commit

Permalink
fix q padding with non zero t0
Browse files Browse the repository at this point in the history
  • Loading branch information
mloubout committed Mar 19, 2024
1 parent 000d669 commit 4f8b15e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/TimeModeling/Modeling/python_interface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ function devito_interface(modelPy::PyObject, srcGeometry::Geometry, srcData::Arr
# Interpolate input data to computational grid
dtComp = convert(Float32, modelPy."critical_dt")
qIn = time_resample(srcData, srcGeometry, dtComp)
qIn = _maybe_pad_t0(qIn, srcGeometry, recGeometry)

# Set up coordinates with devito dimensions
src_coords = setup_grid(srcGeometry, modelPy.shape)
Expand Down Expand Up @@ -109,6 +110,7 @@ function devito_interface(modelPy::PyObject, srcGeometry::Geometry, srcData::Arr
# Interpolate input data to computational grid
dtComp = convert(Float32, modelPy."critical_dt")
qIn = time_resample(srcData, srcGeometry, dtComp)
qIn = _maybe_pad_t0(qIn, srcGeometry, recGeometry)

# Set up coordinates with devito dimensions
#origin = get_origin(modelPy)
Expand Down Expand Up @@ -167,6 +169,7 @@ function devito_interface(modelPy::PyObject, recGeometry::Geometry, recData::Arr
dtComp = convert(Float32, modelPy."critical_dt")
dIn = time_resample(recData, recGeometry, dtComp)
qIn = time_resample(srcData, recGeometry, dtComp)
qIn, dIn = _maybe_pad_t0(qIn, recGeometry, dIn, recGeometry)

# Set up coordinates with devito dimensions
rec_coords = setup_grid(recGeometry, modelPy.shape)
Expand Down
3 changes: 3 additions & 0 deletions src/TimeModeling/Utils/time_utilities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,6 @@ end

_maybe_pad_t0(qIn::judiVector{T, AT}, dObserved::judiVector{T, AT}) where{T<:Number, AT} =
_maybe_pad_t0(get_data(qIn), get_data(dObserved))

_maybe_pad_t0(qIn::Matrix{T}, qGeom::Geometry, dataGeom::Geometry) where T<:Number =
_maybe_pad_t0(qIn, qGeom, zeros(T, dataGeom.nt[1], 1), dataGeom)[1]

0 comments on commit 4f8b15e

Please sign in to comment.