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
dc960fdf
Commit
dc960fdf
authored
3 years ago
by
tomrink
Browse files
Options
Downloads
Patches
Plain Diff
minor...
parent
1938276d
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/util.py
+24
-1
24 additions, 1 deletion
modules/util/util.py
with
24 additions
and
1 deletion
modules/util/util.py
+
24
−
1
View file @
dc960fdf
...
...
@@ -202,4 +202,27 @@ def is_night(solzen, test_angle=100.0):
if
len
(
solzen
)
==
0
or
np
.
sum
(
solzen
>=
test_angle
)
<
len
(
solzen
):
return
False
else
:
return
True
\ No newline at end of file
return
True
def
get_grid_values_all
(
h5f
,
grid_name
,
scale_factor_name
=
'
scale_factor
'
,
add_offset_name
=
'
add_offset
'
):
hfds
=
h5f
[
grid_name
]
attrs
=
hfds
.
attrs
grd_vals
=
hfds
[:,:]
grd_vals
=
np
.
where
(
grd_vals
==
-
999
,
np
.
nan
,
grd_vals
)
grd_vals
=
np
.
where
(
grd_vals
==
-
127
,
np
.
nan
,
grd_vals
)
grd_vals
=
np
.
where
(
grd_vals
==
-
32768
,
np
.
nan
,
grd_vals
)
if
attrs
is
None
:
return
grd_vals
if
scale_factor_name
is
not
None
:
scale_factor
=
attrs
.
get
(
scale_factor_name
)[
0
]
grd_vals
=
grd_vals
*
scale_factor
if
add_offset_name
is
not
None
:
add_offset
=
attrs
.
get
(
add_offset_name
)[
0
]
grd_vals
=
grd_vals
+
add_offset
return
grd_vals
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