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
c8d6c377
Commit
c8d6c377
authored
4 years ago
by
tomrink
Browse files
Options
Downloads
Patches
Plain Diff
minor
parent
28239b72
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/icing/pirep_goes.py
+63
-63
63 additions, 63 deletions
modules/icing/pirep_goes.py
with
63 additions
and
63 deletions
modules/icing/pirep_goes.py
+
63
−
63
View file @
c8d6c377
...
@@ -331,69 +331,6 @@ def run(pirep_dct, outfile=None, outfile_l1b=None, dt_str_start=None, dt_str_end
...
@@ -331,69 +331,6 @@ def run(pirep_dct, outfile=None, outfile_l1b=None, dt_str_start=None, dt_str_end
create_file
(
outfile_l1b
,
data_dct
,
l1b_ds_list
,
l1b_ds_types
,
lon_c
,
lat_c
,
time_s
,
fl_alt_s
,
ice_int_s
,
unq_ids
)
create_file
(
outfile_l1b
,
data_dct
,
l1b_ds_list
,
l1b_ds_types
,
lon_c
,
lat_c
,
time_s
,
fl_alt_s
,
ice_int_s
,
unq_ids
)
# ------------ This code will not be needed when we implement a Fully Connected CNN -----------------------------------
# Example GOES file to retrieve GEOS parameters in MetPy form (CONUS)
exmp_file
=
'
/Users/tomrink/data/OR_ABI-L1b-RadC-M6C14_G16_s20193140811215_e20193140813588_c20193140814070.nc
'
def
make_for_full_domain_predict
(
clvrx_file
,
name_list
=
l1b_ds_list
):
w_x
=
16
w_y
=
16
xlen
=
2500
ylen
=
1500
exmpl_ds
=
xr
.
open_dataset
(
exmp_file
)
mdat
=
exmpl_ds
.
metpy
.
parse_cf
(
'
Rad
'
)
geos
=
mdat
.
metpy
.
cartopy_crs
#xlen = mdat.x
#ylen = mdat.y
exmpl_ds
.
close
()
h5f
=
h5py
.
File
(
clvrx_file
,
'
r
'
)
grd_dct
=
{
name
:
None
for
name
in
name_list
}
cnt_a
=
0
for
didx
,
ds_name
in
enumerate
(
name_list
):
gvals
=
get_grid_values_all
(
h5f
,
ds_name
)
if
gvals
is
not
None
:
grd_dct
[
ds_name
]
=
gvals
cnt_a
+=
1
if
cnt_a
>
0
and
cnt_a
!=
len
(
name_list
):
raise
GenericException
(
'
weirdness
'
)
grd_dct_n
=
{
name
:
[]
for
name
in
name_list
}
n_x
=
int
(
xlen
/
w_x
)
n_y
=
int
(
ylen
/
w_y
)
i_0
=
0
j_0
=
0
cc
=
[]
ll
=
[]
for
didx
,
ds_name
in
enumerate
(
name_list
):
for
j
in
range
(
4
,
n_y
-
4
,
1
):
j_ul
=
j_0
+
j
*
w_y
for
i
in
range
(
4
,
n_x
-
4
,
1
):
i_ul
=
i_0
+
i
*
w_x
if
didx
==
0
:
ll
.
append
(
j_ul
)
cc
.
append
(
i_ul
)
grd_dct_n
[
ds_name
].
append
(
grd_dct
[
ds_name
][
j_ul
:
j_ul
+
w_y
,
i_ul
:
i_ul
+
w_x
])
grd_dct
=
{
name
:
None
for
name
in
name_list
}
for
didx
,
ds_name
in
enumerate
(
name_list
):
grd_dct
[
ds_name
]
=
np
.
stack
(
grd_dct_n
[
ds_name
])
h5f
.
close
()
return
grd_dct
,
ll
,
cc
# -------------------------------------------------------------------------------------------
def
analyze
(
ice_dct
,
no_ice_dct
):
def
analyze
(
ice_dct
,
no_ice_dct
):
last_file
=
None
last_file
=
None
...
@@ -1575,3 +1512,66 @@ def analyze_moon_phase(icing_dict):
...
@@ -1575,3 +1512,66 @@ def analyze_moon_phase(icing_dict):
cnt
+=
1
cnt
+=
1
print
(
len
(
icing_dict
),
cnt
)
print
(
len
(
icing_dict
),
cnt
)
# ------------ This code will not be needed when we implement a Fully Connected CNN -----------------------------------
# Example GOES file to retrieve GEOS parameters in MetPy form (CONUS)
exmp_file
=
'
/Users/tomrink/data/OR_ABI-L1b-RadC-M6C14_G16_s20193140811215_e20193140813588_c20193140814070.nc
'
def
make_for_full_domain_predict
(
clvrx_file
,
name_list
=
l1b_ds_list
):
w_x
=
16
w_y
=
16
xlen
=
2500
ylen
=
1500
exmpl_ds
=
xr
.
open_dataset
(
exmp_file
)
mdat
=
exmpl_ds
.
metpy
.
parse_cf
(
'
Rad
'
)
geos
=
mdat
.
metpy
.
cartopy_crs
#xlen = mdat.x
#ylen = mdat.y
exmpl_ds
.
close
()
h5f
=
h5py
.
File
(
clvrx_file
,
'
r
'
)
grd_dct
=
{
name
:
None
for
name
in
name_list
}
cnt_a
=
0
for
didx
,
ds_name
in
enumerate
(
name_list
):
gvals
=
get_grid_values_all
(
h5f
,
ds_name
)
if
gvals
is
not
None
:
grd_dct
[
ds_name
]
=
gvals
cnt_a
+=
1
if
cnt_a
>
0
and
cnt_a
!=
len
(
name_list
):
raise
GenericException
(
'
weirdness
'
)
grd_dct_n
=
{
name
:
[]
for
name
in
name_list
}
n_x
=
int
(
xlen
/
w_x
)
n_y
=
int
(
ylen
/
w_y
)
i_0
=
0
j_0
=
0
cc
=
[]
ll
=
[]
for
didx
,
ds_name
in
enumerate
(
name_list
):
for
j
in
range
(
4
,
n_y
-
4
,
1
):
j_ul
=
j_0
+
j
*
w_y
for
i
in
range
(
4
,
n_x
-
4
,
1
):
i_ul
=
i_0
+
i
*
w_x
if
didx
==
0
:
ll
.
append
(
j_ul
)
cc
.
append
(
i_ul
)
grd_dct_n
[
ds_name
].
append
(
grd_dct
[
ds_name
][
j_ul
:
j_ul
+
w_y
,
i_ul
:
i_ul
+
w_x
])
grd_dct
=
{
name
:
None
for
name
in
name_list
}
for
didx
,
ds_name
in
enumerate
(
name_list
):
grd_dct
[
ds_name
]
=
np
.
stack
(
grd_dct_n
[
ds_name
])
h5f
.
close
()
return
grd_dct
,
ll
,
cc
# -------------------------------------------------------------------------------------------
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