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
2d10ced3
Commit
2d10ced3
authored
3 years ago
by
tomrink
Browse files
Options
Downloads
Patches
Plain Diff
snapshot...
parent
823d1c3b
No related branches found
Branches containing commit
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
+19
-1
19 additions, 1 deletion
modules/icing/pirep_goes.py
with
19 additions
and
1 deletion
modules/icing/pirep_goes.py
+
19
−
1
View file @
2d10ced3
...
@@ -1126,7 +1126,7 @@ def box_extract(outfile='/home/rink/box_out.h5', train_params=train_params_day):
...
@@ -1126,7 +1126,7 @@ def box_extract(outfile='/home/rink/box_out.h5', train_params=train_params_day):
h5f_expl
.
close
()
h5f_expl
.
close
()
def
run_mean_std
():
def
run_mean_std
(
check_cloudy
=
False
):
ds_list
=
[
'
cld_height_acha
'
,
'
cld_geo_thick
'
,
'
cld_press_acha
'
,
ds_list
=
[
'
cld_height_acha
'
,
'
cld_geo_thick
'
,
'
cld_press_acha
'
,
'
supercooled_cloud_fraction
'
,
'
cld_temp_acha
'
,
'
cld_opd_acha
'
,
'
supercooled_cloud_fraction
'
,
'
cld_temp_acha
'
,
'
cld_opd_acha
'
,
'
cld_reff_acha
'
,
'
cld_reff_dcomp
'
,
'
cld_reff_dcomp_1
'
,
'
cld_reff_dcomp_2
'
,
'
cld_reff_dcomp_3
'
,
'
cld_reff_acha
'
,
'
cld_reff_dcomp
'
,
'
cld_reff_dcomp_1
'
,
'
cld_reff_dcomp_2
'
,
'
cld_reff_dcomp_3
'
,
...
@@ -1142,6 +1142,16 @@ def run_mean_std():
...
@@ -1142,6 +1142,16 @@ def run_mean_std():
ice_h5f_lst
=
[
h5py
.
File
(
f
,
'
r
'
)
for
f
in
ice_flist
]
ice_h5f_lst
=
[
h5py
.
File
(
f
,
'
r
'
)
for
f
in
ice_flist
]
no_ice_h5f_lst
=
[
h5py
.
File
(
f
,
'
r
'
)
for
f
in
no_ice_flist
]
no_ice_h5f_lst
=
[
h5py
.
File
(
f
,
'
r
'
)
for
f
in
no_ice_flist
]
if
check_cloudy
:
cld_msk_i
=
[]
cld_msk_ni
=
[]
for
idx
,
ice_h5f
in
enumerate
(
ice_h5f_lst
):
no_ice_h5f
=
no_ice_h5f_lst
[
idx
]
cld_msk_i
.
append
(
ice_h5f
[
'
cloud_mask
'
][:,].
flatten
())
cld_msk_ni
.
append
(
no_ice_h5f
[
'
cloud_mask
'
][:,].
flatten
())
cld_msk_i
=
np
.
concatenate
(
cld_msk_i
)
cld_msk_ni
=
np
.
concatenate
(
cld_msk_ni
)
for
dname
in
ds_list
:
for
dname
in
ds_list
:
data
=
[]
data
=
[]
data_i
=
[]
data_i
=
[]
...
@@ -1160,11 +1170,19 @@ def run_mean_std():
...
@@ -1160,11 +1170,19 @@ def run_mean_std():
std
=
np
.
nanstd
(
data
)
std
=
np
.
nanstd
(
data
)
data_i
=
np
.
concatenate
(
data_i
)
data_i
=
np
.
concatenate
(
data_i
)
if
check_cloudy
:
keep
=
np
.
logical_or
(
cld_msk_i
==
2
,
cld_msk_i
==
3
)
data_i
=
data_i
[
keep
]
print
(
'
ice:
'
,
data_i
.
shape
)
mean_i
=
np
.
nanmean
(
data_i
)
mean_i
=
np
.
nanmean
(
data_i
)
data_i
-=
mean_i
data_i
-=
mean_i
std_i
=
np
.
nanstd
(
data_i
)
std_i
=
np
.
nanstd
(
data_i
)
data_ni
=
np
.
concatenate
(
data_ni
)
data_ni
=
np
.
concatenate
(
data_ni
)
if
check_cloudy
:
keep
=
np
.
logical_or
(
cld_msk_ni
==
2
,
cld_msk_ni
==
3
)
data_ni
=
data_ni
[
keep
]
print
(
'
no ice:
'
,
data_ni
.
shape
)
mean_ni
=
np
.
nanmean
(
data_ni
)
mean_ni
=
np
.
nanmean
(
data_ni
)
data_ni
-=
mean_ni
data_ni
-=
mean_ni
std_ni
=
np
.
nanstd
(
data_ni
)
std_ni
=
np
.
nanstd
(
data_ni
)
...
...
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