Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 22 additions & 15 deletions avaframe/com4FlowPy/com4FlowPy.py
Original file line number Diff line number Diff line change
Expand Up @@ -526,20 +526,27 @@ def mergeAndWriteResults(modelPaths, modelOptions):
log.info("-------------------------")

# Merge calculated tiles
zDelta = SPAM.mergeRaster(modelPaths["tempDir"], "res_z_delta")
flux = SPAM.mergeRaster(modelPaths["tempDir"], "res_flux")
cellCounts = SPAM.mergeRaster(modelPaths["tempDir"], "res_count", method='sum')
zDeltaSum = SPAM.mergeRaster(modelPaths["tempDir"], "res_z_delta_sum", method='sum')
routFluxSum = SPAM.mergeRaster(modelPaths["tempDir"], "res_rout_flux_sum", method='sum')
depFluxSum = SPAM.mergeRaster(modelPaths["tempDir"], "res_dep_flux_sum", method='sum')
fpTa = SPAM.mergeRaster(modelPaths["tempDir"], "res_fp")
slTa = SPAM.mergeRaster(modelPaths["tempDir"], "res_sl")
travelLength = SPAM.mergeRaster(modelPaths["tempDir"], "res_travel_length")

if modelOptions["infraBool"]:
if 'zDelta' in _outputs:
zDelta = SPAM.mergeRaster(modelPaths["tempDir"], "res_z_delta")
if 'flux' in _outputs:
flux = SPAM.mergeRaster(modelPaths["tempDir"], "res_flux")
if 'cellCounts' in _outputs:
cellCounts = SPAM.mergeRaster(modelPaths["tempDir"], "res_count", method='sum')
if 'zDeltaSum' in _outputs:
zDeltaSum = SPAM.mergeRaster(modelPaths["tempDir"], "res_z_delta_sum", method='sum')
if 'routFluxSum' in _outputs:
routFluxSum = SPAM.mergeRaster(modelPaths["tempDir"], "res_rout_flux_sum", method='sum')
if 'depFluxSum' in _outputs:
depFluxSum = SPAM.mergeRaster(modelPaths["tempDir"], "res_dep_flux_sum", method='sum')
if 'fpTravelAngle' in _outputs:
fpTa = SPAM.mergeRaster(modelPaths["tempDir"], "res_fp")
if 'slTravelAngle' in _outputs:
slTa = SPAM.mergeRaster(modelPaths["tempDir"], "res_sl")
if 'travelLength' in _outputs:
travelLength = SPAM.mergeRaster(modelPaths["tempDir"], "res_travel_length")
if modelOptions["infraBool"] and 'backcalc' in _outputs:
backcalc = SPAM.mergeRaster(modelPaths["tempDir"], "res_backcalc")

if modelOptions["forestInteraction"]:
if modelOptions["forestInteraction"] and 'forestInteraction' in _outputs:
forestInteraction = SPAM.mergeRaster(modelPaths["tempDir"], "res_forestInt", method='min')

# Write Output Files to Disk
Expand Down Expand Up @@ -581,10 +588,10 @@ def mergeAndWriteResults(modelPaths, modelOptions):
# if not modelOptions["infraBool"]: # if no infra
# io.output_raster(modelPaths["demPath"], modelPaths["resDir"] / ("cell_counts%s" %(output_format)),cell_counts)
# io.output_raster(modelPaths["demPath"], modelPaths["resDir"] / ("z_delta_sum%s" %(output_format)),z_delta_sum)
if modelOptions["infraBool"]: # if infra
if modelOptions["infraBool"] and 'backcalc' in _outputs: # if infra
io.output_raster(modelPaths["demPath"], modelPaths["resDir"] / "com4_{}_{}_backcalculation{}".format(_uid,
_ts, _oF), backcalc)
if modelOptions["forestInteraction"]:
if modelOptions["forestInteraction"] and 'forestInteraction' in _outputs:
io.output_raster(modelPaths["demPath"], modelPaths["resDir"] / "com4_{}_{}_forestInteraction{}".format(_uid,
_ts, _oF), forestInteraction)

Expand Down
5 changes: 3 additions & 2 deletions avaframe/com4FlowPy/com4FlowPyCfg.ini
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,9 @@ outputFileFormat = .tif
# zDeltaSum
# routFluxSum
# depFluxSum
# if forestInteraction: forestInteraction is automatically added to outputs
# if infra: backCalculation is automatically added to output
# forestInteraction
# backalc

outputFiles = zDelta|cellCounts|travelLength|fpTravelAngle

#++++++++++++ Custom paths True/False
Expand Down
3 changes: 0 additions & 3 deletions avaframe/com4FlowPy/flowClass.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,9 +374,6 @@ def calc_distribution(self):
if self.forestBool and self.forestDetrainmentBool:
self.forest_detrainment()

self.calc_fp_travelangle()
self.calc_sl_travelangle()

# FOREST-Detrainment
# here we subtract the detrainment from the flux before moving flux to new cells.
if self.forestBool and self.forestDetrainmentBool:
Expand Down
Loading