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
7428e303
Commit
7428e303
authored
9 months ago
by
tomrink
Browse files
Options
Downloads
Patches
Plain Diff
snapshot...
parent
0c2000b0
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/contrail/util.py
+5
-1
5 additions, 1 deletion
modules/contrail/util.py
with
5 additions
and
1 deletion
modules/contrail/util.py
+
5
−
1
View file @
7428e303
...
@@ -52,7 +52,6 @@ def extract(mask_image, image_ts, clavrx_path):
...
@@ -52,7 +52,6 @@ def extract(mask_image, image_ts, clavrx_path):
clvrx_lats
=
get_grid_values_all
(
clvrx_h5f
,
'
latitude
'
).
flatten
()
clvrx_lats
=
get_grid_values_all
(
clvrx_h5f
,
'
latitude
'
).
flatten
()
contrail_idxs
=
(
mask_image
==
1
).
flatten
()
contrail_idxs
=
(
mask_image
==
1
).
flatten
()
print
(
'
number of contrail pixels:
'
,
np
.
sum
(
contrail_idxs
))
# Assuming GOES FD for now -------------------
# Assuming GOES FD for now -------------------
# elems, lines = np.meshgrid(np.arange(5424), np.arange(5424))
# elems, lines = np.meshgrid(np.arange(5424), np.arange(5424))
...
@@ -121,6 +120,8 @@ def extract(mask_image, image_ts, clavrx_path):
...
@@ -121,6 +120,8 @@ def extract(mask_image, image_ts, clavrx_path):
print
(
'
working on pressure level:
'
,
bins
[
key
])
print
(
'
working on pressure level:
'
,
bins
[
key
])
for
c_idx
in
bins_dict
[
key
]:
for
c_idx
in
bins_dict
[
key
]:
lon
=
contrail_lons
[
c_idx
]
lon
=
contrail_lons
[
c_idx
]
if
lon
<
0
:
# Match GFS convention
lon
+=
360.0
lat
=
contrail_lats
[
c_idx
]
lat
=
contrail_lats
[
c_idx
]
press
=
contrail_press
[
c_idx
]
press
=
contrail_press
[
c_idx
]
...
@@ -129,6 +130,9 @@ def extract(mask_image, image_ts, clavrx_path):
...
@@ -129,6 +130,9 @@ def extract(mask_image, image_ts, clavrx_path):
horz_wind_spd_value
=
horz_wind_spd_3d
.
interp
(
Pressure
=
press
,
Longitude
=
lon
,
Latitude
=
lat
,
method
=
'
nearest
'
)
horz_wind_spd_value
=
horz_wind_spd_3d
.
interp
(
Pressure
=
press
,
Longitude
=
lon
,
Latitude
=
lat
,
method
=
'
nearest
'
)
vert_shear_value
=
vert_shear_3d
.
interp
(
Pressure
=
press
,
Longitude
=
lon
,
Latitude
=
lat
,
method
=
'
nearest
'
)
vert_shear_value
=
vert_shear_3d
.
interp
(
Pressure
=
press
,
Longitude
=
lon
,
Latitude
=
lat
,
method
=
'
nearest
'
)
# tmp = horz_shear_3d.sel(Pressure=press, method='nearest')
# tmp = tmp.sel(Longitude=lon, Latitude=lat, method='nearest')
voxel_dict
[
key
].
append
((
press
,
lat
,
lon
,
horz_shear_value
,
static_value
,
horz_wind_spd_value
,
vert_shear_value
))
voxel_dict
[
key
].
append
((
press
,
lat
,
lon
,
horz_shear_value
,
static_value
,
horz_wind_spd_value
,
vert_shear_value
))
# Create pandas DataFrame for each list of tuples in voxel_dict
# Create pandas DataFrame for each list of tuples in voxel_dict
...
...
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