SEAScope.types package¶
Submodules¶
SEAScope.types.collection module¶
This module handles the serialization and deserialization of collection objects
- SEAScope.types.collection.deserialize(buf)[source]¶
Rebuild a collection from a FlatBuffers buffer.
- Parameters:
buf (bytearray) – The buffer which contains the collection object serialized with FlatBuffers
- Returns:
The deserialized collection object as a dictionary. Note that the “defaultVariable” key is lost in the process.
- Return type:
dict
- SEAScope.types.collection.serialize(builder, collection_obj)[source]¶
Serialize a collection using FlatBuffers.
- Parameters:
builder (flatbuffers.builder.Builder) – The FlatBuffers builder instance which serializes data. If this parameter is None, then a new builder will be created
collection_obj (dict) – Dictionary which contains information about the collection to serialize It must have ten keys:
mustBeCurrent
: abool
which tells SEAScope how its temporal filter must be applied for this collection.When this setting is set to true, the viewer will ignore granules whose time range does not contain the current datetime. It is the recommended behavior for collections whose granules cover the whole globe.
When it is set to false, the viewer displayed the granules of the collection as long as their time range intersects the current time window (cf. timespans in the list of settings for the application configuration file). Use this behavior for collections of granules with a smaller spatial footprint or a sparse temporal coverage.
xSeamless
: abool
which tells SEAScope that the granules of the collection have a 360° longitudinal coverySeamless
: abool
which tells SEAScope that the granules of the collection have a 180° latitudinal coverNEWSAligned
: abool
which tells SEAScope that the axes of the data matrix are aligned witth the South-North and West-East axeslabel
: astr
that SEAScope uses to designate the collectiontags
: adict
which contains tags that describe the collection. SEAScope considers a (key, value) pair as a tag.variables
: alist
ofdict
containing information about the variables defined for the collection. Eachdict
objects must have all the keys required bySEAScope.types.variable.serialize()
defaultVariable
: aint
which is the index of the default item in thevariables
listid
: adict
whose content can be used by SEAScope as a unique identifier for the collection. It must have all the keys required bySEAScope.types.renderable_id.serialize()
- Returns:
A tuple which contains two elements:
the
flatbuffers.builder.Builder
instance which has been used to serialize dataan
int
which is the address/offset of the serialized object in the builder buffer
- Return type:
tuple(flatbuffers.builder.Builder, int)
SEAScope.types.collection_id module¶
This module handle the serialization of collection identifiers.
- SEAScope.types.collection_id.serialize(builder, colid_obj)[source]¶
Serializes a collection identifier using FlatBuffers.
- Parameters:
builder (flatbuffers.builder.Builder) – The FlatBuffers builder instance which serializes data. If this parameter is None, then a new builder will be created
colid_obj (dict) – Dictionary which contains information about the collection to serialize It must have two keys:
sourceId : an
int
that identifies the data source which owns the collectioncollectionId : an
int
that identifies the collection within the data source it belongs to
- Returns:
A tuple which contains two elements:
the
flatbuffers.builder.Builder
instance which has been used to serialize dataan
int
which is the address/offset of the serialized object in the builder buffer
- Return type:
tuple(flatbuffers.builder.Builder, int)
SEAScope.types.color module¶
This module handles the serialization and deserialization of color values
- SEAScope.types.color.deserialize(o)[source]¶
Rebuild a color from a FlatBuffers buffer.
- Parameters:
buf (bytearray) – The buffer which contains the color object serialized with FlatBuffers
- Returns:
The deserialized color object as a
list
of 3int
(R, G and B)- Return type:
dict
- SEAScope.types.color.serialize(builder, color_obj)[source]¶
Serialize a rendering configuration using FlatBuffers.
- Parameters:
builder (flatbuffers.builder.Builder) – The FlatBuffers builder instance which serializes data. If this parameter is None, then a new builder will be created
color_obj (
list
of 3int
) – The color described by its red, green and blue channels
- Returns:
A tuple which contains two elements:
the
flatbuffers.builder.Builder
instance which has been used to serialize dataan
int
which is the address/offset of the serialized object in the builder buffer
- Return type:
tuple(flatbuffers.builder.Builder, int)
SEAScope.types.data_bucket module¶
This module handles the serialization of data bucket objects
- SEAScope.types.data_bucket.serialize(builder, bucket_obj)[source]¶
Serialize a data bucket using FlatBuffers.
- Parameters:
builder (flatbuffers.builder.Builder) – The FlatBuffers builder instance which serializes data. If this parameter is None, then a new builder will be created
bucket_obj (
dict
) – Dictionary which contains information about the data bucket to serialize. It must have 2 keys:info
: adict
providing information about the data contained in the bucket. It must have all the keys required bySEAScope.types.data_info.serialize()
data
: alist
of numpy.uint8 which contains values packed as unsigned bytes
- Returns:
A tuple which contains two elements:
the
flatbuffers.builder.Builder
instance which has been used to serialize dataan
int
which is the address/offset of the serialized object in the builder buffer
- Return type:
tuple(flatbuffers.builder.Builder, int)
SEAScope.types.data_info module¶
This module handles the serialization of data info objects
- SEAScope.types.data_info.data_types = {'float32': 4, 'none': 0, 'uint32': 3, 'uint8': 1, 'ushort16': 2}¶
Data types that can be used to store information in SEAScope. Beware: SEAScope expects some values to have a specific type and will probably crash or return an error if a value with another type is provided.
- Type:
dict
- SEAScope.types.data_info.serialize(builder, info_obj)[source]¶
Serialize a granule data info using FlatBuffers.
- Parameters:
builder (flatbuffers.builder.Builder) – The FlatBuffers builder instance which serializes data. If this parameter is None, then a new builder will be created
info_obj (dict) – Dictionary which contains information about the data to serialize
It must have keys:
offsets
: alist
offloat
for the offset used when packing the data values (packed = (values - offset) / scale
).One value per channel contained in the data matrix
scaleFactors
: alist
of float for the scale factors used when packing the data values (packed = (values - offset) / scale
)One value per channel contained in the data matrix
fillValues
: alist
offloat
for the fill values that have been stored in the data matrix to replace missing/invalid data. Note that the fill values in this list belong to the packed values domain.One value per channel contained in the data matrix
dataType
: astr
which identifies the type to allocate for the values contained in the data matrix. Its value must be a key of theSEAScope.types.data_info.data_types`
dictionary.Only
uint8
is supported at the momentchannels
: anint
for the number of channels/fields contained in the data matrixxArity
: anint
which tells SEAScope how many columns it must allocate when reconstructing the data matrixyArity
: anint
which tells SEAScope how many rows it must allocate when reconstructing the data matrix
- Returns:
A tuple which contains two elements:
the
flatbuffers.builder.Builder
instance which has been used to serialize dataan
int
which is the address/offset of the serialized object in the builder buffer
- Return type:
tuple(flatbuffers.builder.Builder, int)
SEAScope.types.extraction module¶
This module handles the deserialization of extraction objects
SEAScope.types.gcp module¶
This module handles the serialization and deserialization of GCP objects
- SEAScope.types.gcp.deserialize(o)[source]¶
Rebuild a GCP from a FlatBuffers buffer.
- Parameters:
buf (bytearray) – The buffer which contain the GCP object serialized with FlatBuffers
- Returns:
The deserialized GCP object as a dictionary.
- Return type:
dict
- SEAScope.types.gcp.serialize(builder, gcp_obj)[source]¶
Serialize a GCP using FlatBuffers.
- Parameters:
builder (flatbuffers.builder.Builder) – The FlatBuffers builder instance which serializes data. If this parameter is None, then a new builder will be created
gcp_obj (dict) – Dictionary which contains information about the GCP to serialize
It must have four keys:
lon
: afloat
which gives the longitude of the GCPlat
: afloat
which gives the latitude of the GCPi
: anint
which is the number of the column in the data matrix for the GCPj
: anint
which is the number of the row in the data matrix for the GCP
There is a fifth optional key:
time
: aint
which is the number of milliseconds since epoch for the GCP. The default value is 0 if this key is not provided.
- Returns:
A tuple which contains two elements:
the
flatbuffers.builder.Builder
instance which has been used to serialize dataan
int
which is the address/offset of the serialized object in the builder buffer
- Return type:
tuple(flatbuffers.builder.Builder, int)
SEAScope.types.granule_data module¶
This module handles the serialization of granule data objects
- SEAScope.types.granule_data.serialize(builder, data_obj)[source]¶
Serialize a granule data using FlatBuffers.
- Parameters:
builder (flatbuffers.builder.Builder) – The FlatBuffers builder instance which serializes data. If this parameter is None, then a new builder will be created
data_obj (dict) – Dictionary which contains information about the granule data to serialize. Its keys must be the name of the data fields and its values must be
dict
objects that satisfy the requirements of theSEAScope.types.data_bucket.serialize()
method
- Returns:
A tuple which contains two elements:
the
flatbuffers.builder.Builder
instance which has been used to serialize dataan
int
which is the address/offset of the serialized object in the builder buffer
- Return type:
tuple(flatbuffers.builder.Builder, int)
SEAScope.types.granule_metadata module¶
This module handles the serialization and deserialization of granule metadata objects
- SEAScope.types.granule_metadata.data_models = {'LAT_LON': 0, 'NJ_NI': 2, 'ROW_CELL': 3, 'TIME': 5, 'TIME_STATION': 4, 'Y_X': 1}¶
Data models supported by SEAScope.
- Type:
dict
- SEAScope.types.granule_metadata.deserialize(o)[source]¶
Rebuild a granule metadata from a FlatBuffers buffer.
- Parameters:
buf (bytearray) – The buffer which contains the granule metadata object serialized with FlatBuffers
- Returns:
The deserialized granule metadata object as a dictionary.
- Return type:
dict
- SEAScope.types.granule_metadata.serialize(builder, obj)[source]¶
Serialize a granule metadata using FlatBuffers.
- Parameters:
builder (flatbuffers.builder.Builder) – The FlatBuffers builder instance which serializes data. If this parameter is None, then a new builder will be created
obj (dict) – Dictionary which contains information about the shape to serialize It must have between 8 and 21 keys:
sourceId
: anint
which is the unique identifier for the source which provides the granulecollectionId
: anint
which is the unique identifier (within the data source) for the collection that owns the granulegranuleId
: anint
which is the unique identifier (within the data source) for the granuledataId
: astr
which is the name of the granule. As for thegranuleId
it should remain unique within a data sourcedataModel
: astr
that identifies the data model used to store the granule data. The value must be a key of theSEAScope.types.granule_metadata.data_models
dictionarystart
: anint
which is the first time when data is available in the granule, in milliseconds since 1970-01-01T00:00:00.000Zstop
: anint
which is the first time afterstart
when data is not available anymore, in milliseconds since 1970-01-01T00:00:00.000Zuris
: alist
ofdict
. The elements of the list describe the files attached to the granule and must satisfy the requirements of theSEAScope.types.idf_descriptor.serialize()
methodtitle
: an optionalstr
for the title/long name of the granuleinstitution
: an optionalstr
for the name of the institution which provided the granulecomment
: an optionalstr
for any comment about the granulefile_id
: an optionalstr
for an identifier or path of the original file which has been converted to IDFproduct_version
: an optionalstr
for the version of the productlon_min
: an optionalfloat
for the min longitude of the spatial coveragelon_max
: an optionalfloat
for the max longitude of the spatial coveragelat_min
: an optionalfloat
for the min latitude of the spatial coveragelat_max
: an optionalfloat
for the max latitude of the spatial coveragecreator_email
: an optionalstr
the email address of the person who generated the IDF filestation_id
: an optionalstr
for the unique identifier of the station that provided the measurements contained in the granuleplatform
: an optionalstr
for the name or identifier of the platform which hosts the sensors that provided the measurementssensor
: an optionalstr
for the name or identifier of the sensor that measured the values contained in the granule
- Returns:
A tuple which contains two elements:
the
flatbuffers.builder.Builder
instance which has been used to serialize dataan
int
which is the address/offset of the serialized object in the builder buffer
- Return type:
tuple(flatbuffers.builder.Builder, int)
SEAScope.types.idf_descriptor module¶
This module handles the serialization and deserialization of IDF descriptor objects
- SEAScope.types.idf_descriptor.deserialize(o)[source]¶
Rebuild an IDF descriptor from a FlatBuffers buffer.
- Parameters:
buf (bytearray) – The buffer which contain the IDF descriptor object serialized with FlatBuffers
- Returns:
The deserialized IDF descriptor object as a dictionary.
- Return type:
dict
- SEAScope.types.idf_descriptor.serialize(builder, obj)[source]¶
Serialize an IDF descriptor using FlatBuffers.
- Parameters:
builder (flatbuffers.builder.Builder) – The FlatBuffers builder instance which serializes data. If this parameter is None, then a new builder will be created
obj (dict) – Dictionary which contains information about the IDF descriptor to serialize
It must have 6 keys:
uri
: astr
which is the address where SEAScope will find the granuleresolution
: afloat
which is the resolution, in meters per cell of data, of the granulesubsampling_factor
: anint
which tells SEAScope how many times the data contained in the granule have been subsampled (by 2) compared to the full resolution dataxArity
: anint
which tells SEAScope how many columns it must allocate when reconstructing the data matrixyArity
: anint
which tells SEAScope how many rows it must allocate when reconstructing the data matrixshape
: adict
that describes the shape of the granule. The value must satisfy the requirements of theSEAScope.types.shape.serialize()
method
- Returns:
A tuple which contains two elements:
the
flatbuffers.builder.Builder
instance which has been used to serialize dataan
int
which is the address/offset of the serialized object in the builder buffer
- Return type:
tuple(flatbuffers.builder.Builder, int)
SEAScope.types.renderable_id module¶
This module handles the serialization and deserialization of the identifiers for renderable objects.
- SEAScope.types.renderable_id.deserialize(o)[source]¶
Rebuild an identifier for a renderable object from a FlatBuffers buffer.
- Parameters:
buf (bytearray) – The buffer which contain the renderable ID object serialized with FlatBuffers
- Returns:
The deserialized renderable ID object as a dictionary.
- Return type:
dict
- SEAScope.types.renderable_id.serialize(builder, rid_obj)[source]¶
Serialize a renderable ID using FlatBuffers.
- Parameters:
builder (flatbuffers.builder.Builder) – The FlatBuffers builder instance which serializes data. If this parameter is None, then a new builder will be created
rid_obj (dict) – Dictionary which contains information about the renderable ID to serialize
It must have 5 keys:
granuleLevel
: abool
that tells SEAScope if the targeted object is a granule (True) or a collection (False)sourceId
: aint
which is the unique identifier of the data source which provided the targeted objectcollectionId
: aint
which is the unique identifier (within the data source) of the targeted collectiongranuleId
: aint
which is the unique identifier (within the data source) of the targeted granuleIgnored if
granuleLevel
is FalsevariableId
:aint
which is the unique identifier (within the collection) of the targeted variable
- Returns:
A tuple which contains two elements:
the
flatbuffers.builder.Builder
instance which has been used to serialize dataan
int
which is the address/offset of the serialized object in the builder buffer
- Return type:
tuple(flatbuffers.builder.Builder, int)
SEAScope.types.rendering_cfg module¶
This module handles the serialization and deserialization of rendering configuration objects
- SEAScope.types.rendering_cfg.deserialize(o)[source]¶
Rebuild a rendering configuration from a FlatBuffers buffer.
- Parameters:
buf (bytearray) – The buffer which contain the rendering configuration object serialized with FlatBuffers
- Returns:
The deserialized rendering configuration object as a dictionary.
- Return type:
dict
- SEAScope.types.rendering_cfg.filter_modes = {'BILINEAR': 1, 'NEAREST': 0}¶
Rendering filters available in SEAScope. These filters are applied for mapping pixels with data.
- Type:
dict
- SEAScope.types.rendering_cfg.rendering_methods = {'ARROWS': 1, 'BARBS': 2, 'DOTSCLOUD': 4, 'RASTER': 0, 'RAWRGB': 6, 'STREAMLINES': 5, 'TRAJECTORIES': 3}¶
Methods for rendering data in SEAScope.
Note that DOTSCLOUD is not supported by the current version of SEAScope
- Type:
dict
- SEAScope.types.rendering_cfg.serialize(builder, cfg_obj)[source]¶
Serialize a rendering configuration using FlatBuffers.
- Parameters:
builder (flatbuffers.builder.Builder) – The FlatBuffers builder instance which serializes data. If this parameter is None, then a new builder will be created
cfg_obj (dict) – Dictionary which contains information about the rendering configuration to serialize
It must have 15 keys:
rendered
: abool
telling SEAScope if the associated target should be rendered or not (only relevant for collections)logscale
: abool
telling SEAScope to use a logarithmic scale when applying the colormap (True) or the default linear scale (False)min
: afloat
that SEAScope must use as the minimal value when applying the colormapmax
: afloat
that SEAScope must use as the maximal value when applying the colormapopacity
: afloat
giving the opacity of the target. Its value belongs to the [0.0, 1.0] range: 0.0 is fully transparent, 1.0 is completely opaquezindex
: afloat
that SEAScope uses to decide in which order the data should be rendered. Granules with a low zindex are rendered before granules with a high zindexcolormap
: astr
which identifies the colormap applied to the representation of the variable.A colormap identifier is only valid if there is a file in the
colormaps
directory whose name is the identifier suffixed by the.rgb
extension.renderMethod
: astr
that tells SEAScope which rendering method must be used to display the variable. The value should be a key of theSEAScope.types.rendering_cfg.rendering_methods
dictionaryparticlesCount
: anint
which sets the size of the pool of animated particles.This value controls the density of the particles when using the streamlines rendering method.
Increasing the density adds a toll on the GPU and may significatively reduce fluidity.
particleTTL
: anint
(deprecated)streamlineLength
: anint
which tells SEAScope how many segments each streamline should be made ofstreamlineSpeed
: afloat
(deprecated)filterMode
: astr
that tells SEAScope which filter to use when mapping pixels with data values. The value must be a key of theSEAScope.types.rendering_cfg.filter_modes
dictionarytarget
: adict
that identifies the target of the rendering configuration. The value must satisfy the requirements of theSEAScope.types.renderable_id.serialize()
method.color
: adict
describing the uniform color that SEAScope will apply when rendering the target. The value must satisfy the requirements of theSEAScope.types.color.serialize()
method.If both
color
andcolormap
are defined, then the colormap will be used and the color will be ignored.billboardsSize
: a :obj:float used by SEAScope to define the size of symbols when rendering data as arrows or barbs.billboardsDensity
: a :obj:float value between 0.0 and 1.0 that SEAScope uses to compute how many symbols it must draw when using the arrows or barbs renderers. A value of 0.0 means that symbols will be separated by a blank space which has the same size as one symbol. A value of 1.0 means that there is no blank space between visible symbols.lineThickness
: a :obj:float that tells SEAScope how thick lines should be (in pixels) when drawing trajectories or polylines.
- Returns:
A tuple which contains two elements:
the
flatbuffers.builder.Builder
instance which has been used to serialize dataan
int
which is the address/offset of the serialized object in the builder buffer
- Return type:
tuple(flatbuffers.builder.Builder, int)
SEAScope.types.shape module¶
This module handles the serialization and deserialization of shape objects
- SEAScope.types.shape.deserialize(o)[source]¶
Rebuild a shape from a FlatBuffers buffer.
- Parameters:
buf (bytearray) – The buffer which contains the shape object serialized with FlatBuffers
- Returns:
The deserialized shape object as a dictionary.
- Return type:
dict
- SEAScope.types.shape.serialize(builder, shp_obj)[source]¶
Serialize a shape using FlatBuffers.
- Parameters:
builder (flatbuffers.builder.Builder) – The FlatBuffers builder instance which serializes data. If this parameter is None, then a new builder will be created
shp_obj (dict) – Dictionary which contains information about the shape to serialize It must have three keys:
xArity
: anint
which tells SEAScope how many columns it must allocate when reconstructing the GCPs matrixyArity
: anint
which tells SEAScope how many rows it must allocate when reconstructing the GCPs matrixgcps
: alist
ofdict
containing information about the GCPs of the shape. Eachdict
object must have all the keys required bySEAScope.types.gcp.serialize()
- Returns:
A tuple which contains two elements:
the
flatbuffers.builder.Builder
instance which has been used to serialize dataan
int
which is the address/offset of the serialized object in the builder buffer
- Return type:
tuple(flatbuffers.builder.Builder, int)
SEAScope.types.source module¶
This module handles the serialization and deserialization of source objects
- SEAScope.types.source.serialize(builder, src_obj)[source]¶
Serialize a source using FlatBuffers.
- Parameters:
builder (flatbuffers.builder.Builder) – The FlatBuffers builder instance which serializes data. If this parameter is None, then a new builder will be created
src_obj (dict) – Dictionary which contains information about the source to serialize It must have ten keys:
title
: astr
that SEAScope uses to designate the sourcedescription
: astr
that SEAScope can display to provide information about the sourcetags
: adict
which contains tags that describe the collection. SEAScope considers a (key, value) pair as a tag.id
: anint
that SEAScope can uses as a unique identifier for the source
- Returns:
A tuple which contains two elements:
the
flatbuffers.builder.Builder
instance which has been used to serialize dataan
int
which is the address/offset of the serialized object in the builder buffer
- Return type:
tuple(flatbuffers.builder.Builder, int)
SEAScope.types.tag module¶
This module handles the serialization and deserialization of tag objects
- SEAScope.types.tag.deserialize(t)[source]¶
Rebuild a tag from a FlatBuffers buffer.
- Parameters:
buf (bytearray) – The buffer which contains the tag object serialized with FlatBuffers
- Returns:
The deserialized tag as a (name, value) pair.
- Return type:
tuple(
str
,str
)
- SEAScope.types.tag.serialize(builder, name, value)[source]¶
Serialize a timestep using FlatBuffers.
- Parameters:
builder (flatbuffers.builder.Builder) – The FlatBuffers builder instance which serializes data. If this parameter is None, then a new builder will be created
name (str) – Name of the tag
value (str) – Value of the tag. If the tag value is not a string, make sure to convert it to
str
before passing it to this method
- Returns:
A tuple which contains two elements:
the
flatbuffers.builder.Builder
instance which has been used to serialize dataan
int
which is the address/offset of the serialized object in the builder buffer
- Return type:
tuple(flatbuffers.builder.Builder, int)
SEAScope.types.timespan module¶
This module handles the serialization and deserialization of timespan objects
- SEAScope.types.timespan.deserialize(o)[source]¶
Rebuild a timespan from a FlatBuffers buffer.
- Parameters:
buf (bytearray) – The buffer which contains the timespan object serialized with FlatBuffers
- Returns:
The deserialized timespan object as a dictionary.
- Return type:
dict
- SEAScope.types.timespan.serialize(builder, span_obj)[source]¶
Serialize a timespan using FlatBuffers.
- Parameters:
builder (flatbuffers.builder.Builder) – The FlatBuffers builder instance which serializes data. If this parameter is None, then a new builder will be created
span_obj (dict) – Dictionary which contains information about the timespan to serialize It must have three keys:
label
: astr
displayed by SEAScope to designate this timespanpastOffset
: anint
that tells SEAScope when the timespan starts, as a positive number of seconds relative to SEAScope current datetime, i.e.start = current - pastOffset
futureOffset
: anint
that tells SEAScope when the timespan ends, as a positive number of seconds relative to SEAScope current datetime, i.e.end = current + futureOffset
- Returns:
A tuple which contains two elements:
the
flatbuffers.builder.Builder
instance which has been used to serialize dataan
int
which is the address/offset of the serialized object in the builder buffer
- Return type:
tuple(flatbuffers.builder.Builder, int)
SEAScope.types.timestep module¶
This module handles the serialization and deserialization of timestep objects
- SEAScope.types.timestep.deserialize(o)[source]¶
Rebuild a timestep from a FlatBuffers buffer.
- Parameters:
buf (bytearray) – The buffer which contains the timestep object serialized with FlatBuffers
- Returns:
The deserialized timestep object as a dictionary.
- Return type:
dict
- SEAScope.types.timestep.serialize(builder, step_obj)[source]¶
Serialize a timestep using FlatBuffers.
- Parameters:
builder (flatbuffers.builder.Builder) – The FlatBuffers builder instance which serializes data. If this parameter is None, then a new builder will be created
step_obj (dict) – Dictionary which contains information about the timestep to serialize It must have two keys:
label
: astr
displayed by SEAScope to designate this timestepstep
: anint
that gives the size of the step in seconds
- Returns:
A tuple which contains two elements:
the
flatbuffers.builder.Builder
instance which has been used to serialize dataan
int
which is the address/offset of the serialized object in the builder buffer
- Return type:
tuple(flatbuffers.builder.Builder, int)
SEAScope.types.variable module¶
This module handles the serialization and deserialization of variable objects
- SEAScope.types.variable.deserialize(v)[source]¶
Rebuild a variable from a FlatBuffers buffer.
- Parameters:
buf (bytearray) – The buffer which contains the variable object serialized with FlatBuffers
- Returns:
The deserialized variable object as a dictionary.
- Return type:
dict
- SEAScope.types.variable.serialize(builder, var_obj)[source]¶
Serialize a variable using FlatBuffers.
- Parameters:
builder (flatbuffers.builder.Builder) – The FlatBuffers builder instance which serializes data. If this parameter is None, then a new builder will be created
var_obj (dict) – Dictionary which contains information about the variable to serialize It must have five keys:
label
: astr
that SEAScope uses to designate the variableunits
: astr
for the units of the variablefields
: alist
ofstr
which contains the name of the data fields that must be read in order to recompose the variable. For example the U and V components for a vectorfield, or three channels for RGB imagestags
: adict
which contains tags that describe the variable. SEAScope considers a (key, value) pair as a tag.defaultRenderingMethod
: astr
that designates the rendering method that must be used by default for this variable. This parameter must be one of the keys of theSEAScope.types.rendering_cfg.rendering_methods
dictionary
- Returns:
A tuple which contains two elements:
the
flatbuffers.builder.Builder
instance which has been used to serialize dataan
int
which is the address/offset of the serialized object in the builder buffer
- Return type:
tuple(flatbuffers.builder.Builder, int)