forked from pytroll/pyresample
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request pytroll#39 from pytroll/feature-download-scripts
Feature download scripts
- Loading branch information
Showing
7 changed files
with
282 additions
and
69 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
|
||
# Copyright (c) 2018 Adam.Dybbroe | ||
|
||
# Author(s): | ||
|
||
# Adam.Dybbroe <adam.dybbroe@smhi.se> | ||
|
||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
|
||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
|
||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
"""Script to download the the LUT files for atmospheric correction in the SW | ||
spectral range | ||
""" | ||
|
||
import logging | ||
import argparse | ||
from pyspectral.utils import download_luts, AEROSOL_TYPES | ||
from pyspectral.utils import logging_on, logging_off | ||
|
||
|
||
if __name__ == "__main__": | ||
parser = argparse.ArgumentParser( | ||
description='Download the atm correction LUT files') | ||
parser.add_argument("--aerosol_types", '-a', nargs='*', | ||
help="Aerosol types", | ||
type=str, default=AEROSOL_TYPES) | ||
parser.add_argument( | ||
"-d", '--dry_run', help=("Dry run - no action"), action='store_true', | ||
default=False) | ||
parser.add_argument( | ||
"-v", '--verbose', help=("Turn logging on"), action='store_true') | ||
|
||
args = parser.parse_args() | ||
verbose = args.verbose | ||
dry_run = args.dry_run | ||
aerosol_types = args.aerosol_types | ||
|
||
if verbose: | ||
logging_on(logging.DEBUG) | ||
else: | ||
logging_off() | ||
|
||
# Download: | ||
download_luts(aerosol_type=aerosol_types, dry_run=dry_run) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
|
||
# Copyright (c) 2018 Adam.Dybbroe | ||
|
||
# Author(s): | ||
|
||
# Adam.Dybbroe <adam.dybbroe@smhi.se> | ||
|
||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
|
||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
|
||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
"""Script to download the RSR files from internet | ||
""" | ||
|
||
import logging | ||
import argparse | ||
from pyspectral.utils import download_rsr | ||
from pyspectral.utils import logging_on, logging_off | ||
|
||
if __name__ == "__main__": | ||
|
||
parser = argparse.ArgumentParser( | ||
description='Download relative spectral response data in hdf5') | ||
parser.add_argument("-o", "--destination", help=("Destination path where to store the files"), | ||
default=None, type=str) | ||
parser.add_argument( | ||
"-d", '--dry_run', help=("Dry run - no action"), action='store_true', | ||
default=False) | ||
parser.add_argument( | ||
"-v", '--verbose', help=("Turn logging on"), action='store_true') | ||
|
||
args = parser.parse_args() | ||
dest_dir = args.destination | ||
verbose = args.verbose | ||
dry_run = args.dry_run | ||
|
||
if verbose: | ||
logging_on(logging.DEBUG) | ||
else: | ||
logging_off() | ||
|
||
if dest_dir: | ||
download_rsr(dest_dir=dest_dir, dry_run=dry_run) | ||
else: | ||
download_rsr(dry_run=dry_run) |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.