Samples and Mock Data
Choose between a synthetic DataSource and generated example files for your application.
Compare seismic displays
Compare density and wiggles on the same synthetic section. Drag a box to zoom; double-click to reset.
<SectionView source={source} path="demo"
display={{ colormap: 'Seismic', wiggle: false, agc: false }}
rangeBars style={{ height: 340 }} />Use mocks to test rendering. Use generated files to test parsing as well.
Choose the Test You Need
| Goal | API | Execution |
|---|---|---|
| Render without a file or service | MockDataSource |
Source returns synthetic data |
| Exercise a browser file session | source.openSample(name) |
File generated and opened in a worker |
| Test a parser with bytes | makeSample(name) |
Generation runs on your calling thread |
Start with a Mock Section
import { useState } from 'react'
import { MockDataSource } from '@bs/outkrop-core/mock'
import { SectionView } from '@bs/outkrop-react'
export function SampleSection() {
const [source] = useState(() => new MockDataSource({ latencyMs: 20 }))
return <SectionView source={source} path="mock://line_small.sgy" style={{ height: 480 }} />
}
Built-in paths: mock://line_small.sgy, mock://line_large.sgy, mock://gathers.sgy, mock://well.las, mock://sonic.dlis. The DLIS identifier is a mock; it does not mean readers supports local DLIS.
Set lines / wells in MockOptions to choose dimensions and spacing. latencyMs simulates delayed responses; it is not a real network benchmark.
Generate and Open a File
import { LocalDataSource } from '@bs/outkrop-readers/browser'
export async function openSampleSection(signal?: AbortSignal) {
const source = new LocalDataSource()
try {
const info = await source.openSample('synthetic-line.sgy', { signal })
return { source, info }
} catch (error) {
source.dispose()
throw error
}
}
The caller owns the returned source: dispose it after views unmount.
| Sample name | Data |
|---|---|
synthetic-line.sgy |
Seismic line |
velocity-model.sgy |
Velocity model |
sonic-waveforms.su |
Trace waveforms |
synthetic-well.las |
Scalar well log |
core-plugs.csv |
Core measurements |
pressure-tests.json |
Pressure table |
Get Bytes Directly
import { makeSample } from '@bs/outkrop-readers/synthetic'
import { memorySource, openSeismic } from '@bs/outkrop-readers'
export async function inspectGeneratedLine() {
const bytes = makeSample('synthetic-line.sgy')
return openSeismic(memorySource(bytes))
}
Use the optional imports shown here so unused sample code can be omitted. See direct parsing.