Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SCDDS-core
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SPC
SCDDS
SCDDS-core
Commits
379d7d9f
Commit
379d7d9f
authored
4 years ago
by
Cristian Galperti
Browse files
Options
Downloads
Patches
Plain Diff
prev adc working for node 01 and 02,
on all shots with SCD data, standard channels loading still to be integrated
parent
dd790b79
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
code/classes/SCDclass_taskmdsloadprevADC.m
+89
-88
89 additions, 88 deletions
code/classes/SCDclass_taskmdsloadprevADC.m
with
89 additions
and
88 deletions
code/classes/SCDclass_taskmdsloadprevADC.m
+
89
−
88
View file @
379d7d9f
...
@@ -7,6 +7,10 @@ classdef SCDclass_taskmdsloadprevADC < SCDclass_task
...
@@ -7,6 +7,10 @@ classdef SCDclass_taskmdsloadprevADC < SCDclass_task
workspacedatabasestructure
workspacedatabasestructure
end
end
properties
(
Access
=
private
)
logdecimate
end
methods
methods
function
obj
=
SCDclass_taskmdsloadprevADC
(
id
,
varargin
)
function
obj
=
SCDclass_taskmdsloadprevADC
(
id
,
varargin
)
...
@@ -25,18 +29,24 @@ classdef SCDclass_taskmdsloadprevADC < SCDclass_task
...
@@ -25,18 +29,24 @@ classdef SCDclass_taskmdsloadprevADC < SCDclass_task
obj
.
workspacedatabasestructure
=
''
;
obj
.
workspacedatabasestructure
=
''
;
end
end
obj
.
classname
=
mfilename
;
obj
.
classname
=
mfilename
;
obj
.
logdecimate
=
20
;
end
end
function
init
(
obj
,
shot
)
function
init
(
obj
,
shot
)
mdsconnect
(
obj
.
mdsserver
);
mdsconnect
(
obj
.
mdsserver
);
mdsopen
(
obj
.
mdstree
,
shot
);
mdsopen
(
obj
.
mdstree
,
shot
);
switch
(
obj
.
node
)
try
case
1
switch
(
obj
.
node
)
obj
.
actualizeNode01
(
shot
);
case
1
case
2
obj
.
actualizeNode
(
shot
,
96
);
obj
.
actualizeNode02
(
shot
);
case
2
end
obj
.
actualizeNode
(
shot
,
192
);
end
catch
fprintf
(
'\n'
);
warning
(
'SCDclass_taskmdsloadprevADC:init'
,
'Error initializing ADC bus for node %d.'
,
obj
.
node
);
end
end
end
function
[
obj
,
value
]
=
getdata
(
obj
,
shot
)
function
[
obj
,
value
]
=
getdata
(
obj
,
shot
)
...
@@ -47,10 +57,12 @@ classdef SCDclass_taskmdsloadprevADC < SCDclass_task
...
@@ -47,10 +57,12 @@ classdef SCDclass_taskmdsloadprevADC < SCDclass_task
case
1
case
1
[
~
,
value
]
=
obj
.
getdataNode01ACQ196
(
shot
);
[
~
,
value
]
=
obj
.
getdataNode01ACQ196
(
shot
);
case
2
case
2
% Here we need to switch betweeen old and new acquisition unit
% TODO: add tcv standard in case data is not available
if
shot
<
65113
if
shot
<
65113
[
~
,
value
]
=
obj
.
getdataNode02ACQ196
(
shot
);
%% Here we need to switch betweeen old and new acquisition unit and tcv standard also
[
~
,
value
]
=
obj
.
getdataNode02ACQ196
(
shot
);
else
else
[
~
,
value
]
=
obj
.
getdataNode02
tst
(
shot
);
%% Here we need to switch betweeen old and new acquisition unit and tcv standard also
[
~
,
value
]
=
obj
.
getdataNode02
ACQ2106
(
shot
);
end
end
end
end
end
end
...
@@ -70,146 +82,135 @@ classdef SCDclass_taskmdsloadprevADC < SCDclass_task
...
@@ -70,146 +82,135 @@ classdef SCDclass_taskmdsloadprevADC < SCDclass_task
methods
(
Access
=
private
)
methods
(
Access
=
private
)
function
obj
=
actualizeNode
01
(
obj
,
shot
)
function
obj
=
actualizeNode
(
obj
,
shot
,
nadcs
)
dd
=
SCDconf_getdatadict
(
obj
.
datadictionary
);
dd
=
SCDconf_getdatadict
(
obj
.
datadictionary
);
adcbus
=
dd
.
getEntry
(
obj
.
modelbus
)
.
getValue
;
adcbus
=
dd
.
getEntry
(
obj
.
modelbus
)
.
getValue
;
[
~
,
data
]
=
obj
.
getdata
(
shot
);
[
~
,
data
]
=
obj
.
getdata
(
shot
);
T
=
timeseries
;
T
=
timeseries
;
if
obj
.
verbose
==
1
if
obj
.
verbose
==
1
fprintf
(
'Actualizing data for bus:
''
%s
''
(%s, shot %d) '
,
obj
.
modelbus
,
obj
.
classname
,
shot
);
fprintf
(
'Actualizing data for bus:
''
%s
''
(%s, shot %d)
0%%
'
,
obj
.
modelbus
,
obj
.
classname
,
shot
);
end
end
for
ii
=
1
:
96
for
ii
=
1
:
nadcs
T
.
Time
=
data
.
Time
;
T
.
Time
=
data
.
Time
;
T
.
Data
=
int16
(
data
.
Data
(:,
ii
));
T
.
Data
=
int16
(
data
.
Data
(:,
ii
));
assignin
(
'base'
,
'temp'
,
T
);
assignin
(
'base'
,
'temp'
,
T
);
assigncmd
=
sprintf
(
'%s.%s=temp;'
,
obj
.
workspacedatabasestructure
,
adcbus
.
Elements
(
ii
)
.
Name
);
assigncmd
=
sprintf
(
'%s.%s=temp;'
,
obj
.
workspacedatabasestructure
,
adcbus
.
Elements
(
ii
)
.
Name
);
evalin
(
'base'
,
assigncmd
);
evalin
(
'base'
,
assigncmd
);
if
obj
.
verbose
==
1
&&
mod
(
ii
,
4
)
==
0
if
obj
.
verbose
==
1
&&
mod
(
ii
,
obj
.
logdecimate
)
==
0
fprintf
(
'
.'
);
fprintf
(
'
%.0f%% '
,
ii
/
nadcs
*
100
);
end
end
end
end
evalin
(
'base'
,
'clear temp'
);
evalin
(
'base'
,
'clear temp'
);
if
obj
.
verbose
==
1
if
obj
.
verbose
==
1
fprintf
(
'\n'
);
fprintf
(
'
100%%
\n'
);
end
end
end
end
function
obj
=
actualizeNode02
(
obj
,
shot
)
%%
dd
=
SCDconf_getdatadict
(
obj
.
datadictionary
);
% Node 01 loading functions
adcbus
=
dd
.
getEntry
(
obj
.
modelbus
)
.
getValue
;
[
~
,
data
]
=
obj
.
getdata
(
shot
);
function
[
obj
,
value
]
=
getdataNode01ACQ196
(
obj
,
shot
)
T
=
timeseries
;
T
=
timeseries
;
timebase
=
mdsvalue
(
'dim_of(\top.crpprt01.board1.adc_01)'
);
%% TODO: check with marte
d_time
=
double
(
mdsvalueraw
(
'\top.crpprt01.params:d_time'
))
*
1.0e-6
;
%timebase = round(timebase.*1/d_time)*d_time-d_time/2;
timebase
=
round
(
timebase
.*
1
/
d_time
)
*
d_time
-
d_time
/
100
;
T
.
Time
=
timebase
;
T
.
Data
=
zeros
(
numel
(
timebase
),
96
);
datamatrix
=
zeros
(
numel
(
timebase
),
96
);
if
obj
.
verbose
==
1
if
obj
.
verbose
==
1
fprintf
(
'
Actualiz
ing data for bus:
''
%s
''
(%s, shot %d) '
,
obj
.
modelbus
,
obj
.
classname
,
shot
);
fprintf
(
'
Gett
ing data for bus:
''
%s
''
(%s, shot %d)
0%%
'
,
obj
.
modelbus
,
obj
.
classname
,
shot
);
end
end
for
ii
=
1
:
192
for
ii
=
1
:
96
T
.
Time
=
data
.
Time
;
% Node 01 data are loaded in the stored order since
T
.
Data
=
int16
(
data
.
Data
(:,
ii
));
% up to now there is only old node 01
assignin
(
'base'
,
'temp'
,
T
);
assigncmd
=
sprintf
(
'%s.%s=temp;'
,
obj
.
workspacedatabasestructure
,
adcbus
.
Elements
(
ii
)
.
Name
);
channelstr
=
sprintf
(
'\\top.crpprt01.board1.adc_%02d.raw'
,
physical2logical
(
ii
)
);
evalin
(
'base'
,
assigncmd
);
datamatrix
(:,
ii
)
=
int16
(
mdsvalue
(
channelstr
));
if
obj
.
verbose
==
1
&&
mod
(
ii
,
4
)
==
0
if
obj
.
verbose
==
1
&&
mod
(
ii
,
obj
.
logdecimate
)
==
0
fprintf
(
'
.'
);
fprintf
(
'
%.0f%% '
,
ii
/
96
*
100
);
end
end
end
end
evalin
(
'base'
,
'clear temp'
);
T
.
Data
=
datamatrix
;
% this speeds up a lot the loading
value
=
T
;
if
obj
.
verbose
==
1
if
obj
.
verbose
==
1
fprintf
(
'\n'
);
fprintf
(
'
100%%
\n'
);
end
end
end
end
%%
% Node 02 loading functions
function
[
obj
,
value
]
=
getdataNode02ACQ196
(
obj
,
shot
)
function
[
obj
,
value
]
=
getdataNode02ACQ196
(
obj
,
shot
)
T
=
timeseries
;
T
=
timeseries
;
timebase
=
mdsvalue
(
'dim_of(\top.crpprt02.board1.adc_01)'
);
%% TODO: check with marte
timebase
=
mdsvalue
(
'dim_of(\top.crpprt02.board1.adc_01)'
);
d_time
=
double
(
mdsvalueraw
(
'\top.crpprt02.params:d_time'
))
*
1.0e-6
;
d_time
=
double
(
mdsvalueraw
(
'\top.crpprt02.params:d_time'
))
*
1.0e-6
;
%timebase = round(timebase.*1/d_time)*d_time-d_time/2;
%timebase = round(timebase.*1/d_time)*d_time-d_time/2;
timebase
=
round
(
timebase
.*
1
/
d_time
)
*
d_time
-
d_time
/
100
;
timebase
=
round
(
timebase
.*
1
/
d_time
)
*
d_time
-
d_time
/
100
;
T
.
Time
=
timebase
;
T
.
Time
=
timebase
;
T
.
Data
=
zeros
(
numel
(
timebase
),
192
);
T
.
Data
=
zeros
(
numel
(
timebase
),
192
);
datamatrix
=
zeros
(
numel
(
timebase
),
192
);
if
obj
.
verbose
==
1
if
obj
.
verbose
==
1
fprintf
(
'Getting data for bus:
''
%s
''
(%s, shot %d) '
,
obj
.
modelbus
,
obj
.
classname
,
shot
);
fprintf
(
'Getting data for bus:
''
%s
''
(%s, shot %d)
0%%
'
,
obj
.
modelbus
,
obj
.
classname
,
shot
);
end
end
for
ii
=
1
:
96
for
ii
=
1
:
96
% NOTE: physical2logical remapping is only for
% NOTE: physical2logical remapping is only for
% data acquired with the present ACQ196 system
% data acquired with the ACQ196 system, not for the new
% it must go away when using the new ACQ2106 system
% 2106 based one
%fprintf('Loading channel %d:%d ...\r',1,physical2logical(ii));
channelstr
=
sprintf
(
'\\top.crpprt02.board1.adc_%02d.raw'
,
physical2logical
(
ii
));
channelstr
=
sprintf
(
'\\top.crpprt02.board1.adc_%02d.raw'
,
physical2logical
(
ii
));
T
.
Data
(:,
ii
)
=
int16
(
mdsvalue
(
channelstr
));
datamatrix
(:,
ii
)
=
int16
(
mdsvalue
(
channelstr
));
if
obj
.
verbose
==
1
&&
mod
(
ii
,
4
)
==
0
if
obj
.
verbose
==
1
&&
mod
(
ii
,
obj
.
logdecimate
)
==
0
fprintf
(
'
.'
);
fprintf
(
'
%.0f%% '
,
ii
/
192
*
100
);
end
end
end
end
for
ii
=
1
:
96
for
ii
=
1
:
96
%fprintf('Loading channel %d:%d ...\r',2,physical2logical(ii));
channelstr
=
sprintf
(
'\\top.crpprt02.board2.adc_%02d.raw'
,
physical2logical
(
ii
));
channelstr
=
sprintf
(
'\\top.crpprt02.board2.adc_%02d.raw'
,
physical2logical
(
ii
));
T
.
Data
(:,
ii
+
96
)
=
int16
(
mdsvalue
(
channelstr
));
datamatrix
(:,
ii
+
96
)
=
int16
(
mdsvalue
(
channelstr
));
if
obj
.
verbose
==
1
&&
mod
(
ii
,
4
)
==
0
if
obj
.
verbose
==
1
&&
mod
(
ii
,
obj
.
logdecimate
)
==
0
fprintf
(
'
.'
);
fprintf
(
'
%.0f%% '
,
(
ii
+
96
)/
192
*
100
);
end
end
end
end
T
.
Data
=
datamatrix
;
% this speeds up a lot the loading
value
=
T
;
value
=
T
;
if
obj
.
verbose
==
1
if
obj
.
verbose
==
1
fprintf
(
'\n'
);
fprintf
(
'
100%%
\n'
);
end
end
end
end
function
[
obj
,
value
]
=
getdataNode02tst
(
obj
,
shot
)
function
[
obj
,
value
]
=
getdataNode02ACQ2106
(
obj
,
shot
)
% TODO: this should go away as soon as we use the official rtc
if
shot
>
65826
% tree
mdsnodename
=
'node02'
;
mdsopen
(
'rtctst'
,
shot
);
else
mdsnodename
=
'tcvrt02'
;
end
mdsopen
(
'rtc'
,
shot
);
T
=
timeseries
;
T
=
timeseries
;
timebase
=
mdsvalue
(
'dim_of(\top.
tcvrt02
.adc.adc_001)'
);
%% TODO: check with marte
timebase
=
mdsvalue
(
[
'dim_of(\top.
'
mdsnodename
'
.adc.adc_001)'
]
);
d_time
=
double
(
mdsvalueraw
(
'\top.
tcvrt02
.params:d_time'
))
*
1.0e-6
;
d_time
=
double
(
mdsvalueraw
(
[
'\top.
'
mdsnodename
'
.params:d_time'
]
))
*
1.0e-6
;
%timebase = round(timebase.*1/d_time)*d_time-d_time/2;
%timebase = round(timebase.*1/d_time)*d_time-d_time/2;
timebase
=
round
(
timebase
.*
1
/
d_time
)
*
d_time
-
d_time
/
100
;
timebase
=
round
(
timebase
.*
1
/
d_time
)
*
d_time
-
d_time
/
100
;
T
.
Time
=
timebase
;
T
.
Time
=
timebase
;
T
.
Data
=
zeros
(
numel
(
timebase
),
192
);
T
.
Data
=
zeros
(
numel
(
timebase
),
192
);
datamatrix
=
zeros
(
numel
(
timebase
),
192
);
if
obj
.
verbose
==
1
if
obj
.
verbose
==
1
fprintf
(
'Getting data for bus:
''
%s
''
(%s, shot %d) '
,
obj
.
modelbus
,
obj
.
classname
,
shot
);
fprintf
(
'Getting data for bus:
''
%s
''
(%s, shot %d)
0%%
'
,
obj
.
modelbus
,
obj
.
classname
,
shot
);
end
end
for
ii
=
1
:
192
for
ii
=
1
:
192
channelstr
=
sprintf
(
'\\top.tcvrt02.adc.adc_%03d.raw'
,
ii
);
channelstr
=
sprintf
([
'\\top.'
mdsnodename
'.adc.adc_%03d.raw'
],
ii
);
T
.
Data
(:,
ii
)
=
int16
(
mdsvalue
(
channelstr
));
%T.Data(:,ii)=int16(mdsvalue(channelstr));
if
obj
.
verbose
==
1
&&
mod
(
ii
,
4
)
==
0
%T.Data(:,ii)=int16(mdsvalueraw(channelstr));
fprintf
(
'.'
);
datamatrix
(:,
ii
)
=
int16
(
mdsvalueraw
(
channelstr
));
if
obj
.
verbose
==
1
&&
mod
(
ii
,
obj
.
logdecimate
)
==
0
fprintf
(
'%.0f%% '
,
ii
/
192
*
100
);
end
end
end
end
T
.
Data
=
datamatrix
;
% this speeds up a lot the loading
value
=
T
;
value
=
T
;
if
obj
.
verbose
==
1
if
obj
.
verbose
==
1
fprintf
(
'\n'
);
fprintf
(
'
100%%
\n'
);
end
end
end
end
function
[
obj
,
value
]
=
getdataNode01ACQ196
(
obj
,
shot
)
T
=
timeseries
;
timebase
=
mdsvalue
(
'dim_of(\top.crpprt01.board1.adc_01)'
);
%% TODO: check with marte
d_time
=
double
(
mdsvalueraw
(
'\top.crpprt01.params:d_time'
))
*
1.0e-6
;
%timebase = round(timebase.*1/d_time)*d_time-d_time/2;
timebase
=
round
(
timebase
.*
1
/
d_time
)
*
d_time
-
d_time
/
100
;
T
.
Time
=
timebase
;
T
.
Data
=
zeros
(
numel
(
timebase
),
96
);
if
obj
.
verbose
==
1
fprintf
(
'Getting data for bus:
''
%s
''
(%s, shot %d) '
,
obj
.
modelbus
,
obj
.
classname
,
shot
);
end
for
ii
=
1
:
96
% Node 01 data are loaded in the stored order since
% up to now there is only old node 01
channelstr
=
sprintf
(
'\\top.crpprt01.board1.adc_%02d.raw'
,
physical2logical
(
ii
));
T
.
Data
(:,
ii
)
=
int16
(
mdsvalue
(
channelstr
));
if
obj
.
verbose
==
1
&&
mod
(
ii
,
4
)
==
0
fprintf
(
'.'
);
end
end
value
=
T
;
if
obj
.
verbose
==
1
fprintf
(
'\n'
);
end
end
end
end
end
end
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment