SEG-Y and Knime

Hi,

I’ve been using Knime for several months now and would like to move to into some deeper tasks. I’ve scoured everywhere I could look but came back empty.

I’m looking for some guidance on what would be needed to scan the first 3200 bytes of a binary SEG-Y (segy) file, transform the EBCDIC format to ASCII and maybe scan the binary file a bit deeper (400 bytes further) and go on to the next file? I’d like to dump that information into a table and go onto the next.

All nodes I’ve seen read the entire file. The files I’m scanning may be up to 4Tb large.

I’m starting down the python path and I’d just like to know if anybody out there could give me some guidance.

Thanks in advance!

Hi @philcremer,

We don’t have a node that directly implements the scenario you are describing.

I would suggest implementing a reader like you are describing with the Java Snippet node. That way, you can skip the data transfer part from Python back to KNIME entirely. FileInputStream would be a good starting point in the Java API. Also, here is a snippet that reads the first 32 bytes for use with the Java Snippet node:

// Enter your code here:
byte[] bytes = new byte[32];
try (FileInputStream fileInputStream = new FileInputStream(c_Location)) {
	fileInputStream.read(bytes);
	// Do something with bytes
} catch (Exception e) {
	 // handle exceptions
}
out_something = bytes;

Keep in mind that the Java Snippet node operates row-wise, i.e. it will apply the snippet to each row of the input table.

Best,
Stefan