Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CanalRecharge ¶ added in v1.5.0
CanalRecharge is a function to get the recharge amounts from the diversions and apportion them to the Canal sections and recharge them into the groundwater model.
func Conveyance ¶
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.
func GetSurfaceWaterDelivery ¶
func GetSurfaceWaterDelivery(v *database.Setup) (map[int]Diversions, error)
GetSurfaceWaterDelivery function returns a map with a key of year and a value of 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.
Types ¶
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"` CellArea float64 `db:"cell_area"` 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 daily diversions table data and also the results are this struct which is a monthly total using the first day of each month.
func FilterDivs ¶ added in v1.2.3
FilterDivs function that receives a slice of divs and filters them to a canal that is given as an int
type Diversions ¶ added in v1.5.0
type Diversions []Diversion
func (*Diversions) FilterSWDeliveryByYear ¶ added in v1.5.0
func (divs *Diversions) FilterSWDeliveryByYear(y int) (filteredDivs Diversions)
func (*Diversions) FindDiversionsByCanalId ¶ added in v1.5.0
func (divs *Diversions) FindDiversionsByCanalId(canalId int) (canalDiversions Diversions)
type SSDiversion ¶ added in v1.3.12
type SSDiversion struct { CanalId int `db:"canal_id"` DivMnth int `db:"mnth"` DivAmount sql.NullFloat64 `db:"div_avg"` }
SSDiversion is a struct to hold the daily diversions table data and also the results are this struct which is a monthly total using the first day of each month.