Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fusion_matlab
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
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
geoffc_sips
fusion_matlab
Commits
4bad4155
Commit
4bad4155
authored
7 years ago
by
Geoff Cureton
Browse files
Options
Downloads
Patches
Plain Diff
Added bowtie-pixel filling to VIIRS level-1b granules using viirsmend.
parent
9d07e3d6
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
example_local_prepare.py
+2
-2
2 additions, 2 deletions
example_local_prepare.py
source/flo/__init__.py
+29
-14
29 additions, 14 deletions
source/flo/__init__.py
with
31 additions
and
16 deletions
example_local_prepare.py
+
2
−
2
View file @
4bad4155
...
@@ -22,8 +22,8 @@ comp = FUSION_MATLAB()
...
@@ -22,8 +22,8 @@ comp = FUSION_MATLAB()
granule
=
datetime
(
2015
,
4
,
17
,
14
)
granule
=
datetime
(
2015
,
4
,
17
,
14
)
interval
=
TimeInterval
(
granule
,
granule
+
timedelta
(
minutes
=
0
))
interval
=
TimeInterval
(
granule
,
granule
+
timedelta
(
minutes
=
0
))
#
satellite = 'snpp'
satellite
=
'
snpp
'
satellite
=
'
aqua
'
#
satellite = 'aqua'
delivery_id
=
'
20170831-1
'
delivery_id
=
'
20170831-1
'
...
...
This diff is collapsed.
Click to expand it.
source/flo/__init__.py
+
29
−
14
View file @
4bad4155
...
@@ -52,26 +52,24 @@ import logging
...
@@ -52,26 +52,24 @@ import logging
import
traceback
import
traceback
from
glob
import
glob
from
glob
import
glob
from
datetime
import
datetime
,
timedelta
from
datetime
import
datetime
,
timedelta
from
subprocess
import
check_output
from
subprocess
import
check_output
,
check_call
,
CalledProcessError
from
flo.computation
import
Computation
from
flo.computation
import
Computation
from
subprocess
import
check_call
,
CalledProcessError
from
flo.time
import
TimeInterval
,
check_coverage
,
round_datetime
from
flo.time
import
TimeInterval
,
check_coverage
,
round_datetime
from
flo.util
import
symlink_inputs_to_working_dir
from
flo.util
import
symlink_inputs_to_working_dir
from
flo.dawg
import
DawgCatalog
from
flo.sw.viirsmend
import
ViirsMend
from
flo.sw.viirs_l1
import
ViirsL1b2
,
ViirsGeo2
from
flo.sw.cris_l1b
import
L1B
from
flo.sw.collocation
import
CrisViirsCollocation
from
flo.sw.collocation
import
CrisViirsCollocation
from
flo.sw.lib.glutil
import
delivered_software
,
support_software
from
glutil.software
import
delivered_software
,
support_software
,
runscript
from
glutil.nc
import
nc_compress
from
glutil.hdf
import
hdf_compress
from
glutil.catalogs
import
dawg_catalog
from
orbnav_client
import
Client
from
orbnav_client
import
Client
from
utils
import
create_dir
from
utils
import
create_dir
dawg_catalog
=
DawgCatalog
(
'
DAWG
'
)
# every module should have a LOG object
# every module should have a LOG object
LOG
=
logging
.
getLogger
(
__file__
)
LOG
=
logging
.
getLogger
(
__file__
)
...
@@ -236,6 +234,17 @@ class FUSION_MATLAB(Computation):
...
@@ -236,6 +234,17 @@ class FUSION_MATLAB(Computation):
vl1b
=
dawg_catalog
.
file
(
satellite
,
'
VL1BM
'
,
granule
,
version
=
'
2.0.2
'
)
vl1b
=
dawg_catalog
.
file
(
satellite
,
'
VL1BM
'
,
granule
,
version
=
'
2.0.2
'
)
cris
=
dawg_catalog
.
file
(
satellite
,
'
CL1B
'
,
granule
,
version
=
'
v1.0rc8
'
)
cris
=
dawg_catalog
.
file
(
satellite
,
'
CL1B
'
,
granule
,
version
=
'
v1.0rc8
'
)
# Generate the mended VIIRS granule.
interval
=
TimeInterval
(
granule
,
granule
+
timedelta
(
minutes
=
0
))
mend_context
=
ViirsMend
().
find_contexts
(
interval
)[
0
]
mend_vl1b
=
ViirsMend
().
dataset
(
'
out
'
).
product
(
{
'
granule
'
:
granule
,
'
platform
'
:
mend_context
[
'
platform
'
],
'
cloud_version
'
:
mend_context
[
'
cloud_version
'
]
}
)
# Generate the CrIS/VIIRS collocation using the CrIS and VIIRS files from DAWG
# Generate the CrIS/VIIRS collocation using the CrIS and VIIRS files from DAWG
collo_context
=
{
collo_context
=
{
'
satellite
'
:
satellite
,
'
satellite
'
:
satellite
,
...
@@ -250,6 +259,7 @@ class FUSION_MATLAB(Computation):
...
@@ -250,6 +259,7 @@ class FUSION_MATLAB(Computation):
# Download the required files, and add them to the task inputs.
# Download the required files, and add them to the task inputs.
task
.
input
(
'
geo
'
,
vgeom
)
task
.
input
(
'
geo
'
,
vgeom
)
task
.
input
(
'
l1b
'
,
vl1b
)
task
.
input
(
'
l1b
'
,
vl1b
)
task
.
input
(
'
mend_l1b
'
,
mend_vl1b
)
task
.
input
(
'
sounder
'
,
cris
)
task
.
input
(
'
sounder
'
,
cris
)
task
.
input
(
'
collo
'
,
collo
)
task
.
input
(
'
collo
'
,
collo
)
...
@@ -283,7 +293,7 @@ class FUSION_MATLAB(Computation):
...
@@ -283,7 +293,7 @@ class FUSION_MATLAB(Computation):
cmd
=
'
{}/{} {} {} {} {} {} {}
'
.
format
(
cmd
=
'
{}/{} {} {} {} {} {} {}
'
.
format
(
bin_dir
,
bin_dir
,
fusion_binary
,
fusion_binary
,
support_software
.
lookup
(
'
matlab
/
2015b
'
).
path
,
support_software
.
lookup
(
'
matlab
'
,
'
2015b
'
).
path
,
geo_file
,
geo_file
,
l1b_file
,
l1b_file
,
'
'
.
join
(
sounder_files
),
'
'
.
join
(
sounder_files
),
...
@@ -404,8 +414,11 @@ class FUSION_MATLAB(Computation):
...
@@ -404,8 +414,11 @@ class FUSION_MATLAB(Computation):
# Move the final fused file to the work directory
# Move the final fused file to the work directory
LOG
.
debug
(
'
Found final fused output file
"
{}
"
, moving to {}...
'
.
format
(
fused_l1b_file
,
current_dir
))
LOG
.
debug
(
'
Found final fused output file
"
{}
"
, moving to {}...
'
.
format
(
fused_l1b_file
,
current_dir
))
shutil
.
move
(
fused_l1b_file
,
current_dir
)
fused_l1b_file_basename
=
basename
(
fused_l1b_file
).
replace
(
'
.bowtie_restored
'
,
''
)
fused_l1b_file
=
glob
(
pjoin
(
current_dir
,
basename
(
fused_l1b_file
)))[
0
]
LOG
.
debug
(
'
Moving
"
{}
"
to
"
{}
"
...
'
.
format
(
fused_l1b_file
,
fused_l1b_file_basename
))
shutil
.
move
(
fused_l1b_file
,
pjoin
(
current_dir
,
fused_l1b_file_basename
))
fused_l1b_file
=
glob
(
pjoin
(
current_dir
,
fused_l1b_file_basename
))[
0
]
# Remove the fused_outputs directory
# Remove the fused_outputs directory
LOG
.
debug
(
'
Removing the fused_outputs dir {} ...
'
.
format
(
out_dir
))
LOG
.
debug
(
'
Removing the fused_outputs dir {} ...
'
.
format
(
out_dir
))
...
@@ -500,7 +513,8 @@ class FUSION_MATLAB(Computation):
...
@@ -500,7 +513,8 @@ class FUSION_MATLAB(Computation):
# Run the fusion_matlab package
# Run the fusion_matlab package
rc_fusion
,
matlab_file
=
self
.
run_fusion_matlab
(
rc_fusion
,
matlab_file
=
self
.
run_fusion_matlab
(
inputs
[
'
geo
'
],
inputs
[
'
geo
'
],
inputs
[
'
l1b
'
],
#inputs['l1b'],
inputs
[
'
mend_l1b
'
],
[
inputs
[
'
sounder
'
]],
[
inputs
[
'
sounder
'
]],
[
inputs
[
'
collo
'
]],
[
inputs
[
'
collo
'
]],
**
kwargs
**
kwargs
...
@@ -511,7 +525,8 @@ class FUSION_MATLAB(Computation):
...
@@ -511,7 +525,8 @@ class FUSION_MATLAB(Computation):
# Now that we've computed the Matlab file, convert to a NetCDF file...
# Now that we've computed the Matlab file, convert to a NetCDF file...
rc_fusion
,
fused_l1b_file
=
self
.
convert_matlab_to_netcdf
(
matlab_file
,
rc_fusion
,
fused_l1b_file
=
self
.
convert_matlab_to_netcdf
(
matlab_file
,
inputs
[
'
l1b
'
],
#inputs['l1b'],
inputs
[
'
mend_l1b
'
],
**
kwargs
)
**
kwargs
)
LOG
.
debug
(
'
convert_matlab_to_netcdf() return value: {}
'
.
format
(
rc_fusion
))
LOG
.
debug
(
'
convert_matlab_to_netcdf() return value: {}
'
.
format
(
rc_fusion
))
...
...
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