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
5e37420d
Commit
5e37420d
authored
2 years ago
by
tomrink
Browse files
Options
Downloads
Patches
Plain Diff
snapshot...
parent
30d6ebd0
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/util/viirs_surfrad.py
+25
-3
25 additions, 3 deletions
modules/util/viirs_surfrad.py
with
25 additions
and
3 deletions
modules/util/viirs_surfrad.py
+
25
−
3
View file @
5e37420d
...
@@ -7,6 +7,27 @@ from aeolus.datasource import CLAVRx_VIIRS
...
@@ -7,6 +7,27 @@ from aeolus.datasource import CLAVRx_VIIRS
from
icing.moon_phase
import
*
from
icing.moon_phase
import
*
from
pathlib
import
Path
from
pathlib
import
Path
keep_out_opd
=
[
'
/ships19/cloud/scratch/cphillips/clavrx/run_viirs_superres/sites_super_l2/arm/2019/11/02/clavrx_VNP02IMG.A2019306.1912.001.2019307003236.uwssec.nc
'
,
'
/ships19/cloud/scratch/cphillips/clavrx/run_viirs_superres/sites_super_l2/arm/2019/04/13/clavrx_VNP02IMG.A2019103.1918.001.2019104005120.uwssec.nc
'
,
'
/ships19/cloud/scratch/cphillips/clavrx/run_viirs_superres/sites_super_l2/sioux_falls/2019/05/25/clavrx_VNP02IMG.A2019145.1936.001.2019146005424.uwssec.nc
'
,
'
/ships19/cloud/scratch/cphillips/clavrx/run_viirs_superres/sites_super_l2/sioux_falls/2019/11/01/clavrx_VNP02IMG.A2019305.1936.001.2019306005913.uwssec.nc
'
,
'
/ships19/cloud/scratch/cphillips/clavrx/run_viirs_superres/sites_super_l2/sioux_falls/2019/03/01/clavrx_VNP02IMG.A2019060.1930.001.2019061005942.uwssec.nc
'
,
'
/ships19/cloud/scratch/cphillips/clavrx/run_viirs_superres/sites_super_l2/table_mountain/2019/12/01/clavrx_VNP02IMG.A2019335.2012.001.2019336013827.uwssec.nc
'
,
'
/ships19/cloud/scratch/cphillips/clavrx/run_viirs_superres/sites_super_l2/table_mountain/2019/05/18/clavrx_VNP02IMG.A2019138.2006.001.2019139013059.uwssec.nc
'
,
'
/ships19/cloud/scratch/cphillips/clavrx/run_viirs_superres/sites_super_l2/fort_peck/2019/01/28/clavrx_VNP02IMG.A2019028.1930.001.2019029005408.uwssec.nc
'
,
'
/ships19/cloud/scratch/cphillips/clavrx/run_viirs_superres/sites_super_l2/fort_peck/2019/08/08/clavrx_VNP02IMG.A2019220.1930.001.2019221010714.uwssec.nc
'
,
'
/ships19/cloud/scratch/cphillips/clavrx/run_viirs_superres/sites_super_l2/madison/2019/10/13/clavrx_VNP02IMG.A2019286.1848.001.2019287001722.uwssec.nc
'
,
'
/ships19/cloud/scratch/cphillips/clavrx/run_viirs_superres/sites_super_l2/madison/2019/03/20/clavrx_VNP02IMG.A2019079.1830.001.2019079235918.uwssec.nc
'
,
'
/ships19/cloud/scratch/cphillips/clavrx/run_viirs_superres/sites_super_l2/madison/2019/12/26/clavrx_VNP02IMG.A2019360.1900.001.2019361001327.uwssec.nc
'
,
'
/ships19/cloud/scratch/cphillips/clavrx/run_viirs_superres/sites_super_l2/desert_rock/2019/02/05/clavrx_VNP02IMG.A2019036.2018.001.2019037030301.uwssec.nc
'
,
'
/ships19/cloud/scratch/cphillips/clavrx/run_viirs_superres/sites_super_l2/desert_rock/2019/03/30/clavrx_VNP02IMG.A2019089.2024.001.2019090015614.uwssec.nc
'
,
'
/ships19/cloud/scratch/cphillips/clavrx/run_viirs_superres/sites_super_l2/bondville_il/2019/11/03/clavrx_VNP02IMG.A2019307.1854.001.2019308001716.uwssec.nc
'
,
'
/ships19/cloud/scratch/cphillips/clavrx/run_viirs_superres/sites_super_l2/goodwin_creek/2019/04/15/clavrx_VNP02IMG.A2019105.1842.001.2019106001003.uwssec.nc
'
,
'
/ships19/cloud/scratch/cphillips/clavrx/run_viirs_superres/sites_super_l2/penn_state/2019/07/18/clavrx_VNP02IMG.A2019199.1742.001.2019199230925.uwssec.nc
'
,
'
/ships19/cloud/scratch/cphillips/clavrx/run_viirs_superres/sites_super_l2/penn_state/2019/02/02/clavrx_VNP02IMG.A2019033.1754.001.2019034011318.uwssec.nc
'
]
keep_out
=
keep_out_opd
target_param
=
'
cloud_probability
'
target_param
=
'
cloud_probability
'
# target_param = 'cld_opd_dcomp'
# target_param = 'cld_opd_dcomp'
...
@@ -48,7 +69,7 @@ def process_cld_prob(grd_k):
...
@@ -48,7 +69,7 @@ def process_cld_prob(grd_k):
num_keep
=
np
.
sum
(
keep
)
num_keep
=
np
.
sum
(
keep
)
keep_clr
=
np
.
where
(
keep
,
grd_k
<
0.20
,
False
)
keep_clr
=
np
.
where
(
keep
,
grd_k
<
0.20
,
False
)
frac_keep
=
np
.
sum
(
keep_clr
)
/
num_keep
frac_keep
=
np
.
sum
(
keep_clr
)
/
num_keep
if
not
(
0.3
5
<
frac_keep
<
0.
65
):
if
not
(
0.3
0
<
frac_keep
<
0.
70
):
return
None
return
None
grd_k
=
np
.
where
(
np
.
invert
(
keep
),
0
,
grd_k
)
# Convert NaN to 0
grd_k
=
np
.
where
(
np
.
invert
(
keep
),
0
,
grd_k
)
# Convert NaN to 0
return
grd_k
return
grd_k
...
@@ -73,7 +94,8 @@ def run_all(directory, out_directory, day_night='ANY', pattern='clavrx_*.nc', st
...
@@ -73,7 +94,8 @@ def run_all(directory, out_directory, day_night='ANY', pattern='clavrx_*.nc', st
path
=
directory
+
'
**
'
+
'
/
'
+
pattern
path
=
directory
+
'
**
'
+
'
/
'
+
pattern
data_files
=
glob
.
glob
(
path
,
recursive
=
True
)
all_files
=
glob
.
glob
(
path
,
recursive
=
True
)
data_files
=
[
f
for
f
in
all_files
if
f
not
in
keep_out
]
label_valid_tiles
=
[]
label_valid_tiles
=
[]
label_train_tiles
=
[]
label_train_tiles
=
[]
...
@@ -112,7 +134,7 @@ def run_all(directory, out_directory, day_night='ANY', pattern='clavrx_*.nc', st
...
@@ -112,7 +134,7 @@ def run_all(directory, out_directory, day_night='ANY', pattern='clavrx_*.nc', st
if
len
(
data_train_tiles
)
==
0
and
len
(
data_valid_tiles
)
==
0
:
if
len
(
data_train_tiles
)
==
0
and
len
(
data_valid_tiles
)
==
0
:
continue
continue
if
(
f_cnt
%
20
)
==
0
:
if
(
f_cnt
%
5
)
==
0
:
num_valid_samples
=
0
num_valid_samples
=
0
if
len
(
data_valid_tiles
)
>
0
:
if
len
(
data_valid_tiles
)
>
0
:
label_valid
=
np
.
stack
(
label_valid_tiles
)
label_valid
=
np
.
stack
(
label_valid_tiles
)
...
...
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