Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MVCM
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
Paolo Veglio
MVCM
Commits
09ec38da
Commit
09ec38da
authored
2 years ago
by
Paolo Veglio
Browse files
Options
Downloads
Patches
Plain Diff
added output filename as argument of main()
parent
c46a70fa
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
hires_module.py
+26
-9
26 additions, 9 deletions
hires_module.py
spectral_tests.py
+1
-1
1 addition, 1 deletion
spectral_tests.py
with
27 additions
and
10 deletions
hires_module.py
+
26
−
9
View file @
09ec38da
import
numpy
as
np
#
import xarray as xr
import
xarray
as
xr
import
netCDF4
as
nc
from
glob
import
glob
...
...
@@ -60,7 +60,8 @@ def main(*,
geos_constants
:
str
=
_geos_constants
,
ndvi_file
:
str
=
_ndvi_file
,
sst_file
:
str
=
_sst_file
,
cloud_mask_file
=
_cld_mask
)
->
None
:
cloud_mask_file
:
str
=
_cld_mask
,
out_fname
:
str
=
'
temp.nc
'
)
->
None
:
f
=
nc
.
Dataset
(
cloud_mask_file
)
...
...
@@ -165,17 +166,33 @@ def main(*,
(
scene_flags
[
'
uniform
'
]
==
1
)
&
(
confidence
<=
0.95
))
confidence
[
idx
]
=
restoral
.
sunglint
(
viirs_data
,
thresholds
[
'
Sun_Glint
'
],
total_bit
,
temp_confidence
)[
idx
]
total_confidence
=
np
.
sqrt
(
confidence
*
mvcm_conf
.
repeat
(
2
,
0
).
repeat
(
2
,
1
))
#
total_confidence = np.sqrt(confidence * mvcm_conf.repeat(2, 0).repeat(2, 1))
date
=
mod02
.
split
(
'
.
'
)[
1
]
time
=
mod02
.
split
(
'
.
'
)[
2
]
# np.savez(f'{data_path}/pyMVCM_{date}.{time}',
np
.
savez
(
f
'
{
data_path
}
/outputs/pyMVCM_
{
date
}
.
{
time
}
'
,
confidence
=
total_confidence
,
py_conf
=
confidence
,
mvcm_conf
=
mvcm_conf
,
lat
=
viirs_data
.
latitude
.
values
,
lon
=
viirs_data
.
longitude
.
values
,
ocean_day_mask
=
viirs_data
.
Ocean_Day
.
values
)
# c1=cmin_G1, c2=cmin_G2, c3=cmin_G3)
mvcm_confidence
=
mvcm_conf
.
repeat
(
2
,
0
).
repeat
(
2
,
1
)
out_xr
=
xr
.
Dataset
(
data_vars
=
dict
(
hires_confidence
=
([
'
number_of_lines
'
,
'
number_of_pixels
'
],
confidence
),
mvcm_confidence
=
([
'
number_of_lines
'
,
'
number_of_pixels
'
],
mvcm_confidence
),
ocean_day_mask
=
([
'
number_of_lines
'
,
'
number_of_pixels
'
],
viirs_data
.
Ocean_Day
.
values
),
),
coords
=
dict
(
latitude
=
([
'
number_of_lines
'
,
'
number_of_pixels
'
],
viirs_data
.
latitude
.
values
),
longitude
=
([
'
number_of_lines
'
,
'
number_of_pixels
'
],
viirs_data
.
longitude
.
values
),
)
)
# out_xr.to_netcdf(f'hires_MVCM.{date}.{time}.nc')
out_xr
.
to_netcdf
(
out_fname
)
# # np.savez(f'{data_path}/pyMVCM_{date}.{time}',
# np.savez(f'{data_path}/outputs/pyMVCM_{date}.{time}',
# confidence=total_confidence, py_conf=confidence, mvcm_conf=mvcm_conf,
# lat=viirs_data.latitude.values, lon=viirs_data.longitude.values,
# ocean_day_mask=viirs_data.Ocean_Day.values)
# # c1=cmin_G1, c2=cmin_G2, c3=cmin_G3)
# return confidence # , conf, total_bit
...
...
This diff is collapsed.
Click to expand it.
spectral_tests.py
+
1
−
1
View file @
09ec38da
...
...
@@ -115,7 +115,7 @@ class CloudTests(object):
cmin
=
np
.
fmin
(
cmin
,
confidence
)
# return cmin, np.abs(1-test_bit)*qa_bit
return
sfcdif
,
test_bit
return
cmin
,
test_bit
@run_if_test_exists_for_scene
def
bt_diff_86_11um
(
self
,
...
...
This diff is collapsed.
Click to expand it.
Paolo Veglio
@pveglio
mentioned in commit
391c6d6b
·
2 years ago
mentioned in commit
391c6d6b
mentioned in commit 391c6d6b352bf9212a12ed9ad7ca87ab86492fba
Toggle commit list
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