windninja

package module
v0.0.0-...-7776183 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2020 License: BSD-3-Clause Imports: 22 Imported by: 0

Documentation

Overview

Package windninja is the go implentation of the diagnostic wind model WindNinja. See https://firelab.org/projects/windninja for more information.

Index

Constants

View Source
const (
	Unknown  = DataType(C.GDT_Unknown)
	Byte     = DataType(C.GDT_Byte)
	UInt16   = DataType(C.GDT_UInt16)
	Int16    = DataType(C.GDT_Int16)
	UInt32   = DataType(C.GDT_UInt32)
	Int32    = DataType(C.GDT_Int32)
	Float32  = DataType(C.GDT_Float32)
	Float64  = DataType(C.GDT_Float64)
	CInt16   = DataType(C.GDT_CInt16)
	CInt32   = DataType(C.GDT_CInt32)
	CFloat32 = DataType(C.GDT_CFloat32)
	CFloat64 = DataType(C.GDT_CFloat64)
)
View Source
const (
	// Read data
	Read = RWFlag(C.GF_Read)
	// Write data
	Write = RWFlag(C.GF_Write)
)
View Source
const (
	// Read only (no update) access
	ReadOnly = Access(C.GA_ReadOnly)
	// Read/write access.
	Update = Access(C.GA_Update)

	// Allow raster and vector drivers to be used.
	AllDrivers = Access(C.GDAL_OF_ALL)

	// Allow raster drivers to be used.
	RasterDrivers = Access(C.GDAL_OF_RASTER)

	// Allow vector drivers to be used.
	VectorDrivers = Access(C.GDAL_OF_VECTOR)

	// Allow gnm drivers to be used.
	GNMDrivers = Access(C.GDAL_OF_GNM)

	// Unsure
	KindMask = Access(C.GDAL_OF_KIND_MASK)

	// Open in shared mode.
	Shared = Access(C.GDAL_OF_SHARED)

	// Emit error message in case of failed open.
	Verbose = Access(C.GDAL_OF_VERBOSE_ERROR)

	// Open as internal dataset. Such dataset isn't registered in the global list
	// of opened dataset. Cannot be used with GDAL_OF_SHARED.
	Internal = Access(C.GDAL_OF_INTERNAL)
)
View Source
const (
	MassConserving = iota
	MomentumConserving
	SemiLagrangian
)

Variables

This section is empty.

Functions

func IntSliceToCInt

func IntSliceToCInt(data []int) []C.int

func Version

func Version() string

Types

type Access

type Access uint

type DataType

type DataType int

type Dataset

type Dataset struct {
	// contains filtered or unexported fields
}

func OpenEx

func OpenEx(filename string, flags Access, allowedDrivers []string, options []string, siblingFiles []string) (*Dataset, error)

func (*Dataset) Close

func (dataset *Dataset) Close()

Close the dataset

func (*Dataset) GeoTransform

func (dataset *Dataset) GeoTransform() [6]float64

func (*Dataset) IO

func (dataset *Dataset) IO(
	rwFlag RWFlag,
	xOff, yOff, xSize, ySize int,
	buffer interface{},
	bufXSize, bufYSize int,
	bandCount int,
	bandMap []int,
	pixelSpace, lineSpace, bandSpace int,
) error

func (*Dataset) ProjectionRef

func (dataset *Dataset) ProjectionRef() string

func (*Dataset) RasterCount

func (dataset *Dataset) RasterCount() int

Fetch the number of raster bands in the dataset

func (*Dataset) RasterXSize

func (dataset *Dataset) RasterXSize() int

Fetch X size of raster

func (*Dataset) RasterYSize

func (dataset *Dataset) RasterYSize() int

Fetch Y size of raster

type Dense

type Dense = mat.Dense

Alias these types for future removal depending on how we implement these internally.

We may replace this with a compressed row/col storage.

type InitFunc

type InitFunc func(x, y, z float64) (float64, float64, float64)

func UniformInit

func UniformInit(u, v, w float64) InitFunc

func WxInit

func WxInit(wxFile string, when time.Time) InitFunc

type LandfireClient

type LandfireClient struct {
	// contains filtered or unexported fields
}

func NewLandfireClient

func NewLandfireClient(c *http.Client) *LandfireClient

func (*LandfireClient) Download

func (c *LandfireClient) Download(ctx context.Context, mbr MBR, srs, dst string) error

Download requests a landscape file with the requested bounds and writes the file to the target path dst. If dst does not have the extension '.lcp', then it is added. A file with the same path but a '.prj' extension is written as well.

The following process is followed:

1) send a request for validation 2) initiate download 3) check downloadStatus 4) download the data to a temporary file 5) extract the landscape files from the temporary zip into dst.(lcp|prj)

TODO(kyle): progress? TODO(kyle): figure out if we can use an io.Writer here, if it seems better.

type MBR

type MBR struct {
	MinX float64
	MaxX float64
	MinY float64
	MaxY float64
}

type MeshOpts

type MeshOpts struct {
	DX      float64
	DY      float64
	Z0      float64
	ZGrowth float64
}

type Ninja

type Ninja struct {
	// contains filtered or unexported fields
}

func NewNinja

func NewNinja(solver Solver) (*Ninja, error)

func (*Ninja) BuildMesh

func (n *Ninja) BuildMesh(elevation string, opts MeshOpts) error

func (*Ninja) Geo

func (n *Ninja) Geo(i, j, k int) (float64, float64, float64)

func (*Ninja) Initialize

func (n *Ninja) Initialize(init InitFunc) error

func (*Ninja) PointInit

func (n *Ninja) PointInit(x, y, z, r float64) error

func (*Ninja) SimulateWind

func (n *Ninja) SimulateWind(ctx context.Context) error

SimulateWind calculates the diagnostic wind field given a valid intialized field. TODO(kyle): change name

type Ninjas

type Ninjas []*Ninja

func NewWx

func NewWx(elevation, model string, times ...time.Time) (Ninjas, error)

func (Ninjas) WriteATM

func (n Ninjas) WriteATM(w io.Writer) error

type RWFlag

type RWFlag int

Read/Write flag for RasterIO() method

type Solver

type Solver int

type SymDense

type SymDense = mat.SymDense

Alias these types for future removal depending on how we implement these internally.

We may replace this with a compressed row/col storage.

Jump to

Keyboard shortcuts

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