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
f1517765
Commit
f1517765
authored
1 year ago
by
Paolo Veglio
Browse files
Options
Downloads
Patches
Plain Diff
added verbosity levels to main and cli
parent
409db469
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#46818
failed
1 year ago
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
mvcm/cli_mvcm.py
+12
-5
12 additions, 5 deletions
mvcm/cli_mvcm.py
mvcm/main.py
+4
-5
4 additions, 5 deletions
mvcm/main.py
with
16 additions
and
10 deletions
mvcm/cli_mvcm.py
+
12
−
5
View file @
f1517765
"""
Command line interface.
"""
import
argparse
# from glob import glob
from
pkg_resources
import
get_distribution
from
mvcm.main
import
main
_datapath
=
"
/ships19/hercules/pveglio/mvcm_viirs_hires
"
# _fname_mod02 = glob(f'{_datapath}/VNP02MOD.A2022173.1312.001.*.uwssec_bowtie_corrected.nc')[0]
# _fname_mod02 =
# glob(f'{_datapath}/VNP02MOD.A2022173.1312.001.*.uwssec_bowtie_corrected.nc')[0]
# _fname_mod03 = glob(f'{_datapath}/VNP03MOD.A2022173.1312.001.*.uwssec.nc')[0]
# _fname_img02 = glob(f'{_datapath}/VNP02IMG.A2022173.1312.001.*.uwssec_bowtie_corrected.nc')[0]
# _fname_img02 =
# glob(f'{_datapath}/VNP02IMG.A2022173.1312.001.*.uwssec_bowtie_corrected.nc')[0]
# _fname_img03 = glob(f'{_datapath}/VNP03IMG.A2022173.1312.001.*.uwssec.nc')[0]
# thresholds:
...
...
@@ -28,6 +30,7 @@ _VERSION = get_distribution("mvcm").version
def
mvcm
():
"""
Call main function.
"""
parser
=
argparse
.
ArgumentParser
(
prog
=
"
MVCM
"
,
description
=
""
)
parser
.
add_argument
(
...
...
@@ -73,7 +76,11 @@ def mvcm():
help
=
"
print version and exit
"
,
)
parser
.
add_argument
(
"
-v
"
,
"
--verbose
"
,
action
=
"
store_true
"
,
help
=
"
print verbose information
"
"
-v
"
,
"
--verbose
"
,
action
=
"
count
"
,
default
=
1
,
help
=
"
print verbose information. Argument can be used multiple times.
"
,
)
args
=
parser
.
parse_args
()
...
...
@@ -95,7 +102,7 @@ def mvcm():
sst_file
=
args
.
sst
or
_sst_file
eco_file
=
args
.
eco
or
_eco_file
out_file
=
args
.
out
or
"
test_out.nc
"
verbose
=
args
.
verbose
or
False
verbose
=
args
.
verbose
main
(
satellite
=
satellite
,
...
...
This diff is collapsed.
Click to expand it.
mvcm/main.py
+
4
−
5
View file @
f1517765
...
...
@@ -22,6 +22,7 @@ from mvcm.restoral import Restoral
# from glob import glob
LOG_LEVELS
=
[
"
CRITICAL
"
,
"
ERROR
"
,
"
WARNING
"
,
"
INFO
"
,
"
DEBUG
"
]
# #################################################################### #
# TEST CASE
...
...
@@ -88,7 +89,7 @@ def timer(func):
return
wrapper_timer
#
@timer
@timer
def
main
(
satellite
:
str
=
"
snpp
"
,
sensor
:
str
=
"
viirs
"
,
...
...
@@ -152,10 +153,8 @@ def main(
-------
None
"""
if
verbose
is
True
:
logging
.
basicConfig
(
level
=
logging
.
INFO
)
else
:
logging
.
basicConfig
(
level
=
logging
.
WARNING
)
verbose_level
=
np
.
minimum
(
verbose
,
4
)
logging
.
basicConfig
(
level
=
LOG_LEVELS
[
verbose_level
])
file_names
=
{
"
MOD02
"
:
f
"
{
mod02
}
"
,
...
...
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