summaryrefslogtreecommitdiffstats
path: root/python/astra/data2d.py
diff options
context:
space:
mode:
authorWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2020-06-23 15:19:06 +0200
committerWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2020-07-02 15:54:12 +0200
commit492c0211608fa756ba6642ff7ae3b479765a955b (patch)
tree325b34d12f5969f7b90d6eaacb4d023e2a386213 /python/astra/data2d.py
parentecfb65a05b8ed5171ad65173581d5fe328926995 (diff)
downloadastra-492c0211608fa756ba6642ff7ae3b479765a955b.tar.gz
astra-492c0211608fa756ba6642ff7ae3b479765a955b.tar.bz2
astra-492c0211608fa756ba6642ff7ae3b479765a955b.tar.xz
astra-492c0211608fa756ba6642ff7ae3b479765a955b.zip
Check numpy array type
Diffstat (limited to 'python/astra/data2d.py')
-rw-r--r--python/astra/data2d.py7
1 files changed, 1 insertions, 6 deletions
diff --git a/python/astra/data2d.py b/python/astra/data2d.py
index 188ff69..6ab458f 100644
--- a/python/astra/data2d.py
+++ b/python/astra/data2d.py
@@ -65,12 +65,7 @@ def link(datatype, geometry, data):
:returns: :class:`int` -- the ID of the constructed object.
"""
- if not isinstance(data,np.ndarray):
- raise ValueError("Input should be a numpy array")
- if not data.dtype==np.float32:
- raise ValueError("Numpy array should be float32")
- if not (data.flags['C_CONTIGUOUS'] and data.flags['ALIGNED']):
- raise ValueError("Numpy array should be C_CONTIGUOUS and ALIGNED")
+ checkArrayForLink(data)
return d.create(datatype,geometry,data,True)
def store(i, data):