Skip to contents

Returns the mapping for a fuel_types_rast whose cells hold the 1-based integer codes of the BC FUEL_TYPE_CD factor, as as.integer() gives them for a factor with these 13 levels: 1=B71_S-2, 2=C-2, 3=C-3, 4=C-4, 5=C-5, 6=C-6, 7=C-7, 8=D-1/2, 9=M-1/2, 10=N (non-fuel), 11=O-1a/b, 12=S-1, 13=S-3. Mapped to the five base types accepted by defaultFuelTypeTable() / calibration_par_names().

Usage

bc_fuel_code_to_base()

Value

Character vector of length 13, names "1".."13", values "Conifer" / "ConiferPlantation" / "Deciduous" / "Slash" / "Open" / NA_character_.

Details

A code table is right only for the raster whose codes it was written for. terra::rasterize() of a factor field writes 0-based category codes, which this table reads as the class before each one. Pass such a raster with its category labels instead: save_observed_fire_targets() decodes a labelled raster by label, with bc_fuel_label_to_base().

Downstream projects with a different fuel-classification raster should pass their own mapping vector to save_observed_fire_targets() via the fuel_code_to_base argument.