sixty-north / segpy

A Python package for reading and writing SEG Y files.
Other
102 stars 54 forks source link

Confusion about dimensionality detection heuristic #77

Closed abingham closed 6 years ago

abingham commented 6 years ago

I'm trying to write a test for create_reader's ability to guess the dimensionality of a dataset, but I'm confused about how or if the heuristic for 2D works.

The heuristic says "if there's a cdp_catalog but no line_catalog, then the dimensionality is 2". However, looking at toolkit.catalog_traces(), it seems like we can't ever actually create that situation. In short, in every case where we can create a cdp_catalog, we're also able to create (at least) an alt_line_catalog", and this alt_line_catalog will get used as the line catalog, i.e. a valid cdp_catalog implies a valid line_catalog.

It's entirely possible that I'm missing some important point about catalogs, so let me know if that's the case.

rob-smallshire commented 6 years ago

Hmm. Might be worth trying to load all the actual SEG-Y files we have in Dropbox to see if any of them are actually detected as being 2D.

rob-smallshire commented 6 years ago

The cdp_catalog maps ensemble_num to trace_number. The alt_line_catalog maps (file_sequence_num, ensemble_num) to trace_number. So yes, even in the case that file_sequence_num is constant or undefined or all traces the alt_line_catalog will be successfully constructed.

I've very much minded to remove the alt_line_catalog stuff from catalog_traces() on the basis that if your 3D seismic is organised in this odd way, it's reasonable that you need to do more legwork to explain to Segpy exactly what you're dealing with, rather than relying on the heuristic. A refinement of that, might be to only try to use the alt_line_catalog if the dimensionality has been forced to 3 when calling create_reader().

rob-smallshire commented 6 years ago

In summary, I think you should remove the alt_line_catalog thing, because as it is now, it's just broken.