Documentation ¶
Index ¶
- Constants
- Variables
- func AnimateGIF(images []image.Image, delay int, style LoopStyle) (*gif.GIF, error)
- func AvailableDates(satellite *Satellite, sector *Sector, product *Product) ([]int, error)
- func CreateLoop(opts *LoopOptions) error
- func DownloadImage(request *ImageRequest) (image.Image, error)
- func LatestTimes(satellite *Satellite, sector *Sector, product *Product, count int) ([]int, error)
- func SaveGIF(output string, img *gif.GIF) (string, error)
- func SelectTimestamps(times []int, opts *LoopOptions) ([]time.Time, error)
- type ImageRequest
- type LoopOptions
- type LoopStyle
- type Product
- type Satellite
- type Sector
- type Zoom
Constants ¶
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.
- Satellite
- Sector
- Product Example: https://rammb-slider.cira.colostate.edu/data/json/jpss/northern_hemisphere/cira_geocolor/available_dates.json
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:
- Date
- Satellite
- Sector
- Product
- Image Timestamp
- Zoom Level
- Section Y-Position
- Section X-Position Example: https://rammb-slider.cira.colostate.edu/data/imagery/20210404/jpss---northern_hemisphere/cira_geocolor/20210404215820/04/011_007.png
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.
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.
- Satellite
- Sector
- Product Example: https://rammb-slider.cira.colostate.edu/data/json/jpss/northern_hemisphere/cira_geocolor/latest_times.json
Variables ¶
var CIRADustDEBRAProduct = &Product{
ID: "debra",
FriendlyName: "Dust - DEBRA",
Description: "CIRA",
Value: "cira_debra_dust",
ZoomAdjust: 2,
}
CIRA Dust DEBRA Product
var CIRAGeoColorProduct = &Product{
ID: "geocolor",
FriendlyName: "GeoColor",
Description: "CIRA",
Value: "geocolor",
ZoomAdjust: 1,
}
CIRA GeoColor Product
var CIRAProxyVisibleProduct = &Product{
ID: "proxy-visible",
FriendlyName: "Proxy Visible",
Description: "CIRA",
Value: "cira_proxy_visible",
}
CIRA Proxy Visible Product
var CIRAShortwaveAlbedoProduct = &Product{
ID: "shortwave-albedo",
FriendlyName: "Shortwave Albedo",
Description: "CIRA",
Value: "shortwave_albedo_cira",
ZoomAdjust: 2,
}
CIRA Shortwave Albedo Product
var CIRASnowCloudLayersProduct = &Product{
ID: "snow-cloud-layers",
FriendlyName: "Snow/Cloud-Layers",
Description: "CIRA",
Value: "cira_high_low_cloud_and_snow",
ZoomAdjust: 1,
}
CIRA Snow/Cloud-Layers Product
var CIRASnowCloudProduct = &Product{
ID: "snow-cloud",
FriendlyName: "Snow/Cloud",
Description: "CIRA",
Value: "cira_cloud_snow_discriminator",
ZoomAdjust: 1,
}
CIRA Snow/Cloud Product
var CIRAVisibleAlbedoProduct = &Product{
ID: "visible-albedo",
FriendlyName: "Visible Albedo",
Description: "CIRA",
Value: "visible_albedo_cira",
ZoomAdjust: 2,
}
CIRA Visible Albedo Product
var GOES16Satellite = &Satellite{ ID: "goes-16", FriendlyName: "GOES-16", Description: "East, 75.2W", Value: "goes-16", Products: map[string]*Product{ GOESBand1Product.ID: GOESBand1Product, GOESBand2Product.ID: GOESBand2Product, CIRAGeoColorProduct.ID: CIRAGeoColorProduct, }, Sectors: map[string]*Sector{ GOESCONUSSector.ID: GOESCONUSSector, GOESFullDiskSector.ID: GOESFullDiskSector, GOESMesoscale1Sector.ID: GOESMesoscale1Sector, GOESMesoscale2Sector.ID: GOESMesoscale2Sector, }, ZoomLevels: GOESHimawariZoomLevels, }
GOES-16 Satellite
var GOES17Satellite = &Satellite{ ID: "goes-17", FriendlyName: "GOES-17", Description: "West, 137.2W", Value: "goes-17", Products: map[string]*Product{ GOESBand1Product.ID: GOESBand1Product, GOESBand2Product.ID: GOESBand2Product, GOESBand3Product.ID: GOESBand3Product, GOESBand4Product.ID: GOESBand4Product, GOESBand5Product.ID: GOESBand5Product, GOESBand6Product.ID: GOESBand6Product, GOESBand7Product.ID: GOESBand7Product, GOESBand8Product.ID: GOESBand8Product, GOESBand9Product.ID: GOESBand9Product, GOESBand10Product.ID: GOESBand10Product, GOESBand11Product.ID: GOESBand11Product, GOESBand12Product.ID: GOESBand12Product, GOESBand13Product.ID: GOESBand13Product, GOESBand14Product.ID: GOESBand14Product, GOESBand15Product.ID: GOESBand15Product, GOESBand16Product.ID: GOESBand16Product, CIRAGeoColorProduct.ID: CIRAGeoColorProduct, CIRAProxyVisibleProduct.ID: CIRADustDEBRAProduct, CIRAShortwaveAlbedoProduct.ID: CIRAShortwaveAlbedoProduct, CIRADustDEBRAProduct.ID: CIRADustDEBRAProduct, CIRASnowCloudProduct.ID: CIRASnowCloudProduct, CIRASnowCloudLayersProduct.ID: CIRASnowCloudLayersProduct, SplitWindowDifferenceProduct.ID: SplitWindowDifferenceProduct, }, Sectors: map[string]*Sector{ GOESCONUSSector.ID: GOESCONUSSector, GOESFullDiskSector.ID: GOESFullDiskSector, GOESMesoscale1Sector.ID: GOESMesoscale1Sector, GOESMesoscale2Sector.ID: GOESMesoscale2Sector, }, ZoomLevels: GOESHimawariZoomLevels, }
GOES-17 Satellite
var GOESBand10Product = &Product{
ID: "band-10",
FriendlyName: "Band 10",
Description: "7.3 µm 'Lower-level Water Vapor'",
Value: "band_10",
ZoomAdjust: 2,
}
GOES Band 10 Product
var GOESBand11Product = &Product{
ID: "band-11",
FriendlyName: "Band 11",
Description: "8.4 µm 'Cloud-Top Phase'",
Value: "band_11",
ZoomAdjust: 2,
}
GOES Band 11 Product
var GOESBand12Product = &Product{
ID: "band-12",
FriendlyName: "Band 12",
Description: "9.6 µm 'Ozone'",
Value: "band_12",
ZoomAdjust: 2,
}
GOES Band 12 Product
var GOESBand13Product = &Product{
ID: "band-13",
FriendlyName: "Band 13",
Description: "10.3 µm 'Clean & IR Longwave Window'",
Value: "band_13",
ZoomAdjust: 2,
}
GOES Band 13 Product
var GOESBand14Product = &Product{
ID: "band-14",
FriendlyName: "Band 14",
Description: "11.2 µm 'IR Longwave Window'",
Value: "band_14",
ZoomAdjust: 2,
}
GOES Band 14 Product
var GOESBand15Product = &Product{
ID: "band-15",
FriendlyName: "Band 15",
Description: "12.3 µm '\"Dirty\" Longwave Window'",
Value: "band_15",
ZoomAdjust: 2,
}
GOES Band 15 Product
var GOESBand16Product = &Product{
ID: "band-16",
FriendlyName: "Band 16",
Description: "13.3 µm '\"CO2\" Longwave Infrared",
Value: "band_16",
ZoomAdjust: 2,
}
GOES Band 16 Product
var GOESBand1Product = &Product{
ID: "band-1",
FriendlyName: "Band 1",
Description: "0.47 µm 'Blue'",
Value: "band_01",
ZoomAdjust: 1,
}
GOES Band 1 Product
var GOESBand2Product = &Product{
ID: "band-2",
FriendlyName: "Band 2",
Description: "0.64 µm 'Red'",
Value: "band_02",
}
GOES Band 2 Product
var GOESBand3Product = &Product{
ID: "band-3",
FriendlyName: "Band 3",
Description: "0.86 µm 'Veggie'",
Value: "band_03",
ZoomAdjust: 1,
}
GOES Band 3 Product
var GOESBand4Product = &Product{
ID: "band-4",
FriendlyName: "Band 4",
Description: "1.37 µm 'Cirrus'",
Value: "band_04",
ZoomAdjust: 2,
}
GOES Band 4 Product
var GOESBand5Product = &Product{
ID: "band-5",
FriendlyName: "Band 5",
Description: "1.6 µm 'Snow/Ice'",
Value: "band_05",
ZoomAdjust: 1,
}
GOES Band 5 Product
var GOESBand6Product = &Product{
ID: "band-6",
FriendlyName: "Band 6",
Description: "2.2 µm 'Cloud Particle Size'",
Value: "band_06",
ZoomAdjust: 2,
}
GOES Band 6 Product
var GOESBand7Product = &Product{
ID: "band-7",
FriendlyName: "Band 7",
Description: "3.9 µm 'Shortwave Window'",
Value: "band_07",
ZoomAdjust: 2,
}
GOES Band 7 Product
var GOESBand8Product = &Product{
ID: "band-8",
FriendlyName: "Band 8",
Description: "6.2 µm 'Upper-Level Tropospheric Water Vapor'",
Value: "band_08",
ZoomAdjust: 2,
}
GOES Band 8 Product
var GOESBand9Product = &Product{
ID: "band-9",
FriendlyName: "Band 9",
Description: "6.9 µm 'Mid-Level Tropospheric Water Vapor'",
Value: "band_09",
ZoomAdjust: 2,
}
GOES Band 9 Product
var GOESCONUSSector = &Sector{ ID: "conus", FriendlyName: "CONUS", Value: "conus", CellSize: 625, CropRatioX: 1, CropRatioY: .6, MaxZoomLevel: 4, MissingProducts: []*Product{}, }
GOES CONUS Sector
var GOESFullDiskSector = &Sector{ ID: "fd", FriendlyName: "Full Disk", Value: "full_disk", CellSize: 678, MaxZoomLevel: 5, MissingProducts: []*Product{}, }
GOES Full Disk Sector
var GOESHimawariZoomLevels = []*Zoom{
{
Level: 0,
Scale: "16 km",
},
{
Level: 1,
Scale: "8 km",
},
{
Level: 2,
Scale: "4 km",
},
{
Level: 3,
Scale: "2 km",
},
{
Level: 4,
Scale: "1 km",
},
{
Level: 5,
Scale: ".5 km",
},
{
Level: 6,
Scale: ".25 km",
},
{
Level: 7,
Scale: ".125 km",
},
}
GOESHimawariZoomLevels zoom level is a common zoom level list for both GOES and Himawari satellites.
var GOESMesoscale1Sector = &Sector{ ID: "ms1", FriendlyName: "Mesoscale 1", Value: "mesoscale_01", CellSize: 500, MaxZoomLevel: 2, MissingProducts: []*Product{}, }
GOES Mesoscale 1 Sector
var GOESMesoscale2Sector = &Sector{ ID: "ms2", FriendlyName: "Mesoscale 2", Value: "mesoscale_02", CellSize: 500, MaxZoomLevel: 2, MissingProducts: []*Product{}, }
GOES Mesoscale 2 Sector
var Himawari8Satellite = &Satellite{ ID: "himawari-8", FriendlyName: "Himawari-8", Description: "Japan, 140.7E", Value: "himawari", Products: map[string]*Product{ CIRAGeoColorProduct.ID: CIRAGeoColorProduct, CIRAShortwaveAlbedoProduct.ID: CIRAShortwaveAlbedoProduct, CIRADustDEBRAProduct.ID: CIRADustDEBRAProduct, CIRAVisibleAlbedoProduct.ID: CIRAVisibleAlbedoProduct, SplitWindowDifferenceProduct.ID: SplitWindowDifferenceProduct, }, Sectors: map[string]*Sector{ HimawariFullDiskSector.ID: HimawariFullDiskSector, HimawariJapanSector.ID: HimawariJapanSector, HimawariMesoscale1Sector.ID: HimawariMesoscale1Sector, }, ZoomLevels: GOESHimawariZoomLevels, }
Himawari-8 Satellite
var HimawariFullDiskSector = &Sector{ ID: "fd", FriendlyName: "Full Disk", Value: "full_disk", CellSize: 688, MaxZoomLevel: 5, MissingProducts: []*Product{}, }
Himawari Full Disk Sector
var HimawariJapanSector = &Sector{ ID: "japan", FriendlyName: "Japan", Value: "japan", CellSize: 750, MaxZoomLevel: 3, MissingProducts: []*Product{ CIRAGeoColorProduct, }, }
Himawari Japan Sector
var HimawariMesoscale1Sector = &Sector{ ID: "ms1", FriendlyName: "Japan", Value: "japan", CellSize: 750, MaxZoomLevel: 3, MissingProducts: []*Product{ CIRAGeoColorProduct, }, }
Himawari Mesoscale 1 Sector
var Satellites = map[string]*Satellite{ GOES16Satellite.ID: GOES16Satellite, GOES17Satellite.ID: GOES17Satellite, Himawari8Satellite.ID: Himawari8Satellite, }
Satellites contains all of the available and included satellites.
var SplitWindowDifferenceProduct = &Product{
ID: "split-window-difference",
FriendlyName: "Split Window Difference",
Description: "10.3 µm - 12.3 µm ",
Value: "split_window_difference_10_3-12_3",
ZoomAdjust: 2,
}
Split Window Difference Product
Functions ¶
func AnimateGIF ¶ added in v0.3.0
AnimateGIF animates the supplied images into a GIF image. This will convert RGB images to a 256-color palette due to the GIF color limit of 256. This will likely result in some down-sampling of your image colors.
func AvailableDates ¶
AvailableDates returns the list of dates that SLIDER has available data for as ints in the form of YYYYMMDD.
func CreateLoop ¶
func CreateLoop(opts *LoopOptions) error
CreateLoop creates a new loop with the options specified in the provided LoopOptions.
func DownloadImage ¶
func DownloadImage(request *ImageRequest) (image.Image, error)
DownloadImage downloads an individual image cell from SLIDER.
func LatestTimes ¶
LatestTimes returns the list of timestamps that SLIDER has available data for as ints in the form of YYYYMMDDhhmmss.
func SaveGIF ¶
SaveGIF encodes the GIF data into a .gif file. The .gif extension will be added automatically. If a file with the same name exists an incrementing number will be appended to the end of the file name.
func SelectTimestamps ¶
func SelectTimestamps(times []int, opts *LoopOptions) ([]time.Time, error)
SelectTimestamps selects the desired timestamps from the list of int timestamps returned by SLIDER. Timestamps are returned in sorted chronological order.
Types ¶
type ImageRequest ¶
type ImageRequest struct { Date string Satellite string Sector string Product string ImageTimestamp string ZoomLevel int SectionXPosition int SectionYPosition int }
ImageRequest contains the parameters required to request an individual image cell from SLIDER.
type LoopOptions ¶
type LoopOptions struct { // Satellite is the satellite to request imagery from. Satellite *Satellite // Sector is the sector to request imagery for. Sector *Sector // Product is the product to request imagery for. Product *Product // LoopStyle is the animation style of the output animation. Loop LoopStyle // NumberOfImages is the number of frames in the output animation. NumberOfImages int // Speed is the interval between frames. A higher number increases the delay between frames. Speed int // ZoomLevel is the zoom level to request imagery for. Increasing ZoomLevel increases the output animation // resolution and therefore filesize. ZoomLevel int // TimeStep is the interval between image capture times in minutes. TimeStep int // BeginTime is the desired capture time of the first image in the loop. BeginTime time.Time // EndTime is the desired capture time of the last image in the loop. EndTime time.Time // OutputDirectory is the directory to save output animations in. OutputDirectory string // AllowStaleImages allows imagery that is over one year old to be included in animations. Disallowing this old // imagery by default helps to prevent old images from being accidentally included in loops. AllowStaleImages bool // contains filtered or unexported fields }
LoopOptions are the config options used to create a new loop.
func LoopOptsFromURL ¶ added in v0.3.0
func LoopOptsFromURL(uri string) (*LoopOptions, error)
type LoopStyle ¶
type LoopStyle int
LoopStyle is the animation direction of the images, for example forward or backward.
const ( // ForwardLoop animates loops with images in chronological order. ForwardLoop LoopStyle = iota // ReverseLoop animates loops in reverse order from ForwardLoop ReverseLoop // RockLoop animates the loop forward first then in reverse. Note that using the RockLoop style will cause // animation file sizes to be nearly twice the size has a forward and reverse loops due there being twice the // number of frames. RockLoop )
type Product ¶
type Product struct { // ID is the shorthand string used on the command-line and in the config for this product ID string // FriendlyName is the friendly human-readable name for this product FriendlyName string // Description is a short description of the product details Description string // Value is the string sent to SLIDER for this product when requesting images Value string // ZoomAdjust is the number of zoom levels to remove from available zoom levels for this product. ZoomAdjust int }
Product contains all of the information for a single product captured by a weather satellite.
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 this satellite FriendlyName string // Description is a short description of the satellite details Description string // Value is the string sent to SLIDER for this satellite when requesting images Value string // Sectors contains a list of available sectors for this Satellite keyed by ID. Sectors map[string]*Sector // Products contains a list of available products for this satellite keyed by ID. Products map[string]*Product // ZoomLevels is the list of available zoom levels or resolutions for this satellite ZoomLevels []*Zoom }
Satellite contains all of the information for a single weather satellite and all of it's sectors and products.
func (*Satellite) ValidProduct ¶ added in v0.3.0
ValidProduct returns true if the provided product is available for this satellite.
func (*Satellite) ValidSector ¶
ValidSector returns true if the provided sector is available for this satellite.
func (*Satellite) ValidSectorProduct ¶
ValidSectorProduct returns true if the provided sector and products are available for this satellite AND the product is not included in the sector's MissingProducts list. Generally this is the method that should be used to validate that sectors and products are available for the satellite.
type Sector ¶
type Sector struct { // ID is the shorthand string used on the command-line and in the config ID string // FriendlyName is a longer string with a human-readable name for the sector FriendlyName string // Value is the string for this sector sent to SLIDER when requesting images Value string // CellSize is the size of each cell tile in pixels CellSize int // CropRatioX is the amount to crop the image on the X-axis from 0 to 1 CropRatioX float32 // CropRatioY is the amount to crop the image on the X-axis from 0 to 1 CropRatioY float32 // MaxZoomLevel is the max zoom level or resolution that this is available for this sector. MaxZoomLevel int // MissingProducts is a list of satellite products that are unavailable for this sector (typically due to the lack // of data availability). MissingProducts []*Product }
Sector contains all of the information for a single sector captured by a weather satellite.
func (*Sector) ProductMissing ¶ added in v0.3.0
ProductMissing returns true if the provided product is present in the MissingProducts list.