Commit 23763bbce3aac7edff218b60ac96be3104ad3e59
1 parent
394d719a
Integrate code
Showing
3 changed files
with
9 additions
and
17 deletions
cscripts/cscaldb.py
| ... | ... | @@ -121,7 +121,7 @@ class cscaldb(ctools.cscript): |
| 121 | 121 | |
| 122 | 122 | # Extract response names from calibrations and append them to the |
| 123 | 123 | # response name list |
| 124 | - nrows = calibrations.length() | |
| 124 | + nrows = calibrations.nrows() | |
| 125 | 125 | ncols = calibrations.number() |
| 126 | 126 | for row in range(nrows): |
| 127 | 127 | for col in range(ncols): | ... | ... |
cscripts/csiactcopy.py
| ... | ... | @@ -239,7 +239,7 @@ class csiactcopy(ctools.cscript): |
| 239 | 239 | |
| 240 | 240 | # Loop over rows and columns to copy over values exteding remote HDU |
| 241 | 241 | for col in tmp_hdu: |
| 242 | - for row in range(col.length()): | |
| 242 | + for row in range(col.nrows()): | |
| 243 | 243 | remote_hdu[col.name()][size + row] = col[row] |
| 244 | 244 | |
| 245 | 245 | # Get remote obs_id |
| ... | ... | @@ -329,7 +329,7 @@ class csiactcopy(ctools.cscript): |
| 329 | 329 | remote_col = remote_hdu[i] |
| 330 | 330 | |
| 331 | 331 | # Loop over entries and merge |
| 332 | - for j in range(remote_col.length()): | |
| 332 | + for j in range(remote_col.nrows()): | |
| 333 | 333 | local_col[j+old_local_rows] = remote_col[j] |
| 334 | 334 | |
| 335 | 335 | # Save local fits file | ... | ... |
cscripts/csresmap.py
| ... | ... | @@ -34,7 +34,7 @@ class csresmap(ctools.cscript): |
| 34 | 34 | # Constructor |
| 35 | 35 | def __init__(self, *argv): |
| 36 | 36 | """ |
| 37 | - Constructor. | |
| 37 | + Constructor | |
| 38 | 38 | """ |
| 39 | 39 | # Set name |
| 40 | 40 | self._name = 'csresmap' |
| ... | ... | @@ -113,13 +113,13 @@ class csresmap(ctools.cscript): |
| 113 | 113 | self['nypix'].integer() |
| 114 | 114 | self['binsz'].real() |
| 115 | 115 | self['ebinalg'].string() |
| 116 | - if self['ebinalg'].string() == "FILE": | |
| 116 | + if self['ebinalg'].string() == 'FILE': | |
| 117 | 117 | self['ebinfile'].filename() |
| 118 | 118 | else: |
| 119 | 119 | self['emin'].real() |
| 120 | 120 | self['emax'].real() |
| 121 | 121 | self['enumbins'].integer() |
| 122 | - | |
| 122 | + | |
| 123 | 123 | # Query parameters |
| 124 | 124 | self['edisp'].boolean() |
| 125 | 125 | self['algorithm'].string() |
| ... | ... | @@ -152,11 +152,7 @@ class csresmap(ctools.cscript): |
| 152 | 152 | self._get_parameters() |
| 153 | 153 | |
| 154 | 154 | # Write observation into logger |
| 155 | - if self._logTerse(): | |
| 156 | - self._log('\n') | |
| 157 | - self._log.header1(gammalib.number('Observation',len(self._obs))) | |
| 158 | - self._log(str(self._obs)) | |
| 159 | - self._log('\n') | |
| 155 | + self._log_observations(gammalib.NORMAL, self._obs, 'Observation') | |
| 160 | 156 | |
| 161 | 157 | # If a counts and model cube are specified then load them as sky map |
| 162 | 158 | if self._use_maps: |
| ... | ... | @@ -175,9 +171,7 @@ class csresmap(ctools.cscript): |
| 175 | 171 | else: |
| 176 | 172 | |
| 177 | 173 | # Write header |
| 178 | - if self._logTerse(): | |
| 179 | - self._log('\n') | |
| 180 | - self._log.header1('Generate binned map (ctbin)') | |
| 174 | + self._log_header1(gammalib.TERSE, 'Generate binned map (ctbin)') | |
| 181 | 175 | |
| 182 | 176 | # Create countsmap |
| 183 | 177 | bin = ctools.ctbin(self._obs) |
| ... | ... | @@ -207,9 +201,7 @@ class csresmap(ctools.cscript): |
| 207 | 201 | countmap = cta_counts_cube.counts() |
| 208 | 202 | |
| 209 | 203 | # Write header |
| 210 | - if self._logTerse(): | |
| 211 | - self._log('\n') | |
| 212 | - self._log.header1('Generate model map (ctmodel)') | |
| 204 | + self._log_header1(gammalib.TERSE, 'Generate model map (ctmodel)') | |
| 213 | 205 | |
| 214 | 206 | # Create model map |
| 215 | 207 | model = ctools.ctmodel(self._obs) | ... | ... |