As the Segy format is not understood the same way in all software, you might find that the Segy writer that is available in the INTGeo library does not write header values the way you expect them. Here are some hints on how this writer works and steps you can take:
The header values that are written to disk are extracted from the ITrace interface. Specially, the ITrace.getHeader(int) method is used to retrieve each value to write on disk. The id passed as a parameter to that method identifies its matching IFieldDesc.
The tutorial only writes the INLINE and XLINE header values. If you need other header values, you need to adjust the ISeismicData.getTraceHeaderFields(int) and the ISeismicReader.getTraceHeaderFields() method to return all header values to write.
The Segy format is defined by the cgStandardSegyFormat class. The Segy writer looks up each field name in that format, and tries to find matching IFieldDesc instances in your virtual ISeismicData. Here is sample code to extract all standard header names:
import com.interactive.jgeo.seismic.data.cgHeaderFieldDesc;
import com.interactive.jgeo.seismic.data.cgHeaderFormat;
import com.interactive.jgeo.seismic.segy.cgStandardSegyFormat;
import java.util.Vector;
cgStandardSegyFormat format = new cgStandardSegyFormat();
Vector<cgHeaderFormat> formats = format.getTraceHeaderFormats();
for (cgHeaderFormat currentFormat : formats) {
Vector<cgHeaderFieldDesc> headerFields = currentFormat.getHeaderFields();
for (cgHeaderFieldDesc currentHeaderField : headerFields) {
System.out.println(currentHeaderField.getIdentifier() + ": " + currentHeaderField.getName());
}
}
This method creates this output:
200: TSSN
201: FIELD REC
202: FIELD TR
203: SHTPT ID
204: CDP
205: CDPTR
206: TRACE ID
222: VERT SUM
223: HORZ SUM
224: DATA USE
207: OFFSET
208: RCV ELEV
225: SRC ELEV
226: SRC DEPTH
227: RCV DATUM
228: SRC DATUM
229: SRC WATER DEPTH
230: RCV WATER DEPTH
231: ELEVATION SCALER
209: LOC SCALER
210: SRCX
211: SRCY
212: RCVX
213: RCVY
232: COORD UNITS
233: WEATHER VEL
234: SUBWEATHER VEL
235: SRC UPHOLE TIME
236: RCV UPHOLE TIME
237: SRC STATIC CORR
238: RCV STATIC CORR
239: TOTAL STATIC CORR
240: LAG A
241: LAG B
214: START TIME
242: MUTE START
243: MUTE END
215: SAMPLES IN TRACE
216: SAMPLE RATE
217: CDPX
218: CDPY
219: INLINE
220: XLINE
221: SHTPT NUM
244: SURF TIME SCALER
The IDs are not relevant for the field matching logic. Only the names should match exactly.
If the header values written to disk are invalid, here is sample code you can use to check that each trace has the right values:
import com.interactive.intgeoapi.data.IFieldDesc;
import com.interactive.intgeoapi.data.query.SeismicRangeQuery;
import com.interactive.intgeoapi.data.seismic.ISeismicData;
import com.interactive.intgeoapi.data.seismic.ISeismicReader;
import com.interactive.intgeoapi.data.seismic.ITrace;
ISeismicData seismicData = ...
ISeismicReader reader = seismicData.select(new SeismicRangeQuery());
ITrace firstTrace = reader.getTrace(0);
IFieldDesc inlineField = reader.getTraceHeaderField("INLINE");
Number header = firstTrace.getHeader(inlineField.getIdentifier());
System.out.println(header);
If all header values are correct in your virtual dataset and the final .sgy file doesn't show these values, then the format used by the Segy writer is not the format you expect. In this case, check this tutorial.