-
Notifications
You must be signed in to change notification settings - Fork 146
Open
Description
Hello there :)
I found a small error in the chooseTime()
function under the TimelapseERT()
class. I would like to double-check if I am doing things right.
I am inverting for field data, which already has an error value. When I initiate the TimeLapseERT class it stores this in self.ERR
. However, when I want to invert for a single time step using:
result = tl.invert(t=0, mesh=mesh, lam=100, verbose=True, robustData=True)
it creates other error values using estimateError()
under the function chooseTime()
. Is this intended or just a small bug? Is my modification valid?
This is the original function
def chooseTime(self, t=None):
"""Return data for specific time.
Parameters
----------
t : int|str|datetime
"""
if not isinstance(t, (int, np.int32, np.int64)):
t = self.timeIndex(t)
rhoa = self.DATA[:, t].copy()
arhoa = np.abs(rhoa.data)
arhoa[rhoa.mask] = np.nanmedian(arhoa)
data = self.data.copy()
data["rhoa"] = arhoa
data.estimateError() #new values of error
data["err"][rhoa.mask] = 1e8
self.data = data
return data
This is how I have chosen to modify it.
def chooseTimeModified(self, t=None):
"""Return data for specific time.
Parameters
----------
t : int|str|datetime
"""
if not isinstance(t, (int, np.int32, np.int64)):
t = self.timeIndex(t)
rhoa = self.DATA[:, t].copy()
err = self.ERR[:, t].copy()
aerr = np.abs(err.data)
arhoa = np.abs(rhoa.data)
arhoa[rhoa.mask] = np.nanmedian(arhoa)
data = self.data.copy()
data["rhoa"] = arhoa
data.estimateError()
data["err"] = err
self.data = data
return data
Metadata
Metadata
Assignees
Labels
No labels