segygo

package module
v0.0.0-...-96103e3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 3, 2018 License: Apache-2.0 Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

SEG-Y reader in Go

Go-lang library to read and write SEG-Y files

This library tries to replicate the functionality of most other SEG-Y libraries out there. But, for Go-lang that is :-) It currently supports reading a SEG-Y files (binary header; 3200 bytes) and extract the header info stored there.

The write support is not yet there (started, but not ready yet).

Features

  • Reading and parsing of SEG-Y files
  • Writing of an empty SEG-Y file
  • Writing traces to a SEG-Y file

Usage

package main
 
import (
    "github.com/asbjorn/segygo"
    "log"
)

func main() {
    log.Println("Testing segygo package")
    s, err := segygo.OpenFile("/tmp/myfile.segy")
    if err != nil {
        log.Fatalf("Unable to open SEG-Y file: %s", s.Filename)
    }   
}

Credits

Documentation

Index

Constants

View Source
const SEGY_BIN_HDR_LEN = 400
View Source
const SEGY_DESC_HDR_LEN = 3200
View Source
const SEGY_TRACE_HDR_LEN = 240
View Source
const Version = "0.1"

Variables

This section is empty.

Functions

This section is empty.

Types

type BinHeader

type BinHeader struct {
	Jobid, Lino, Reno                                                                                                          int32
	Ntrpr, Nart                                                                                                                int16
	Hdt, Dto, Hns, Nso                                                                                                         uint16
	Format, Fold, Tsort, Vscode, Hsfs, Hsfe, Hslen, Hstyp, Schn, Hstas, Hstae, Htatyp, Hcorr, Bgrcv, Rcvm, Mfeet, Polyt, Vgpol int16
	Hunass                                                                                                                     [170]int16 // unassigned
}

type SegyFile

type SegyFile struct {
	Filename string
	Header   BinHeader
	NrTraces int64

	Position int64
	LogLevel logging.Level
	// contains filtered or unexported fields
}

func CreateFile

func CreateFile(filename string) (SegyFile, error)

func OpenFile

func OpenFile(filename string) (SegyFile, error)

func (*SegyFile) GetHeader

func (s *SegyFile) GetHeader() map[string]interface{}

func (*SegyFile) GetNrSamples

func (s *SegyFile) GetNrSamples() int32

func (*SegyFile) GetNrTraces

func (s *SegyFile) GetNrTraces() int64

func (*SegyFile) ReadTrace

func (s *SegyFile) ReadTrace() (Trace, error)

func (*SegyFile) SetVerbose

func (s *SegyFile) SetVerbose(verbose bool)

type Trace

type Trace struct {
	TraceHeader
	Data []float32
}

type TraceHeader

type TraceHeader struct {
	Tracel                                                               int32
	Tracer                                                               int32
	Fldr                                                                 int32
	Tracf                                                                int32
	Ep                                                                   int32
	CDP                                                                  int32
	CDPT                                                                 int32
	Trid                                                                 int16
	Nvs                                                                  int16
	Nhs                                                                  int16
	Duse                                                                 int16
	Offset                                                               int32
	Gelev                                                                int32
	Selev                                                                int32
	Sdepth                                                               int32
	Gdel                                                                 int32
	Sdel                                                                 int32
	SwDep                                                                int32
	GwDep                                                                int32
	Scalel                                                               int16
	Scalco                                                               int16
	Sx                                                                   int32
	Sy                                                                   int32
	Gx                                                                   int32
	Gy                                                                   int32
	CoUnit                                                               int16
	WeVel                                                                int16
	SweVel                                                               int16
	Sut, Gut, Sstat, Gstat, Tstat, Laga, Lagb, Delrt, Muts, Mute         int16
	Ns, Dt                                                               uint16
	Gain, Igc, Igi, Corr, Sfs, Sfe, Slen, Styp, Stas, Stae, Tatyp        int16
	Afilf, Afils, NoFilf, NoFils, Lcf, Hcf, Lcs, Hcs, Year, Day          int16
	Hour, Minute, Sec, Timbas, Trwf, Grnors, Grnofr, Grnlof, Gaps, Otrav int16
	D1, F1, D2, F2, Ungpow, Unscale                                      float32
	Ntr                                                                  int32
	Mark, Shortpad                                                       int16
	Unass                                                                [14]int16 // unassigned short array
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL