Commit 64202795 authored by Martin Reinecke's avatar Martin Reinecke
Browse files

Merge branch 'NIFTy_5' into outer_product

parents 9628c28d 1deb0df3
...@@ -46,7 +46,7 @@ def CorrelatedField(s_space, amplitude_model): ...@@ -46,7 +46,7 @@ def CorrelatedField(s_space, amplitude_model):
def MfCorrelatedField(s_space_spatial, s_space_energy, amplitude_model_spatial, def MfCorrelatedField(s_space_spatial, s_space_energy, amplitude_model_spatial,
amplitude_model_energy): amplitude_model_energy, name="xi"):
''' '''
Method for construction of correlated multi-frequency fields Method for construction of correlated multi-frequency fields
''' '''
...@@ -71,4 +71,4 @@ def MfCorrelatedField(s_space_spatial, s_space_energy, amplitude_model_spatial, ...@@ -71,4 +71,4 @@ def MfCorrelatedField(s_space_spatial, s_space_energy, amplitude_model_spatial,
a_energy = dom_distr_energy(amplitude_model_energy) a_energy = dom_distr_energy(amplitude_model_energy)
a = a_spatial*a_energy a = a_spatial*a_energy
A = pd(a) A = pd(a)
return ht(A*FieldAdapter(MultiDomain.make({"xi": h_space}), "xi")) return ht(A*FieldAdapter(MultiDomain.make({name: h_space}), name))
...@@ -207,6 +207,14 @@ class Linearization(object): ...@@ -207,6 +207,14 @@ class Linearization(object):
return Linearization(field, NullOperator(field.domain, field.domain), return Linearization(field, NullOperator(field.domain, field.domain),
want_metric=want_metric) want_metric=want_metric)
@staticmethod
def make_const_empty_input(field, want_metric=False):
from .operators.simple_linear_operators import NullOperator
from .multi_domain import MultiDomain
return Linearization(
field, NullOperator(MultiDomain.make({}), field.domain),
want_metric=want_metric)
@staticmethod @staticmethod
def make_partial_var(field, constants, want_metric=False): def make_partial_var(field, constants, want_metric=False):
from .operators.scaling_operator import ScalingOperator from .operators.scaling_operator import ScalingOperator
......
...@@ -42,4 +42,5 @@ class SymmetrizingOperator(EndomorphicOperator): ...@@ -42,4 +42,5 @@ class SymmetrizingOperator(EndomorphicOperator):
lead = (slice(None),)*i lead = (slice(None),)*i
v, loc = dobj.ensure_not_distributed(v, (i,)) v, loc = dobj.ensure_not_distributed(v, (i,))
loc[lead+(slice(1, None),)] -= loc[lead+(slice(None, 0, -1),)] loc[lead+(slice(1, None),)] -= loc[lead+(slice(None, 0, -1),)]
loc /= 2
return Field(self.target, dobj.ensure_default_distributed(v)) return Field(self.target, dobj.ensure_default_distributed(v))
...@@ -75,7 +75,7 @@ def _makeplot(name): ...@@ -75,7 +75,7 @@ def _makeplot(name):
plt.close() plt.close()
return return
extension = os.path.splitext(name)[1] extension = os.path.splitext(name)[1]
if extension in (".pdf", ".png"): if extension in (".pdf", ".png", ".svg"):
plt.savefig(name) plt.savefig(name)
plt.close() plt.close()
else: else:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment