@@ -969,6 +969,8 @@ def __repr__(self, print_range=None):
969
969
content_string += "Description: " + self .tag + "\n "
970
970
if self .N != 1 :
971
971
return content_string
972
+ if isinstance (self [0 ], CObs ):
973
+ return content_string
972
974
973
975
if print_range [1 ]:
974
976
print_range [1 ] += 1
@@ -1136,8 +1138,10 @@ def _apply_func_to_corr(self, func):
1136
1138
for t in range (self .T ):
1137
1139
if _check_for_none (self , newcontent [t ]):
1138
1140
continue
1139
- if np .isnan (np .sum (newcontent [t ]).value ):
1140
- newcontent [t ] = None
1141
+ tmp_sum = np .sum (newcontent [t ])
1142
+ if hasattr (tmp_sum , "value" ):
1143
+ if np .isnan (tmp_sum .value ):
1144
+ newcontent [t ] = None
1141
1145
if all ([item is None for item in newcontent ]):
1142
1146
raise Exception ('Operation returns undefined correlator' )
1143
1147
return Corr (newcontent )
@@ -1194,8 +1198,8 @@ def __rtruediv__(self, y):
1194
1198
@property
1195
1199
def real (self ):
1196
1200
def return_real (obs_OR_cobs ):
1197
- if isinstance (obs_OR_cobs , CObs ):
1198
- return obs_OR_cobs . real
1201
+ if isinstance (obs_OR_cobs . flatten ()[ 0 ] , CObs ):
1202
+ return np . vectorize ( lambda x : x . real )( obs_OR_cobs )
1199
1203
else :
1200
1204
return obs_OR_cobs
1201
1205
@@ -1204,8 +1208,8 @@ def return_real(obs_OR_cobs):
1204
1208
@property
1205
1209
def imag (self ):
1206
1210
def return_imag (obs_OR_cobs ):
1207
- if isinstance (obs_OR_cobs , CObs ):
1208
- return obs_OR_cobs . imag
1211
+ if isinstance (obs_OR_cobs . flatten ()[ 0 ] , CObs ):
1212
+ return np . vectorize ( lambda x : x . imag )( obs_OR_cobs )
1209
1213
else :
1210
1214
return obs_OR_cobs * 0 # So it stays the right type
1211
1215
0 commit comments