mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-05-14 19:43:41 +02:00
fix: complex correlator fix extended to array valued complex
correlators.
This commit is contained in:
parent
f39a70c5a8
commit
6343968404
2 changed files with 8 additions and 6 deletions
|
@ -1198,8 +1198,8 @@ class Corr:
|
|||
@property
|
||||
def real(self):
|
||||
def return_real(obs_OR_cobs):
|
||||
if isinstance(obs_OR_cobs[0], CObs):
|
||||
return obs_OR_cobs[0].real
|
||||
if isinstance(obs_OR_cobs.flatten()[0], CObs):
|
||||
return np.vectorize(lambda x: x.real)(obs_OR_cobs)
|
||||
else:
|
||||
return obs_OR_cobs
|
||||
|
||||
|
@ -1208,8 +1208,8 @@ class Corr:
|
|||
@property
|
||||
def imag(self):
|
||||
def return_imag(obs_OR_cobs):
|
||||
if isinstance(obs_OR_cobs[0], CObs):
|
||||
return obs_OR_cobs[0].imag
|
||||
if isinstance(obs_OR_cobs.flatten()[0], CObs):
|
||||
return np.vectorize(lambda x: x.imag)(obs_OR_cobs)
|
||||
else:
|
||||
return obs_OR_cobs * 0 # So it stays the right type
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue