def BAIM(b4, b5, nodata=-9999):
    """Computes the burned area index for mapping Mediterranean burn scars.
    """
    x = 1 / ( pow(b4-0.05,2) + pow(b5-0.2,2) )
    x[(b4==nodata) | (b5==nodata)] = nodata
    return(x)