Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
saeed
SSHC
Commits
043a5a86
Commit
043a5a86
authored
Jan 31, 2018
by
saeed
Browse files
more improvement on taylorDiagram.py
parent
2d45f6d8
Changes
1
Hide whitespace changes
Inline
Side-by-side
taylorDiagram.py
View file @
043a5a86
...
...
@@ -7,38 +7,34 @@ def TaylorDiagram(RMSVEC, RMSDVEC, CORVEC,COLORVEC,LABELVEC, station, info):
print
"cor"
,
CORVEC
print
"rms "
,
RMSVEC
print
"rmsd"
,
RMSDVEC
######################################################
rms_max
=
max
(
RMSVEC
)
delta
=
rms_max
/
10.0
rmsd_max
=
max
(
RMSDVEC
)
ddelta
=
rmsd_max
/
10.0
######################################################
X
=
np
.
arange
(
0.0
,(
1.20
)
*
rms_max
+
delta
/
100.0
,
delta
/
100.0
)
Y
=
np
.
arange
(
0.0
,(
1.20
)
*
rms_max
+
delta
/
100.0
,
delta
/
100.0
)
nx
=
X
.
shape
[
0
]
ny
=
Y
.
shape
[
0
]
h
=
np
.
zeros
((
ny
,
nx
),
dtype
=
np
.
float32
)
h
=
np
.
zeros
((
ny
,
nx
),
dtype
=
np
.
float32
)
hh
=
np
.
zeros
((
ny
,
nx
),
dtype
=
np
.
float32
)
for
j
in
range
(
ny
):
for
i
in
range
(
nx
):
h
[
j
,
i
]
=
math
.
sqrt
(
X
[
i
]
*
X
[
i
]
+
Y
[
j
]
*
Y
[
j
])
##########################################
rmsd_max
=
max
(
RMSDVEC
)
ddelta
=
rmsd_max
/
10.0
XX
=
np
.
arange
(
0.0
,(
1.20
)
*
rms_max
+
delta
/
100.0
,
delta
/
100.0
)
YY
=
np
.
arange
(
0.0
,(
1.20
)
*
rms_max
+
delta
/
100.0
,
delta
/
100.0
)
nxx
=
XX
.
shape
[
0
]
nyy
=
YY
.
shape
[
0
]
hh
=
np
.
zeros
((
nyy
,
nxx
),
dtype
=
np
.
float32
)
hh
[:,:]
=
-
1.0
for
j
in
range
(
ny
y
):
for
i
in
range
(
nx
x
):
if
(
math
.
sqrt
((
X
X
[
i
])
*
(
X
X
[
i
])
+
Y
Y
[
j
]
*
Y
Y
[
j
])
<=
(
1.20
*
rms_max
)):
hh
[
j
,
i
]
=
math
.
sqrt
((
X
X
[
i
]
-
RMSVEC
[
0
])
*
(
X
X
[
i
]
-
RMSVEC
[
0
])
+
Y
Y
[
j
]
*
Y
Y
[
j
])
for
j
in
range
(
ny
):
for
i
in
range
(
nx
):
if
(
math
.
sqrt
((
X
[
i
])
*
(
X
[
i
])
+
Y
[
j
]
*
Y
[
j
])
<=
(
1.20
*
rms_max
)):
hh
[
j
,
i
]
=
math
.
sqrt
((
X
[
i
]
-
RMSVEC
[
0
])
*
(
X
[
i
]
-
RMSVEC
[
0
])
+
Y
[
j
]
*
Y
[
j
])
hh
=
np
.
ma
.
masked_where
(
hh
==-
1.0
,
hh
)
###########################################
###########################################
###########
fig
=
plt
.
figure
(
num
=
1
,
figsize
=
(
9.0
,
9.0
),
dpi
=
300
,
facecolor
=
'w'
,
edgecolor
=
'k'
)
ax
=
fig
.
add_axes
([
0.08
,
0.08
,
0.8
,
0.8
],
axisbg
=
'1.0'
)
ax
.
set_xlabel
(
'Standard Deviation'
,
fontsize
=
'15'
,
weight
=
'bold'
,
color
=
"green"
)
ax
.
set_ylabel
(
'Standard Deviation'
,
fontsize
=
'15'
,
weight
=
'bold'
,
color
=
"green"
)
ax
.
grid
(
False
)
############################################
############################################
###########
vc
=
np
.
arange
(
0.0
,(
1.20
*
rms_max
)
+
delta
,
delta
)
nl
,
=
vc
.
shape
lines
=
[]
...
...
@@ -48,8 +44,8 @@ def TaylorDiagram(RMSVEC, RMSDVEC, CORVEC,COLORVEC,LABELVEC, station, info):
ax
.
contour
(
X
,
Y
,
h
,
vc
,
colors
=
'0.5'
,
linestyles
=
lines
,
linewidths
=
0.2
)
############################################
vvc
=
np
.
arange
(
0.0
,
rmsd_max
+
ddelta
,
ddelta
)
crm
=
ax
.
contour
(
X
X
,
Y
Y
,
hh
,
vvc
[::
2
],
colors
=
'lightgreen'
,
linestyles
=
"solid"
,
linewidths
=
1.5
)
ax
.
clabel
(
crm
,
vvc
[::
2
],
inline
=
1
,
fontsize
=
12
,
colors
=
'k'
,
fmt
=
'%.
3
f'
)
crm
=
ax
.
contour
(
X
,
Y
,
hh
,
vvc
[::
2
],
colors
=
'lightgreen'
,
linestyles
=
"solid"
,
linewidths
=
1.5
)
ax
.
clabel
(
crm
,
vvc
[::
2
],
inline
=
1
,
fontsize
=
12
,
colors
=
'k'
,
fmt
=
'%.
2
f'
)
############################################
ax
.
spines
[
'top'
].
set_visible
(
False
)
ax
.
spines
[
'right'
].
set_visible
(
False
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment