Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cspp-geo-gridded-glm
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Analyze
Value stream analytics
Contributor 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
cspp_geo
cspp-geo-gridded-glm
Commits
c843713e
Commit
c843713e
authored
5 months ago
by
Levi Pfantz
Browse files
Options
Downloads
Patches
Plain Diff
Update to take orbital_slot position from input files
parent
db52055d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!37
Merge work from 1.1 into master
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gridded_glm/libexec/gridded_glm/_minute_gridder.py
+13
-10
13 additions, 10 deletions
gridded_glm/libexec/gridded_glm/_minute_gridder.py
with
13 additions
and
10 deletions
gridded_glm/libexec/gridded_glm/_minute_gridder.py
+
13
−
10
View file @
c843713e
...
...
@@ -66,7 +66,7 @@ warnings.filterwarnings("ignore")
import
dask
dask
.
config
.
set
(
num_workers
=
1
)
GOES_S
AT_POSITION
S
=
{
'
G16
'
:
'
east
'
,
'
G17
'
:
'
west
'
,
'
G18
'
:
'
west
'
,
'
G19
'
:
'
east
'
,}
GOES_S
UPPORTED_SAT
S
=
[
'
G16
'
,
'
G17
'
,
'
G18
'
,
'
G19
'
]
def
create_parser
():
...
...
@@ -121,16 +121,19 @@ def get_resolution(args):
return
resln
# if provided "auto" position, we determine the sensor from the filename
def
get_goes_position
(
filenames
):
def
get_goes_position
(
files
):
position
=
""
#Check that all files are the same position
for
file
in
files
:
new_position
=
Dataset
(
file
,
'
r
'
).
getncattr
(
'
orbital_slot
'
)
if
not
position
:
position
=
new_position
if
not
new_position
==
position
:
raise
ValueError
(
"
Input files contain a mix of positions. Check them and try again.
"
)
position
=
position
.
split
(
'
-
'
)[
1
]
return
position
.
lower
()
#Check that all files are the same sat
for
key
,
value
in
GOES_SAT_POSITIONS
.
items
():
if
all
(
f
"
_
{
key
}
_
"
in
f
for
f
in
filenames
):
return
value
# we require that all files are from the same sensor and raise an exception if not
raise
ValueError
(
"
could not determine GOES position - did you provide a mix of satellites?
"
)
def
glm_filename_to_minute
(
glm_filename
):
glminfo
=
parse_glm_filename
(
os
.
path
.
basename
(
glm_filename
))
...
...
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