Reference

Base.closeMethod
close(io::CSeis)

Close a handle to a CloudSeis data-set. This may also flush contents of the CloudSeis buffer to storage.

source
Base.copy!Method
copy!(ioout::CSeis, hdrsout::AbstractMatrix{UInt8}, ioin::CSeis, hdrsin::AbstractMatrix{UInt8})

copy headers from hdrsin to hdrsout, and where hdrsin are headers from a frame of ioin, and where hdrsout are headers from a frame of ioout.

Example

julia ioin = csopen(AzContainer("mydataset-in-cs";storageaccount="mystorageaccount")) ioout = csopen(AzContainer("mydataset-out-cs";storageaccount="mystorageaccount"))

hdrsin = readframehdrs(ioin, 1) hdrsout = allocframehdrs(ioout) copy!(ioout, hdrsout, ioin, hdrsin)

source
Base.getMethod
get(prop::TraceProperty, hdrs::Matrix, i)

Returns the vale of a trace header property for the ith column in the trace headers hdrs.

Example

julia container = AzContainer("mydataset-cs"; storageaccount="mystorageaccount") io = csopen(container) hdrs = readframehdrs(io, 1) get(prop(io, "TRACE"), hdrs, 1) close(io)

source
Base.getMethod
get(prop::TraceProperty, hdr::Vector)

Returns the vale of a trace header property for the trace header hdr.

Example

julia container = AzContainer("mydataset-cs"; storageaccount="mystorageaccount") io = csopen(container) hdrs = readframehdrs(io,1) hdr = @view hdrs[:,1] get(prop(io, "TRACE"), hdr) close(io)

source
Base.inMethod
in(propdef::TracePropertyDef, io::CSeis)

return true if propdef exists in the CloudSeis data-set, io.

source
Base.reduceMethod
reduce(io[; optional keyword arguments...])

Consolodate data-set extents into fewer extents.

Optional keyword arguments

• mbytes_per_extent=1000 set the size of each output extent via either the size of each extent
• framesperextent=0 set the size of each output extent via the number of frames allowed in each extent.
source
Base.sizeMethod
size(io::CSeis[,i])

Return the size of a CloudSeis data-set. If i is specified, then return the size of dimension i.

source
Base.writeMethod
write(io::CSeis, trcs, rng...)

Write traces to io, and where the size and dimension of trcs must match the size and dimensions of rng....

Example 1

container = AzContainer("mydataset-cs"; storageaccount="mystorageaccount")
io = csopen(container, "w"; axis_length=[100,101,102])
write(io, rand(Float32,100,101,102), :, :, :)
close(io)

Example 2

container = AzContainer("mydataset-cs"; storageaccount="mystorageaccount")
io = csopen(container, "w"; axis_lengths=[100,101,102])
write(io, rand(Float32,100,50,1), :, 1:50, 1)
close(io)
source
CloudSeis.cscreateMethod
cscreate(containers[; optional keyword arguments...])

Create a new CloudSeis dataset without creating a corresponding handle and without opening the data-set. Please see help for csopen for the optional keyword arguments.

containers is either of type Container or Vector{<:Container}. Int the former case, all extents are stored in a single container, and in the later case, extents are shraded accross multiple containers.

source
CloudSeis.csopenMethod
io = csopen(containers[, mode="r"]; axis_lengths::Vector{Int}[, optional keyword arguments])

returns a handle to a CloudSeis data-set, and where container::Container corresponds to a dataset where all extents are in a single container, and container::Vector{<:Container} corresponds to a dataset where extents are sharded across mulitple containers. The container(s) can be either POSIX folders (container::Folder), or cloud storage container (e.g. container::AzContainer).

mode is one of "r" - read, "w" - write, "r+" - open existing data-set for reading and writing.

If mode="w", then axis_lenghts is a required key-word argument. axis_lengths specifies the size of the container. The axis_lengths vector is of at-least length 3.

Optional keyword arguments

