From 41d105eef14cf271bc7c3e1206912d3c5a844ae3 Mon Sep 17 00:00:00 2001 From: rowanc1 Date: Thu, 3 Jul 2014 22:48:17 -0700 Subject: [PATCH] Force overwrite of dobs in makeSyntheticData --- SimPEG/Survey.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/SimPEG/Survey.py b/SimPEG/Survey.py index fdf8ed34..e72b7d22 100644 --- a/SimPEG/Survey.py +++ b/SimPEG/Survey.py @@ -355,16 +355,17 @@ class BaseSurvey(object): "Check if the data is synthetic." return self.mtrue is not None - def makeSyntheticData(self, m, std=0.05, u=None): + def makeSyntheticData(self, m, std=0.05, u=None, force=False): """ Make synthetic data given a model, and a standard deviation. :param numpy.array m: geophysical model :param numpy.array std: standard deviation :param numpy.array u: fields for the given model (if pre-calculated) + :param bool force: force overwriting of dobs """ - if getattr(self, 'dobs', None) is not None: + if getattr(self, 'dobs', None) is not None and not force: raise Exception('Survey already has dobs.') self.mtrue = m self.dtrue = self.dpred(m, u=u)