slider

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2021 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const AvailableDatesURI = "https://rammb-slider.cira.colostate.edu/data/json/%s/%s/%s/available_dates.json"

AvailableDatesURI is the address for retrieving the latest dates for available images.

View Source
const ImageURI = "https://rammb-slider.cira.colostate.edu/data/imagery/%s/%s---%s/%s/%s/%02d/%03d_%03d.png"

ImageURI is the request address for images. It contains the following fields:

View Source
const LatestTimes5760URI = "https://rammb-slider.cira.colostate.edu/data/json/%s/%s/%s/latest_times_5760.json"

LatestTimes5760URI is the same as LatestTimesURI but with more times.

View Source
const LatestTimesURI = "https://rammb-slider.cira.colostate.edu/data/json/%s/%s/%s/latest_times.json"

LatestTimesURI is the address for retrieving the latest times for available images.

Variables

View Source
var GOES16Satellite = &Satellite{
	ID:           "goes-16",
	FriendlyName: "GOES-16",
	Description:  "East, 75.2W",
	SectorProducts: map[*Sector][]*Product{
		GOESCONUSSector: {
			GOESBand1Product,
			GeoColorProduct,
		},
	},
}
View Source
var GOESBand1Product = &Product{
	ID:           "band-1",
	FriendlyName: "Band 1",
	Description:  "0.47 µm ('Blue')",
	Value:        "band_01",
}
View Source
var GOESCONUSSector = &Sector{
	ID:           "conus",
	FriendlyName: "CONUS",
	ZoomLevels: []Zoom{
		{
			Level:     0,
			XCells:    1,
			YCells:    1,
			CellSizeX: 625,
			CellSizeY: 625,
			CropX:     625,
			CropY:     375,
		},
		{
			Level:     1,
			XCells:    2,
			YCells:    2,
			CellSizeX: 625,
			CellSizeY: 625,
			CropX:     1250,
			CropY:     750,
		},
		{
			Level:     2,
			XCells:    4,
			YCells:    4,
			CellSizeX: 625,
			CellSizeY: 625,
			CropX:     2500,
			CropY:     1500,
		},
		{
			Level:     3,
			XCells:    8,
			YCells:    8,
			CellSizeX: 625,
			CellSizeY: 625,
			CropX:     5000,
			CropY:     3000,
		},
	},
}
View Source
var GeoColorProduct = &Product{
	ID:           "geocolor",
	FriendlyName: "GeoColor",
	Description:  "GeoColor (CIRA)",
	Value:        "geocolor",
}

Functions

func AnimateImages

func AnimateImages(images []image.Image, delay int, style LoopStyle) (*gif.GIF, error)

func AvailableDates

func AvailableDates(satellite *Satellite, sector *Sector, product *Product) ([]int, error)

func CreateLoop

func CreateLoop(opts *LoopOptions) error

func DownloadImage

func DownloadImage(request *ImageRequest) (image.Image, error)

func LatestTimes

func LatestTimes(satellite *Satellite, sector *Sector, product *Product, count int) ([]int, error)

func SaveGIF

func SaveGIF(output string, img *gif.GIF) error

func SelectTimestamps

func SelectTimestamps(times []int, opts *LoopOptions) ([]time.Time, error)

Types

type ImageRequest

type ImageRequest struct {
	Date             string
	Satellite        string
	Sector           string
	Product          string
	ImageTimestamp   string
	ZoomLevel        int
	SectionXPosition int
	SectionYPosition int
}

type LoopOptions

type LoopOptions struct {
	Satellite        *Satellite
	Sector           *Sector
	Product          *Product
	Loop             LoopStyle
	NumberOfImages   int
	Speed            int
	ZoomLevel        int
	TimeStep         int
	OutputDirectory  string
	AllowStaleImages bool
}

type LoopStyle

type LoopStyle int
const (
	ForwardLoop LoopStyle = iota
	ReverseLoop
	RockLoop
)

type Product

type Product struct {
	ID           string
	FriendlyName string
	Description  string
	Value        string
}

type Satellite

type Satellite struct {
	// ID is the value sent in the request to SLIDER
	ID string
	// FriendlyName is the friendly human-readable name for the satellite
	FriendlyName string
	// Description is a short description of the satellite details
	Description string
	// SectorProducts contains a mapping of available sectors for this Satellite and Products available for each Sector.
	SectorProducts map[*Sector][]*Product
}

func (*Satellite) ValidSector

func (s *Satellite) ValidSector(sector *Sector) bool

func (*Satellite) ValidSectorProduct

func (s *Satellite) ValidSectorProduct(sector *Sector, product *Product) bool

type Sector

type Sector struct {
	ID           string
	FriendlyName string
	ZoomLevels   []Zoom
}

type Zoom

type Zoom struct {
	Level     int
	XCells    int
	YCells    int
	CellSizeX int
	CellSizeY int
	CropX     int
	CropY     int
}

Cell X/Y axis origin (0,0) is the upper-left-hand corner of the image.

Jump to

Keyboard shortcuts

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