mirror of
https://github.com/wassname/simpeg.git
synced 2026-09-10 12:37:30 +08:00
Clean up imports in DC, move data to forward folder. clean up init statements.
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
from SimPEG import utils
|
||||
|
||||
|
||||
class SimPEGData(object):
|
||||
"""Data holds the observed data, and the standard deviations."""
|
||||
|
||||
__metaclass__ = utils.Save.Savable
|
||||
|
||||
std = None #: Estimated Standard Deviations
|
||||
dobs = None #: Observed data
|
||||
dtrue = None #: True data, if data is synthetic
|
||||
mtrue = None #: True model, if data is synthetic
|
||||
|
||||
def __init__(self, prob, **kwargs):
|
||||
utils.setKwargs(self, **kwargs)
|
||||
self.prob = prob
|
||||
|
||||
def isSynthetic(self):
|
||||
"Check if the data is synthetic."
|
||||
return self.mtrue is not None
|
||||
@@ -1,4 +1,5 @@
|
||||
from SimPEG import utils, data, np, sp
|
||||
from SimPEG import utils, np, sp
|
||||
import Data
|
||||
norm = np.linalg.norm
|
||||
|
||||
|
||||
@@ -224,7 +225,7 @@ class Problem(object):
|
||||
noise = std*abs(dtrue)*np.random.randn(*dtrue.shape)
|
||||
dobs = dtrue+noise
|
||||
stdev = dobs*0 + std
|
||||
return data.SimPEGData(self, dobs=dobs, std=stdev, dtrue=dtrue, mtrue=m)
|
||||
return Data.SimPEGData(self, dobs=dobs, std=stdev, dtrue=dtrue, mtrue=m)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
from Problem import *
|
||||
import ModelTransforms
|
||||
from Data import *
|
||||
|
||||
Reference in New Issue
Block a user