Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion tofu/imas2tofu/_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -2699,7 +2699,14 @@ def _to_Cam_Du(self, ids, lk, indch, nan=None, pos=None):
u = np.array([oo[:,1,0]*np.cos(oo[:,1,2]),
oo[:,1,0]*np.sin(oo[:,1,2]), oo[:,1,1]])
u = (u-D) / np.sqrt(np.sum((u-D)**2, axis=0))[None,:]
dgeom = (D,u)
dgeom = (D, u)
indnan = np.any(np.isnan(D), axis=0) | np.any(np.isnan(u), axis=0)
if np.any(indnan):
nunav, ntot = str(indnan.sum()), str(D.shape[1])
msg = "Some lines of sight geometry unavailable in ids:\n"
msg += " - unavailable LOS: {0} / {1}\n".format(nunav, ntot)
msg += " - indices: {0}".format(str(indnan.nonzero()[0]))
warnings.warn(msg)
else:
dgeom = None

Expand Down Expand Up @@ -2935,6 +2942,7 @@ def to_Data(self, ids=None, dsig=None, data=None, X=None, tlim=None,
dchans=dchans)
cam.Id.set_dUSR( {'imas-nchMax': nchMax} )


# -----------------------
# data
lk = sorted(dsig.keys())
Expand Down
12 changes: 7 additions & 5 deletions tofu/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1451,11 +1451,13 @@ def _get_summary(cls, lar, lcol,
# pass

def __repr__(self):
if hasattr(self, 'get_summary'):
return self.get_summary(return_='msg', verb=False)
else:
return object.__repr__(self)

try:
if hasattr(self, 'get_summary'):
return self.get_summary(return_='msg', verb=False)
else:
return object.__repr__(self)
except Exception:
return self.__class__.__name__

#############################
# strip and to/from dict
Expand Down
2 changes: 1 addition & 1 deletion tofu/version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Do not edit, pipeline versioning governed by git tags!
__version__ = '1.4.1-177-g5b98902'
__version__ = '1.4.1-190-gd25622d'