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
4238040e
Commit
4238040e
authored
8 months ago
by
Antonia Frank
Browse files
Options
Downloads
Patches
Plain Diff
Adaptations to make tcv2ids2db work for core_sources
parent
e75df9fe
No related branches found
No related tags found
1 merge request
!165
Core sources tcv2ids2database
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
matlab/TCV_IMAS/tcv2ids2database.m
+3
-0
3 additions, 0 deletions
matlab/TCV_IMAS/tcv2ids2database.m
matlab/TCV_IMAS/tcv_get_ids_core_sources.m
+16
-13
16 additions, 13 deletions
matlab/TCV_IMAS/tcv_get_ids_core_sources.m
with
19 additions
and
13 deletions
matlab/TCV_IMAS/tcv2ids2database.m
+
3
−
0
View file @
4238040e
...
...
@@ -81,6 +81,9 @@ else
p
.
Results
return
end
params
.
imas_backend
=
upper
(
params
.
imas_backend
);
% replace empty inputs with defaults
names
=
fieldnames
(
params
);
mask
=
structfun
(
@
isempty
,
params
);
...
...
This diff is collapsed.
Click to expand it.
matlab/TCV_IMAS/tcv_get_ids_core_sources.m
+
16
−
13
View file @
4238040e
...
...
@@ -178,6 +178,7 @@ if ~isempty(ec_gdat.ec.data) % if EC data available, fill sources
% retrieve active launcher information from ec_inputs
nb_launchers
=
numel
(
ec_inputs
.
launchers_active
.
data
);
active_launchers
=
find
(
ec_inputs
.
launchers_active
.
data
==
1
)
'
;
nb_active
=
numel
(
active_launchers
);
% find times of injected EC power to interpolate power & current densities
% on p_ec_injected tgrid
...
...
@@ -198,7 +199,7 @@ if ~isempty(ec_gdat.ec.data) % if EC data available, fill sources
main_desc
=
'Source from electron cyclotron heating and current drive'
;
production
=
'TORAY'
;
id_ec
.
index
=
3
;
id_ec
.
name
=
'ec'
;
for
i_lau
=
active
_launchers
for
i_lau
=
1
:
nb_
active
id_ec
.
description
=
sprintf
(
'L%i/G%i, %s from %s double width CD profiles'
,
i_lau
,
ec_inputs
.
gyro2launcher
.
data
(
i_lau
),
main_desc
,
production
);
ids_core_sources
.
source
{
last_index
+
i_lau
}
=
source_template
;
ids_core_sources
.
source
{
last_index
+
i_lau
}
.
identifier
=
id_ec
;
...
...
@@ -340,7 +341,7 @@ if ~isempty(ec_gdat.ec.data) % if EC data available, fill sources
end
% fill the ids entries
for
i_lau
=
active
_launchers
for
i_lau
=
1
:
nb_
active
for
ii
=
1
:
nt_ec_out
% 1d_profiles
ids_core_sources
.
source
{
last_index
+
i_lau
}
.
profiles_1d
{
ii
}
.
time
=
ec_tgrid_out
(
ii
);
...
...
@@ -350,33 +351,33 @@ if ~isempty(ec_gdat.ec.data) % if EC data available, fill sources
ids_core_sources
.
source
{
last_index
+
i_lau
}
.
profiles_1d
{
ii
}
.
grid
.
rho_pol_norm
=
interp_rho_pol
(:,
ii
);
% power density
ids_core_sources
.
source
{
last_index
+
i_lau
}
.
profiles_1d
{
ii
}
.
electrons
.
energy
=
...
interp_p_dens
(:,
i_lau
,
ii
);
interp_p_dens
(:,
active_launchers
(
i_lau
)
,
ii
);
% integrated power density
ids_core_sources
.
source
{
last_index
+
i_lau
}
.
profiles_1d
{
ii
}
.
electrons
.
power_inside
=
...
interp_p_integrated
(:,
i_lau
,
ii
);
interp_p_integrated
(:,
active_launchers
(
i_lau
)
,
ii
);
% current density
ids_core_sources
.
source
{
last_index
+
i_lau
}
.
profiles_1d
{
ii
}
.
j_parallel
=
...
interp_jpar0
(:,
i_lau
,
ii
);
interp_jpar0
(:,
active_launchers
(
i_lau
)
,
ii
);
% integrated current density
ids_core_sources
.
source
{
last_index
+
i_lau
}
.
profiles_1d
{
ii
}
.
current_parallel_inside
=
...
interp_jpar0_integrated
(:,
i_lau
,
ii
);
interp_jpar0_integrated
(:,
active_launchers
(
i_lau
)
,
ii
);
end
% globals
ids_core_sources
.
source
{
last_index
+
i_lau
}
.
global_quantities
{
ii
}
.
time
=
ec_tgrid_out
(
ii
);
ids_core_sources
.
source
{
last_index
+
i_lau
}
.
global_quantities
{
ii
}
.
power
=
...
interp_p_integrated
(
end
,
i_lau
,
ii
);
interp_p_integrated
(
end
,
active_launchers
(
i_lau
)
,
ii
);
ids_core_sources
.
source
{
last_index
+
i_lau
}
.
global_quantities
{
ii
}
.
current_parallel
=
...
interp_jpar0_integrated
(
end
,
i_lau
,
ii
);
interp_jpar0_integrated
(
end
,
active_launchers
(
i_lau
)
,
ii
);
end
end
%add empty sources for rest of unused launchers
if
numel
(
ids_core_sources
.
source
)
-
last_index
~=
nb_launchers
ids_core_sources
.
source
{
last_index
+
nb_launchers
}
=
[];
end
%
%add empty sources for rest of unused launchers
%
if numel(ids_core_sources.source)-last_index ~= nb_launchers
%
ids_core_sources.source{last_index+nb_launchers} = [];
%
end
last_index
=
last_index
+
nb_
launchers
;
last_index
=
last_index
+
nb_
active
;
end
%% NBI. same tgrid for NBI1 and NBI2
...
...
@@ -423,6 +424,7 @@ if numel(active_nbi)>0
p_nbi_injected_tmp
=
interpos
(
nbi_powers_tgrid
,
powers_gdat
.
(
nbi_names
{
i_nbi
})
.
data
,
nbi_tgrid_out
);
for
ii
=
1
:
nt_nbi_out
ids_core_sources
.
source
{
last_index
+
i_nbi
}
.
profiles_1d
{
ii
}
.
time
=
nbi_tgrid_out
(
ii
);
% globals
ids_core_sources
.
source
{
last_index
+
i_nbi
}
.
global_quantities
{
ii
}
.
time
=
nbi_tgrid_out
(
ii
);
ids_core_sources
.
source
{
last_index
+
i_nbi
}
.
global_quantities
{
ii
}
.
power
=
p_nbi_injected_tmp
(
ii
);
...
...
@@ -465,6 +467,7 @@ if ~isempty(powers_gdat.dnbi)
p_dnbi_injected
=
interpos
(
dnbi_powers_tgrid
,
powers_gdat
.
dnbi
.
data
,
dnbi_tgrid_out
);
for
ii
=
1
:
nt_dnbi_out
ids_core_sources
.
source
{
last_index
+
1
}
.
profiles_1d
{
ii
}
.
time
=
dnbi_tgrid_out
(
ii
);
% globals
ids_core_sources
.
source
{
last_index
+
1
}
.
global_quantities
{
ii
}
.
time
=
dnbi_tgrid_out
(
ii
);
ids_core_sources
.
source
{
last_index
+
1
}
.
global_quantities
{
ii
}
.
power
=
p_dnbi_injected
(
ii
);
...
...
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