diff --git a/cscripts/Makefile.am b/cscripts/Makefile.am index 55fa0ed..d480368 100644 --- a/cscripts/Makefile.am +++ b/cscripts/Makefile.am @@ -5,14 +5,14 @@ pythonscripts = __init__.py \ cspull.py cssens.py cstsdist.py cscaldb.py csresmap.py \ csiactobs.py csiactdata.py csobsdef.py csspec.py cslightcrv.py csobsinfo.py \ csinfo.py csmodelinfo.py csmodelmerge.py cstsmapmerge.py \ - csobs2caldb.py csfindobs.py csiactdload.py \ + csobs2caldb.py csfindobs.py csiactcopy.py \ obsutils.py # Scripts for which symbolic links will be created in bindir linkscripts = cspull cssens cstsdist cscaldb csresmap \ csiactobs csiactdata csobsdef csspec cslightcrv csobsinfo \ csinfo csmodelinfo csmodelmerge cstsmapmerge \ - csobs2caldb csfindobs csiactdload + csobs2caldb csfindobs csiactcopy # Distribute scripts EXTRA_DIST = $(binscripts) $(pythonscripts) diff --git a/cscripts/__init__.py.in b/cscripts/__init__.py.in index 2e3bfa2..d67c23b 100644 --- a/cscripts/__init__.py.in +++ b/cscripts/__init__.py.in @@ -39,7 +39,7 @@ __all__ = [ "csfindobs", "csiactobs", "csiactdata", - "csiactdload", + "csiactcopy", "obsutils", "test", ] @@ -64,7 +64,7 @@ from .cstsmapmerge import cstsmapmerge from .csfindobs import csfindobs from .csiactobs import csiactobs from .csiactdata import csiactdata -from .csiactdload import csiactdload +from .csiactcopy import csiactcopy from . import obsutils # Add test function diff --git a/cscripts/csiactdload.py b/cscripts/csiactcopy.py index 165b290..17d82be 100755 --- a/cscripts/csiactdload.py +++ b/cscripts/csiactcopy.py @@ -2,7 +2,7 @@ # ========================================================================== # Download IACT data from remote machine # -# Copyright (C) 2015 Michael Mayer +# Copyright (C) 2016 Michael Mayer # # 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 @@ -28,7 +28,7 @@ import shutil # ================ # # csiactdata class # # ================ # -class csiactdload(ctools.cscript): +class csiactcopy(ctools.cscript): """ This script copies IACT data from one location to another. It can take a list of observation IDs to allow the download specific @@ -39,7 +39,7 @@ class csiactdload(ctools.cscript): Constructor. """ # Set name - self.name = "csiactdload" + self.name = "csiactcopy" self.version = "1.1.0" self.datapath = os.getenv("VHEFITS","") @@ -91,7 +91,7 @@ class csiactdload(ctools.cscript): pars.append(gammalib.GApplicationPar("outpath","s","a","/path/to/fits","","","Destination path of FITS data")) pars.append(gammalib.GApplicationPar("runlist","f","h","NONE","","","List of observation IDs")) pars.append_standard() - pars.append(gammalib.GApplicationPar("logfile","f","h","csiactdload.log","","","Log filename")) + pars.append(gammalib.GApplicationPar("logfile","f","h","csiactcopy.log","","","Log filename")) pars.save(parfile) # Return @@ -169,11 +169,13 @@ class csiactdload(ctools.cscript): self.log.parformat("Number of observations") self.log(str(len(self.runlist))) self.log("\n") + # Copy all data if runlist file is "NONE" elif self.m_runlist == "NONE": if self.logTerse(): self.log("Copy all available data") self.log("\n") + # Raise exception if file not valid else: raise RuntimeError("*** ERROR: Runlist file \""+self.m_runlist+"\" not available") @@ -374,7 +376,7 @@ class csiactdload(ctools.cscript): if filesize > 0.0: total_size += filesize - n_copied += 1 + n_copied += 1 # Increment counter k += 1 @@ -724,7 +726,7 @@ if __name__ == '__main__': Copy IACT data """ # Create instance of application - app = csiactdload(sys.argv) + app = csiactcopy(sys.argv) # Open logfile app.logFileOpen() diff --git a/cscripts/csiactobs.py b/cscripts/csiactobs.py index db2b794..50c60cc 100755 --- a/cscripts/csiactobs.py +++ b/cscripts/csiactobs.py @@ -47,10 +47,10 @@ class csiactobs(ctools.cscript): # Initialise some members self.m_ebounds = gammalib.GEbounds() - self.datapath = os.getenv("VHEFITS","") - self.inmodels = None - self.xml = gammalib.GXml() - self.models = gammalib.GModels() + self.datapath = os.getenv("VHEFITS","") + self.inmodels = None + self.xml = gammalib.GXml() + self.models = gammalib.GModels() # Make sure that parfile exists file = self.parfile() diff --git a/doc/source/reference_manual/csiactdload.rst b/doc/source/reference_manual/csiactcopy.rst index b9dafae..182417b 100644 --- a/doc/source/reference_manual/csiactdload.rst +++ b/doc/source/reference_manual/csiactcopy.rst @@ -1,6 +1,6 @@ -.. _csiactdload: +.. _csiactcopy: -csiactdload +csiactcopy =========== Copies IACT data from one location to another diff --git a/doc/source/reference_manual/index.rst b/doc/source/reference_manual/index.rst index c8f548b..bc42824 100644 --- a/doc/source/reference_manual/index.rst +++ b/doc/source/reference_manual/index.rst @@ -61,4 +61,4 @@ IACT cscripts csiactdata --- Shows information about IACT data available on the user machine csiactobs --- Generates observation definition file for IACT data from observation IDs csfindobs --- Generates a list of IACT observation IDs - csiactdload --- Copies IACT data from one location to another + csiactcopy --- Copies IACT data from one location to another