api

package
v0.0.0-...-084b64f Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorHandler

func ErrorHandler(ctx *gin.Context)

Types

type AttributeAlongSurfaceRequest

type AttributeAlongSurfaceRequest struct {
	AttributeRequest

	// Surface along which data must be retrieved
	Surface core.RegularSurface `json:"surface" binding:"required"`

	// Samples interval above the horizon to include in attribute calculation.
	// This value should be given in the VDS's vertical domain. E.g. if the
	// vertical domain is 'ms' then a value of 22 means to include samples up
	// to 22 ms above the horizon definition. The value is rounded down to the
	// nearest whole sample. I.e. if the cube is sampled at 4ms, the attribute
	// calculation will include samples 4, 8, 12, 16 and 20ms above the
	// horizon, while the sample at 24ms is excluded.
	//
	// For each point of the surface (sample_value - above) should be in range
	// of vertical axis.
	//
	// Defaults to zero
	Above float32 `json:"above" example:"20.0"`

	// Samples interval below the horizon to include in attribute calculation.
	// Implements the same behavior as 'above'.
	//
	// For each point of the surface (sample_value + below) should be in range
	// of vertical axis.
	//
	// Defaults to zero
	Below float32 `json:"below" example:"20.0"`

} //@name AttributeAlongSurfaceRequest

Query for Attribute along the surface endpoints @Description Query payload for attribute "along" endpoint.

type AttributeBetweenSurfacesRequest

type AttributeBetweenSurfacesRequest struct {
	AttributeRequest

	// One of the two surfaces between which data will be retrieved. This value
	// should be given in the VDS's vertical domain, Annotation (for example,
	// Depth or Time). Surface will be used as reference for any sampling
	// operation, i.e. points that are on this surface will be present in the
	// final calculations and could be retrieved through samplevalue. At the
	// surface points where no data exists fillvalue will be set in the result
	// buffer.
	PrimarySurface core.RegularSurface `json:"primarySurface" binding:"required"`

	// One of the two surfaces between which data will be retrieved. This value
	// should be given in the VDS's vertical domain, Annotation (for example,
	// Depth or Time). Surface will be used to define data boundaries. For every
	// point on the primary surface the closest point on the secondary surface
	// would be found and its value set as the request boundary. It might not be
	// included in final calculations. If the closest value is fillvalue,
	// fillvalue will be set in the result buffer. It is not required for
	// surfaces to have the same plane (origin, rotation, step). If surfaces
	// intersect, exception will be thrown. If any of the values of the surface
	// is outside of data boundaries, exception will be raised.
	SecondarySurface core.RegularSurface `json:"secondarySurface" binding:"required"`

} //@name AttributeBetweenSurfacesRequest

Query for Attribute between surfaces endpoints @Description Query payload for attribute "between" endpoint.

type AttributeRequest

type AttributeRequest struct {
	RequestedResource

	// Horizontal interpolation method
	// Supported options are: nearest, linear, cubic, angular and triangular.
	// Defaults to nearest.
	// This field is passed on to OpenVDS, which does the actual interpolation.
	//
	// This only applies to the horizontal plane. Traces are always
	// interpolated with cubic interpolation (algorithm: modified makima)
	// Note: For nearest interpolation result will snap to the nearest point
	// as per "half up" rounding. This is different from openvds logic.
	Interpolation string `json:"interpolation" example:"linear"`

	// Stepsize for samples within the window defined by above below
	//
	// Samples within the vertical window will be re-sampled to 'stepsize'
	// using cubic interpolation (modified makima) before the attributes are
	// calculated.
	//
	// This value should be given in the vertical domain of the traces. E.g.
	// 0.1 implies re-sample samples at an interval of 0.1 meter (if it's a
	// depth cube) or 0.1 ms (if it's a time cube with vertical units in
	// milliseconds).
	//
	// Setting this to zero, or omitting it will default it to the vertical
	// stepsize in the VDS volume.
	Stepsize float32 `json:"stepsize" example:"1.0"`

	// Requested attributes. Multiple attributes can be calculated by the same
	// request. This is considerably faster than doing one request per
	// attribute.
	Attributes []string `json:"attributes" binding:"required" swaggertype:"array,string" example:"min,max"`

} //@name AttributeRequest

