Commit 3ba575b2f0d0916360285c3c0cccd61fece7ab38
1 parent
b4dcdf64
Minor updates on the makefile and the logging in csobsinfo
Showing
2 changed files
with
16 additions
and
9 deletions
cscripts/Makefile.am
| 1 | 1 | ## Process this file with automake to produce Makefile.in |
| 2 | 2 | |
| 3 | 3 | # Scripts to be distributed in bindir |
| 4 | -binscripts = tsmerge.py | |
| 4 | +binscripts = tsmerge.py modelmerge.py | |
| 5 | 5 | |
| 6 | 6 | # Scripts to be distributed in $(pyexecdir)/cscripts |
| 7 | 7 | pythonscripts = __init__.py \ |
| 8 | 8 | cspull.py cssens.py cstsdist.py cscaldb.py csresmap.py \ |
| 9 | - cshessobs.py csobsdef.py csspec.py cslightcrv.py \ | |
| 9 | + cshessobs.py csobsdef.py csspec.py cslightcrv.py csobsinfo.py \ | |
| 10 | 10 | csinfo.py \ |
| 11 | 11 | obsutils.py |
| 12 | 12 | |
| 13 | 13 | # Scripts for which symbolic links will be created in bindir |
| 14 | 14 | linkscripts = cspull cssens cstsdist cscaldb csresmap \ |
| 15 | - cshessobs csobsdef csspec cslightcrv \ | |
| 15 | + cshessobs csobsdef csspec cslightcrv csobsinfo \ | |
| 16 | 16 | csinfo |
| 17 | 17 | |
| 18 | 18 | # Distribute scripts | ... | ... |
cscripts/csobsinfo.py
| ... | ... | @@ -160,17 +160,24 @@ class csobsinfo(ctools.cscript): |
| 160 | 160 | # Loop over observations |
| 161 | 161 | for obs in self.obs: |
| 162 | 162 | |
| 163 | - # Logging | |
| 164 | - if self.logTerse(): | |
| 165 | - self.log.header2(obs.name()) | |
| 166 | - | |
| 163 | + | |
| 167 | 164 | # Skip non-CTA observations |
| 168 | 165 | if not obs.classname() == "GCTAObservation": |
| 169 | 166 | self.log("Skipping "+obs.instrument()+" observation\n") |
| 170 | 167 | continue |
| 171 | 168 | |
| 169 | + # Use observed object as observation name | |
| 170 | + # if name is not given | |
| 171 | + obs_name = obs.name() | |
| 172 | + if obs_name == "": | |
| 173 | + obs_name = obs.object() | |
| 174 | + | |
| 175 | + # Logging | |
| 176 | + if self.logTerse(): | |
| 177 | + self.log.header2(obs_name) | |
| 178 | + | |
| 172 | 179 | # Retrieve observation name |
| 173 | - obs_names.append(obs.name()) | |
| 180 | + obs_names.append(obs_name) | |
| 174 | 181 | |
| 175 | 182 | # Retrieve energy boundaries |
| 176 | 183 | obs_bounds = obs.events().ebounds() |
| ... | ... | @@ -309,7 +316,7 @@ class csobsinfo(ctools.cscript): |
| 309 | 316 | |
| 310 | 317 | # Log mean offset if possible |
| 311 | 318 | if self.m_offset: |
| 312 | - self.log.parformat("Mean offset") | |
| 319 | + self.log.parformat("Mean offset angle") | |
| 313 | 320 | self.log("%.2f"%(sum(self.offsets)/len(self.offsets))) |
| 314 | 321 | self.log("\n") |
| 315 | 322 | ... | ... |