Terraflux Terraflux
Download

Circuit connectivity

8 operators. Inputs marked required must be connected or given; the others have defaults.

circuit.advanced#

Currents and voltages of a raster circuit with sources and grounds, Circuitscape 6.1's advanced mode through landschaft's C++: each cell with a conductance a node joined to its 8 neighbours (4 asked) by the average conductance; current injected at the sources, drawn at the grounds (a conductance to ground, or a direct ground: inf); every component with both solved exactly. The node current is the larger of a cell's inflow and outflow.

InputTypeWhat it is
conductancerequiredmapthe conductance of each cell (no value: no node)
sourcerequiredmapthe current injected at each cell, amps
groundrequiredmapthe conductance to ground of each cell (inf: direct)
OutputTypeWhat it is
currentmapthe node current of each cell
voltagemapthe voltage of each cell
SettingTypeWhat it is
four_neighborsboolthe four orthogonal neighbours only

circuit.circuitscape_ini#

Run a Circuitscape INI file on rasters, as Circuitscape.compute(path) does (landschaft's circuitscape_ini): advanced, pairwise, one-to-all and all-to-one, with its polygons, mask, reclassification, included pairs and variable source strengths; the inputs read as Circuitscape reads them (ASCII grids in double, GeoTIFFs, text lists; paths from the working directory or next to the INI), the outputs written as it names them next to output_file (ASCII grids, or GeoTIFF with write_as_tif). solver, precision and parallelize have no effect: every solve is exact in double.

OutputTypeWhat it is
resistancestablepairwise: a row per point and its resistances; one-to-all: id, value
voltagemapadvanced: the voltages
currentmapadvanced: the currents
cummapthe cumulative current
maxmapthe largest current
mapsstackthe pairs' (or points') voltage and current maps
SettingTypeWhat it is
pathrequiredtextthe INI file
write_outputsboolwrite the output files as Circuitscape (default true)
batchintegerone-to-all problems solved together (default 4 x the threads)

circuit.network_advanced#

Circuitscape's advanced mode on a network (data_type = network; landschaft's circuitscape_network_advanced): currents injected at nodes and grounds (a resistance of 0 a direct ground) on a graph of edges numbered from 1 (or 0, then every number shifted, as Circuitscape.jl). Duplicate edges add up. Every component with a source and a ground is solved.

InputTypeWhat it is
graphtablethe edges: node, node, resistance (or conductance)
sourcestablenode, current
groundstablenode, resistance (or conductance) to ground
OutputTypeWhat it is
voltagestablenode, voltage (0 where not solved)
node_currentstablenode, current
branch_currentstablefrom, to, current
SettingTypeWhat it is
graph_filetextor Circuitscape's edge list file
graph_is_resistanceboolthe edge values are resistances (default true)
sources_filetextor Circuitscape's source file
grounds_filetextor Circuitscape's ground file
ground_is_resistanceboolthe ground values are resistances (default true)
remove_src_or_gndtextnodes that are both: keepall (default)...

circuit.network_pairwise#

Circuitscape's pairwise mode on a network (landschaft's circuitscape_network_pairwise): the effective resistance between every pair of focal nodes (-1: not connected), every component factorised once; included or excluded pairs from Circuitscape's file; with the map options every pair's node voltages, node and branch currents (JSON), and the currents summed over the pairs.

InputTypeWhat it is
graphtablethe edges: node, node, resistance (or conductance)
OutputTypeWhat it is
resistancestablea row per focal node: its id, then its resistances
cum_node_currentstablewith current_maps: node, current summed over the pairs
cum_branch_currentstablewith current_maps: from, to, current
mapsanywith the map options: each pair's values (JSON)
SettingTypeWhat it is
graph_filetextor Circuitscape's edge list file
graph_is_resistanceboolthe edge values are resistances (default true)
focal_nodesrequiredanythe focal node numbers, or the path of Circuitscape's file
included_pairstextCircuitscape's include / exclude pairs file
voltage_mapsboolevery pair's node voltages
current_mapsboolevery pair's currents, and their sums

circuit.omniscape#

Omnidirectional connectivity with Omniscape's moving-window circuits (Omniscape 0.7 through landschaft's C++): a target every block_size cells injects its block's source strength into the sources within radius, grounded at the target; the node currents of every window add up into the cumulative current. The flow potential (the same on a conductance of 1) and the current normalised by it (above 1: channelled; below: impeded) when asked. Sources from the resistance (its conductance) unless given; conditions keep the sources whose values match the target's.