Query for Attribute endpoints @Description Query payload for attribute endpoint.

type DataRequest

type DataRequest interface {
	// contains filtered or unexported methods
}

type Endpoint

type Endpoint struct {
	MakeVdsConnection core.ConnectionMaker
	Cache             cache.Cache
}

func (*Endpoint) AttributesAlongSurfacePost

func (e *Endpoint) AttributesAlongSurfacePost(ctx *gin.Context)

AttributesAlongSurfacePost godoc @Summary Returns horizon attributes along the surface @description.markdown attribute_along @Tags attributes @Param body body AttributeAlongSurfaceRequest True "Request Parameters" @Accept application/json @Produce multipart/mixed @Success 200 {object} core.AttributeMetadata "(Example below only for metadata part)" @Failure 400 {object} ErrorResponse "Request is invalid" @Failure 500 {object} ErrorResponse "openvds failed to process the request" @Router /attributes/surface/along [post]

func (*Endpoint) AttributesBetweenSurfacesPost

func (e *Endpoint) AttributesBetweenSurfacesPost(ctx *gin.Context)

AttributesBetweenSurfacesPost godoc @Summary Returns horizon attributes between provided surfaces @description.markdown attribute_between @Tags attributes @Param body body AttributeBetweenSurfacesRequest True "Request Parameters" @Accept application/json @Produce multipart/mixed @Success 200 {object} core.AttributeMetadata "(Example below only for metadata part)" @Failure 400 {object} ErrorResponse "Request is invalid" @Failure 500 {object} ErrorResponse "openvds failed to process the request" @Router /attributes/surface/between [post]

func (*Endpoint) FenceGet

func (e *Endpoint) FenceGet(ctx *gin.Context)

FenceGet godoc @Summary Returns traces along an arbitrary path, such as a well-path @description.markdown fence @Tags fence @Param query query string True "Urlencoded/escaped FenceResponse" @Accept application/json @Produce multipart/mixed @Success 200 {object} core.FenceMetadata "(Example below only for metadata part)" @Failure 400 {object} ErrorResponse "Request is invalid" @Failure 500 {object} ErrorResponse "openvds failed to process the request" @Router /fence [get]

func (*Endpoint) FencePost

func (e *Endpoint) FencePost(ctx *gin.Context)

FencePost godoc @Summary Returns traces along an arbitrary path, such as a well-path @description.markdown fence @Tags fence @Param body body FenceRequest True "Request Parameters" @Accept application/json @Produce multipart/mixed @Success 200 {object} core.FenceMetadata "(Example below only for metadata part)" @Failure 400 {object} ErrorResponse "Request is invalid" @Failure 500 {object} ErrorResponse "openvds failed to process the request" @Router /fence [post]

func (*Endpoint) Health

func (e *Endpoint) Health(ctx *gin.Context)

func (*Endpoint) MetadataGet

func (e *Endpoint) MetadataGet(ctx *gin.Context)

MetadataGet godoc @Summary Return volumetric metadata about the VDS @description.markdown metadata @Tags metadata @Param query query string True "Urlencoded/escaped MetadataRequest" @Produce json @Success 200 {object} core.Metadata @Failure 400 {object} ErrorResponse "Request is invalid" @Failure 500 {object} ErrorResponse "openvds failed to process the request" @Router /metadata [get]

func (*Endpoint) MetadataPost

func (e *Endpoint) MetadataPost(ctx *gin.Context)

MetadataPost godoc @Summary Return volumetric metadata about the VDS @description.markdown metadata @Tags metadata @Param body body MetadataRequest True "Request parameters" @Produce json @Success 200 {object} core.Metadata @Failure 400 {object} ErrorResponse "Request is invalid" @Failure 500 {object} ErrorResponse "openvds failed to process the request" @Router /metadata [post]

