Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
plot-precip-maps
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Andrew Buddenberg
plot-precip-maps
Commits
dbd7e5f7
Commit
dbd7e5f7
authored
May 23, 2013
by
abuddenberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added comments describing what the color mean.
parent
3ae60fe2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
src/plot_north_american_categories.py
src/plot_north_american_categories.py
+8
-8
No files found.
src/plot_north_american_categories.py
View file @
dbd7e5f7
...
...
@@ -24,9 +24,9 @@ from numpy.ma import masked_equal
import
numpy
as
np
import
matplotlib.pyplot
as
plt
from
config
import
GLOBAL_PRECIP_FILES
,
SEASONS
from
config
import
GLOBAL_PRECIP_FILES
,
NA_PRECIP_FILES
,
SEASONS
for
infilename
,
outfilename
in
GLOBAL
_PRECIP_FILES
:
for
infilename
,
outfilename
in
NA
_PRECIP_FILES
:
nc
=
netcdf_file
(
infilename
)
lat_data
=
nc
.
variables
[
'lat'
].
data
...
...
@@ -34,7 +34,7 @@ for infilename, outfilename in GLOBAL_PRECIP_FILES:
fig
=
plt
.
figure
(
figsize
=
(
25
,
16
),
dpi
=
100
,
tight_layout
=
True
)
for
i
,
season
in
enumerate
([
'Winter'
,
'Spring'
,
'Summer'
,
'Fall'
,
'Annual'
]):
for
i
,
season
in
enumerate
([
'Winter'
,
'Spring'
,
'Summer'
,
'Fall'
]):
data_var
,
signif_var
=
SEASONS
[
season
]
data
=
nc
.
variables
[
data_var
].
data
...
...
@@ -73,13 +73,13 @@ for infilename, outfilename in GLOBAL_PRECIP_FILES:
#There's got to be a better way of doing this than copying the array
data
=
np
.
ma
.
masked_array
(
data
)
data
.
mask
=
stipples_mask
data
=
np
.
ma
.
masked_array
(
data
.
filled
(
3.0
))
#3.0 denotes areas of statistical significance
data
=
np
.
ma
.
masked_array
(
data
.
filled
(
3.0
))
#3.0 denotes areas of statistical significance
; red
data
.
mask
=
zeros_mask
data
=
np
.
ma
.
masked_array
(
data
.
filled
(
1.0
))
#1.0 denotes areas little change
data
=
np
.
ma
.
masked_array
(
data
.
filled
(
1.0
))
#1.0 denotes areas little change
; blue
data
.
mask
=
third_cat_mask
data
=
np
.
ma
.
masked_array
(
data
.
filled
(
2.0
))
#2.0 denotes areas of statistical uncertainty
data
=
np
.
ma
.
masked_array
(
data
.
filled
(
2.0
))
#2.0 denotes areas of statistical uncertainty
; green
weird
=
m
.
pcolor
(
x
,
y
,
data
)
...
...
@@ -91,6 +91,6 @@ for infilename, outfilename in GLOBAL_PRECIP_FILES:
# print np.any(np.logical_and(third_cat_mask, stipples_mask))
plt
.
savefig
(
'../dist/'
+
outfilename
.
format
(
'north_american_categories'
),
format
=
'eps'
,
dpi
=
200
)
#
plt.show()
#
plt.savefig('../dist/' + outfilename.format('north_american_categories'), format='eps', dpi=200)
plt
.
show
()
Write
Preview
Markdown
is supported
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