Hi Kate,
Matthew Duveneck helped me with this recently. My goal was to iteratively input new ignition probability maps for prescribed fire in the SCF extension.
In your scenario file, you can add a line that will run an external R script. The first few lines of the scenario file look like this:
LandisData Scenario
Duration 10
Species species_LTB.txt
Ecoregions ecoregions.txt
EcoregionsMap ecoregions.tif
CellLength 100 << meters, 100 x 100 m = 1 hectare
ExternalCommand "Rscript pause_test_SCF.R"
In my case, the R script uses the fine fuels raster from a given time step to generate a new map of prescribed fire ignition probabilities. To bring these in to SCF, the first few lines of my text file look like this.
LandisData "Social Climate Fire"
Timestep 1
Species_CSV_File Fire_Spp_Table.csv
AccidentalIgnitionsMap Accidental_Ignition_Map.tif
LightningIgnitionsMap Lightning_Ignition_Map.tif
RxIgnitionsMap Lightning_Ignition_Map.tif << just a placeholder, will be overwritten immediately
DynamicRxIgnitionMaps << Optional
1 ./external_dynamic_input_maps/Rx_Ignition_Map1.tif
2 ./external_dynamic_input_maps/Rx_Ignition_Map2.tif
3 ./external_dynamic_input_maps/Rx_Ignition_Map3.tif
4 ./external_dynamic_input_maps/Rx_Ignition_Map4.tif
5 ./external_dynamic_input_maps/Rx_Ignition_Map5.tif
Happy to share more with you if it would be helpful, though I'll be out on paternity leave the next couple weeks. My email is graham.frank at
oregonstate.edu