• similarto::String An existing CloudSeis dataset. If set, then all other named arguments can be used to modify the data context that belongs to the existing CloudSeis dataset.
• datatype::String Examples are CMP, SHOT, etc. If not set, then UNKNOWN is used.
• traceformat::DataType=Float32 Not supported. We have only tested against traceformat=Float32.
• byteorder::String
• extents::Vector{UnitRange} List of integer ranges (frame range) for each extent. Each extent maps to an object in block storage (set only one of extents, frames_per_extent and mbytes_per_extent).
• frames_per_extent::Int Nominal number of frames per extent (set only one of extents, frames_per_extent and mbytes_per_extent).
• mbytes_per_extent::Int Nominal size of each extent in units of mega-bytes (set only one of extents, frames_per_extent and mbytes_per_extent).
• geometry::Geometry An optional three point geometry can be embedded in the CloudSeis file.
• tracepropertydefs::Vector{TracePropertyDef} An array of trace property definitions. These are in addition to the axes property definitions.
• dataproperties::Vector{DataProperty} An array of data properties. One property per dataset rather than one property per trace (as is true for tracepropertydefs).
• axis_propdefs::Vector{TracePropertyDef} Trace properties corresponding to the CloudSeis axes. If not set, then SAMPLE, TRACE, FRAME, VOLUME and HYPRCUBE are used.
• axis_units::Vector{String} Units corresponding to the CloudSeis axes. e.g. SECONDS, METERS, etc. If not set, then UNKNOWN is used.
• axis_domains::Vector{String} Domains corresponding to the CloudSeis axes. e.g. SPACE, TIME, etc. If not set, then UNKNOWN is used.
• axis_pstarts::Vector{Float64} Physical origins for each axis. If not set, then 0.0 is used for the physical origin of each axis.
• axis_pincs::Vector{Float64} Physical deltas for each axis. If not set, then 1.0 is used for the physical delta for each axis.
• axis_lstarts::Vector{Int} Logical starts for each axis. If not set, then 1 is used for the logical start for each axis.
• axis_lincs::Vector{Int} Logical increments for each axis. If not set, then 1 is used for the logical increment for each axis.
• compressor="none" Compress the cache before writing to disk. This is particularly useful for data with variable fold. chooose from: ("none", "blosc", "leftjustify")

Example

Azure storage

using AzStorage, CloudSeis
container = AzContainer("mydataset-cs"; storageaccount="mystorageaccount")
io = csopen(container, "w"; axis_lengths=[10,11,12], axis_pincs=[0.004,10.0,20.0])
close(io)

POSIX storage

using AzStorage, FolderStorage
container = Folder("mydataset-cs")
io = csopen(container, "w"; axis_lengths=[10,11,12], axis_pincs=[0.004,10.0,20.0])
source
CloudSeis.datapropertyMethod
dataproperty(io::CSeis, name)

Return the CloudSeis data property with name that is in the CloudSeis data-set io.

source
TeaSeis.allocframeMethod
trcs,hdrs = allocframe(io::CSeis)

Allocate and return memory to store traces and trace headers for a single frame.

source
TeaSeis.domainsMethod
domains(io::CSeis[,i])

Return the domain for the data-context axes. If i is specified, then return the domain for the ith data-context axis.

source
TeaSeis.foldMethod
fold(io::CSeis, i)

Return the fold of a CloudSeis frame corresponding, and where the frame is described by its index i. The frame index can be either an Int, a VarArg{Int}, or a CartesianIndex.

Example

io = csopen("foo.cs", "w"; axis_lengths=[10,11,12])
fold(io, 5, 6) # fold corresponding to 5th frame and 6th volume
source
TeaSeis.leftjustify!Method
leftjustify!(io::CSeis, trcs, hdrs)

This is primarily used for compression, but one can also use this as a convenience method to move all live traces to the beginning of its frame.

source
TeaSeis.lincsMethod
lincs(io::CSeis[,i])

Return the logical increment for the data-context axes. If i is specfied, then return the logical increment for the ith data-context axis

source
TeaSeis.lstartsMethod
lstarts(io::CSeis[,i])

Return the logical start for the data-context axes. If i is specfied, then return the logical start for the ith data-context axis

source
TeaSeis.pincsMethod
pincs(io::CSeis[,i])

Return the physical increment for the data-context axes. If i is specified, then return the physical increment for the ith data-context axis.

source
TeaSeis.propMethod
prop(io::CSeis, propertydef)

Given a property definition propertydef, return a trace property corresponding to the CloudSeis data-set. propertydef can either be a string or a TracePropertyDef.

source
TeaSeis.propdefsMethod
propdefs(io::CSeis[,i])

Return the property definitions corresponding to the data-context axes. If i is specified, then return the property definition for the ith data-context axis.

source
TeaSeis.propsMethod
props(io::CSeis[,i])

Return the trace property corresponding to the data-context axes. If i is specified, then return the property for the ith data-context axis.

source
TeaSeis.pstartsMethod
pstarts(io::CSeis[,i])

Return the physical start for the data-context axes. If i is specified, then return the physical start for the ith data-context axis.

source
TeaSeis.readframe!Method
readframe!(io::CSeis, trcs, hdrs, idx...)

Read traces and headers from io into trcs::Matrix, and hdrs::Matrix for the frame idx.... idx... can either be integer(s) or a CartesianIndex.

source
TeaSeis.readframeMethod
trcs,hdrs = readframe(io::CSeis, idx...)

Read traces and headers from io for the frame idx.... idx... can either be integer(s) or a CartesianIndex.

