Documentation ¶
Index ¶
- func EcoGET(cache *cache.Cache) func(url.Values) (*BenefitsWrapper, error)
- func EcoScenarioPOST(cache *cache.Cache) func(*ScenarioPostData) (*Scenario, error)
- func EcoSummaryPOST(cache *cache.Cache) func(*SummaryPostData) (*BenefitsWrapper, error)
- func ITreeCodesGET(cache *cache.Cache) func() *ITreeCodes
- type BenefitsWrapper
- type ITreeCodes
- type Scenario
- type ScenarioPostData
- type ScenarioTree
- type SummaryPostData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EcoScenarioPOST ¶
func EcoScenarioPOST(cache *cache.Cache) func(*ScenarioPostData) (*Scenario, error)
Take an array of prospective trees where each tree contains an array of diamaters, one for each year the tree is alive, and return an array of eco calulations, one for each year
Trees will die of as part of the scenario, so the `diameters` arrays for the trees may have different lengths. Trees that die may be replaced with other trees, so there will be trees that appear in the scenario at t > 0, so the `diameters` array may have initial elements set to 0.
Specifying a "region" for an individual tree will override the scenario-level "region" value.
The "years" parameter must be >= the length of the longest "diameters" array under "scenario_trees".
Request (with bogus example parameters):
POST /eco_scenario.json
{ "region": "NoEastXXX", "instance_id": 1, "years": 3 "scenario_trees": [ { "otmcode": "CACO", "species_id": 1, "region": "NoEastXXX", "diameters": [1, 1.3, 1.7] } ] }
Response (with bogus example values):
{ "Years": [ { "aq_nox_avoided": 0.01548490, "aq_nox_dep": 0.00771784, "aq_pm10_avoided": 0.00546863 }, { "aq_nox_avoided": 0.02548420, "aq_nox_dep": 0.01973722, "aq_pm10_avoided": 0.00676823 }, { "aq_nox_avoided": 0.05484902, "aq_nox_dep": 0.04774471, "aq_pm10_avoided": 0.00946822 } ], "Total": { "aq_nox_avoided": ... , "aq_nox_dep": ... , "aq_pm10_avoided": ... } }
func EcoSummaryPOST ¶
func EcoSummaryPOST(cache *cache.Cache) func(*SummaryPostData) (*BenefitsWrapper, error)
func ITreeCodesGET ¶
func ITreeCodesGET(cache *cache.Cache) func() *ITreeCodes
Types ¶
type BenefitsWrapper ¶
We can't marshall maps directly with go-rest so we just wrap it here
type ITreeCodes ¶
type ScenarioPostData ¶
type ScenarioPostData struct { Region string Instance_id string Years int Scenario_trees []ScenarioTree }