core

package
v0.0.0-...-d9b9230 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2019 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Document

type Document struct {
	// Library is the information about the software library used to create the ASDF file.
	// See https://asdf-standard.readthedocs.io/en/latest/generated/stsci.edu/asdf/core/software-1.0.0.html
	Library *Software
	// History is the list of extensions used to create the ASDF file.
	// See https://asdf-standard.readthedocs.io/en/latest/generated/stsci.edu/asdf/core/asdf-1.1.0.html#history
	History *History
	// Tree is the contents of the ASDF file. It is mapped to a JSON object model.
	// Please refer to https://godoc.org/github.com/Jeffail/gabs
	Tree *gabs.Container
}

Document carries the ASDF object tree with its metadata.

func (Document) IterArrays

func (doc Document) IterArrays(visitor func(array *NDArray))

IterArrays visits all the contained ndarray-s in the document.

type ExtensionMetadata

type ExtensionMetadata struct {
	// Class is the value of `extension_class` property.
	Class string
	// Package indicates the name and the version of the extension.
	Package schema.Tag
}

ExtensionMetadata is defined in https://asdf-standard.readthedocs.io/en/latest/generated/stsci.edu/asdf/core/extension_metadata-1.0.0.html

type History

type History struct {
	// Extensions is the list of transformations applied to the document.
	Extensions []*ExtensionMetadata
	// File change history.
	Entries []*HistoryEntry
}

History is defined in https://asdf-standard.readthedocs.io/en/latest/generated/stsci.edu/asdf/core/asdf-1.1.0.html#history

type HistoryEntry

type HistoryEntry struct {
	// Description is the description of the transformation performed.
	Description string
	// Time is the timestamp of the transformation, in UTC.
	Time string
	// Software is the list of https://asdf-standard.readthedocs.io/en/latest/generated/stsci.edu/asdf/core/software-1.0.0.html
	// It may contain one or more elements.
	Software []*Software
}

HistoryEntry is defined in https://asdf-standard.readthedocs.io/en/latest/generated/stsci.edu/asdf/core/history_entry-1.0.0.html

type NDArray

type NDArray struct {
	// DataType is the tensor element type.
	DataType *types.Basic
	// Shape is the tensor shape: a one-dimensional integer sequence.
	Shape []int
	// ByteOrder is the byte order if the tensor contains integers.
	ByteOrder binary.ByteOrder
	// Data is the raw tensor buffer, similar to `numpy.ndarray.data`.
	Data []byte
}

NDArray is defined in https://asdf-standard.readthedocs.io/en/latest/generated/stsci.edu/asdf/core/ndarray-1.0.0.html It is similar to `numpy.ndarray` in Python.

func (NDArray) CountBytes

func (arr NDArray) CountBytes() int

CountBytes returns the size of the tensor in bytes.

func (NDArray) CountElements

func (arr NDArray) CountElements() int

CountElements returns the total number of elements in the tensor.

func (NDArray) ElementSize

func (arr NDArray) ElementSize() int

ElementSize returns the data type size in bytes.

func (*NDArray) EnsureHostEndianness

func (arr *NDArray) EnsureHostEndianness()

EnsureHostEndianness changes the endianness to host as needed.

func (NDArray) ReflectedDataType

func (arr NDArray) ReflectedDataType() reflect.Type

ReflectedDataType returns the data type as a reflect.Type.

func (NDArray) String

func (arr NDArray) String() string

String formats the tensor as a string. The actual contents are not included.

type Software

type Software struct {
	// Name and the version.
	schema.Tag
	// Author is the author of the software.
	Author string
	// HomePage is the URL of the software.
	HomePage string
}

Software is the information about a library or a tool.

func (Software) String

func (s Software) String() string

Strings formats the object as a string.

Jump to

Keyboard shortcuts

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