Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
gdat
Manage
Activity
Members
Labels
Plan
Issues
36
Issue boards
Milestones
Wiki
Code
Merge requests
13
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository 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
gdat
Commits
58094818
Commit
58094818
authored
5 years ago
by
Olivier Sauter
Browse files
Options
Downloads
Patches
Plain Diff
add ids ec_antennas
parent
68755592
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!16
Imas codecamp develop
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
matlab/TCV_IMAS/tcv_get_ids_ec_antennas.m
+76
-0
76 additions, 0 deletions
matlab/TCV_IMAS/tcv_get_ids_ec_antennas.m
with
76 additions
and
0 deletions
matlab/TCV_IMAS/tcv_get_ids_ec_antennas.m
0 → 100644
+
76
−
0
View file @
58094818
function
[
ids_ec_antennas
,
ids_ec_antennas_description
,
varargout
]
=
tcv_get_ids_ec_antennas
(
shot
,
ids_ec_antennas_empty
,
gdat_params
,
varargin
);
%
% [ids_ec_antennas,ids_ec_antennas_description,varargout] = tcv_get_ids_ec_antennas(shot,ids_ec_antennas_empty,varargin);
%
%
% gdat_params: gdat_data.gdat_params to get all params passed from original call, in particular error_bar options
%
[
ids_ec_antennas
,
params_ec_antennas
]
=
tcv_ids_headpart
(
shot
,
ids_ec_antennas_empty
,
'ec_antennas'
,
'homogeneous_time'
,
0
,
varargin
{:});
% As a general rule, for a new substructure under the main ids, construct a local structure like:
% "global_quantities" with subfields being the relevant data to get and a local structure:
% "global_quantities_desc" which contains the same subfields themselves containing the gdat string aftre shot used
%
pow
=
gdat_tcv
(
shot
,
'powers'
);
if
shot
>=
63000
warning
(
'not sure if set-up correct for new launchers, beams, gyrotrons. Check with O. Sauter'
)
return
end
nb_antennas
=
9
;
% at this stage keep same numbering as standard TCV launchers before mid-2019
ids_ec_antennas
.
antenna
(
1
:
nb_antennas
)
=
ids_ec_antennas
.
antenna
(
1
);
% copy empty structure for all units, then fill in
% $$$ ids_ec_antennas.time = pow.ec.t; if homogeneous time
% $$$ ids_ec_antennas_description.time = 'time from power';
[
r_phi0
,
z_phi0
,
r1
,
z1
,
rc
,
zc
,
thetphi_L
,
thetphi_tor
,
raysbylauncher
,
powers
,
fname
,
z_axis
,
launch_params
]
=
...
toray_raygeom_TCV
(
shot
,
pow
.
ec
.
t
(
1
:
10
:
end
));
for
iant
=
1
:
nb_antennas
ids_ec_antennas
.
antenna
{
iant
}
.
identifier
=
[
'L'
num2str
(
iant
)];
switch
iant
case
{
1
,
4
}
ids_ec_antennas
.
antenna
{
iant
}
.
name
=
'LFS equatorial launcher'
;
case
{
2
,
3
,
5
,
6
}
ids_ec_antennas
.
antenna
{
iant
}
.
name
=
'LFS top launcher'
;
otherwise
ids_ec_antennas
.
antenna
{
iant
}
.
name
=
'TOP launcher'
;
end
if
any
(
isfinite
(
pow
.
ec
.
data
(:,
iant
)))
ids_ec_antennas
.
antenna
{
iant
}
.
power_launched
.
data
=
pow
.
ec
.
data
(:,
iant
);
ids_ec_antennas
.
antenna
{
iant
}
.
power_launched
.
time
=
pow
.
ec
.
t
;
ids_ec_antennas_description
.
antenna
{
iant
}
.
power_launched
=
'from gdat powers .ec'
;
ids_ec_antennas_description
.
antenna
{
iant
}
.
launching_position
=
'from launch_params obtained from toray_raygeom_TCV'
;
else
ids_ec_antennas_description
.
antenna
{
iant
}
.
power_launched
=
'no power for this launcher from gdat powers .ec'
;
end
if
~
isempty
(
launch_params
{
iant
})
% find 1st non-empty data
it_ok
{
iant
}
=
[];
for
it
=
1
:
length
(
launch_params
{
iant
})
if
~
isempty
(
launch_params
{
iant
}{
it
})
it_ok
{
iant
}(
end
+
1
)
=
it
;
end
end
% non time-dependent quantities, take 1st ok values
ids_ec_antennas
.
antenna
{
iant
}
.
frequency
=
launch_params
{
iant
}{
it_ok
{
iant
}(
1
)}
.
freq
;
ids_ec_antennas
.
antenna
{
iant
}
.
mode
.
time
=
[
pow
.
ec
.
t
(
1
)
pow
.
ec
.
t
(
end
)];
ids_ec_antennas
.
antenna
{
iant
}
.
mode
.
data
=
[
-
1
-
1
];
% at this stage assume X mode always, to change when available
for
i
=
1
:
length
(
it_ok
{
iant
})
r0
=
sqrt
(
launch_params
{
iant
}{
it_ok
{
iant
}(
i
)}
.
x0
.^
2
+
launch_params
{
iant
}{
it_ok
{
iant
}(
i
)}
.
y0
.^
2
)
/
100.
;
% in [m]
time_launch
=
launch_params
{
iant
}{
it_ok
{
iant
}(
i
)}
.
time
;
ids_ec_antennas
.
antenna
{
iant
}
.
launching_position
.
r
.
data
(
i
)
=
r0
;
ids_ec_antennas
.
antenna
{
iant
}
.
launching_position
.
z
.
data
(
i
)
=
launch_params
{
iant
}{
it_ok
{
iant
}(
i
)}
.
z0
/
100.
;
ids_ec_antennas
.
antenna
{
iant
}
.
launching_position
.
phi
.
data
(
i
)
=
atan2
(
launch_params
{
iant
}{
it_ok
{
iant
}(
i
)}
.
y0
/
100
,
r0
);
ids_ec_antennas
.
antenna
{
iant
}
.
launching_position
.
r
.
time
(
i
)
=
time_launch
;
ids_ec_antennas
.
antenna
{
iant
}
.
launching_position
.
z
.
time
(
i
)
=
time_launch
;
ids_ec_antennas
.
antenna
{
iant
}
.
launching_position
.
phi
.
time
(
i
)
=
time_launch
;
ids_ec_antennas
.
antenna
{
iant
}
.
launching_angle_pol
.
data
(
i
)
=
launch_params
{
iant
}{
it_ok
{
iant
}(
i
)}
.
theta_toray
*
pi
/
180.
;
ids_ec_antennas
.
antenna
{
iant
}
.
launching_angle_pol
.
time
(
i
)
=
time_launch
;
ids_ec_antennas
.
antenna
{
iant
}
.
launching_angle_tor
.
data
(
i
)
=
launch_params
{
iant
}{
it_ok
{
iant
}(
i
)}
.
phi_toray
*
pi
/
180.
;
ids_ec_antennas
.
antenna
{
iant
}
.
launching_angle_tor
.
time
(
i
)
=
time_launch
;
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