func (*Endpoint) SliceGet

func (e *Endpoint) SliceGet(ctx *gin.Context)

SliceGet godoc @Summary Fetch a slice from a VDS @description.markdown slice @Tags slice @Param query query string True "Urlencoded/escaped SliceRequest" @Produce multipart/mixed @Success 200 {object} core.SliceMetadata "(Example below only for metadata part)" @Failure 400 {object} ErrorResponse "Request is invalid" @Failure 500 {object} ErrorResponse "openvds failed to process the request" @Router /slice [get]

func (*Endpoint) SlicePost

func (e *Endpoint) SlicePost(ctx *gin.Context)

SlicePost godoc @Summary Fetch a slice from a VDS @description.markdown slice @Tags slice @Param body body SliceRequest True "Query Parameters" @Accept application/json @Produce multipart/mixed @Success 200 {object} core.SliceMetadata "(Example below only for metadata part)" @Failure 400 {object} ErrorResponse "Request is invalid" @Failure 500 {object} ErrorResponse "openvds failed to process the request" @Router /slice [post]

type ErrorResponse

type ErrorResponse struct {
	// Textual description of encountered error
	Error string `json:"error" example:"message"`

} // @name ErrorResponse

@Description Error response description

type FenceRequest

type FenceRequest struct {
	RequestedResource
	// Coordinate system for the requested fence
	// Supported options are:
	// ilxl : inline, crossline pairs
	// ij   : Coordinates are given as in 0-indexed system, where the first
	//        line in each direction is 0 and the last is number-of-lines - 1.
	// cdp  : Coordinates are given as cdpx/cdpy pairs. In the original SEGY
	//        this would correspond to the cdpx and cdpy fields in the
	//        trace-headers after applying the scaling factor.
	CoordinateSystem string `json:"coordinateSystem" binding:"required" example:"cdp"`

	// A list of (x, y) points in the coordinate system specified in
	// coordinateSystem, for example [[2000.5, 100.5], [2050, 200], [10, 20]].
	Coordinates [][]float32 `json:"coordinates" binding:"required"`

	// Interpolation method
	// Supported options are: nearest, linear, cubic, angular and triangular.
	// Defaults to nearest.
	// This field is passed on to OpenVDS, which does the actual interpolation.
	// Note: For nearest interpolation result will snap to the nearest point
	// as per "half up" rounding. This is different from openvds logic.
	Interpolation string `json:"interpolation" example:"linear"`

	// Providing a FillValue is optional and will be used for the sample points
	// that lie outside the seismic cube.
	// Note: In case the FillValue is not set, and any of the provided coordinates
	// fall outside the seismic cube, the request will be rejected with an error.
	FillValue *float32 `json:"fillValue"`

} //@name FenceRequest

type MetadataRequest

type MetadataRequest struct {
	RequestedResource

} //@name MetadataRequest

type Normalizable

type Normalizable interface {
	NormalizeConnection() error
}

type RequestedResource

