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