diff --git a/AUG/README_mdsplus b/AUG/README_mdsplus index 08d1a0abe3df3744ed9a2148288c2426920d30fd..6797cef0c648c14c3d9d9124d225a3fc42ac2a59 100644 --- a/AUG/README_mdsplus +++ b/AUG/README_mdsplus @@ -16,3 +16,28 @@ mdsvalue('1+2') zmag.data=mdsvalue('_zmag=augsignal(shot,"FPG","Zmag")'); zmag.t=mdsvalue('dim_of(_aa,0)'); + +To get subsets of points: + +Thanks to Xavier Llobet I have succeeded in fetching only every nth point of the SXR trace. For other purposes a filter would be better so a tdi function should be performed to do it locally, may be it exists already. + +In any case, for what I wanted to do, here is the solution: + +(Create _sxr data and dimensions on remote host, fetch channel numbers only) +sxr_channels=mdsvalue('_sxr=augsignal(15133,"SXR","B");_sxr_t=dim_of(_sxr,0);_sxr_chan=dim_of(_sxr,1)'); + +nth=12; + +(use "data" function to remove complicated relation between _sxr array and its dimensions. This relation depends on how the build_signal was used to create the signal. Note Xavier has important suggestion on how to build the dimensions such as to save space in compression, etc, for those interested) + +sxr_full_t_dim=mdsvalue('_sxrdata=data(_sxr);size(_sxrdata,0)'); + +(at this point _sxrdata has just the values and the dimensions are just the indices 0...N, etc, so we can use the array extraction to take every nth point for all channels:) + +sxr_data=mdsvalue('_sxrdata[0:sxr_full_t_dim-1:nth,*]'); +eval(['sxr_data=mdsvalue(''_sxrdata[0:' num2str(sxr_full_t_dim-1) ':' num2str(nth) ',*]'');']) + +Same for time array +sxr_data_t=mdsvalue('_sxr_t[0:sxr_full_t_dim-1:nth]'); +eval(['sxr_data_t=mdsvalue(''_sxr_t[0:' num2str(sxr_full_t_dim-1) ':' num2str(nth) ']'');']) +