type RequestedResource struct {
	// The vds-key can either be provided as a string (single blob URL) or a list of strings (one or more blob URLs).
	//
	// The blob URL can be provided in signed or unsigned form. Only requests where all the blob URLs
	// are of the same form will be accepted. I.e. all signed or all unsigned.
	// - Unsigned form:
	//    example:"https://account.blob.core.windows.net/container/blob"
	//    If the unsigned form is used the sas-token must be provided in a separate sas-key.
	//
	// - Signed form:
	//    example:"https://account.blob.core.windows.net/container/blob?sp=r&st=2022-09-12T09:44:17Z&se=2022-09-12T17:44:17Z&spr=https&sv=2021-06-08&sr=c&sig=..."
	//    In the signed form the blob URL and the sas-token are separated by "?" and passed as a single string.
	//    The sas-key can not be used when blob URLs are provided in signed form,
	//    i.e. the user can choose to leave the sas-key unassigned or to send the empty string ("").
	//
	// Note: The whole query string will be passed further down to openvds.
	// We expect query parameters to contain sas-token and sas-token
	// only and give no guarantee for what Openvds/Azure returns
	// if any additional arguments are provided.
	//
	// Warning: We do not expect storage accounts to have snapshots. If your
	// storage account has any, please contact System Admin, as due to caching
	// you might end up with incorrect data.
	Vds stringOrSlice `json:"vds" binding:"required" example:"https://account.blob.core.windows.net/container/blob"`

	// A sas-token is a string containing a key that must have read access to the corresponding blob URL.
	// If blob URLs are provided in the signed form the sas-key must be undefined or set to the empty string ("").
	// When blob URLs are provided in unsigned form the sas-key must contain tokens corresponding to the provided URLs.
	// If the vds-key is provided as a string then the sas-key must be provided as a string.
	// When using string list representation the vds-key and sas-key must contain the same number of elements and
	// element number "i" in the sas-key is the token for the URL in element "i" in the vds-key.
	Sas stringOrSlice `json:"sas,omitempty" example:"sp=r&st=2022-09-12T09:44:17Z&se=2022-09-12T17:44:17Z&spr=https&sv=2021-06-08&sr=c&sig=..."`

	// When a singe blob URL and sas token pair is provided the binary_operator-key must be undefined or be the empty string("").
	// If two pairs are provided the binary_operator-key defines how the two data sets are combined into a new virtual data set.
	// Provided VDS A, VDS B and the binary_operator-key "subtraction" the request returns data from data set (A - B).
	// Valid options are: "addition", "subtraction", "multiplication", "division" and empty string ("").
	//
	// Note that there are some restrictions when applying a binary operation on two cubes.
	// Each of the axes inline, crossline and depth/time must be identical.
	// I.e, same start value, same stepsize and same number of values.
	// Further more the axis must be of the same type, for instance it is not possible to take the
	// difference between a time cube and a depth cube.
	BinaryOperator string `json:"binary_operator,omitempty" example:"subtraction"`
}

func (*RequestedResource) NormalizeConnection

func (r *RequestedResource) NormalizeConnection() error

type SliceRequest

type SliceRequest struct {
	RequestedResource

	// Direction can be specified in two domains
	// - Annotation. Valid options: Inline, Crossline and Depth/Time/Sample
	// - Index. Valid options: i, j and k.
	//
	// When requesting z-slices using annotation it's recommended to use Depth
	// or Time as they include validation against the VDS itself. I.e. the
	// server returns an error if you request a time-slice from a depth cube
	// and visa-versa. Use Sample if you don't care for such guarantees or as a
	// fallback if the VDS file is wonky.
	//
	// i, j, k are zero-indexed and correspond to Inline, Crossline,
	// Depth/Time/Sample, respectively.
	//
	// All options are case-insensitive.
	Direction string `json:"direction" binding:"required" example:"inline"`

	// Line number of the slice
	Lineno *int `json:"lineno" binding:"required" example:"10000"`

	// Restrict the slice in the other dimensions (sub-slicing)
	//
	// Bounds can be used to retrieve sub-slices. For example: when requesting
	// a time slice you can set inline and/or crossline bounds to restrict the
	// area of the slice.
	//
	// Bounds are optional. Not specifying any bounds will produce the requested
	// slice through the entire volume.
	//
	// Any bounds in the same direction as the slice itself are ignored.
	//
	// Bounds are applied one after the other. If there are multiple bounds in the
	// same direction, the last one takes precedence.
	//
	// Bounds will throw out-of-bounds error if their range is outside the
	// cubes dimensions.
	//
	// Bounds can be set using both annotation and index. You are free to mix
	// and match as you see fit.
	Bounds []core.Bound `json:"bounds" binding:"dive"`

} //@name SliceRequest

Query for slice endpoints @Description Query payload for slice endpoint /slice.

type Stringable

type Stringable interface {
	// contains filtered or unexported methods
}

Jump to

Keyboard shortcuts

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