def _mass_to_density(self, mass):
        density_order = _np.argsort(self.density)
        n = len(self.density)
        mass_fraction = max(0, int(round(mass * n)) - 1)
        level_index = density_order[mass_fraction]
        level = self.density[level_index]

        return level


#############################################
### LEVEL SET TREE CONSTRUCTION FUNCTIONS ###
#############################################
Convert the specified mass level value into a density level value.
dataset/ETHPy150Open CoAxLab/DeBaCl/debacl/level_set_tree.py/LevelSetTree._mass_to_density