devitocodes / devito

DSL and compiler framework for automated finite-differences and stencil computation
http://www.devitoproject.org
MIT License
536 stars 221 forks source link

add noise #2355

Closed vahid-honarbakhsh closed 1 month ago

vahid-honarbakhsh commented 2 months ago

Hi,

I want to add random noise to the data. How can I do it?

Generate synthetic data from true model

, , _ = solver.forward(vp=model.vp, rec=d_obs) + noise

Thanks, vahid

mloubout commented 2 months ago
rec, u, summary = solver.forward(vp=model.vp, rec=d_obs) 
rec.data[:] += noise_you_want # of shape rec.shape
georgebisbas commented 1 month ago

@vahid-honarbakhsh is that still an issue? Since this is mostly a question on how to use the DSL and not a repository-specific issue, I am closing this for now and you can always ask in our slack channel: https://join.slack.com/t/devitocodes/shared_invite/zt-gtd2yxj9-Y31YKk_7lr9AwfXeL2iMFg