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
f79a05e1
Commit
f79a05e1
authored
4 years ago
by
tomrink
Browse files
Options
Downloads
Patches
Plain Diff
snapshot...
parent
f74a467f
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/gfs_reader.py
+29
-3
29 additions, 3 deletions
modules/util/gfs_reader.py
with
29 additions
and
3 deletions
modules/util/gfs_reader.py
+
29
−
3
View file @
f79a05e1
...
...
@@ -157,8 +157,6 @@ def get_time_interpolated_layer(xr_dataset_s, time_s, time, fld_name, press, lon
lyr
=
lyr
.
assign_coords
(
time
=
time_s
)
intrp_lyr
=
lyr
.
interp
(
time
=
time
,
method
=
method
)
intrp_lyr
=
intrp_lyr
.
expand_dims
(
'
channel
'
)
intrp_lyr
=
intrp_lyr
.
assign_coords
(
channel
=
[
fld_name
])
return
intrp_lyr
...
...
@@ -252,7 +250,7 @@ def get_time_interpolated_vert_profile(xr_dataset_s, time_s, fld_name, time, lon
def
get_time_interpolated_vert_profile_s
(
xr_dataset_s
,
time_s
,
fld_name_s
,
time
,
lons
,
lats
,
method
=
'
linear
'
):
prof_s
=
[]
for
ds
in
xr_dataset_s
:
vp
=
get_vert_profile
(
ds
,
fld_name_s
,
lons
,
lats
)
vp
=
get_vert_profile
_s
(
ds
,
fld_name_s
,
lons
,
lats
)
prof_s
.
append
(
vp
)
prof
=
xr
.
concat
(
prof_s
,
'
time
'
)
...
...
@@ -278,6 +276,20 @@ def get_time_interpolated_point(ds_0, ds_1, time0, time1, fld_name, time, lons,
return
intrp_vals
def
get_time_interpolated_voxel
(
xr_dataset_s
,
time_s
,
time
,
fld_name
,
lon
,
lat
,
press
,
x_width
=
5
,
y_width
=
5
,
z_width
=
3
,
method
=
'
linear
'
):
vox_s
=
[]
for
ds
in
xr_dataset_s
:
vox
=
get_voxel
(
ds
,
fld_name
,
lon
,
lat
,
press
,
x_width
=
x_width
,
y_width
=
y_width
,
z_width
=
z_width
)
vox_s
.
append
(
vox
)
vox
=
xr
.
concat
(
vox_s
,
'
time
'
)
vox
=
vox
.
assign_coords
(
time
=
time_s
)
intrp_vox
=
vox
.
interp
(
time
=
time
,
method
=
method
)
return
intrp_vox
def
get_voxel
(
xr_dataset
,
fld_name
,
lon
,
lat
,
press
,
x_width
=
5
,
y_width
=
5
,
z_width
=
3
):
if
lon360
:
if
lon
<
0
:
...
...
@@ -301,6 +313,20 @@ def get_voxel(xr_dataset, fld_name, lon, lat, press, x_width=5, y_width=5, z_wid
return
sub_fld
def
get_time_interpolated_voxel_s
(
xr_dataset_s
,
time_s
,
time
,
fld_name_s
,
lon
,
lat
,
press
,
x_width
=
5
,
y_width
=
5
,
z_width
=
3
,
method
=
'
linear
'
):
vox_s
=
[]
for
ds
in
xr_dataset_s
:
vox
=
get_voxel_s
(
ds
,
fld_name_s
,
lon
,
lat
,
press
,
x_width
=
x_width
,
y_width
=
y_width
,
z_width
=
z_width
)
vox_s
.
append
(
vox
)
vox
=
xr
.
concat
(
vox_s
,
'
time
'
)
vox
=
vox
.
assign_coords
(
time
=
time_s
)
intrp_vox
=
vox
.
interp
(
time
=
time
,
method
=
method
)
return
intrp_vox
def
get_voxel_s
(
xr_dataset
,
fld_name_s
,
lon
,
lat
,
press
,
x_width
=
5
,
y_width
=
5
,
z_width
=
3
):
if
lon360
:
if
lon
<
0
:
...
...
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