Commit b3393c22 authored by Daniel Scheffler's avatar Daniel Scheffler
Browse files

Added documentation for command line interface.


Former-commit-id: ac377dde
parent 23d0f224
......@@ -121,59 +121,8 @@ def _run_job(dbJob, parallelization_level='scenes'):
PC.run_all_processors()
if __name__=='__main__':
# if len(sys.argv)<2:
# # a job ID has not been given
#
# # ID = 26184107
# # ID = 26185175 # 1x TM5
# # ID = 26185176 # 1x Landsat
# # ID = 26185177 # 1. Sentinel-2-Testszene
# # ID = 26185189 # direkt benachbarte Granules von 1. Sentinel-2-Testszene
# # ID = 26185237 # 4 x Landsat-8 -> Job per database tools erstellt
# # ID = 26185239 # 50 x Landsat-8 -> Job per database tools erstellt - 1. L8 Beta-Testjob
# # ID = 26185242 # 1 x Landsat-8 - Bug files_in_archive=None
# # ID = 26185250 # Beta-Job - 219 x L8, 172 x L7, 111 x S2, spatref S2
# # ID = 26185251 # 1x L8, Zielsensor L8
# # ID = 26185252 # 1x L8, Zielsensor L8, spat.ref L8
# # ID = 26185253 # 25x L8, Zielsensor L8, spat.ref L8
# # ID = 26185254 # 10x L8, Zielsensor L8, spat.ref L8
# # ID = 26185255 # 1x L8 Bug 5 corners found -> Grund=Schreibfehler L1A im tiled Python-mode bei mehr als 1 Szene im Job
# # ID = 26185256 # 1x L7 SLC off, Zielsensor L8, spat.ref L8
# # ID = 26185257 # Beta-Job - 219 x L8, 172 x L7, 111 x S2, spatref L8
# # ID = 26185258 # Beta-Job - 219 x L8, spatref L8
# # ID = 26185259 # Beta-Job - 172 x L7, spatref L8
# # ID = 26185260 # Beta-Job - 111 x S2, spatref L8
# # ID = 26185268 # 25x L7 SLC off, Zielsensor L8, spat.ref L8
# # ID = 26185269 # 1x L7 SLC off, Bug SpatialIndexMediator
# # ID = 26185270 # 5x L7 SLC off, Bug SpatialIndexMediator
# # ID = 26185275 # 1x L8, spat. Ref. L8 Bug L1B_mask not found
# # ID = 26185264 # 1x L8, Bug L1B_masks not found
# # ID = 26185265 # 1x L8, Bug L2B_masks not found
# # ID = 26185268 # "2x L8, Bug L2B_masks not found, incl. 1x bad archive"
# # ID = 26185269 # "10x L8, Bug L2B_masks not found"
# # ID = 26185272 # "1x S2A Sips"
# ID = 26185273 # "1x L7, target L8, spat.ref L8"
# # ID = 26185275 # "1x L7, target L8, spat.ref L8 L1B Matching failed"
# # ID = 26185276 # "1x L7, target L8, spat.ref L8 L1B Matching window became too small."
# # ID = 26185279 # "GEOMS: 25x L7, target L8, spat.ref L8"
# # ID = 26185280 # "GEOMS: 1x L7, target L8, spat.ref L8, debugging NoneType object is not subscriptable within mapinfo2geotransform"
# # ID = 26185281 # "GEOMS: 4x L7, target L8, spat.ref L8, freeze of pool.map"
# # ID = 26185283 # "GEOMS: 10x L7, target L8, spat.ref L8, freeze of pool.map"
# # ID = 26185284 # "GEOMS: 11x L7, target L8, spat.ref L8, freeze of pool.map"
# # ID = 26185321 # "GEOMS: 1x L7, target L8, spat.ref L8, debugging L1B_P"
# # ID = 26185322 # "GEOMS: 1x L7, target L8, spat.ref L8, Bug calc_shifted_cross_power_spectrum: NoneType object not iterable"
# # ID = 26185277 # "GMS41: 10x L7, target L8, spat.ref L8, Permission errors during logging"
# # ID = 26185278 # "Beta-Job - 172 x L7, spatref L8"
# # ID = 26185284 # "GMS41: "all beta-L8 with cloud cover <30% (74 scenes)"
# # ID = 26185285 # "GMS41: "all beta-L7 with cloud cover <30% (49 scenes)"
# # ID = 26185396 # "GEOMS: 1x S2A multi GSD testing"
# # ID = 26185398 # "GEOMS: 1x S2A granule multi GSD testing"
#
# else:
# ID = int(sys.argv[1])
def get_gms_argparser():
"""Return argument parser for run_gms.py program."""
### CONFIGURE MAIN PARSER FOR GeoMultiSens
parser = argparse.ArgumentParser(
......@@ -216,38 +165,33 @@ if __name__=='__main__':
## ADD ARGUMENTS
if sys.argv[1]=='jobid':
# add arguments to parser_jobid
jid_p = parser_jobid.add_argument
jid_p('jobid', type=int,
help='job ID of an already created GeoMultiSens job (must be present in the jobs table of the database)')
elif sys.argv[1]=='sceneids':
# add arguments to parser_sceneids
sid_p = parser_sceneids.add_argument
sid_p('sceneids', nargs='+', type=int,
help="list of scene IDs corresponding to valid records within the 'scenes' table of the database")
elif sys.argv[1]=='entityids':
# add arguments to parser_entityids
eid_p = parser_entityids.add_argument
eid_p('entityids', nargs='+', type=str,
help="list of entity IDs corresponding to valid records within the 'scenes' table of the database")
# FIXME satellite and sensor are required
elif sys.argv[1]=='filenames':
# add arguments to parser_filenames
eid_p = parser_filenames.add_argument
eid_p('filenames', nargs='+', type=str,
help="list of filenames of satellite image archives corresponding to valid records within the 'scenes' "
"table of the database")
elif sys.argv[1]=='constraints':
# add arguments to parse_constraints
con_p = parser_constraints.add_argument
# TODO
#con_p('constraints', nargs='+', type=str, help="list of entity IDs corresponding to valid records within the "
# "'scenes' table of the database")
# add arguments to parser_jobid
jid_p = parser_jobid.add_argument
jid_p('jobid', type=int,
help='job ID of an already created GeoMultiSens job (must be present in the jobs table of the database)')
# add arguments to parser_sceneids
sid_p = parser_sceneids.add_argument
sid_p('sceneids', nargs='+', type=int,
help="list of scene IDs corresponding to valid records within the 'scenes' table of the database")
# add arguments to parser_entityids
eid_p = parser_entityids.add_argument
eid_p('entityids', nargs='+', type=str,
help="list of entity IDs corresponding to valid records within the 'scenes' table of the database")
# FIXME satellite and sensor are required
# add arguments to parser_filenames
eid_p = parser_filenames.add_argument
eid_p('filenames', nargs='+', type=str,
help="list of filenames of satellite image archives corresponding to valid records within the 'scenes' "
"table of the database")
# add arguments to parse_constraints
con_p = parser_constraints.add_argument
# TODO
#con_p('constraints', nargs='+', type=str, help="list of entity IDs corresponding to valid records within the "
# "'scenes' table of the database")
# add general arguments # TODO add these configs to each subparser
......@@ -278,9 +222,65 @@ if __name__=='__main__':
parser_filenames.set_defaults(func=run_from_filenames)
parser_constraints.set_defaults(func=run_from_constraints)
return parser
if __name__=='__main__':
# if len(sys.argv)<2:
# # a job ID has not been given
#
# # ID = 26184107
# # ID = 26185175 # 1x TM5
# # ID = 26185176 # 1x Landsat
# # ID = 26185177 # 1. Sentinel-2-Testszene
# # ID = 26185189 # direkt benachbarte Granules von 1. Sentinel-2-Testszene
# # ID = 26185237 # 4 x Landsat-8 -> Job per database tools erstellt
# # ID = 26185239 # 50 x Landsat-8 -> Job per database tools erstellt - 1. L8 Beta-Testjob
# # ID = 26185242 # 1 x Landsat-8 - Bug files_in_archive=None
# # ID = 26185250 # Beta-Job - 219 x L8, 172 x L7, 111 x S2, spatref S2
# # ID = 26185251 # 1x L8, Zielsensor L8
# # ID = 26185252 # 1x L8, Zielsensor L8, spat.ref L8
# # ID = 26185253 # 25x L8, Zielsensor L8, spat.ref L8
# # ID = 26185254 # 10x L8, Zielsensor L8, spat.ref L8
# # ID = 26185255 # 1x L8 Bug 5 corners found -> Grund=Schreibfehler L1A im tiled Python-mode bei mehr als 1 Szene im Job
# # ID = 26185256 # 1x L7 SLC off, Zielsensor L8, spat.ref L8
# # ID = 26185257 # Beta-Job - 219 x L8, 172 x L7, 111 x S2, spatref L8
# # ID = 26185258 # Beta-Job - 219 x L8, spatref L8
# # ID = 26185259 # Beta-Job - 172 x L7, spatref L8
# # ID = 26185260 # Beta-Job - 111 x S2, spatref L8
# # ID = 26185268 # 25x L7 SLC off, Zielsensor L8, spat.ref L8
# # ID = 26185269 # 1x L7 SLC off, Bug SpatialIndexMediator
# # ID = 26185270 # 5x L7 SLC off, Bug SpatialIndexMediator
# # ID = 26185275 # 1x L8, spat. Ref. L8 Bug L1B_mask not found
# # ID = 26185264 # 1x L8, Bug L1B_masks not found
# # ID = 26185265 # 1x L8, Bug L2B_masks not found
# # ID = 26185268 # "2x L8, Bug L2B_masks not found, incl. 1x bad archive"
# # ID = 26185269 # "10x L8, Bug L2B_masks not found"
# # ID = 26185272 # "1x S2A Sips"
# ID = 26185273 # "1x L7, target L8, spat.ref L8"
# # ID = 26185275 # "1x L7, target L8, spat.ref L8 L1B Matching failed"
# # ID = 26185276 # "1x L7, target L8, spat.ref L8 L1B Matching window became too small."
# # ID = 26185279 # "GEOMS: 25x L7, target L8, spat.ref L8"
# # ID = 26185280 # "GEOMS: 1x L7, target L8, spat.ref L8, debugging NoneType object is not subscriptable within mapinfo2geotransform"
# # ID = 26185281 # "GEOMS: 4x L7, target L8, spat.ref L8, freeze of pool.map"
# # ID = 26185283 # "GEOMS: 10x L7, target L8, spat.ref L8, freeze of pool.map"
# # ID = 26185284 # "GEOMS: 11x L7, target L8, spat.ref L8, freeze of pool.map"
# # ID = 26185321 # "GEOMS: 1x L7, target L8, spat.ref L8, debugging L1B_P"
# # ID = 26185322 # "GEOMS: 1x L7, target L8, spat.ref L8, Bug calc_shifted_cross_power_spectrum: NoneType object not iterable"
# # ID = 26185277 # "GMS41: 10x L7, target L8, spat.ref L8, Permission errors during logging"
# # ID = 26185278 # "Beta-Job - 172 x L7, spatref L8"
# # ID = 26185284 # "GMS41: "all beta-L8 with cloud cover <30% (74 scenes)"
# # ID = 26185285 # "GMS41: "all beta-L7 with cloud cover <30% (49 scenes)"
# # ID = 26185396 # "GEOMS: 1x S2A multi GSD testing"
# # ID = 26185398 # "GEOMS: 1x S2A granule multi GSD testing"
#
# else:
# ID = int(sys.argv[1])
# RUN!
parsed_args = parser.parse_args()
parsed_args = get_gms_argparser().parse_args()
parsed_args.func(parsed_args)
print('\nready.')
......
......@@ -40,7 +40,7 @@ import geomultisens
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode']
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode', 'sphinx.ext.todo', 'sphinxarg.ext']
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
......
......@@ -5,3 +5,17 @@ Usage
To use GeoMultiSens in a project::
import geomultisens
GeoMultiSens command line interface
***********************************
run_gms.py
--------------
At the command line, GeoMultiSens provides the **run_gms.py** command:
.. argparse::
:filename: ./../bin/run_gms.py
:func: get_gms_argparser
:prog: run_gms.py
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment