common

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GraphCopyProductToStorage = "CopyProductToStorage"
	GraphPass                 = "Pass"
)
View Source
const (
	ResultTypeTile  = "tile"
	ResultTypeScene = "scene"
)
View Source
const (
	TagSourceID             = "sourceID"
	TagUUID                 = "uuid"
	TagIngestionDate        = "ingestionDate"
	TagConstellation        = "constellation"
	TagSatellite            = "satellite"
	TagPolarisationMode     = "polarisationMode"
	TagOrbitDirection       = "orbitDirection"
	TagRelativeOrbit        = "relativeOrbit"
	TagOrbit                = "orbit"
	TagProductType          = "productType"
	TagDownloadURL          = "downloadURL"
	TagSliceNumber          = "sliceNumber"
	TagLastRelativeOrbit    = "lastRelativeOrbit"
	TagLastOrbit            = "lastOrbit"
	TagCloudCoverPercentage = "cloudCoverPercentage"

	TagProcessingDate = "processingDate"
	TagPrevScenes     = "previous_scenes"
	TagRefScenes      = "reference_scenes"
)

Record tags

View Source
const (
	DownloadLinkMetadata = "downloadLink"
)

Variables

This section is empty.

Functions

func ConstellationStrings added in v1.0.1

func ConstellationStrings() []string

ConstellationStrings returns a slice of all String values of the enum

func FormatBrackets added in v1.0.1

func FormatBrackets(str string, info map[string]string) string

*

  • FormatBrackets replaces in <str> all {keys} of <info> by the corresponding value
  • keys must be one of SCENE, MISSION_ID, PRODUCT_LEVEL, DATE(YEAR/MONTH/DAY), TIME(HOUR/MINUTE/SECOND), PDGS, ORBIT, TILE (LATITUDE_BAND/GRID_SQUARE/GRANULE_ID)

func GetDateFromProductId added in v1.0.1

func GetDateFromProductId(sceneName string) (time.Time, error)

func Info added in v1.0.1

func Info(sceneName string) (map[string]string, error)

func StatusStrings added in v1.0.0

func StatusStrings() []string

StatusStrings returns a slice of all String values of the enum

Types

type Constellation added in v1.0.1

type Constellation int

Constellation defines the kind of satellites

const (
	Unknown   Constellation = iota
	Sentinel1               // MMM_BB_TTTR_LFPP_YYYYMMDDTHHMMSS_YYYMMDDTHHMMSS_OOOOOO_DDDDDD_CCCC.SAFE
	Sentinel2               // MMM_MSIXXX_YYYYMMDDTHHMMSS_Nxxyy_ROOO_Txxxxx_<Product Discriminator>.SAFE or MMM_CCCC_FFFFDDDDDD_ssss_YYYYMMDDTHHMMSS_ROOO_VYYYYMMTDDHHMMSS_YYYYMMTDDHHMMSS.SAFE
	PHR                     // DS_PHR1B_201706161037358_XXX_XX_XXXXXXX_XXXX_XXXXX
	SPOT                    // DS_SPOT7_201806232333174_XXX_XXX_XXX_XXX_XXXXXXX_XXXXX
)

func ConstellationString added in v1.0.1

func ConstellationString(s string) (Constellation, error)

ConstellationString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func ConstellationValues added in v1.0.1

func ConstellationValues() []Constellation

ConstellationValues returns all values of the enum

func GetConstellationFromProductId added in v1.0.1

func GetConstellationFromProductId(sceneName string) Constellation

func (Constellation) IsAConstellation added in v1.0.1

func (i Constellation) IsAConstellation() bool

IsAConstellation returns "true" if the value is listed in the enum definition. "false" otherwise

func (Constellation) MarshalJSON added in v1.0.1

func (i Constellation) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface for Constellation

func (Constellation) String added in v1.0.1

func (i Constellation) String() string

func (*Constellation) UnmarshalJSON added in v1.0.1

func (i *Constellation) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for Constellation

type Result

type Result struct {
	Type    string `json:"type"` // scene (ResultTypeScene) or tile (ResultTypeTile)
	ID      int    `json:"id"`
	Status  Status `json:"status"`
	Message string `json:"message"`
}

type Scene

type Scene struct {
	ID       int        `json:"id"`
	SourceID string     `json:"source_id"`
	AOI      string     `json:"aoi"`
	Data     SceneAttrs `json:"data,omitempty"`
}

type SceneAttrs

type SceneAttrs struct {
	UUID         string                 `json:"uuid"`
	Date         time.Time              `json:"date"`
	TileMappings map[string]TileMapping `json:"tiles"`
	GraphName    string                 `json:"graph_name"`
	GraphConfig  map[string]string      `json:"graph_config"`
	RecordID     string                 `json:"record_id"`
	InstancesID  map[string]string      `json:"instances_id"`
	Metadata     map[string]interface{} `json:"metadata"`
}

func (*SceneAttrs) Scan

func (a *SceneAttrs) Scan(value interface{}) error

Scan implements the sql.Scanner interface.

func (SceneAttrs) Value

func (a SceneAttrs) Value() (driver.Value, error)

Value implements the driver.Value interface

type SceneToIngest

type SceneToIngest struct {
	Scene
	Tiles map[string]TileToIngest `json:"tiles"`
}

type Status

type Status int
const (
	StatusNEW Status = iota
	StatusPENDING
	StatusDONE
	StatusFAILED
	StatusRETRY
)

func StatusString

func StatusString(s string) (Status, error)

StatusString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func StatusValues

func StatusValues() []Status

StatusValues returns all values of the enum

func (Status) Color

func (s Status) Color() string

func (Status) IsAStatus

func (i Status) IsAStatus() bool

IsAStatus returns "true" if the value is listed in the enum definition. "false" otherwise

func (Status) MarshalJSON

func (i Status) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface for Status

func (*Status) Scan

func (i *Status) Scan(value interface{}) error

func (Status) String

func (i Status) String() string

func (*Status) UnmarshalJSON

func (i *Status) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for Status

func (Status) Value

func (i Status) Value() (driver.Value, error)

type Tile

type Tile struct {
	ID       int       `json:"id"`
	SourceID string    `json:"source_id"`
	Scene    Scene     `json:"scene,omitempty"`
	Data     TileAttrs `json:"data,omitempty"`
}

type TileAttrs

type TileAttrs struct {
	SwathID   string `json:"swath_id"`
	TileNr    int    `json:"tile_nr"`
	GraphName string `json:"graph_name"`
}

func (*TileAttrs) Scan

func (a *TileAttrs) Scan(value interface{}) error

Scan implements the sql.Scanner interface.

func (TileAttrs) Value

func (a TileAttrs) Value() (driver.Value, error)

Value implements the driver.Value interface

type TileMapping

type TileMapping struct {
	SwathID string `json:"swath_id"`
	TileNr  int    `json:"tile_nr"`
}

type TileToIngest

type TileToIngest struct {
	PreviousTileID   string    `json:"previous_tile_id"`
	PreviousSceneID  string    `json:"previous_scene_id"`
	ReferenceTileID  string    `json:"reference_tile_id"`
	ReferenceSceneID string    `json:"reference_scene_id"`
	Data             TileAttrs `json:"data"`
}

type TileToProcess

type TileToProcess struct {
	Tile
	Previous  Tile `json:"tile_previous"`
	Reference Tile `json:"tile_reference"`
}

Jump to

Keyboard shortcuts

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