MDSplus / mdsplus

The MDSplus data management system
https://mdsplus.org/
Other
72 stars 44 forks source link

[Python] How to get get downsampling like with setTimeContext on non-segmented nodes #1523

Closed ghost closed 1 year ago

ghost commented 5 years ago

Hi all, I tried the setTimeContext method in Tree for pyhton. But it seems not working for my tree. I tried setting both Tree (the class) and the tree (the variable) as Tree.setTimeContext(XXX, YYY, ZZZ) and tree.setTimeContext(XXX, YYY, ZZZ). But even after setting this method, my time and data of one node is not chaged it still remains the same. (data is acquired with getNode.data() and the time is acquired with getDimensionAt(0).data())

Is there a problem with this method for python? Or is it the problem of the way I use the code?

GabrieleManduchi commented 5 years ago

Hi,   setTimeContext() works only for segmented signals. The other signals (i.e. those saved with putData() operation) are unaffected by the definition of the time context. How are your signals stored?

On 23/01/2019 08:58, shakaka wrote:

Hi all, I tried the setTimeContext method in Tree for pyhton. But it seems not working for my tree. I tried setting both Tree (the class) and the tree (the variable) as |Tree.setTimeContext(XXX, YYY, ZZZ)| and |tree.setTimeContext(XXX, YYY, ZZZ)|. But even after setting this method, my time and data of one node is not chaged it still remains the same. (data is acquired with |getNode.data()| and the time is acquired with |getDimensionAt(0).data()|)

Is there a problem with this method for python? Or is it the problem of the way I use the code?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/MDSplus/mdsplus/issues/1523, or mute the thread https://github.com/notifications/unsubscribe-auth/AISySGHvplY_bBRcv0PKKScv-L0zeE9Nks5vGBYPgaJpZM4aOOh1.

-- Gabriele Manduchi

Istituto Gas Ionizzati del CNR Consorzio RFX - Associazione EURATOM/ENEA sulla Fusione Corso Stati Uniti 4, 35127 Padova - Italy ph +39-049-829-5039/-5000 fax +39-049-8700718 mailto:gabriele.manduchi@igi.cnr.it, http://www.igi.cnr.it

ghost commented 5 years ago

Thank you so much for your reply. My signal is store with putData indeed. The method is not applicable then. Is there anything else I can use to resample? Cause I am trying to speed up a bit for massive data demonstration.

GabrieleManduchi commented 5 years ago

You may use TDI fun resample

RESAMPLE(IN _s, OPTIONAL _start, OPTIONAL _end, IN _inc)

be aware, however, that in this way the whole signal is retrieved in any case. If the signal were segmented, only the required region of interest  would have been read from disk otherwise. In any case, if you are accessing data in thin client configuration (e.g. reading data from jScope) you may experience better performance since only the result of the RESAMPLE evaluation are sent over the network.

On 23/01/2019 12:57, shakaka wrote:

Thank you so much for your reply. My signal is store with putData indeed. The method is not applicable then. Is there anything else I can use to resample? Cause I am trying to speed up a bit for massive data demonstration.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/MDSplus/mdsplus/issues/1523#issuecomment-456775283, or mute the thread https://github.com/notifications/unsubscribe-auth/AISySEmqpfNw_AIg7Us6CXuwGeBAcjdMks5vGE4fgaJpZM4aOOh1.

-- Gabriele Manduchi

Istituto Gas Ionizzati del CNR Consorzio RFX - Associazione EURATOM/ENEA sulla Fusione Corso Stati Uniti 4, 35127 Padova - Italy ph +39-049-829-5039/-5000 fax +39-049-8700718 mailto:gabriele.manduchi@igi.cnr.it, http://www.igi.cnr.it

ghost commented 5 years ago

Thank you for the TDI solution.

You mentioned that the whole signal will be retrieved as resampled. But if I use a new node to stroe this expression, I sould be able to read from both the raw node and resampled node right?

P.S. I am not too familiar with the TDI expression and I am not able to find the TDI RESAMPLE fun in the list of the TDI on the official website. Would you please give me an example about the usage of this RESAMPLE fun?

You may use TDI fun resample RESAMPLE(IN _s, OPTIONAL _start, OPTIONAL _end, IN _inc) be aware, however, that in this way the whole signal is retrieved in any case. If the signal were segmented, only the required region of interest would have been read from disk otherwise. In any case, if you are accessing data in thin client configuration (e.g. reading data from jScope) you may experience better performance since only the result of the RESAMPLE evaluation are sent over the network. On 23/01/2019 12:57, shakaka wrote: Thank you so much for your reply. My signal is store with putData indeed. The method is not applicable then. Is there anything else I can use to resample? Cause I am trying to speed up a bit for massive data demonstration. — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#1523 (comment)>, or mute the thread https://github.com/notifications/unsubscribe-auth/AISySEmqpfNw_AIg7Us6CXuwGeBAcjdMks5vGE4fgaJpZM4aOOh1. -- Gabriele Manduchi Istituto Gas Ionizzati del CNR Consorzio RFX - Associazione EURATOM/ENEA sulla Fusione Corso Stati Uniti 4, 35127 Padova - Italy ph +39-049-829-5039/-5000 fax +39-049-8700718 mailto:gabriele.manduchi@igi.cnr.it, http://www.igi.cnr.it

zack-vii commented 5 years ago

Maybe we should consider implementing something like xTreeShr in a more deterministic fashion for general data nodes. I would tie the functionality to the usage SIGNAL. The discussion i tried to kick off in PR #1638 is related to this original issue.

zack-vii commented 5 years ago

Documentation should be place or at least be linked in http://www.mdsplus.org/index.php?title=Documentation:Tutorial:LargeSignals

zack-vii commented 3 years ago

You may be able to use Data.getSignalXY() to achieve that.

ghost commented 3 years ago

Thank you very much for your support. But I am not currently working on the same project now. I might not be able to respond accordingly. In that case, I think we can close this issue if it is not encountered by others.