Commit f7c5fe8b9883ac280e336b71aab0673a8599c1a7
1 parent
d8e86a14
csobsselect accepts an observation container upon construction and returns an ob…
…servation container through the obs() method.
Showing
1 changed file
with
10 additions
and
2 deletions
cscripts/csobsselect.py
| @@ -55,8 +55,10 @@ class csobsselect(ctools.cscript): | @@ -55,8 +55,10 @@ class csobsselect(ctools.cscript): | ||
| 55 | """ | 55 | """ |
| 56 | Get parameters from parfile and setup observations | 56 | Get parameters from parfile and setup observations |
| 57 | """ | 57 | """ |
| 58 | - # Query input parameters | ||
| 59 | - self['inobs'].filename() | 58 | + # If there are no observations in container then query the inobs |
| 59 | + # parameter | ||
| 60 | + if self._obs.size() == 0: | ||
| 61 | + self['inobs'].filename() | ||
| 60 | 62 | ||
| 61 | # Query relevant pointing selection parameters | 63 | # Query relevant pointing selection parameters |
| 62 | pntselect = self['pntselect'].string() | 64 | pntselect = self['pntselect'].string() |
| @@ -327,6 +329,12 @@ class csobsselect(ctools.cscript): | @@ -327,6 +329,12 @@ class csobsselect(ctools.cscript): | ||
| 327 | # Return | 329 | # Return |
| 328 | return | 330 | return |
| 329 | 331 | ||
| 332 | + def obs(self): | ||
| 333 | + """ | ||
| 334 | + Return observation container | ||
| 335 | + """ | ||
| 336 | + return self._obs | ||
| 337 | + | ||
| 330 | def execute(self): | 338 | def execute(self): |
| 331 | """ | 339 | """ |
| 332 | Execute the script | 340 | Execute the script |