Friendly graphical user interface click here
Fire Advanced Analyitics research group scriptable knowledge base
- Novel Algorithms related to landscape risk metrics, spatial decision optimization models, etc.
- (Cell2) Fire (W) Simulator integration algorithms to facilitating placing firebreaks, measuring forest fire impacts, etc.
- (Q)GIS algorithms to common tasks related to rasters, polygons, spatial clustering, etc.
- Install QGIS
- Open QGIS Python Console
- Type (to install)::
!pip install fire2a-lib
- Visit fire2a-lib documentation, example:
from fire2a.downstream_protection_value import digraph_from_messages
digraph = digraph_from_messages('messages01.csv')
- Install QGIS
- Docker users check qgis container
- Linux developers could skip QGIS by
apt install python3-gdal gdal-bin
- Use python from the terminal
- Windows: Open OsGeo4W Shell app,
python
is available - MacOS: Open terminal app, use this
/Applications/QGIS.app/Contents/MacOS/bin/python
(see creating an alias below) - Linux: Do a system site packages aware python virtual environment
python3 -m venv --system-site-packages qgis_venv
- Install
python -m pip install fire2a-lib
- Visit fire2a-lib documentation, example:
python -m fire2a.cell2fire -vvv --base-raster ../fuels.asc --authid EPSG:25831 --scar-sample Grids/Grids2/F
orestGrid03.csv --scar-poly propagation_scars.shp --burn-prob burn_probability.tif
- Check standalone scripting for more info on initializing a headless QGIS environment
- Usage examples
- Microsoft users check this VSCode integration
- macOS users add a permanent alias, on the terminal app
echo "alias pythonq='/Applications/QGIS.app/Contents/MacOS/bin/python'" >> ~/.zshrc
- debbuging:
breakpoint()
from IPython import embed
embed()
- sessions, with: IPython, qtconsole, jupyter-lab, or IPyConsole (QGIS plugin) compatible
# Interactive explore from IPython
In [1]: from fire2a.<press-tab>
# Select and Copy a whole module from line 1 up -but not included- to 'def main def main(argv=None):' line
In [2]: %paste
# Choose your args
In [3]: args = arg_parser.parse_args(['-vvv', '--base-raster', ...
# Skip:
if argv is sys.argv:
argv = sys.argv[1:]
args = arg_parser(argv)
# Ready
Everyone interacting in the project's codebases, issue trackers, chat rooms, and fora is expected to follow the PSF Code of Conduct.