InputTypeWhat it is
resistancerequiredmapthe resistance (or conductance), > 0; no value: no data
sourcemapthe source strengths (default: from the resistance)
condition1mapconditional connectivity: the first condition
condition1_futuremapits future values (compare_to_future)
condition2mapa second condition
condition2_futuremapits future values
OutputTypeWhat it is
currentmapthe cumulative current (cum_currmap)
flow_potentialmapthe flow potential (flow_potential: true)
normalizedmapthe current over the flow potential (normalized_current)
SettingTypeWhat it is
radiusrequirednumberthe window's radius, in cells
block_sizenumbertargets every this many cells, odd (1)
buffernumbercells beyond the radius in each window (0)
source_thresholdnumbersources given: below this none (0)
r_cutoffnumbersources from the resistance: none above it (inf)
resistance_is_conductanceboolthe map holds conductances
four_neighborsboolthe four orthogonal neighbours only
flow_potentialboolthe flow potential too
normalized_currentboolthe normalised current too
correct_artifactsboolundo the blocks' artifacts (true)
mask_nodataboolno value where the resistance has none (true)
reclass_tableany[[value, new value], ...] (null: no data)
compare_to_futuretextnone (default), 1, 2 or both
comparison1textwithin (default) or equal
comparison2textwithin (default) or equal
condition1_lowernumberwithin: the least difference (0)
condition1_uppernumberwithin: the largest difference (0)
condition2_lowernumberwithin: the least difference (0)
condition2_uppernumberwithin: the largest difference (0)
precisiontextdouble (default) or single

circuit.omniscape_ini#

Run an Omniscape INI file, as run_omniscape(path) does (landschaft's omniscape_ini): every option of Omniscape 0.7 with its defaults (radius, resistance_file and project_name required), paths from the working directory or next to the INI; the outputs written to project_name (_1, _2... when it exists) as Omniscape writes them: config.ini, cum_currmap, flow_potential, normalized_cum_currmap, classified_resistance (GeoTIFF or ASCII grids, no data -9999).

OutputTypeWhat it is
currentmapthe cumulative current (cum_currmap)
flow_potentialmapwith calc_flow_potential
normalizedmapwith calc_normalized_current
classified_resistancemapwith reclassify_resistance
SettingTypeWhat it is
pathrequiredtextthe INI file
write_outputsboolwrite the outputs to the project folder (default true)

circuit.one_to_all#

Circuitscape's one-to-all (or all-to-one) mode on rasters (landschaft's circuitscape_one_to_all): for every focal point in turn, 1 A (or its strength) injected there with every other point a direct ground (one-to-all), or the point grounded and the others injecting (all-to-one); the voltage over the strength at each point (one-to-all), the cumulative and largest current maps when asked. Circuitscape's quirks kept (strengths by position); all-to-one measures no resistances, so its table's value column is 0, as Circuitscape's: read its current maps.

InputTypeWhat it is
habitatrequiredmapthe resistance (or conductance); no value: no node
pointsrequiredmapthe focal points' ids (0 or no value elsewhere; cells of one id: a region)
polygonsmapshort-circuit regions: ids > 0, their cells one node
maskmapcells where it is not positive (or has no value) removed
OutputTypeWhat it is
resistancestablethe effective resistances
cummapthe cumulative current (cum_map)
maxmapthe largest current of the pairs (max_map)
SettingTypeWhat it is
habitat_is_resistanceboolresistances (default) or conductances
four_neighborsboolthe four orthogonal neighbours only
avg_resistancesboolneighbours joined by their resistances' average
cum_mapboolthe cumulative current
max_mapboolthe largest current
focal_zeroboolcurrent 0 on the focal nodes in the maps
reclass_tableany[[value, new value], ...] applied to the habitat first
all_to_oneboolall-to-one instead of one-to-all
strengthsany[[id, strength], ...], by position as Circuitscape
batchintegerthe problems solved together (default 4 x the threads; the last bits depend on it)

circuit.pairwise#

Circuitscape's pairwise mode on rasters (landschaft's circuitscape_pairwise): the effective resistance between every pair of focal points (-1: not connected), every component factorised once and its pairs solved together; the cumulative and the largest current maps when asked.

InputTypeWhat it is
habitatrequiredmapthe resistance (or conductance); no value: no node
pointsrequiredmapthe focal points' ids (0 or no value elsewhere; cells of one id: a region)
polygonsmapshort-circuit regions: ids > 0, their cells one node
maskmapcells where it is not positive (or has no value) removed
OutputTypeWhat it is
resistancestablethe effective resistances
cummapthe cumulative current (cum_map)
maxmapthe largest current of the pairs (max_map)
SettingTypeWhat it is
habitat_is_resistanceboolresistances (default) or conductances
four_neighborsboolthe four orthogonal neighbours only
avg_resistancesboolneighbours joined by their resistances' average
cum_mapboolthe cumulative current
max_mapboolthe largest current
focal_zeroboolcurrent 0 on the focal nodes in the maps
reclass_tableany[[value, new value], ...] applied to the habitat first
null_currentsboolno value instead of 0 where no current (in the maps)
log_transformboollog10 of the current maps