Skip to content

Commit

Permalink
Merge pull request #31 from LabSid-USP/20-Adicionar-param-config-tipo…
Browse files Browse the repository at this point in the history
…-arq-map-tiff

Close #20 Add export format configuration
  • Loading branch information
soaressgabriel committed Jul 1, 2021
2 parents 6df67d6 + d16760f commit 13d773c
Showing 1 changed file with 20 additions and 11 deletions.
31 changes: 20 additions & 11 deletions rubem.py
Original file line number Diff line number Diff line change
Expand Up @@ -486,20 +486,25 @@ def dynamic(self):
"Ssat": self.TUr,
"Runoff": self.runoff,
}

for fileName, isSelected in genFilesDic.items():
# Check if the variable (fileName) has been selected for export
if isSelected:

# Export raster by default
reportTif(
self,
self.ref,
varDic.get(fileName),
fileName,
self.outpath,
dyn=True,
)
# Export *.tiff raster
if enableTIFFormat:
reportTif(
self,
self.ref,
varDic.get(fileName),
fileName,
self.outpath,
dyn=True,
)

# Export *.map raster
if enableMapFormat:
reportMapSeries(self, varDic.get(fileName), fileName)

# Check if we have to export the time series of the selected variable (fileName)
if genTss:
Expand Down Expand Up @@ -552,9 +557,13 @@ def dynamic(self):
for file in genFilesList:
genFilesDic[file] = config.getboolean("GENERATE_FILE", file)

# Check if time series generation has been activated
# Store the setting that enables the export of time series
genTss = config.getboolean("GENERATE_FILE", "genTss")

# Store the format in which the resulting files will be exported (*.tif and/or *.map)
enableTIFFormat = config.getboolean("GENERATE_FILE_FORMAT", "enableTiff")
enableMapFormat = config.getboolean("GENERATE_FILE_FORMAT", "enableMapSeries")

steps = totalSteps(startDate, endDate)
start = steps[0]
end = steps[1]
Expand Down

0 comments on commit 13d773c

Please sign in to comment.