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
d9e6fe95
Commit
d9e6fe95
authored
3 years ago
by
Nick Bearson
Browse files
Options
Downloads
Plain Diff
resolves a merge conflict from moving our meso sector checking around
parents
11c9763a
840520fe
No related branches found
No related tags found
1 merge request
!26
group inputs by minute and process accordingly
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gridded_glm/libexec/_minute_gridder.py
+36
-11
36 additions, 11 deletions
gridded_glm/libexec/_minute_gridder.py
with
36 additions
and
11 deletions
gridded_glm/libexec/_minute_gridder.py
+
36
−
11
View file @
d9e6fe95
...
...
@@ -77,7 +77,7 @@ def create_parser():
"
(default: print to screen).
"
)
parser
.
add_argument
(
'
-o
'
,
'
--output-dir
'
,
metavar
=
'
OUTPUT_DIR
'
,
default
=
os
.
getcwd
(),
help
=
"
output directory (default: use current directory)
"
)
parser
.
add_argument
(
'
--goes-sector
'
,
default
=
"
full
"
,
choices
=
[
'
full
'
,
'
conus
'
,
'
meso
'
],
parser
.
add_argument
(
'
--goes-sector
'
,
default
=
"
full
"
,
choices
=
[
'
full
'
,
'
conus
'
,
'
meso
'
,
'
meso1
'
,
'
meso2
'
],
help
=
"
If sector is meso, ctr_lon and ctr_lat
\n
"
"
are interpreted as the ctr_x and ctr_y of the fixed grid.
\n
"
"
(default: full)
"
)
...
...
@@ -154,8 +154,10 @@ def get_sector_shortstring(args):
return
'
F
'
elif
args
.
goes_sector
==
'
conus
'
:
return
'
C
'
elif
args
.
goes_sector
==
'
meso
'
:
elif
args
.
goes_sector
==
'
meso
'
or
args
.
goes_sector
==
'
meso1
'
:
return
'
M1
'
elif
args
.
goes_sector
==
'
meso2
'
:
return
'
M2
'
else
:
raise
RuntimeError
(
"
sector not recognized
"
)
...
...
@@ -196,7 +198,25 @@ def grid_setup(glm_files, args, work_dir=os.getcwd()):
min_events
=
None
min_groups
=
None
if
args
.
goes_sector
==
"
meso
"
and
(
args
.
ctr_lat
==
None
or
args
.
ctr_lon
==
None
):
if
args
.
realtime
:
if
len
(
args
.
filenames
)
!=
1
:
log
.
error
(
"
realtime mode only accepts one input file
"
)
exit
(
1
)
glminfo
=
parse_glm_filename
(
os
.
path
.
basename
(
args
.
filenames
[
0
]))
globstring
=
"
{}_{}_{}_s{}*
"
.
format
(
glminfo
[
0
],
glminfo
[
1
],
glminfo
[
2
],
glminfo
[
3
].
strftime
(
"
%Y%j%H%M
"
))
fileglob
=
glob
(
os
.
path
.
join
(
os
.
path
.
dirname
(
args
.
filenames
[
0
]),
globstring
))
if
len
(
fileglob
)
!=
3
:
log
.
error
(
"
There are not (yet) three GLM files from this minute. This may be expected. Exiting.
"
)
exit
(
0
)
args
.
filenames
=
fileglob
for
f
in
args
.
filenames
:
if
not
os
.
path
.
exists
(
f
):
log
.
error
(
"
Tried to grid file that does not exist: {}
"
.
format
(
f
))
exit
(
1
)
if
"
meso
"
in
args
.
goes_sector
and
(
args
.
ctr_lat
==
None
or
args
.
ctr_lon
==
None
):
log
.
error
(
"
sector
'
meso
'
requires --ctr-lat & --ctr-lon
"
)
exit
(
1
)
...
...
@@ -214,18 +234,23 @@ def grid_setup(glm_files, args, work_dir=os.getcwd()):
goes_position
=
get_goes_position
(
glm_files
)
if
"
meso
"
in
args
.
goes_sector
:
view
=
"
meso
"
else
:
view
=
args
.
goes_sector
resln
=
get_resolution
(
args
)
view
=
get_GOESR_grid
(
position
=
goes_position
,
view
=
args
.
goes_sector
,
grid
=
get_GOESR_grid
(
position
=
goes_position
,
view
=
view
,
resolution
=
resln
)
nadir_lon
=
view
[
'
nadir_lon
'
]
dx
=
dy
=
view
[
'
resolution
'
]
nx
,
ny
=
view
[
'
pixelsEW
'
],
view
[
'
pixelsNS
'
]
nadir_lon
=
grid
[
'
nadir_lon
'
]
dx
=
dy
=
grid
[
'
resolution
'
]
nx
,
ny
=
grid
[
'
pixelsEW
'
],
grid
[
'
pixelsNS
'
]
geofixcs
,
grs80lla
=
get_GOESR_coordsys
(
sat_lon_nadir
=
nadir_lon
)
if
'
centerEW
'
in
view
:
x_ctr
,
y_ctr
=
view
[
'
centerEW
'
],
view
[
'
centerNS
'
]
elif
args
.
goes_sector
==
'
meso
'
:
if
'
centerEW
'
in
grid
:
x_ctr
,
y_ctr
=
grid
[
'
centerEW
'
],
grid
[
'
centerNS
'
]
elif
view
==
'
meso
'
:
# use ctr_lon, ctr_lat to get the center of the mesoscale FOV
x_ctr
,
y_ctr
,
z_ctr
=
geofixcs
.
fromECEF
(
*
grs80lla
.
toECEF
(
args
.
ctr_lon
,
args
.
ctr_lat
,
0.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