示例#1
0
def normalize(field: SampledField, norm: SampledField, epsilon=1e-5):
    """ Multiplies the values of `field` so that its sum matches the source. """
    data = math.normalize_to(field.values, norm.values, epsilon)
    return field.with_values(data)
示例#2
0
 def normalized(self, total, epsilon=1e-5):
     if isinstance(total, CenteredGrid):
         total = total.data
     normalize_data = math.normalize_to(self.data, total, epsilon)
     return self.with_data(normalize_data)
示例#3
0
def normalize(field: SampledField, norm: SampledField, epsilon=1e-5):
    data = math.normalize_to(field.values, norm.values, epsilon)
    return field.with_(values=data)