Is it possible in Obspy to convert a SEGY file to a SEG2 file?
I see where one can read in a SEG2 file (Obspy.seg2.seg2)
but is it possible to write data in SEG2 format, similar to SEGY?
Thanks,
Mark Goldman
U.S. Geological Survey
345 Middlefield Rd, MS 977
Menlo Park, CA 94025
goldman@usgs.gov
650-329-5496
Hi Mark,
Is it possible in Obspy to convert a SEGY file to a SEG2 file?
I see where one can read in a SEG2 file (Obspy.seg2.seg2)
but is it possible to write data in SEG2 format, similar to SEGY?
currently the SEG2 plugin provides only a reader.
See for example:
https://github.com/obspy/obspy/blob/master/setup.py#L219-L222
https://github.com/obspy/obspy/blob/master/obspy/io/seg2/seg2.py
For the conversion you are asking for (SEGY -> SEG2), you'd needed the writer to be implemented. This should be not to complicated, but nobody ever contributed it. The conversion in the other direction is should be possible, as the writer for SEGY already exists.
In case your are considering to give it a try and want to contribute the writer for SEG2, the routine would go into `obspy/io/seg2/seg2.py` and then needs to be registered in the `setup.py` (see links above). If you open a ticket or a pull request, the developer will guide you through the process.
Cheers!
~petr
Thanks for the example, I may give it a try
There is also a common IRIS varient of SEGY files that
should be an easy plugin to develop
(no 3600 byte reel header, bytes 229-232=#samples/trace, bytes 205-206=data_sample_format: 0 = 2 byte int, 1=4 byte int)
Mark