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
e2252ca2
Commit
e2252ca2
authored
Jan 24, 2018
by
saeed
Browse files
some modification to taylor
parent
b077b6eb
Changes
1
Hide whitespace changes
Inline
Side-by-side
taylordig.py
View file @
e2252ca2
...
...
@@ -2,8 +2,12 @@ import numpy as np
import
matplotlib.pyplot
as
plt
import
math
X
=
np
.
arange
(
0.0
,
2.1
,
0.001
)
Y
=
np
.
arange
(
0.0
,
2.1
,
0.001
)
#matplotlib.rcParams['xtick.direction'] = 'out'
#matplotlib.rcParams['ytick.direction'] = 'out'
#plt.tick_params(axis="y", labelcolor="b")
X
=
np
.
arange
(
0.0
,
1.1
,
0.01
)
Y
=
np
.
arange
(
0.0
,
1.1
,
0.01
)
print
X
.
shape
...
...
@@ -18,38 +22,53 @@ for j in range(ny):
for
i
in
range
(
nx
):
h
[
j
,
i
]
=
math
.
sqrt
(
X
[
i
]
*
X
[
i
]
+
Y
[
j
]
*
Y
[
j
])
fig
=
plt
.
figure
(
num
=
1
,
figsize
=
(
12
.0
,
6
.0
),
dpi
=
300
,
facecolor
=
'w'
,
edgecolor
=
'k'
)
fig
=
plt
.
figure
(
num
=
1
,
figsize
=
(
3
.0
,
3
.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
(
'RMS/OBS_STD'
,
fontsize
=
'
20
'
,
weight
=
'bold'
)
ax
.
set_ylabel
(
'RMS/OBS_STD'
,
fontsize
=
'
20
'
,
weight
=
'bold'
)
ax
.
set_xlabel
(
'RMS/OBS_STD'
,
fontsize
=
'
5
'
,
weight
=
'bold'
)
ax
.
set_ylabel
(
'RMS/OBS_STD'
,
fontsize
=
'
5
'
,
weight
=
'bold'
)
ax
.
grid
(
False
)
vc
=
np
.
arange
(
0.0
,
2
.2
,
0.2
)
vc
=
np
.
arange
(
0.0
,
1
.2
,
0.2
)
ax
.
contour
(
X
,
Y
,
h
,
vc
,
colors
=
'0.5'
)
#ax.spines['top'].set_visible(False)
#ax.spines['right'].set_visible(False)
ax
.
set_xlim
(
0.0
,
2.0
)
ax
.
set_ylim
(
0.0
,
2.0
)
ax
.
contour
(
X
,
Y
,
h
,
vc
,
colors
=
'0.5'
,
linewidths
=
0.2
)
ax
.
spines
[
'top'
].
set_visible
(
False
)
ax
.
spines
[
'right'
].
set_visible
(
False
)
ax
.
set_xlim
(
0.0
,
1.005
)
ax
.
set_ylim
(
0.0
,
1.005
)
ax
.
yaxis
.
set_ticks_position
(
'left'
)
ax
.
xaxis
.
set_ticks_position
(
'bottom'
)
radius
=
np
.
arange
(
0.0
,
5.
0
,
0.
5
)
radius
=
np
.
arange
(
0.0
,
1.2
0
,
0.
20
)
xangle
=
[
1.0
,
0.99
,
0.95
]
+
list
(
np
.
arange
(
0.9
,
-
0.1
,
-
0.1
))
xangle
=
list
(
np
.
arange
(
0.0
,
1.10
,
0.10
))
#print xangle
for
ang
in
xangle
:
print
ang
,
math
.
degrees
(
math
.
acos
(
ang
))
nline
=
0
for
rd
in
radius
:
for
ang
in
xangle
:
#print math.cos(math.acos(ang))
if
ang
==
0.99
or
ang
==
0.95
:
ax
.
plot
([
0.0
,
rd
*
math
.
cos
(
math
.
acos
(
ang
))],[
0.0
,
rd
*
math
.
sin
(
math
.
acos
(
ang
))],
'k-'
,
lw
=
"0.0"
)
else
:
ax
.
plot
([
0.0
,
rd
*
math
.
cos
(
math
.
acos
(
ang
))],[
0.0
,
rd
*
math
.
sin
(
math
.
acos
(
ang
))],
'k-'
,
lw
=
"0.25"
)
#ax.plot([0.0,rd*math.cos(math.acos(ang))],[0.0,rd*math.sin(math.acos(ang))],'k-',lw="0.25")
#ax.plot([0.0,0.0],[rd*math.cos(math.acos(ang)),rd*math.sin(math.acos(ang))],'k-',lw="0.25")
#ax.plot([0.0,1.0],[0.0,1.0],'k-',lw="0.25")
if
nline
==
0
:
nline
+=
1
ax
.
plot
([
0.0
,
rd
*
ang
],[
0.0
,
rd
*
math
.
sqrt
(
1.0
-
(
ang
*
ang
))],
color
=
"0.5"
,
ls
=
"-"
,
label
=
"viken"
,
lw
=
"0.2"
)
if
rd
==
1.0
:
ax
.
annotate
(
str
(
ang
),
xy
=
(
rd
*
ang
,
rd
*
math
.
sqrt
(
1.0
-
(
ang
*
ang
))))
else
:
nline
+=
1
ax
.
plot
([
0.0
,
rd
*
ang
],[
0.0
,
rd
*
math
.
sqrt
(
1.0
-
(
ang
*
ang
))],
color
=
"0.5"
,
ls
=
"-"
,
lw
=
"0.2"
)
if
rd
==
1.0
and
ang
>
0.0
:
ax
.
annotate
(
str
(
ang
),
xy
=
(
rd
*
ang
,
rd
*
math
.
sqrt
(
1.0
-
(
ang
*
ang
))))
ax
.
plot
(
0.2
*
math
.
cos
(
math
.
acos
(
0.5
)),
0.2
*
math
.
sin
(
math
.
acos
(
0.5
)),
'ob'
,
ms
=
3
)
#ax.legend(numpoints=1,prop=dict(size='xx-small'),loc = 'upper right', bbox_to_anchor = (0.5, 0.5))
ax
.
legend
(
numpoints
=
1
,
prop
=
dict
(
size
=
'xx-small'
),
loc
=
'best'
)
plt
.
savefig
(
"taylor.png"
,
bbox_inches
=
'tight'
,
dpi
=
300
,
facecolor
=
'w'
,
edgecolor
=
'w'
,
orientation
=
'portrait'
)
plt
.
close
(
1
)
...
...
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