daniel-koehn / DENISE-Black-Edition

2D time-domain isotropic (visco)elastic FD modeling and full waveform inversion (FWI) code for P/SV-waves
GNU General Public License v2.0
121 stars 66 forks source link

Add interactive python API #25

Closed ovcharenkoo closed 4 years ago

ovcharenkoo commented 4 years ago

Hi Daniel,

Please have a look at the wrapper I built around your PythonIO, which I daily use in my research. This parses ./par/DENISE_marm_OBC.inp and assigns parameters from the file to respective class attributes. Thus, these parameters become editable like class attributed, through the dot.

When you later change the default DENISE_marmOBC.inp file, there should be no need to edit the api unless you change notation. For now, it assumes that variables in the .inp file are assigned following either ...(par) =val, or par = VAL patterns.

By default, the wrapper creates an ./outputs/ folder, which mimics ./par/ folder, where it outputs everything. One could change the output destination on the fly by assigning a path to self.save_folder.

I also reproduced your Marmousi FWI example in the Jupyter notebook.

Best regards, Oleg

daniel-koehn commented 4 years ago

Hi Oleg,

Wow, this Python API is very useful. A lot of bug reports I receive are based on formating errors introduced by DENISE users in the input files. Thanks for the code contribution.

Best regards,

Daniel