def dart_learned(domain, b):
    if domain.unflooded_domain == None:
        print 'No unflooded training domain provided.'
        return None
    unflooded_b = modis_utilities.compute_modis_indices(domain.unflooded_domain)
    water_mask  = modis_utilities.get_permanent_water_mask()
    threshold   = modis_utilities.compute_binary_threshold(get_dartmouth(unflooded_b), water_mask, domain.bounds)
    return dartmouth(domain, b, threshold)
The dartmouth method but with threshold calculation included (training image required)
dataset/ETHPy150Open nasa/CrisisMappingToolkit/cmt/modis/simple_modis_algorithms.py/dart_learned