From f7c5fe8b9883ac280e336b71aab0673a8599c1a7 Mon Sep 17 00:00:00 2001 From: Jürgen Knödlseder Date: Tue, 13 Jun 2017 09:18:43 +0200 Subject: [PATCH] csobsselect accepts an observation container upon construction and returns an observation container through the obs() method. --- cscripts/csobsselect.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/cscripts/csobsselect.py b/cscripts/csobsselect.py index bcc9969..54f66e2 100755 --- a/cscripts/csobsselect.py +++ b/cscripts/csobsselect.py @@ -55,8 +55,10 @@ class csobsselect(ctools.cscript): """ Get parameters from parfile and setup observations """ - # Query input parameters - self['inobs'].filename() + # If there are no observations in container then query the inobs + # parameter + if self._obs.size() == 0: + self['inobs'].filename() # Query relevant pointing selection parameters pntselect = self['pntselect'].string() @@ -327,6 +329,12 @@ class csobsselect(ctools.cscript): # Return return + def obs(self): + """ + Return observation container + """ + return self._obs + def execute(self): """ Execute the script -- libgit2 0.21.4