Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
python
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
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
Tom Rink
python
Commits
d604ccb3
Commit
d604ccb3
authored
3 years ago
by
tomrink
Browse files
Options
Downloads
Patches
Plain Diff
minor...
parent
d6807531
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/util/plot.py
+25
-0
25 additions, 0 deletions
modules/util/plot.py
with
25 additions
and
0 deletions
modules/util/plot.py
+
25
−
0
View file @
d604ccb3
...
...
@@ -13,6 +13,8 @@ import matplotlib.pyplot as plt
import
cartopy.crs
as
ccrs
import
xarray
as
xr
import
os
import
h5py
from
util.util
import
get_grid_values_all
from
util.setup
import
home_dir
...
...
@@ -217,3 +219,26 @@ def plot_image3(image, cmap='Greys'):
ax
.
coastlines
(
resolution
=
'
50m
'
,
color
=
'
black
'
,
linewidth
=
0.25
)
ax
.
add_feature
(
ccrs
.
cartopy
.
feature
.
STATES
,
linewidth
=
0.25
)
plt
.
title
(
'
GOES-16
'
,
loc
=
'
left
'
,
fontweight
=
'
bold
'
,
fontsize
=
15
)
def
make_icing_image
(
clvrx_file
,
ice_lons
,
ice_lats
,
ice_lons_vld
=
None
,
ice_lats_vld
=
None
,
filename
=
'
testimage
'
):
h5f
=
h5py
.
File
(
clvrx_file
,
'
r
'
)
image
=
get_grid_values_all
(
h5f
,
'
temp_10_4um_nom
'
)
exmpl_ds
=
xr
.
open_dataset
(
exmp_file
)
mdat
=
exmpl_ds
.
metpy
.
parse_cf
(
'
Rad
'
)
geos
=
mdat
.
metpy
.
cartopy_crs
x
=
mdat
.
x
y
=
mdat
.
y
fig
=
plt
.
figure
(
figsize
=
(
15
,
24
))
ax
=
fig
.
add_subplot
(
1
,
1
,
1
,
projection
=
geos
)
ax
.
imshow
(
image
,
origin
=
'
upper
'
,
extent
=
(
x
.
min
(),
x
.
max
(),
y
.
min
(),
y
.
max
()),
cmap
=
'
Greys
'
,
transform
=
geos
)
ax
.
coastlines
(
resolution
=
'
50m
'
,
color
=
'
black
'
,
linewidth
=
0.25
)
ax
.
add_feature
(
ccrs
.
cartopy
.
feature
.
STATES
,
linewidth
=
0.25
)
ax
.
scatter
(
ice_lons
,
ice_lats
,
s
=
0.6
,
marker
=
'
o
'
,
color
=
'
orange
'
,
transform
=
ccrs
.
PlateCarree
())
if
ice_lats_vld
is
not
None
:
ax
.
scatter
(
ice_lons_vld
,
ice_lats_vld
,
s
=
20.0
,
marker
=
'
o
'
,
color
=
'
blue
'
,
transform
=
ccrs
.
PlateCarree
())
plt
.
title
(
'
GOES-16, 2019-04-30_14:26Z >60% Probability Icing
'
,
loc
=
'
left
'
,
fontweight
=
'
bold
'
,
fontsize
=
15
)
ImageDirAndName
=
os
.
path
.
join
(
'
/Users/tomrink
'
,
filename
)
fig
.
savefig
(
ImageDirAndName
)
\ No newline at end of file
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