Comments (3)
Hi all,
I was wondering how the MDSplus arrays work when I casually found this issue. I think it is not just matter of documentation: people do not understand how they works because they do not work as expected.
A very common operation one normally wants to apply to multi-dimensional arrays is slicing. MDSplus slicing seems not to work as the experienced user expects both in an MDSplus expression and on the Python mdsarray object. What I mean is that in the example below one expects d3 to have shape (4,1).
It seems to me that mdsplus arrays work more like list of lists than like multidimensional arrays. What about returning numpy arrays directly? That's what users need.
Sincerely
from MDSplus import *
c = Connection("somemachine.someplace.comecountry")
c.openTree("test", 11)
d1 = c.get("SIG1")
d2 = c.get("SIG1[0, *]")
d3 = c.get("SIG1[*, 0]")
In[11]: d1.shape
Out[12]: (69, 4)
In[13]: d2.shape
Out[14]: (69, 1)
In[15]: d3.shape
Out[16]: (69,)
In[17]: type(d1)
Out[18]: MDSplus.mdsarray.Float32Array
from mdsplus.
MDSplus arrays are implemented using numpy arrays. To get to the numpy array you just use the data() method. In the example above, d1.data() would return the numpy array.
from mdsplus.
More documentation on MDSplus arrays has been added by Gabriele to the MDSplus web site at: http://www.mdsplus.org/index.php/Documentation:Tutorial:MdsObjects#More_on_Arrays
from mdsplus.
Related Issues (20)
- IDL - mdsisclient can't check against socket=0 causing further issues when set_database claims !mdsdb_socket=0 HOT 23
- kit for RPI aarch64
- Untested MDSplus builds HOT 2
- website documentation for ubuntu / debian HOT 1
- Connection.get() is broken in python by PR #2620 HOT 1
- Remove references to obsolete platforms from the IDL API
- Exceeding the limit of 64 concurrent mdsip connections causes a crash HOT 3
- The mdsvalue() function of the IDL API fails if the most recent socket is disconnected HOT 1
- mdsdisconnect in the IDL API does not correctly return the optional status value HOT 2
- mdstcl - dir/full segfault HOT 8
- TreeGetRecord() returns a misleading error code HOT 4
- MdsIpThreadStatic.c has an extraneous DEBUG define statement
- Enhance the IDL Test Harness HOT 1
- Can I compose a tree to have physical subtrees with different shot numbers? HOT 3
- mdsip.hosts file does not working in mdsip HOT 12
- mdsplus8 and alpha: the "dir" command of "mdstcl" crashes when working with deep trees that have long paths HOT 3
- MDSTCL: a tab completion feature would make it easier to navigate in trees that have very long paths
- MDSplus .data file gets very large HOT 33
- Segfault in libTreeShr.so when doing node deletion with a multi-processing Python program HOT 18
- MDSVALUE in MATLAB breaks when reading Signals HOT 20
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mdsplus.