[rsf-devel] Looking for program/function for comparing two RSF files

4 views
Skip to first unread message

Dmitry Kabanov

unread,
Sep 11, 2018, 9:21:13 AM9/11/18
to Madagascar Devel Mailing List
Dear Madagascar Community,

Is there any program or function in Madagascar that allows to compare
RSF files and determine if their data are close enough?

What I have in mind as an example is the function `assert_allclose`
from the Numpy Testing package:

https://docs.scipy.org/doc/numpy/reference/generated/numpy.testing.assert_allclose.html

that compares two floating-point arrays and determines if they are
close to each other within some absolute and relative tolerances.

Thank you in advance!


Sincerely yours,
Dmitry Kabanov
Software developer in One Omega Seismics
King Abdullah University of Science and Technology, Saudi Arabia
Mobile: 054-470-11-93

--

This message and its contents, including attachments are intended solely
for the original recipient. If you are not the intended recipient or have
received this message in error, please notify me immediately and delete
this message from your computer system. Any unauthorized use or
distribution is prohibited. Please consider the environment before printing
this email.


_______________________________________________
RSF-devel mailing list
RSF-...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rsf-devel

Karl Schleicher

unread,
Sep 28, 2018, 6:58:58 PM9/28/18
to Dmitry Kabanov, Madagascar Devel Mailing List


Dmitry,
Sorry about the slow response.  I need to do a little experimenting before responding.

You can read Madagascar .rsf file into python using $RSFSRC/api/m8r.py.  This file is moved into $RSFSR/lib.python2.7/site-packages/m8r/py when you make Madagascar.  This makes it ready for you to import into python.  This should allow you to create the program you desire.

I experimented with pythonin a Jupyter notebook to create two .rsf files that are almost the same to experiment with numpy.testing.assert_allclose. The notebook and a python file are attached. I do not know your vision for this program, but you should be able to create it using these code examples.

Karl Schleicher
 


From: Dmitry Kabanov <dmitry....@kaust.edu.sa>
Sent: Tuesday, September 11, 2018 7:55 AM
To: Madagascar Devel Mailing List
Subject: [rsf-devel] Looking for program/function for comparing two RSF files
 
Dear Madagascar Community,

Is there any program or function in Madagascar that allows to compare
RSF files and determine if their data are close enough?

What I have in mind as an example is the function `assert_allclose`
from the Numpy Testing package:



that compares two floating-point arrays and determines if they are
close to each other within some absolute and relative tolerances.

Thank you in advance!


Sincerely yours,
Dmitry Kabanov
Software developer in One Omega Seismics
King Abdullah University of Science and Technology, Saudi Arabia
Mobile: 054-470-11-93

--

This message and its contents, including attachments are intended solely
for the original recipient. If you are not the intended recipient or have
received this message in error, please notify me immediately and delete
this message from your computer system. Any unauthorized use or
distribution is prohibited. Please consider the environment before printing
this email.


_______________________________________________
RSF-devel mailing list
RSF-...@lists.sourceforge.net
madagascar_assert_allclose.ipynb
madagascar_assert_allclose.py

Dmitry Kabanov

unread,
Sep 29, 2018, 5:56:52 PM9/29/18
to Karl Schleicher, Madagascar Devel Mailing List
Dear Karl,

Thank you for the example!
It seems like the only easy way to compare RSF files numerically is
through python, so I'm gonna stick with this way for now.

Hopefully, my proficiency with Madagascar will become better soon and
I will rewrite it as a C program, such that to remove the dependency
on Python.
Sincerely yours,
Dmitry Kabanov
Software developer in One Omega Seismics
King Abdullah University of Science and Technology, Saudi Arabia
Mobile: 054-470-11-93


> ________________________________
> This message and its contents, including attachments are intended solely for
> the original recipient. If you are not the intended recipient or have
> received this message in error, please notify me immediately and delete this
> message from your computer system. Any unauthorized use or distribution is
> prohibited. Please consider the environment before printing this email.

--

This message and its contents, including attachments are intended solely
for the original recipient. If you are not the intended recipient or have
received this message in error, please notify me immediately and delete
this message from your computer system. Any unauthorized use or
distribution is prohibited. Please consider the environment before printing
this email.


_______________________________________________
RSF-devel mailing list
RSF-...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rsf-devel
Reply all
Reply to author
Forward
0 new messages