core

package
v0.0.0-...-3036a32 Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AxisI         = C.I
	AxisJ         = C.J
	AxisK         = C.K
	AxisInline    = C.INLINE
	AxisCrossline = C.CROSSLINE
	AxisDepth     = C.DEPTH
	AxisTime      = C.TIME
	AxisSample    = C.SAMPLE
)
View Source
const (
	CoordinateSystemIndex      = C.INDEX
	CoordinateSystemAnnotation = C.ANNOTATION
	CoordinateSystemCdp        = C.CDP
)
View Source
const (
	BinaryOperatorInvalidOperator = C.INVALID_OPERATOR
	BinaryOperatorNoOperator      = C.NO_OPERATOR
	BinaryOperatorAddition        = C.ADDITION
	BinaryOperatorSubtraction     = C.SUBTRACTION
	BinaryOperatorMultiplication  = C.MULTIPLICATION
	BinaryOperatorDivision        = C.DIVISION
)

Variables

This section is empty.

Functions

func GetAttributeType

func GetAttributeType(attribute string) (int, error)

func GetAxis

func GetAxis(direction string) (int, error)

func GetBinaryOperator

func GetBinaryOperator(binaryOperator string) (uint32, error)

func GetCoordinateSystem

func GetCoordinateSystem(coordinateSystem string) (int, error)

func GetInterpolationMethod

func GetInterpolationMethod(interpolation string) (int, error)

Types

type Array

type Array struct {
	// Data format is represented by numpy-style format codes. Currently the
	// format is always 4-byte floats, little endian (<f4).
	Format string `json:"format" example:"<f4"`

	// Shape of the returned data
	Shape []int `json:"shape" swaggertype:"array,integer" example:"10,50"`
}

type AttributeMetadata

type AttributeMetadata struct {
	Array

} // @name AttributeMetadata

@Description Attribute metadata

type Axis

type Axis struct {
	// Name/Annotation of axis
	Annotation string `json:"annotation" example:"Sample"`

	// Minimum axis value
	Min float64 `json:"min" example:"4.0"`

	// Maximum axis value
	Max float64 `json:"max" example:"4500.0"`

	// Number of samples along the axis
	Samples int `json:"samples" example:"1600"`

	// Distance from one sample to the next
	StepSize float64 `json:"stepsize" example:"4.0"`

	// Axis units
	Unit string `json:"unit" example:"ms"`

} // @name Axis

@Description Axis description

type AzureConnection

type AzureConnection struct {
	// contains filtered or unexported fields
}

func NewAzureConnection

func NewAzureConnection(
	blobPath string,
	container string,
	host string,
	sas string,
) *AzureConnection

func (*AzureConnection) ConnectionString

func (c *AzureConnection) ConnectionString() string

func (*AzureConnection) IsAuthorizedToRead

func (c *AzureConnection) IsAuthorizedToRead() bool
  • Verify that the connection has enough access to read a VDS from Blob Store *
  • This function does a HEAD request to the VolumeDataLayout in the VDS, in
  • form of a 'get blob properties' request [1] in order to verify read access,
  • and that the token is generally valid. *
  • The HEAD request itself is not sufficient if the SAS token happens to be a
  • Service- or User Delegation SAS. In that case we also need to check if the
  • Signed Resource ('sr') parameter contains either 'c' (container) or 'd'
  • (directory). The presence of either 'c' or 'd' confirms that the SAS-token is
  • valid not only for the VolumeDataLayout blob, but all blobs in the same and
  • subsequent directories relative to the VolumeDataLayout blob. *
  • [1] https://learn.microsoft.com/en-us/rest/api/storageservices/get-blob-properties

func (*AzureConnection) Url

func (c *AzureConnection) Url() string

type Bound

type Bound struct {
	// Direction of the bound. See SliceRequest.Direction for valid options
	Direction *string `json:"direction" binding:"required" example:"inline"`

	// Lower bound - inclusive
	Lower *int `json:"lower" binding:"required" example:"100"`

	// Upper bound - inclusive
	// Upper bound must be greater or equal to lower bound
	Upper *int `json:"upper" binding:"required" example:"200"`

} // @name SliceBound

@Description Slice bounds.

type BoundingBox

type BoundingBox struct {
	Cdp  [][]float64 `json:"cdp"`
	Ilxl [][]float64 `json:"ilxl"`
	Ij   [][]float64 `json:"ij"`

} //@name BoundingBox

@Description The bounding box of the survey, defined by its 4 corner @Description coordinates. The bounding box is given in 3 different @Description coordinate systems. The points are sorted in the same order for @Description each system. E.g. [[1,2], [2,2], [2,3], [1,3]]

type Connection

type Connection interface {
	Url() string
	ConnectionString() string
	IsAuthorizedToRead() bool
}

type ConnectionMaker

type ConnectionMaker func(blob, sas string) (Connection, error)

func MakeAzureConnection

func MakeAzureConnection(accounts []string) ConnectionMaker

type DSHandle

type DSHandle struct {
	// contains filtered or unexported fields
}

func CreateDSHandle

func CreateDSHandle(connections []Connection, operator uint32) (DSHandle, error)

func NewDSHandle

func NewDSHandle(connection Connection) (DSHandle, error)

func (DSHandle) Close

func (v DSHandle) Close() error