source
TeaSeis.readframehdrs!Method
readframehdrs!(io::CSeis, trcs, idx...)

Read headers from io into hdrs::Matrix for the frame idx.... idx... can either be integer(s) or a CartesianIndex.

source
TeaSeis.readframehdrsMethod
hdrs = readframehdrs(io::CSeis, idx...)

Read headers from io for the frame idx.... idx.. can either be integer(s) or a CartesianIndex.

source
TeaSeis.readframetrcs!Method
readframetrcs!(io::CSeis, trcs, idx...)

Read traces from io into trcs::Matrix for the frame idx.... idx... can either be integer(s) or a CartesianIndex.

source
TeaSeis.readframetrcsMethod
trcs = readframetrcs(io::CSeis, idx...)

Read traces from io for the frame idx.... idx.. can either be integer(s) or a CartesianIndex.

source
TeaSeis.readhdrs!Method
readhdrs!(io::CSeis, hdrs, rng...)

Read trace headers from io into hdrs::AbstractArray, and where the size and dimension of hdrs must correspond to the range specification in rng.... Unlike readtrcs!, we always read the entirity of each trace header. Therefore, the first range specifier must be :.

Example

container = AzContainer("mydataset-cs"; storageaccount="mystorageaccount")
io = csopen(container)
size(io) # (100,101,102)
close(io)
source
TeaSeis.readhdrsMethod
readhdrs(io::CSeis, rng...)

Read trace headers from io. Unlike readtrcs!, we always read the entirity of each trace header. Therefore, the first range specifier must be :.

Example

container = AzContainer("mydataset-cs"; storageaccount="mystorageaccount")
io = csopen(container)
size(io) # (100,101,102)
hdrs = readhdrs(io, :, :, 1)
close(io)
source
TeaSeis.readtrcs!Method
readtrcs!(io::CSeis, trcs, rng...)

Read traces from io into trcs::AbstractArray, and where the size and dimension of trcs must correspond to the range specification in rng....

Example

container = AzContainer("mydataset-cs"; storageaccount="mystorageaccount")
io = csopen(container)
size(io) # (100,101,102)
trcs = readtrcs!(io, Array{Float32,3}(undef,50,101,1), 1:50, :, 1)
close(io)
source
TeaSeis.readtrcsMethod
readtrcs(io::CSeis, trcs, rng...)

Read traces from io for the specified rng....

Example

container = AzContainer("mydataset-cs"; storageaccount="mystorageaccount")
io = csopen(container)
size(io) # (100,101,102)
trcs = readtrcs!(io, 1:50, :, 1)
close(io)
source
TeaSeis.regularize!Method
regularize!(io::CSeis[, fld], trcs, hdrs)

This is primarily used for compression, but one can also use this as a convenience method undo the effect of leftjustify!, moving traces from the beginning of the frame to their recorded trace location.

source
TeaSeis.set!Method
set!(prop::TraceProperty, hdrs::Matrix, i, value)

Set the vale of the header property for the ith column of hdrs.

Example

container = AzContainer("mydataset-cs"; storageaccount="mystorageaccount")
io = csopen(container)
set!(prop(io, "TRACE"), hdr, 1, 2)
close(io)
source
TeaSeis.set!Method
set!(prop::TraceProperty, hdr::Vector, value)

Set the vale of a trace header property for the hdr.

Example

julia container = AzContainer("mydataset-cs"; storageaccount="mystorageaccount") io = csopen(container) hdrs = readframehdrs(io, 1) hdr = @view hdrs[:,1] set!(prop(io, "TRACE"), hdr, 1) close(io)

source
TeaSeis.unitsMethod
units(io::CSeis[,i])

Return the physical unit for the data-context axes. If i is specfied, then return the physical unit for the ith data-context axis.

source
TeaSeis.writeframeMethod
writeframe(io::CSeis, trcs, hdrs)

Write a frame to io. The location of the frame is determined by the axis headers set in hdrs.

source
TeaSeis.writeframeMethod
writeframe(io::CSeis, trcs, idx...)

Write a frame to io. The location of the frame is determined from idx... which can either be integer(s) or a CartesianIndex. A minimal set of headers are created from idx... and are also written to io.

source
CloudSeis.LogicalIndicesType
I = LogicalIndices(io::CSeis)

Returns a construct similar to CartesianIndices that allows conversion from linear indices to cartesian indices that are offest by the logical starts and deltas of the CloudSeis data context. In addition, LogicalIndices implements iteration for looping over all frames in a data-set. For example,

io = csopen(AzContainer("foo"; storageaccount="bar))
idx = LogicalIndices(io)[2] # get the index corresponding to the second frame in the data-set.
for idx in LogicalIndices(io)
@show idx
trcs, hdrs = getframe(io, idx)
end`
source