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
58b49711
Commit
58b49711
authored
4 years ago
by
Olivier Sauter
Browse files
Options
Downloads
Patches
Plain Diff
add gas, gash for JET and fix cdf2mat for ASTRA cdf file as well
parent
bd6d4d37
No related branches found
No related tags found
1 merge request
!86
add gas, gash for JET and fix cdf2mat for ASTRA cdf file as well
Pipeline
#63569
passed
4 years ago
Stage: test
Changes
2
Pipelines
5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
matlab/CHDF/cdf2mat.m
+56
-21
56 additions, 21 deletions
matlab/CHDF/cdf2mat.m
matlab/JET/jet_requests_mapping.m
+5
-0
5 additions, 0 deletions
matlab/JET/jet_requests_mapping.m
with
61 additions
and
21 deletions
matlab/CHDF/cdf2mat.m
+
56
−
21
View file @
58b49711
...
...
@@ -47,16 +47,31 @@ for i=1:length(coordnames_sorted)
matcdf
.
coords
(
i
)
.
index_allvarnames
=
strmatch
(
matcdf
.
coords
(
i
)
.
name
,
allvarnames
,
'exact'
);
matcdf
.
coords
(
i
)
.
index_varnames_sorted
=
strmatch
(
matcdf
.
coords
(
i
)
.
name
,
varnames_sorted
,
'exact'
);
matcdf
.
coords
(
i
)
.
varid
=
allvarids
(
matcdf
.
coords
(
i
)
.
index_allvarnames
);
if
strcmp
(
allinfo
.
Variables
(
matcdf
.
coords
(
i
)
.
index_allvarnames
)
.
Datatype
,
'single'
)
matcdf
.
coords
(
i
)
.
data
=
netcdf
.
getVar
(
funnetcdf
,
matcdf
.
coords
(
i
)
.
varid
,
'double'
);
if
~
isempty
(
matcdf
.
coords
(
i
)
.
index_allvarnames
)
if
strcmp
(
allinfo
.
Variables
(
matcdf
.
coords
(
i
)
.
index_allvarnames
)
.
Datatype
,
'single'
)
matcdf
.
coords
(
i
)
.
data
=
netcdf
.
getVar
(
funnetcdf
,
matcdf
.
coords
(
i
)
.
varid
,
'double'
);
else
matcdf
.
coords
(
i
)
.
data
=
netcdf
.
getVar
(
funnetcdf
,
matcdf
.
coords
(
i
)
.
varid
);
end
for
ij
=
1
:
length
(
fields_variables_to_copy
)
matcdf
.
coords
(
i
)
.
(
fields_variables_to_copy
{
ij
})
=
allinfo
.
Variables
(
matcdf
.
coords
(
i
)
.
index_allvarnames
)
.
(
fields_variables_to_copy
{
ij
});
end
for
jj
=
1
:
numel
(
allinfo
.
Variables
(
matcdf
.
coords
(
i
)
.
index_allvarnames
)
.
Attributes
)
if
strcmp
(
lower
(
allinfo
.
Variables
(
matcdf
.
coords
(
i
)
.
index_allvarnames
)
.
Attributes
(
jj
)
.
Name
),
'units'
)
matcdf
.
coords
(
i
)
.
units
=
strtrim
(
allinfo
.
Variables
(
matcdf
.
coords
(
i
)
.
index_allvarnames
)
.
Attributes
(
jj
)
.
Value
);
end
if
strcmp
(
lower
(
allinfo
.
Variables
(
matcdf
.
coords
(
i
)
.
index_allvarnames
)
.
Attributes
(
jj
)
.
Name
),
'long_name'
)
matcdf
.
coords
(
i
)
.
long_name
=
strtrim
(
allinfo
.
Variables
(
matcdf
.
coords
(
i
)
.
index_allvarnames
)
.
Attributes
(
jj
)
.
Value
);
end
end
else
matcdf
.
coords
(
i
)
.
data
=
netcdf
.
getVar
(
funnetcdf
,
matcdf
.
coords
(
i
)
.
varid
);
end
for
ij
=
1
:
length
(
fields_variables_to_copy
)
matcdf
.
coords
(
i
)
.
(
fields_variables_to_copy
{
ij
})
=
allinfo
.
Variables
(
matcdf
.
coords
(
i
)
.
index_allvarnames
)
.
(
fields_variables_to_copy
{
ij
});
matcdf
.
coords
(
i
)
.
data
=
[];
for
ij
=
1
:
length
(
fields_variables_to_copy
)
matcdf
.
coords
(
i
)
.
(
fields_variables_to_copy
{
ij
})
=
[];
end
matcdf
.
coords
(
i
)
.
units
=
''
;
matcdf
.
coords
(
i
)
.
long_name
=
[
matcdf
.
coords
(
i
)
.
name
' empty'
];
end
matcdf
.
coords
(
i
)
.
units
=
strtrim
(
allinfo
.
Variables
(
matcdf
.
coords
(
i
)
.
index_allvarnames
)
.
Attributes
(
1
)
.
Value
);
matcdf
.
coords
(
i
)
.
long_name
=
strtrim
(
allinfo
.
Variables
(
matcdf
.
coords
(
i
)
.
index_allvarnames
)
.
Attributes
(
2
)
.
Value
);
matcdf
.
coords
(
i
)
.
label
=
[
matcdf
.
coords
(
i
)
.
name
' '
num2str
(
matcdf
.
coords
(
i
)
.
Size
)
': '
matcdf
.
coords
(
i
)
.
long_name
];
cdf2mat_out
.
coords
.
(
matcdf
.
coords
(
i
)
.
name
)
=
matcdf
.
coords
(
i
);
end
...
...
@@ -65,16 +80,31 @@ for i=1:length(varnames_sorted)
matcdf
.
vars
(
i
)
.
name
=
varnames_sorted
{
i
};
matcdf
.
vars
(
i
)
.
index_allvarnames
=
strmatch
(
matcdf
.
vars
(
i
)
.
name
,
allvarnames
,
'exact'
);
matcdf
.
vars
(
i
)
.
varid
=
allvarids
(
matcdf
.
vars
(
i
)
.
index_allvarnames
);
if
strcmp
(
allinfo
.
Variables
(
matcdf
.
vars
(
i
)
.
index_allvarnames
)
.
Datatype
,
'single'
)
matcdf
.
vars
(
i
)
.
data
=
netcdf
.
getVar
(
funnetcdf
,
matcdf
.
vars
(
i
)
.
varid
,
'double'
);
if
~
isempty
(
matcdf
.
vars
(
i
)
.
index_allvarnames
)
if
strcmp
(
allinfo
.
Variables
(
matcdf
.
vars
(
i
)
.
index_allvarnames
)
.
Datatype
,
'single'
)
matcdf
.
vars
(
i
)
.
data
=
netcdf
.
getVar
(
funnetcdf
,
matcdf
.
vars
(
i
)
.
varid
,
'double'
);
else
matcdf
.
vars
(
i
)
.
data
=
netcdf
.
getVar
(
funnetcdf
,
matcdf
.
vars
(
i
)
.
varid
);
end
for
ij
=
1
:
length
(
fields_variables_to_copy
)
matcdf
.
vars
(
i
)
.
(
fields_variables_to_copy
{
ij
})
=
allinfo
.
Variables
(
matcdf
.
vars
(
i
)
.
index_allvarnames
)
.
(
fields_variables_to_copy
{
ij
});
end
for
jj
=
1
:
numel
(
allinfo
.
Variables
(
matcdf
.
vars
(
i
)
.
index_allvarnames
)
.
Attributes
)
if
strcmp
(
lower
(
allinfo
.
Variables
(
matcdf
.
vars
(
i
)
.
index_allvarnames
)
.
Attributes
(
jj
)
.
Name
),
'units'
)
matcdf
.
vars
(
i
)
.
units
=
strtrim
(
allinfo
.
Variables
(
matcdf
.
vars
(
i
)
.
index_allvarnames
)
.
Attributes
(
jj
)
.
Value
);
end
if
strcmp
(
lower
(
allinfo
.
Variables
(
matcdf
.
vars
(
i
)
.
index_allvarnames
)
.
Attributes
(
jj
)
.
Name
),
'long_name'
)
matcdf
.
vars
(
i
)
.
long_name
=
strtrim
(
allinfo
.
Variables
(
matcdf
.
vars
(
i
)
.
index_allvarnames
)
.
Attributes
(
jj
)
.
Value
);
end
end
else
matcdf
.
vars
(
i
)
.
data
=
netcdf
.
getVar
(
funnetcdf
,
matcdf
.
vars
(
i
)
.
varid
);
end
for
ij
=
1
:
length
(
fields_variables_to_copy
)
matcdf
.
vars
(
i
)
.
(
fields_variables_to_copy
{
ij
})
=
allinfo
.
Variables
(
matcdf
.
vars
(
i
)
.
index_allvarnames
)
.
(
fields_variables_to_copy
{
ij
});
matcdf
.
vars
(
i
)
.
data
=
[];
for
ij
=
1
:
length
(
fields_variables_to_copy
)
matcdf
.
vars
(
i
)
.
(
fields_variables_to_copy
{
ij
})
=
[];
end
matcdf
.
vars
(
i
)
.
units
=
''
;
matcdf
.
vars
(
i
)
.
long_name
=
[
matcdf
.
vars
(
i
)
.
name
' empty'
];
end
matcdf
.
vars
(
i
)
.
units
=
strtrim
(
allinfo
.
Variables
(
matcdf
.
vars
(
i
)
.
index_allvarnames
)
.
Attributes
(
1
)
.
Value
);
matcdf
.
vars
(
i
)
.
long_name
=
strtrim
(
allinfo
.
Variables
(
matcdf
.
vars
(
i
)
.
index_allvarnames
)
.
Attributes
(
2
)
.
Value
);
matcdf
.
vars
(
i
)
.
label
=
matcdf
.
vars
(
i
)
.
name
;
for
j
=
1
:
length
(
matcdf
.
vars
(
i
)
.
Dimensions
)
ij
=
strmatch
(
matcdf
.
vars
(
i
)
.
Dimensions
(
j
)
.
Name
,
coordnames_sorted
,
'exact'
);
...
...
@@ -93,13 +123,18 @@ for i=1:length(varnames_sorted)
matcdf
.
vars
(
i
)
.
label
=
[
matcdf
.
vars
(
i
)
.
label
': '
matcdf
.
vars
(
i
)
.
long_name
' ['
matcdf
.
vars
(
i
)
.
units
']'
];
cdf2mat_out
.
allvars
.
(
matcdf
.
vars
(
i
)
.
name
)
=
matcdf
.
vars
(
i
);
end
top_attr_names
=
{
allinfo
.
Attributes
(:)
.
Name
};
ij
=
strmatch
(
'shot'
,
top_attr_names
,
'exact'
);
cdf2mat_out
.
shot
=
allinfo
.
Attributes
(
ij
)
.
Value
;
if
~
isempty
(
allinfo
.
Attributes
)
top_attr_names
=
{
allinfo
.
Attributes
(:)
.
Name
};
ij
=
strmatch
(
'shot'
,
top_attr_names
,
'exact'
);
cdf2mat_out
.
shot
=
allinfo
.
Attributes
(
ij
)
.
Value
;
else
cdf2mat_out
.
shot
=
NaN
;
end
cdf2mat_out
.
fname
=
pfname
;
cdf2mat_out
.
id
=
pfname
(
length
(
pfname
)
-
11
:
length
(
pfname
)
-
4
);
[
a1
,
a2
,
a3
]
=
fileparts
(
pfname
);
cdf2mat_out
.
id
=
a2
;
netcdf
.
close
(
funnetcdf
);
netcdf
.
close
(
funnetcdf
);
clear
matcdf
return
This diff is collapsed.
Click to expand it.
matlab/JET/jet_requests_mapping.m
+
5
−
0
View file @
58b49711
...
...
@@ -101,6 +101,11 @@ switch lower(data_request)
mapping
.
gdat_timedim
=
2
;
mapping
.
method
=
'switchcase'
;
% could use function make_eqdsk directly?
mapping
.
expression
=
''
;
case
{
'gas'
,
'gasm'
,
'gash'
,
'eler'
}
mapping
.
label
=
'eler'
;
mapping
.
timedim
=
1
;
mapping
.
method
=
'signal'
;
mapping
.
expression
=
[{
'ppf'
},{
'gash'
},{
'eler'
}];
case
'halpha'
mapping
.
label
=
'Halpha'
;
mapping
.
timedim
=
1
;
...
...
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