func (DSHandle) DataHandle

func (v DSHandle) DataHandle() *C.struct_DataHandle

func (DSHandle) Error

func (v DSHandle) Error(status C.int) error

func (DSHandle) GetAttributeMetadata

func (v DSHandle) GetAttributeMetadata(data [][]float32) ([]byte, error)

func (DSHandle) GetAttributesAlongSurface

func (v DSHandle) GetAttributesAlongSurface(
	referenceSurface RegularSurface,
	above float32,
	below float32,
	stepsize float32,
	attributes []string,
	interpolation int,
) ([][]byte, error)

func (DSHandle) GetAttributesBetweenSurfaces

func (v DSHandle) GetAttributesBetweenSurfaces(
	primarySurface RegularSurface,
	secondarySurface RegularSurface,
	stepsize float32,
	attributes []string,
	interpolation int,
) ([][]byte, error)

func (DSHandle) GetFence

func (v DSHandle) GetFence(
	coordinateSystem int,
	coordinates [][]float32,
	interpolation int,
	fillValue *float32,
) ([]byte, error)

func (DSHandle) GetFenceMetadata

func (v DSHandle) GetFenceMetadata(coordinates [][]float32) ([]byte, error)

func (DSHandle) GetMetadata

func (v DSHandle) GetMetadata() ([]byte, error)

func (DSHandle) GetSlice

func (v DSHandle) GetSlice(lineno, direction int, bounds []Bound) ([]byte, error)

func (DSHandle) GetSliceMetadata

func (v DSHandle) GetSliceMetadata(
	lineno int,
	direction int,
	bounds []Bound,
) ([]byte, error)

type FenceMetadata

type FenceMetadata struct {
	Array

} // @name FenceMetadata

@Description Fence metadata

type FileConnection

type FileConnection struct {
	// contains filtered or unexported fields
}

func NewFileConnection

func NewFileConnection(path string) *FileConnection

func (*FileConnection) ConnectionString

func (f *FileConnection) ConnectionString() string

func (*FileConnection) IsAuthorizedToRead

func (c *FileConnection) IsAuthorizedToRead() bool

func (*FileConnection) Url

func (f *FileConnection) Url() string

type InternalError

type InternalError struct {
	// contains filtered or unexported fields
}

func NewInternalError

func NewInternalError(msg string) *InternalError

func (*InternalError) Error

func (e *InternalError) Error() string

type InvalidArgument

type InvalidArgument struct {
	// contains filtered or unexported fields
}

func NewInvalidArgument

func NewInvalidArgument(msg string) *InvalidArgument

func (*InvalidArgument) Error

func (e *InvalidArgument) Error() string

type Metadata

type Metadata struct {
	// Coordinate reference system
	Crs string `json:"crs" example:"PROJCS[\"ED50 / UTM zone 31N\",..."`

	// The original input file name
	InputFileName string `json:"inputFileName" example:"file.segy"`

	// Import time stamp in ISO8601 format
	ImportTimeStamp string `json:"importTimeStamp" example:"2021-02-18T21:54:42.123Z"`

	// Bounding box
	BoundingBox BoundingBox `json:"boundingBox"`

	// Axis descriptions
	//
	// Describes the axes of the requested 2-dimensional slice.
	Axis []*Axis `json:"axis"`

} // @name Metadata

@Description Metadata

type RegularSurface

type RegularSurface struct {
	// Values / height-map
	Values [][]float32 `json:"values" binding:"required"`

	// Rotation of the X-axis (East), counter-clockwise, in degrees
	Rotation *float32 `json:"rotation" binding:"required" example:"33.78"`

	// X-coordinate of the origin
	Xori *float32 `json:"xori" binding:"required" example:"-324.1"`

	// Y-coordinate of the origin
	Yori *float32 `json:"yori" binding:"required" example:"6721.33"`

	// X-increment - The physical distance between height-map columns
	Xinc float32 `json:"xinc" binding:"required" example:"8.12"`

	// Y-increment - The physical distance between height-map rows
	Yinc float32 `json:"yinc" binding:"required" example:"-1.02"`

	// Any sample in the input values with value == fillValue will be ignored
	// and the fillValue will be used in the amplitude map.
	// I.e. for any [i, j] where values[i][j] == fillValue then
	// output[i][j] == fillValue.
	// Additionally, the fillValue is used for any point of the surface that
	// falls outside the bounds of the seismic volume.
	FillValue *float32 `json:"fillValue" binding:"required" example:"-999.25"`

} // @name RegularSurface

@Description Geometrical plane with depth/time data points

func (*RegularSurface) ToString

func (s *RegularSurface) ToString() string

type SliceMetadata

type SliceMetadata struct {
	Array

	// X-axis information
	X Axis `json:"x"`

	// Y-axis information
	Y Axis `json:"y"`

	// Shape of the returned slice. Equals to [Y.Samples, X.Samples]
	Shape []int `json:"shape" swaggertype:"array,integer" example:"10,50"`

	// Horizontal bounding box of the slice. For inline/crossline slices this
	// is a linestring, while for time/depth slices this is a polygon. If the
	// slice is not cropped, the polygon is the bounding box of the cube.
	Geospatial [][]float64 `json:"geospatial"`

} // @name SliceMetadata

@Description Slice metadata

Jump to

Keyboard shortcuts

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