Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Headers when writing segy files #3354

Open
dmartinezdi opened this issue Oct 3, 2023 · 1 comment
Open

Headers when writing segy files #3354

dmartinezdi opened this issue Oct 3, 2023 · 1 comment
Labels
.io.segy question Questions asked by users. Please use https://discourse.obspy.org for asking new questions

Comments

@dmartinezdi
Copy link

I am having an issue with the headers in segy format. I am converting SAC files to SEG-Y files, to analyze them in this format. I have done the header with the obspy.io.segy.segy.SEGYTraceHeader module and fill it with the values and order that they have to had, with the info available in the SAC file and other complementary information needed for the header. When I read the files into python with obspy and convert them to a trace there is no issue, and I can handle, fill and add the respective segy header, but when I try to write this stream with one or more traces it goes out just with very limited information that the header should have and goes blank with lots of spaces in it. The result of the header when it's exported as segy is something like this:

AttribDict({'trace_header': LazyTraceHeaderAttribDict({'unpacked_header': b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00...\x00\x00', 'endian': '>', 'sample_interval_in_ms_for_this_trace': 2000, 'year_data_recorded': 2021, 'day_of_year': 312, 'hour_of_day': 16, 'minute_of_hour': 0, 'second_of_minute': 32})})

If someone has any idea on how to fix it would be lovely.

  • Obspy version: 1.4.0
  • Python version: 3.10.9
  • Windows
  • Installed with pip in anaconda env 
  • Please check whether the bug was already reported or fixed.
  • Please provide the following information:
    • ObsPy version, Python version and Platform (Windows, OSX, Linux ...)
    • How did you install ObsPy and Python (pip, anaconda, from source ...)
    • If possible please supply a short, self contained, correct example that
      demonstrates the issue.
    • If this is a regression (used to work in an earlier version of ObsPy),
      please note when it used to work.
  • Please take the time to format your ticket appropriately
    (e.g. put error tracebacks into code blocks)
@megies
Copy link
Member

megies commented Oct 6, 2023

I don't know SEGY well but this sounds like a usage question, maybe more suited for our discourse forum. Also I think you'll need to post a fully self contained minimal example of what you are doing or people can't really tell what's going on.

@megies megies added question Questions asked by users. Please use https://discourse.obspy.org for asking new questions .io.segy labels Oct 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
.io.segy question Questions asked by users. Please use https://discourse.obspy.org for asking new questions
Projects
None yet
Development

No branches or pull requests

2 participants