Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
gdat
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
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
0d5ad4a6
Commit
0d5ad4a6
authored
3 weeks ago
by
Luke Simons
Browse files
Options
Downloads
Patches
Plain Diff
Changes to have dynamically allocated NBI systems in DD
parent
a13d4a98
No related branches found
No related tags found
1 merge request
!195
Resolve "Missing power launched and position field for NBI IDS"
Pipeline
#265400
passed
3 weeks ago
Stage: test
Stage: post-test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
matlab/TCV_IMAS/tcv_get_ids_nbi.m
+40
-46
40 additions, 46 deletions
matlab/TCV_IMAS/tcv_get_ids_nbi.m
with
40 additions
and
46 deletions
matlab/TCV_IMAS/tcv_get_ids_nbi.m
+
40
−
46
View file @
0d5ad4a6
...
@@ -9,6 +9,7 @@ function [ids_nbi,ids_nbi_description,varargout] = tcv_get_ids_nbi(shot,ids_nbi_
...
@@ -9,6 +9,7 @@ function [ids_nbi,ids_nbi_description,varargout] = tcv_get_ids_nbi(shot,ids_nbi_
% Most information taken from NBI and NB_Model wiki pages:
% Most information taken from NBI and NB_Model wiki pages:
% https://spcwiki.epfl.ch/wiki/NBI
% https://spcwiki.epfl.ch/wiki/NBI
% https://spcwiki.epfl.ch/wiki/NB_Model
% https://spcwiki.epfl.ch/wiki/NB_Model
i_nbi1
=
1
;
i_nbi2
=
2
;
i_dnbi
=
3
;
if
exist
(
'gdat_params'
)
if
exist
(
'gdat_params'
)
[
ids_nbi
,
params_nbi
]
=
tcv_ids_headpart
(
shot
,
ids_nbi_empty
,
'nbi'
,
'homogeneous_time'
,
0
,
'gdat_params'
,
gdat_params
,
varargin
{:});
[
ids_nbi
,
params_nbi
]
=
tcv_ids_headpart
(
shot
,
ids_nbi_empty
,
'nbi'
,
'homogeneous_time'
,
0
,
'gdat_params'
,
gdat_params
,
varargin
{:});
...
@@ -27,15 +28,20 @@ ids_nbi_description='';
...
@@ -27,15 +28,20 @@ ids_nbi_description='';
%
%
nb_units
=
3
;
% assume 3 units: 1st NB1. 2nd NB2 and DNBI
nb_units
=
3
;
% assume 3 units: 1st NB1. 2nd NB2 and DNBI
ids_nbi
.
unit
(
1
:
nb_units
)
=
ids_nbi
.
unit
(
1
);
% copy empty structure for all units, then fill in
% create lists of what is different for each units so that can scan through units
% create lists of what is different for each units so that can scan through units
unit_identifier
=
{
'NB1'
,
'NB2'
,
'DNBI'
};
unit_identifier
=
{
'NB1'
,
'NB2'
,
'DNBI'
};
unit_name
=
{
'25keV 1st NBH source'
,
'50keV 2nd NBH source'
,
'diagnostic NBI'
};
unit_name
=
{
'25keV 1st NBH source'
,
'50keV 2nd NBH source'
,
'diagnostic NBI'
};
results_subname
=
{
'nb1'
,
'nb2'
,
'dnbi'
};
results_subname
=
{
'nb1'
,
'nb2'
,
'dnbi'
};
if
shot
<
70811
if
shot
<
70811
results_subname
=
{
'nbh'
,
'nb2'
,
'dnbi'
};
unit_identifier
=
{
'NB1'
,
'DNBI'
};
unit_name
=
{
'25keV 1st NBH source'
,
'diagnostic NBI'
};
results_subname
=
{
'nbh'
,
'dnbi'
};
nb_units
=
2
;
% assume 2 units: 1st NBI and DNBI
end
end
nbi_indices
=
1
:
nb_units
;
ids_nbi
.
unit
(
nbi_indices
)
=
ids_nbi
.
unit
(
1
);
% copy empty structure for all units, then fill in
species
.
a
=
[
2.
,
2.
,
1.
];
species
.
a
=
[
2.
,
2.
,
1.
];
species
.
z_n
=
[
1.
,
1.
,
1.
];
species
.
z_n
=
[
1.
,
1.
,
1.
];
species
.
label
=
{
'D'
,
'D'
,
'H'
};
species
.
label
=
{
'D'
,
'D'
,
'H'
};
...
@@ -46,45 +52,45 @@ beamlets_group.width_horizontal = [250, 250, 87.2]*1e-3;
...
@@ -46,45 +52,45 @@ beamlets_group.width_horizontal = [250, 250, 87.2]*1e-3;
beamlets_group
.
width_vertical
=
[
250
,
250
,
87.2
]
*
1e-3
;
beamlets_group
.
width_vertical
=
[
250
,
250
,
87.2
]
*
1e-3
;
beamlets_group
.
focus
(
1
:
nb_units
)
=
struct
(
'focal_length_horizontal'
,[],
'focal_length_vertical'
,[],
'width_min_horizontal'
,[],
'width_min_vertical'
,[]);
beamlets_group
.
focus
(
1
:
nb_units
)
=
struct
(
'focal_length_horizontal'
,[],
'focal_length_vertical'
,[],
'width_min_horizontal'
,[],
'width_min_vertical'
,[]);
beamlets_group
.
focus
(
1
)
.
focal_length_horizontal
=
3.76
;
beamlets_group
.
focus
(
i_nbi
1
)
.
focal_length_horizontal
=
3.76
;
beamlets_group
.
focus
(
1
)
.
focal_length_vertical
=
3.98
;
beamlets_group
.
focus
(
i_nbi
1
)
.
focal_length_vertical
=
3.98
;
beamlets_group
.
focus
(
1
)
.
width_min_horizontal
=
21.6
*
1e-2
;
beamlets_group
.
focus
(
i_nbi
1
)
.
width_min_horizontal
=
21.6
*
1e-2
;
beamlets_group
.
focus
(
1
)
.
width_min_vertical
=
9.4
*
1e-2
;
beamlets_group
.
focus
(
i_nbi
1
)
.
width_min_vertical
=
9.4
*
1e-2
;
% So far NB2 parameters are merely a copy of NB1 parameters
% So far NB2 parameters are merely a copy of NB1 parameters
beamlets_group
.
focus
(
2
)
.
focal_length_horizontal
=
3.76
;
beamlets_group
.
focus
(
i_nbi
2
)
.
focal_length_horizontal
=
3.76
;
beamlets_group
.
focus
(
2
)
.
focal_length_vertical
=
3.98
;
beamlets_group
.
focus
(
i_nbi
2
)
.
focal_length_vertical
=
3.98
;
beamlets_group
.
focus
(
2
)
.
width_min_horizontal
=
21.6
*
1e-2
;
beamlets_group
.
focus
(
i_nbi
2
)
.
width_min_horizontal
=
21.6
*
1e-2
;
beamlets_group
.
focus
(
2
)
.
width_min_vertical
=
9.4
*
1e-2
;
beamlets_group
.
focus
(
i_nbi
2
)
.
width_min_vertical
=
9.4
*
1e-2
;
beamlets_group
.
focus
(
3
)
.
focal_length_horizontal
=
1.8
;
beamlets_group
.
focus
(
i_dnbi
)
.
focal_length_horizontal
=
1.8
;
beamlets_group
.
focus
(
3
)
.
focal_length_vertical
=
1.8
;
beamlets_group
.
focus
(
i_dnbi
)
.
focal_length_vertical
=
1.8
;
beamlets_group
.
focus
(
3
)
.
width_min_horizontal
=
12.1
*
1e-2
;
beamlets_group
.
focus
(
i_dnbi
)
.
width_min_horizontal
=
12.1
*
1e-2
;
beamlets_group
.
focus
(
3
)
.
width_min_vertical
=
12.1
*
1e-2
;
beamlets_group
.
focus
(
i_dnbi
)
.
width_min_vertical
=
12.1
*
1e-2
;
beamlets_group
.
divergence
(
1
:
nb_units
)
=
struct
(
'particle_fraction'
,[],
'vertical'
,[],
'horizontal'
,[]);
beamlets_group
.
divergence
(
1
:
nb_units
)
=
struct
(
'particle_fraction'
,[],
'vertical'
,[],
'horizontal'
,[]);
beamlets_group
.
divergence
(
1
)
.
particle_fraction
=
1.
;
beamlets_group
.
divergence
(
i_nbi
1
)
.
particle_fraction
=
1.
;
beamlets_group
.
divergence
(
1
)
.
vertical
=
0.59
*
pi
/
180.
;
beamlets_group
.
divergence
(
i_nbi
1
)
.
vertical
=
0.59
*
pi
/
180.
;
beamlets_group
.
divergence
(
1
)
.
horizontal
=
1.4
*
pi
/
180.
;
beamlets_group
.
divergence
(
i_nbi
1
)
.
horizontal
=
1.4
*
pi
/
180.
;
beamlets_group
.
divergence
(
2
)
.
particle_fraction
=
1.
;
beamlets_group
.
divergence
(
i_nbi
2
)
.
particle_fraction
=
1.
;
beamlets_group
.
divergence
(
2
)
.
vertical
=
0.59
*
pi
/
180.
;
beamlets_group
.
divergence
(
i_nbi
2
)
.
vertical
=
0.59
*
pi
/
180.
;
beamlets_group
.
divergence
(
2
)
.
horizontal
=
1.4
*
pi
/
180.
;
beamlets_group
.
divergence
(
i_nbi
2
)
.
horizontal
=
1.4
*
pi
/
180.
;
beamlets_group
.
divergence
(
3
)
.
particle_fraction
=
1.
;
beamlets_group
.
divergence
(
i_dnbi
)
.
particle_fraction
=
1.
;
beamlets_group
.
divergence
(
3
)
.
vertical
=
0.53
*
pi
/
180.
;
beamlets_group
.
divergence
(
i_dnbi
)
.
vertical
=
0.53
*
pi
/
180.
;
beamlets_group
.
divergence
(
3
)
.
horizontal
=
0.53
*
pi
/
180.
;
beamlets_group
.
divergence
(
i_dnbi
)
.
horizontal
=
0.53
*
pi
/
180.
;
%dcd_NBH = psitbxdcd(4.5889, 0.0, 211.9535*pi/180, 0.0, -9.2308*pi/180);
%dcd_NBH = psitbxdcd(4.5889, 0.0, 211.9535*pi/180, 0.0, -9.2308*pi/180);
beamlets_group
.
position
(
1
:
nb_units
)
=
struct
(
'phi'
,[],
'r'
,[],
'z'
,[]);
beamlets_group
.
position
(
1
:
nb_units
)
=
struct
(
'phi'
,[],
'r'
,[],
'z'
,[]);
beamlets_group
.
position
(
1
)
.
phi
=
211.9535
*
pi
/
180.
;
beamlets_group
.
position
(
i_nbi
1
)
.
phi
=
211.9535
*
pi
/
180.
;
beamlets_group
.
position
(
1
)
.
r
=
4.5889
;
beamlets_group
.
position
(
i_nbi
1
)
.
r
=
4.5889
;
beamlets_group
.
position
(
1
)
.
z
=
0.
;
beamlets_group
.
position
(
i_nbi
1
)
.
z
=
0.
;
beamlets_group
.
position
(
2
)
.
phi
=
58.8255
*
pi
/
180.
;
beamlets_group
.
position
(
i_nbi
2
)
.
phi
=
58.8255
*
pi
/
180.
;
beamlets_group
.
position
(
2
)
.
r
=
4.5889
;
beamlets_group
.
position
(
i_nbi
2
)
.
r
=
4.5889
;
beamlets_group
.
position
(
2
)
.
z
=
0.
;
beamlets_group
.
position
(
i_nbi
2
)
.
z
=
0.
;
beamlets_group
.
position
(
3
)
.
phi
=
295.2416
*
pi
/
180.
;
beamlets_group
.
position
(
i_dnbi
)
.
phi
=
295.2416
*
pi
/
180.
;
beamlets_group
.
position
(
3
)
.
r
=
4.9274
;
beamlets_group
.
position
(
i_dnbi
)
.
r
=
4.9274
;
beamlets_group
.
position
(
3
)
.
z
=
0.
;
beamlets_group
.
position
(
i_dnbi
)
.
z
=
0.
;
params_eff
=
params_eff_ref
;
params_eff
=
params_eff_ref
;
for
iunit
=
1
:
nb_unit
s
for
iunit
=
nbi_indice
s
ids_nbi
.
unit
{
iunit
}
.
identifier
=
unit_identifier
{
iunit
};
ids_nbi
.
unit
{
iunit
}
.
identifier
=
unit_identifier
{
iunit
};
ids_nbi
.
unit
{
iunit
}
.
name
=
unit_name
{
iunit
};
ids_nbi
.
unit
{
iunit
}
.
name
=
unit_name
{
iunit
};
%% power
%% power
...
@@ -131,21 +137,9 @@ for iunit=1:nb_units
...
@@ -131,21 +137,9 @@ for iunit=1:nb_units
% https://spcwiki.epfl.ch/wiki/NB_Model
% https://spcwiki.epfl.ch/wiki/NB_Model
ids_nbi
.
unit
{
iunit
}
.
beamlets_group
{
1
}
.
direction
=
beamlets_group
.
direction
(
iunit
);
%clockwise
ids_nbi
.
unit
{
iunit
}
.
beamlets_group
{
1
}
.
direction
=
beamlets_group
.
direction
(
iunit
);
%clockwise
ids_nbi
.
unit
{
iunit
}
.
beamlets_group
{
1
}
.
tangency_radius
=
beamlets_group
.
tangency_radius
(
iunit
);
ids_nbi
.
unit
{
iunit
}
.
beamlets_group
{
1
}
.
tangency_radius
=
beamlets_group
.
tangency_radius
(
iunit
);
% ids_nbi.unit{iunit}.beamlets_group{1}.tangency_radius_error_index: -999999999
% ids_nbi.unit{iunit}.beamlets_group{1}.tangency_radius_error_lower: -9.0000e+40
% ids_nbi.unit{iunit}.beamlets_group{1}.tangency_radius_error_upper: -9.0000e+40
ids_nbi
.
unit
{
iunit
}
.
beamlets_group
{
1
}
.
angle
=
beamlets_group
.
angle
(
iunit
);
%injection parallel to midplane
ids_nbi
.
unit
{
iunit
}
.
beamlets_group
{
1
}
.
angle
=
beamlets_group
.
angle
(
iunit
);
%injection parallel to midplane
% ids_nbi.unit{iunit}.beamlets_group{1}.angle_error_index: -999999999
% ids_nbi.unit{iunit}.beamlets_group{1}.angle_error_lower: -9.0000e+40
% ids_nbi.unit{iunit}.beamlets_group{1}.angle_error_upper: -9.0000e+40
ids_nbi
.
unit
{
iunit
}
.
beamlets_group
{
1
}
.
width_horizontal
=
beamlets_group
.
width_horizontal
(
iunit
);
ids_nbi
.
unit
{
iunit
}
.
beamlets_group
{
1
}
.
width_horizontal
=
beamlets_group
.
width_horizontal
(
iunit
);
% ids_nbi.unit{iunit}.beamlets_group{1}.width_horizontal_error_index: -999999999
% ids_nbi.unit{iunit}.beamlets_group{1}.width_horizontal_error_lower: -9.0000e+40
% ids_nbi.unit{iunit}.beamlets_group{1}.width_horizontal_error_upper: -9.0000e+40
ids_nbi
.
unit
{
iunit
}
.
beamlets_group
{
1
}
.
width_vertical
=
beamlets_group
.
width_vertical
(
iunit
);
ids_nbi
.
unit
{
iunit
}
.
beamlets_group
{
1
}
.
width_vertical
=
beamlets_group
.
width_vertical
(
iunit
);
% ids_nbi.unit{iunit}.beamlets_group{1}.width_vertical_error_index: -999999999
% ids_nbi.unit{iunit}.beamlets_group{1}.width_vertical_error_lower: -9.0000e+40
% ids_nbi.unit{iunit}.beamlets_group{1}.width_vertical_error_upper: -9.0000e+40
% Should always copy "leaves" only to avoid deleting non-filled in values like error_bars
% Should always copy "leaves" only to avoid deleting non-filled in values like error_bars
fields_to_copy
=
fieldnames
(
beamlets_group
.
focus
(
iunit
));
fields_to_copy
=
fieldnames
(
beamlets_group
.
focus
(
iunit
));
...
...
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