Intervention flows
This method returns the \(m\) intervention flows of a result. These are
the flows that cross the boundary with the environment of the calculated
system (this is why the short name is EnviFlow
in the API). In regionalized
calculations these flows can be pairs of flows and locations, the same flow
can occur in different locations (with possibly different characterisation
factors). The rows of the intervention matrix are indexed by these \(m\)
intervention flows (and the columns by the \(n\) technosphere flows):
$$ B \in \mathbb{R}^{m \times n} $$
REST | result/{result-id}/envi-flows |
IPC | result/envi-flows |
Python IPC | Result.get_envi_flows |
Return type | List[EnviFlow] |
Examples
Python IPC
envi_flows = result.get_envi_flows()
print(
pd.DataFrame(
[
(ef.is_input, ef.flow.name, ef.flow.category, ef.flow.ref_unit)
for ef in envi_flows
],
columns=["Is input?", "Flow", "Category", "Unit"],
).head()
)
# Is input? Flow Category Unit
# 0 False 1,4-dioxane Elementary Flows/air/unspecified kg
# 1 False oryzalin Elementary Flows/soil/groundwater kg
# 2 False Sethoxydim Elementary Flows/soil/groundwater kg
# 3 False Chlorpyrifos Elementary Flows/air/low population density kg
# 4 False lead Elementary Flows/air/unspecified kg
JSON-RPC via Fetch API
The example below shows the usage of this method using the JSON-RPC protocol via the Fetch API which is available in modern web-browsers or platforms like Deno.
let resp = await fetch("http://localhost:8080", {
method: "POST",
body: JSON.stringify({
jsonrpc: "2.0",
id: 1,
method: "result/envi-flows",
params: {
"@id": "66dcc7d0-ce47-46bf-b77a-ada4b4c95169",
}
})
});
let v = await resp.json();
console.log(v);
// {
// jsonrpc: "2.0",
// result: [
// {
// flow: {
// "@type": "Flow",
// "@id": "60ea7a31-8f27-46af-bfe5-66417f00088b",
// name: "Barite",
// category: "Elementary flows/Emission to water/ocean",
// flowType: "ELEMENTARY_FLOW",
// refUnit: "kg"
// },
// isInput: false
// },
// {
// flow: {
// "@type": "Flow",