[rsf-user] rsf from ascii

5 views
Skip to first unread message

Paul Goyes

unread,
May 31, 2023, 4:10:08 AM5/31/23
to rsf-...@lists.sourceforge.net
Hi, I am trying to import and plot a 3D seismic cube. The original data is in .npy (python) with shape 500,112,10 ( 500 is the fast dimension). 

In python, I saved the data in ascii format as follows
>> np.save("shot3D.txt", data.ravel() )

then, I imported to madagascar: 
>> echo n1=500 n2=112 n3=10 d1=0.001 d2=20 d3=40 o1=0 o2=0 o3=0 n4=1  data_format=ascii_float  in=shot3D.txt > test.rsf
>> sfdd < test.rsf form=ascii type=float > test2.rsf

I have a problem because esize=0, i tried with sfput, but I cannot change that parameter, for instance, I cannot use the sfwindow because it requires the bytes..


do you know how can a set the parameter "esize"??

sfin < test2.rsf
in:
    in="/var/tmp/test2.rsf@"
    esize=0 type=float form=ascii
    n1=500         d1=0.001       o1=0          
    n2=112         d2=20          o2=0          
    n3=10          d3=40          o3=0          
560000 elements

Sergey Fomel

unread,
May 31, 2023, 12:18:48 PM5/31/23
to rsf-...@lists.sourceforge.net
To put the data in a binary format, use form=native instead of form=ascii. 

You can also convert from npy directly to RSF by using the Python interface to Madagascar. See an example in $RSFSRC/book/rsf/tutorials/wavelet: wavelet/SConstruct (reproducibility.org)

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