|
char | separator () |
|
std::tuple< std::unordered_map< std::string, std::string >, std::unordered_map< std::string, std::tuple< float, float, float, float > > > | Dictionary (const std::string &filename) |
| Reads the model lookup table and creates dictionaries for the fuel types and cell's ColorsDict.
|
|
std::tuple< std::vector< int >, std::vector< std::string >, int, int, float > | ForestGrid (const std::string &filename, const std::unordered_map< std::string, std::string > &Dictionary) |
| Reads fuels from ASCII raster file and creates a list of cells.
|
|
bool | fileExists (const std::string &filename) |
| checks if a file exists.
|
|
void | DataGrids (const std::string &filename, std::vector< float > &data, int nCells) |
| Read grid data from ASCII file into a vector.
|
|
std::tuple< std::vector< int >, std::vector< std::string >, int, int, float > | ForestGridTif (const std::string &filename, const std::unordered_map< std::string, std::string > &Dictionary) |
| Reads fuels raster file in tif format and creates a list of cells.
|
|
void | DataGridsTif (const std::string &filename, std::vector< float > &data, int nCells) |
| This functionality is not currently available.
|
|
std::vector< std::vector< std::unique_ptr< std::string > > > | GenerateDat (const std::vector< std::string > &GFuelType, const std::vector< int > &GFuelTypeN, const std::vector< float > &Elevation, const std::vector< float > &PS, const std::vector< float > &SAZ, const std::vector< float > &Curing, const std::vector< float > &CBD, const std::vector< float > &CBH, const std::vector< float > &CCF, const std::vector< float > &PY, const std::vector< float > &FMC, const std::vector< float > &TreeHeight, const std::string &InFolder) |
| Create input data matrix.
|
|
void | writeDataToFile (const std::vector< std::vector< std::unique_ptr< std::string > > > &dataGrids, const std::string &InFolder) |
| Save data matrix into a CSV file called Data.csv .
|
|
void | GenDataFile (const std::string &InFolder, const std::string &Simulator) |
| Reads all available input raster files and generates a new file called 'Data.csv' in which each row contains the input data for a cell.
|
|
std::tuple< std::unordered_map< std::string, std::string >, std::unordered_map< std::string, std::tuple< float, float, float, float > > > Dictionary |
( |
const std::string & |
filename | ) |
|
Reads the model lookup table and creates dictionaries for the fuel types and cell's ColorsDict.
The function will look for either spain_lookup_table.csv
, kitral_lookup_table.csv
or fbp_lookup_table.csv
in the input instance directory, depending on the chosen model.
This file should have the following columns:
- grid_value: numeric id for fuel type within grid
- export_value: numeric id for fuel type
- descriptive_name: description of fuel type
- fuel_type: code for fuel type
- r: red
- g: green
- b: blue
- h: hue
- s: saturation
- l: lightness
The function creates a fuel type map <grid_value, fuel_type>
and a color map <grid_value, r, g, b, 1.0>
- Parameters
-
filename | Name of file containing the lookup table for the chosen simulation model |
- Returns
- a tuple with a mapping of fuel code per fuel numeric id, and a mapping of color per fuel numeric id.
void GenDataFile |
( |
const std::string & |
InFolder, |
|
|
const std::string & |
Simulator |
|
) |
| |
Reads all available input raster files and generates a new file called 'Data.csv' in which each row contains the input data for a cell.
If the 'fuels' raster file is in tif
format, then it assumes all other rasters are also in that format. Otherwise, it assumes ascii
format.
The function looks for the following files in InFolder
:
- elevation: terrain elevation [m]
- saz: slope azimuth
- slope: terrain slope
- cur: curing level
- cbd: canopy bulk density [km/m²]
- cbh: canopy base height [m]
- ccf: canopy cover fraction
- py: ignition probability map [%]
- fmc: foliage moisture content
- hm: tree height [m]
The generated file contains the following columns: fuel type, latitude, longitude, elevation, wind speed (always blank), wind direction (always blank), slope, slope azimuth, curing level, canopy bulk density, canopy base height, canopy cover fraction, fuel type number ,foliage moisture content, ignition probability.
- Parameters
-
InFolder | Input data directory |
Simulator | Simulation model code |