Commit c8d78739f48e60df75500105a640cde60fab05fb
1 parent
df7d7a8a
Code formatting an renaming of csiactdload to csiactcopy
Showing
6 changed files
with
19 additions
and
17 deletions
cscripts/Makefile.am
| ... | ... | @@ -5,14 +5,14 @@ pythonscripts = __init__.py \ |
| 5 | 5 | cspull.py cssens.py cstsdist.py cscaldb.py csresmap.py \ |
| 6 | 6 | csiactobs.py csiactdata.py csobsdef.py csspec.py cslightcrv.py csobsinfo.py \ |
| 7 | 7 | csinfo.py csmodelinfo.py csmodelmerge.py cstsmapmerge.py \ |
| 8 | - csobs2caldb.py csfindobs.py csiactdload.py \ | |
| 8 | + csobs2caldb.py csfindobs.py csiactcopy.py \ | |
| 9 | 9 | obsutils.py |
| 10 | 10 | |
| 11 | 11 | # Scripts for which symbolic links will be created in bindir |
| 12 | 12 | linkscripts = cspull cssens cstsdist cscaldb csresmap \ |
| 13 | 13 | csiactobs csiactdata csobsdef csspec cslightcrv csobsinfo \ |
| 14 | 14 | csinfo csmodelinfo csmodelmerge cstsmapmerge \ |
| 15 | - csobs2caldb csfindobs csiactdload | |
| 15 | + csobs2caldb csfindobs csiactcopy | |
| 16 | 16 | |
| 17 | 17 | # Distribute scripts |
| 18 | 18 | EXTRA_DIST = $(binscripts) $(pythonscripts) | ... | ... |
cscripts/__init__.py.in
| ... | ... | @@ -39,7 +39,7 @@ __all__ = [ |
| 39 | 39 | "csfindobs", |
| 40 | 40 | "csiactobs", |
| 41 | 41 | "csiactdata", |
| 42 | - "csiactdload", | |
| 42 | + "csiactcopy", | |
| 43 | 43 | "obsutils", |
| 44 | 44 | "test", |
| 45 | 45 | ] |
| ... | ... | @@ -64,7 +64,7 @@ from .cstsmapmerge import cstsmapmerge |
| 64 | 64 | from .csfindobs import csfindobs |
| 65 | 65 | from .csiactobs import csiactobs |
| 66 | 66 | from .csiactdata import csiactdata |
| 67 | -from .csiactdload import csiactdload | |
| 67 | +from .csiactcopy import csiactcopy | |
| 68 | 68 | from . import obsutils |
| 69 | 69 | |
| 70 | 70 | # Add test function | ... | ... |
cscripts/csiactdload.py renamed to cscripts/csiactcopy.py
| ... | ... | @@ -2,7 +2,7 @@ |
| 2 | 2 | # ========================================================================== |
| 3 | 3 | # Download IACT data from remote machine |
| 4 | 4 | # |
| 5 | -# Copyright (C) 2015 Michael Mayer | |
| 5 | +# Copyright (C) 2016 Michael Mayer | |
| 6 | 6 | # |
| 7 | 7 | # This program is free software: you can redistribute it and/or modify |
| 8 | 8 | # it under the terms of the GNU General Public License as published by |
| ... | ... | @@ -28,7 +28,7 @@ import shutil |
| 28 | 28 | # ================ # |
| 29 | 29 | # csiactdata class # |
| 30 | 30 | # ================ # |
| 31 | -class csiactdload(ctools.cscript): | |
| 31 | +class csiactcopy(ctools.cscript): | |
| 32 | 32 | """ |
| 33 | 33 | This script copies IACT data from one location to another. |
| 34 | 34 | It can take a list of observation IDs to allow the download specific |
| ... | ... | @@ -39,7 +39,7 @@ class csiactdload(ctools.cscript): |
| 39 | 39 | Constructor. |
| 40 | 40 | """ |
| 41 | 41 | # Set name |
| 42 | - self.name = "csiactdload" | |
| 42 | + self.name = "csiactcopy" | |
| 43 | 43 | self.version = "1.1.0" |
| 44 | 44 | self.datapath = os.getenv("VHEFITS","") |
| 45 | 45 | |
| ... | ... | @@ -91,7 +91,7 @@ class csiactdload(ctools.cscript): |
| 91 | 91 | pars.append(gammalib.GApplicationPar("outpath","s","a","/path/to/fits","","","Destination path of FITS data")) |
| 92 | 92 | pars.append(gammalib.GApplicationPar("runlist","f","h","NONE","","","List of observation IDs")) |
| 93 | 93 | pars.append_standard() |
| 94 | - pars.append(gammalib.GApplicationPar("logfile","f","h","csiactdload.log","","","Log filename")) | |
| 94 | + pars.append(gammalib.GApplicationPar("logfile","f","h","csiactcopy.log","","","Log filename")) | |
| 95 | 95 | pars.save(parfile) |
| 96 | 96 | |
| 97 | 97 | # Return |
| ... | ... | @@ -169,11 +169,13 @@ class csiactdload(ctools.cscript): |
| 169 | 169 | self.log.parformat("Number of observations") |
| 170 | 170 | self.log(str(len(self.runlist))) |
| 171 | 171 | self.log("\n") |
| 172 | + | |
| 172 | 173 | # Copy all data if runlist file is "NONE" |
| 173 | 174 | elif self.m_runlist == "NONE": |
| 174 | 175 | if self.logTerse(): |
| 175 | 176 | self.log("Copy all available data") |
| 176 | 177 | self.log("\n") |
| 178 | + | |
| 177 | 179 | # Raise exception if file not valid |
| 178 | 180 | else: |
| 179 | 181 | raise RuntimeError("*** ERROR: Runlist file \""+self.m_runlist+"\" not available") |
| ... | ... | @@ -374,7 +376,7 @@ class csiactdload(ctools.cscript): |
| 374 | 376 | |
| 375 | 377 | if filesize > 0.0: |
| 376 | 378 | total_size += filesize |
| 377 | - n_copied += 1 | |
| 379 | + n_copied += 1 | |
| 378 | 380 | |
| 379 | 381 | # Increment counter |
| 380 | 382 | k += 1 |
| ... | ... | @@ -724,7 +726,7 @@ if __name__ == '__main__': |
| 724 | 726 | Copy IACT data |
| 725 | 727 | """ |
| 726 | 728 | # Create instance of application |
| 727 | - app = csiactdload(sys.argv) | |
| 729 | + app = csiactcopy(sys.argv) | |
| 728 | 730 | |
| 729 | 731 | # Open logfile |
| 730 | 732 | app.logFileOpen() | ... | ... |
cscripts/csiactobs.py
| ... | ... | @@ -47,10 +47,10 @@ class csiactobs(ctools.cscript): |
| 47 | 47 | |
| 48 | 48 | # Initialise some members |
| 49 | 49 | self.m_ebounds = gammalib.GEbounds() |
| 50 | - self.datapath = os.getenv("VHEFITS","") | |
| 51 | - self.inmodels = None | |
| 52 | - self.xml = gammalib.GXml() | |
| 53 | - self.models = gammalib.GModels() | |
| 50 | + self.datapath = os.getenv("VHEFITS","") | |
| 51 | + self.inmodels = None | |
| 52 | + self.xml = gammalib.GXml() | |
| 53 | + self.models = gammalib.GModels() | |
| 54 | 54 | |
| 55 | 55 | # Make sure that parfile exists |
| 56 | 56 | file = self.parfile() | ... | ... |
doc/source/reference_manual/csiactdload.rst renamed to doc/source/reference_manual/csiactcopy.rst
doc/source/reference_manual/index.rst
| ... | ... | @@ -61,4 +61,4 @@ IACT cscripts |
| 61 | 61 | csiactdata --- Shows information about IACT data available on the user machine <csiactdata> |
| 62 | 62 | csiactobs --- Generates observation definition file for IACT data from observation IDs <csiactobs> |
| 63 | 63 | csfindobs --- Generates a list of IACT observation IDs <csfindobs> |
| 64 | - csiactdload --- Copies IACT data from one location to another <csiactdload> | |
| 64 | + csiactcopy --- Copies IACT data from one location to another <csiactcopy> | ... | ... |