conveyLoss

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2021 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Conveyance

func Conveyance(v database.Setup) (err error)

Conveyance function finds the diversions and calculates the conveyance loss for all cells where there is a canal. This outputs to the results table in sqlite. Might update to return delivery by canal.

Types

type Canal

type Canal struct {
	Id   int             `db:"id"`
	Name string          `db:"name"`
	Eff  float64         `db:"eff"`
	Area sql.NullFloat64 `db:"area"`
	Yr   int             `db:"yr"`
}

type CanalCell

type CanalCell struct {
	CanalId    int             `db:"id"`
	CanalType  string          `db:"type_2"`
	DistId     int             `db:"district_id"`
	Eff        sql.NullFloat64 `db:"eff"`
	Node       int             `db:"node"`
	StLength   float64         `db:"st_length"`
	CFlag      int             `db:"c_flag"`
	DnrFact    sql.NullFloat64 `db:"dnr_fact"`
	SatFact    sql.NullFloat64 `db:"sat_fact"`
	UsgsFact   sql.NullFloat64 `db:"usgs_fact"`
	CLinkId    int             `db:"clink_id"`
	CanalEff   sql.NullFloat64 `db:"eff2"`
	LatCount   sql.NullInt64   `db:"latcount"`
	TotalLatLn sql.NullFloat64 `db:"tot_lat_ln"`
	TotalCanLn float64         `db:"tot_can_ln"`
}

type Diversion

type Diversion struct {
	CanalId   int             `db:"canal_id"`
	DivDate   sql.NullTime    `db:"div_dt"`
	DivAmount sql.NullFloat64 `db:"div_amnt_cfs"`
}

Diversion is a struct to hold the dailydiversions table data and also the results are this struct which is a monthly total using the first day of each month.

func FilterSWDeliveryByYear

func FilterSWDeliveryByYear(divs []Diversion, y int) (diversions []Diversion)

func GetSurfaceWaterDelivery

func GetSurfaceWaterDelivery(v database.Setup) ([]Diversion, error)

GetSurfaceWaterDelivery function returns a slice of Diversion that is a monthly amount of surface water delivered to an acre of land. The units of the Diversion are in acre-feet per acre for use in subsequent processes.

Jump to

Keyboard shortcuts

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