Closed Stephen-Veitch closed 6 months ago
See error messages here in a more legible version. Undescribed ERROR on line 19
@Stephen-Veitch I modified the code so it print out the error. This is the new error file: new_ph5toevt_error.txt
The error line is:
[2024-01-23 18:44:55,653] - ph5.core.segyfactory - ERROR: Failed to write extended portion of SEG-Y trace header: 'H' format requires 0 <= number <= 65535
It still isn't clear but it reports the number in event_t['description_s']
to be 0 <= number <= 65535
while it is currently 14530055261
.
Currently the structure for this field in SEGY is INT16. If I change to INT32, no error will happen. But I don't have the format for SEGY extended trace header style Menlo USGS to check if that is correct or not. But I believe it is.
I have a suggestion for this which is to check the description, if it satisfies the limit range it will be added to segy, if not it won't be added to segy and a warning will be added as following
[2024-01-23 19:01:35,892] - ph5.core.segyfactory - WARNING: event_t[description_s]=453005526 is ignored because it doesn't satisfy the limit range [0, 65535]
How do you think about the suggestion above?
Suggest moving forward with this fix with warning message as follows: "WARNING: description_s not added to segy header: Descriptions must be numeric values in range [0,65535] to be added to header."
When attempting to write segys for events whose description_s entry is a 9-digit numeric value ph5toevt crashes after producing a segy file with a single trace if 'extended_header_style' is set to U, 'Menlo USGS' (this is the default value).
This case produces a terminal output with handled errors prior to the crash, but the ERROR lines lack descriptions. The crash appears as python error messages. See terminal output below:
With the same event table, ph5toevt WILL NOT crash if the extended_header_style (-x) is set to P or S, and will generate complete and successful output.