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
96c9c8d3
Commit
96c9c8d3
authored
4 years ago
by
Olivier Sauter
Committed by
Olivier Sauter
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
rm to use CXRS_analysis svn
parent
c1b7920f
No related branches found
No related tags found
1 merge request
!63
Check cxrs
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
matlab/TCV/CXRS_fit_profies.m
+0
-87
0 additions, 87 deletions
matlab/TCV/CXRS_fit_profies.m
with
0 additions
and
87 deletions
matlab/TCV/CXRS_fit_profies.m
deleted
100644 → 0
+
0
−
87
View file @
c1b7920f
function
profiles
=
CXRS_fit_profies
(
V
,
Times
,
param_prof
,
param_plot
);
% Fit profiles with "interpos" function
% Call profiles=CXRS_fit_profies(V,Times,param_prof,param_plot);
%sel=find((V.t+V.dt/2>=Times(1))&(V.t-V.dt/2<=Times(2)));
sel
=
find
((
V
.
t
>=
Times
(
1
))
&
(
V
.
t
<=
Times
(
2
)));
x
=
V
.
x
(
sel
);
dx
=
V
.
dx
(
sel
);
y
=
V
.
y
(
sel
);
dy
=
V
.
dy
(
sel
);
t
=
V
.
t
(
sel
);
dt
=
V
.
dt
(
sel
);
sys
=
V
.
sys
(
sel
);
% shift of duplicated points in rho
Xb
=
x
;
for
ip
=
1
:
length
(
Xb
)
sss
=
1
:
length
(
Xb
);
sss
=
find
(
sss
~=
ip
);
iff
=
(
find
(
Xb
(
ip
)
==
Xb
(
sss
)));
if
length
(
iff
)
>
0
,
Xb
(
iff
(
1
))
=
Xb
(
iff
(
1
))
+
1.e-8
;
end
end
% sort points in rho
[
x
,
iii
]
=
sort
(
Xb
);
if
length
(
iii
)
==
0
% No data
profiles
.
t_lim
=
Times
;
profiles
.
x_prof
=
[];
%profiles.x_prof= NaN(1,101)
profiles
.
y_prof
=
[];
profiles
.
dy_prof
=
[];
profiles
.
use
.
x
=
[];
profiles
.
use
.
dx
=
[];
profiles
.
use
.
y
=
[];
profiles
.
use
.
dy
=
[];
profiles
.
use
.
t
=
[];
profiles
.
use
.
dt
=
[];
profiles
.
use
.
sys
=
[];
profiles
.
param_prof
=
param_prof
;
profiles
.
param_plot
=
param_plot
;
if
param_plot
.
ON
,
if
param_plot
.
clear
,
clf
;
end
hve
(
1
)
=
plot
(
0
,
NaN
,
'ok'
);
hold
on
set
(
hve
(
1
),
'Color'
,
param_plot
.
color
,
'LineStyle'
,
'none'
,
'LineWidth'
,
param_plot
.
lnwidth
,
'Marker'
,
param_plot
.
typemk
,
'MarkerSize'
,
param_plot
.
sizemk
);
profiles
.
plot_handle
=
hve
(
1
);
end
return
;
end
dx
=
dx
(
iii
);
y
=
y
(
iii
);
dy
=
dy
(
iii
);
t
=
t
(
iii
);
dt
=
dt
(
iii
);
sys
=
sys
(
iii
);
if
isempty
(
param_prof
.
xout
),
param_prof
.
xout
=
linspace
(
min
(
x
)
*
0.98
,
max
(
x
)
*
1.02
,
101
);
end
if
((
min
(
x
)
-
min
(
param_prof
.
xout
))
>
0.45
),
param_prof
.
xout
=
linspace
(
min
(
x
)
*
0.85
,
max
(
param_prof
.
xout
),
length
(
param_prof
.
xout
));
%disp(sprintf('Redefine rho for %4.4f-%4.4fsec',Times));
end
x_prof
=
param_prof
.
xout
;
XXmax
=
max
([
max
(
x
)
+
0.01
1.3
]);
if
length
(
iii
)
>=
10
,
%y_prof = interpos(param_prof.kopt,x,y,x_prof,param_prof.taus,param_prof.nbc,param_prof.ybc,abs(dy)+param_prof.err_min);
%disp('...before')
y_prof
=
interpos
(
param_prof
.
kopt
,[
0
;
x
;
XXmax
],[
y
(
1
);
y
;
0
],
x_prof
,
param_prof
.
taus
,
param_prof
.
nbc
,
param_prof
.
ybc
,[
abs
(
y
(
1
))
+
abs
(
dy
(
1
))
*
10.
;
abs
(
dy
);
0
]
+
param_prof
.
err_min
);
%disp('...after')
else
y_prof
=
x_prof
'*
NaN
;
end
y_prof
=
y_prof
'
;
for
ip
=
1
:
length
(
x_prof
)
W
=
1.
/
dy
.*
1.
/(
1.
+
((
x
-
x_prof
(
ip
))
.
/
dx
)
.^
2
);
W
=
W
/
sum
(
W
);
Wn
=
sum
(
1.
/(
1.
+
((
x
-
x_prof
(
ip
))
.
/
dx
)
.^
2
));
dy_prof
(
ip
)
=
sqrt
(
sum
(
W
.*
dy
.^
2
))
.
/
sqrt
(
Wn
);
end
profiles
.
t_lim
=
[
min
(
t
-
dt
/
2.
)
max
(
t
+
dt
/
2.
)];
profiles
.
x_prof
=
x_prof
;
profiles
.
y_prof
=
y_prof
;
profiles
.
dy_prof
=
dy_prof
;
profiles
.
use
.
x
=
x
;
profiles
.
use
.
dx
=
dx
;
profiles
.
use
.
y
=
y
;
profiles
.
use
.
dy
=
dy
;
profiles
.
use
.
t
=
t
;
profiles
.
use
.
dt
=
dt
;
profiles
.
use
.
sys
=
sys
;
profiles
.
param_prof
=
param_prof
;
profiles
.
param_plot
=
param_plot
;
if
param_plot
.
ON
,
if
param_plot
.
clear
,
clf
;
end
% matlab version
[
v
,
~
]
=
version
;
mat_ver
=
str2double
(
v
(
1
:
3
));
hve
=
CXRS_errorbar
(
mat_ver
,
x
,
y
,
dx
,
dy
);
set
(
hve
,
'Color'
,
param_plot
.
color
);
C
=
get
(
hve
(
1
),
'Color'
);
hold
on
set
(
hve
(
1
),
'Color'
,
max
(
C
-
0.2
,[
0
0
0
]),
'LineStyle'
,
'none'
,
'LineWidth'
,
1.0
,
'Marker'
,
param_plot
.
typemk
,
'MarkerSize'
,
param_plot
.
sizemk
);
set
(
hve
(
2
),
'Color'
,
C
);
set
(
hve
(
1
),
'MarkerFaceColor'
,
min
(
C
+
0.5
,[
1
1
1
]),
'MarkerEdgeColor'
,
max
(
C
-
0.3
,[
0
0
0
]));
if
param_plot
.
clear
,
grid
on
;
if
~
isnan
(
max
(
x_prof
)),
set
(
gca
,
'Xlim'
,[
min
(
x_prof
)
max
(
x_prof
)]);
else
,
set
(
gca
,
'Xlim'
,[
0
1.1
]);
end
,
end
hh
=
plot
(
x_prof
,
y_prof
,
'-r'
);
set
(
hh
,
'Color'
,
max
(
C
-
0.1
,[
0
0
0
]),
'LineStyle'
,
'-'
,
'LineWidth'
,
param_plot
.
lnwidth
);
if
(
size
(
y_prof
,
2
)
~=
size
(
dy_prof
,
2
)),
y_prof
=
y_prof
'
;
end
% whos x_prof y_prof dy_prof
hh
=
plot
(
x_prof
,
y_prof
+
dy_prof
,
'-r'
);
set
(
hh
,
'Color'
,
min
(
C
+
0.2
,[
1
1
1
]),
'LineStyle'
,
'--'
,
'LineWidth'
,
1.
);
hh
=
plot
(
x_prof
,
y_prof
-
dy_prof
,
'-r'
);
set
(
hh
,
'Color'
,
min
(
C
+
0.2
,[
1
1
1
]),
'LineStyle'
,
'--'
,
'LineWidth'
,
1.
);
profiles
.
plot_handle
=
hve
(
1
);
end
return
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