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
f3a85a94
Commit
f3a85a94
authored
7 months ago
by
Antonia Frank
Browse files
Options
Downloads
Patches
Plain Diff
Make global_quantities cell arrays again
parent
3010a3c0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!137
Add quantities to ids for MRE
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
matlab/TCV_IMAS/tcv_get_ids_core_sources.m
+23
-30
23 additions, 30 deletions
matlab/TCV_IMAS/tcv_get_ids_core_sources.m
with
23 additions
and
30 deletions
matlab/TCV_IMAS/tcv_get_ids_core_sources.m
+
23
−
30
View file @
f3a85a94
...
...
@@ -58,7 +58,7 @@ id_ohm.index = 7; id_ohm.name = 'ohmic';
ids_core_sources
.
source
{
last_index
+
1
}
=
source_template
;
ids_core_sources
.
source
{
last_index
+
1
}
.
identifier
=
id_ohm
;
ids_core_sources
.
source
{
last_index
+
1
}
.
profiles_1d
(
1
:
ohm_n_t
)
=
{
profiles_template
};
ids_core_sources
.
source
{
last_index
+
1
}
.
global_quantities
=
globals_template
;
ids_core_sources
.
source
{
last_index
+
1
}
.
global_quantities
(
1
:
ohm_n_t
)
=
globals_template
;
ohm_data
=
ohm_gdat
.
ohm
.
ohm_data
;
% load LIUQE data to convert
...
...
@@ -76,9 +76,8 @@ jpar_tilde_to_jpar_0 = R0*T.*Rm2_fs./B0';
jpar_tilde_to_jpar_0_mapped
=
interp1
(
rho_pol_norm_liu
,
jpar_tilde_to_jpar_0
,
ohm_data
.
cd_dens
.
rhopol_norm
'
);
vol_mapped
=
interp1
(
rho_pol_norm_liu
,
vol
,
ohm_data
.
cd_dens
.
rhopol_norm
'
);
% profiles_1d
current_parallel_tmp
=
nan
(
1
,
ohm_n_t
);
for
ii
=
1
:
ohm_n_t
% profiles_1d
ids_core_sources
.
source
{
last_index
+
1
}
.
profiles_1d
{
ii
}
.
time
=
ohm_t_grid
(
ii
);
ids_core_sources
.
source
{
last_index
+
1
}
.
profiles_1d
{
ii
}
.
grid
.
rho_pol_norm
=
...
ohm_data
.
cd_dens
.
rhopol_norm
'
;
...
...
@@ -88,13 +87,12 @@ for ii = 1:ohm_n_t
ids_core_sources
.
source
{
last_index
+
1
}
.
profiles_1d
{
ii
}
.
j_parallel
=
jpar_0_tmp
;
integrated_jpar_0_tmp
=
cumtrapz
(
vol_mapped
(:,
ii
),
jpar_0_tmp
)/
2
/
pi
/
R0
;
ids_core_sources
.
source
{
last_index
+
1
}
.
profiles_1d
{
ii
}
.
current_parallel_inside
=
integrated_jpar_0_tmp
;
current_parallel_tmp
(
ii
)
=
integrated_jpar_0_tmp
(
end
);
end
% globals
ids_core_sources
.
source
{
last_index
+
1
}
.
global_quantities
.
time
=
ohm_t_grid
;
ids_core_sources
.
source
{
last_index
+
1
}
.
global_quantities
.
power
=
powers_gdat
.
ohm
.
data
;
ids_core_sources
.
source
{
last_index
+
1
}
.
global_quantities
.
current_parallel
=
current_parallel_tmp
;
% globals
ids_core_sources
.
source
{
last_index
+
1
}
.
global_quantities
{
ii
}
.
time
=
ohm_t_grid
(
ii
);
ids_core_sources
.
source
{
last_index
+
1
}
.
global_quantities
{
ii
}
.
power
=
powers_gdat
.
ohm
.
data
(
ii
);
ids_core_sources
.
source
{
last_index
+
1
}
.
global_quantities
{
ii
}
.
current_parallel
=
integrated_jpar_0_tmp
(
end
);
end
last_index
=
last_index
+
1
;
% add if statement to only increment if ohmic source has been added
...
...
@@ -109,11 +107,10 @@ id_bs.index = 13; id_bs.name = 'bootstrap_current';
ids_core_sources
.
source
{
last_index
+
1
}
=
source_template
;
ids_core_sources
.
source
{
last_index
+
1
}
.
identifier
=
id_bs
;
ids_core_sources
.
source
{
last_index
+
1
}
.
profiles_1d
(
1
:
bs_n_t
)
=
{
profiles_template
};
ids_core_sources
.
source
{
last_index
+
1
}
.
global_quantities
=
globals_template
;
ids_core_sources
.
source
{
last_index
+
1
}
.
global_quantities
(
1
:
bs_n_t
)
=
globals_template
;
% profiles_1d
current_parallel_tmp
=
nan
(
1
,
bs_n_t
);
for
ii
=
1
:
bs_n_t
% profiles_1d
ids_core_sources
.
source
{
last_index
+
1
}
.
profiles_1d
{
ii
}
.
time
=
bs_t_grid
(
ii
);
ids_core_sources
.
source
{
last_index
+
1
}
.
profiles_1d
{
ii
}
.
grid
.
rho_pol_norm
=
...
bs_data
.
cd_dens
.
rhopol_norm
'
;
...
...
@@ -124,12 +121,11 @@ for ii = 1:bs_n_t
ids_core_sources
.
source
{
last_index
+
1
}
.
profiles_1d
{
ii
}
.
j_parallel
=
jpar_0_tmp
;
integrated_jpar_0_tmp
=
cumtrapz
(
vol_mapped
(:,
ii
),
jpar_0_tmp
)/
2
/
pi
/
R0
;
ids_core_sources
.
source
{
last_index
+
1
}
.
profiles_1d
{
ii
}
.
current_parallel_inside
=
integrated_jpar_0_tmp
;
current_parallel_tmp
(
ii
)
=
integrated_jpar_0_tmp
(
end
);
end
% globals
ids_core_sources
.
source
{
last_index
+
1
}
.
global_quantities
.
time
=
bs_t_grid
;
ids_core_sources
.
source
{
last_index
+
1
}
.
global_quantities
.
current_parallel
=
current_parallel_tmp
;
% globals
ids_core_sources
.
source
{
last_index
+
1
}
.
global_quantities
{
ii
}
.
time
=
bs_t_grid
(
ii
);
ids_core_sources
.
source
{
last_index
+
1
}
.
global_quantities
{
ii
}
.
current_parallel
=
integrated_jpar_0_tmp
(
end
);
end
last_index
=
last_index
+
1
;
% add if statement to only increment if bs source has been added
...
...
@@ -165,7 +161,7 @@ if ~isempty(ec_gdat.ec.data) % if EC data available, fill sources
ids_core_sources
.
source
{
last_index
+
i_lau
}
=
source_template
;
ids_core_sources
.
source
{
last_index
+
i_lau
}
.
identifier
=
id_ec
;
ids_core_sources
.
source
{
last_index
+
i_lau
}
.
profiles_1d
(
1
:
nt_interp
)
=
{
profiles_template
};
ids_core_sources
.
source
{
last_index
+
i_lau
}
.
global_quantities
=
globals_template
;
ids_core_sources
.
source
{
last_index
+
i_lau
}
.
global_quantities
(
1
:
nt_interp
)
=
globals_template
;
end
% load LIUQE data to convert
...
...
@@ -271,15 +267,10 @@ if ~isempty(ec_gdat.ec.data) % if EC data available, fill sources
interp_cd_integrated
(:,:,
it
)
=
interp_norm_cd_integrated
(:,:,
it
)
.*
interp_p_ec_injected
(
it
,:);
end
% fill
profiles_1d with interpolated profil
es
% fill
the ids entri
es
for
i_lau
=
active_launchers
% initialize var for current_parallel and coupled power which needs to be obatined from
% integrated j// profiles and pdens last entry
current_parallel_tmp
=
nan
(
1
,
nt_interp
);
power_coupled_tmp
=
nan
(
1
,
nt_interp
);
for
ii
=
1
:
nt_interp
%
time
%
1d_profiles
ids_core_sources
.
source
{
last_index
+
i_lau
}
.
profiles_1d
{
ii
}
.
time
=
interp_tgrid
(
ii
);
% grids
ids_core_sources
.
source
{
last_index
+
i_lau
}
.
profiles_1d
{
ii
}
.
grid
.
rho_tor_norm
=
interp_rho_tor
(:,
ii
);
...
...
@@ -290,18 +281,20 @@ if ~isempty(ec_gdat.ec.data) % if EC data available, fill sources
% integrated power density
ids_core_sources
.
source
{
last_index
+
i_lau
}
.
profiles_1d
{
ii
}
.
electrons
.
power_inside
=
...
interp_p_integrated
(:,
i_lau
,
ii
);
power_coupled_tmp
(
ii
)
=
interp_p_integrated
(
end
,
i_lau
,
ii
);
power_coupled_tmp
=
interp_p_integrated
(
end
,
i_lau
,
ii
);
% current density
ids_core_sources
.
source
{
last_index
+
i_lau
}
.
profiles_1d
{
ii
}
.
j_parallel
=
...
interp_cd_dens
(:,
i_lau
,
ii
);
% integrated current density
ids_core_sources
.
source
{
last_index
+
i_lau
}
.
profiles_1d
{
ii
}
.
current_parallel_inside
=
...
interp_cd_integrated
(:,
i_lau
,
ii
);
current_parallel_tmp
(
ii
)
=
interp_cd_integrated
(
end
,
i_lau
,
ii
);
current_parallel_tmp
=
interp_cd_integrated
(
end
,
i_lau
,
ii
);
% globals
ids_core_sources
.
source
{
last_index
+
i_lau
}
.
globa_quantities
{
ii
}
.
time
=
interp_tgrid
(
ii
);
ids_core_sources
.
source
{
last_index
+
i_lau
}
.
global_quantities
{
ii
}
.
power
=
power_coupled_tmp
;
ids_core_sources
.
source
{
last_index
+
i_lau
}
.
global_quantities
{
ii
}
.
current_parallel
=
current_parallel_tmp
;
end
ids_core_sources
.
source
{
last_index
+
i_lau
}
.
globa_quantities
.
time
=
interp_tgrid
;
ids_core_sources
.
source
{
last_index
+
i_lau
}
.
global_quantities
.
power
=
power_coupled_tmp
;
ids_core_sources
.
source
{
last_index
+
i_lau
}
.
global_quantities
.
current_parallel
=
current_parallel_tmp
;
end
%add empty sources for rest of unsused launchers
...
...
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