diff --git a/cscripts/cscaldb.py b/cscripts/cscaldb.py index d43f342..7b61a27 100755 --- a/cscripts/cscaldb.py +++ b/cscripts/cscaldb.py @@ -121,7 +121,7 @@ class cscaldb(ctools.cscript): # Extract response names from calibrations and append them to the # response name list - nrows = calibrations.length() + nrows = calibrations.nrows() ncols = calibrations.number() for row in range(nrows): for col in range(ncols): diff --git a/cscripts/csiactcopy.py b/cscripts/csiactcopy.py index fe11a3f..05bd4f7 100755 --- a/cscripts/csiactcopy.py +++ b/cscripts/csiactcopy.py @@ -239,7 +239,7 @@ class csiactcopy(ctools.cscript): # Loop over rows and columns to copy over values exteding remote HDU for col in tmp_hdu: - for row in range(col.length()): + for row in range(col.nrows()): remote_hdu[col.name()][size + row] = col[row] # Get remote obs_id @@ -329,7 +329,7 @@ class csiactcopy(ctools.cscript): remote_col = remote_hdu[i] # Loop over entries and merge - for j in range(remote_col.length()): + for j in range(remote_col.nrows()): local_col[j+old_local_rows] = remote_col[j] # Save local fits file diff --git a/cscripts/csresmap.py b/cscripts/csresmap.py index 3136ee3..ae53697 100755 --- a/cscripts/csresmap.py +++ b/cscripts/csresmap.py @@ -34,7 +34,7 @@ class csresmap(ctools.cscript): # Constructor def __init__(self, *argv): """ - Constructor. + Constructor """ # Set name self._name = 'csresmap' @@ -113,13 +113,13 @@ class csresmap(ctools.cscript): self['nypix'].integer() self['binsz'].real() self['ebinalg'].string() - if self['ebinalg'].string() == "FILE": + if self['ebinalg'].string() == 'FILE': self['ebinfile'].filename() else: self['emin'].real() self['emax'].real() self['enumbins'].integer() - + # Query parameters self['edisp'].boolean() self['algorithm'].string() @@ -152,11 +152,7 @@ class csresmap(ctools.cscript): self._get_parameters() # Write observation into logger - if self._logTerse(): - self._log('\n') - self._log.header1(gammalib.number('Observation',len(self._obs))) - self._log(str(self._obs)) - self._log('\n') + self._log_observations(gammalib.NORMAL, self._obs, 'Observation') # If a counts and model cube are specified then load them as sky map if self._use_maps: @@ -175,9 +171,7 @@ class csresmap(ctools.cscript): else: # Write header - if self._logTerse(): - self._log('\n') - self._log.header1('Generate binned map (ctbin)') + self._log_header1(gammalib.TERSE, 'Generate binned map (ctbin)') # Create countsmap bin = ctools.ctbin(self._obs) @@ -207,9 +201,7 @@ class csresmap(ctools.cscript): countmap = cta_counts_cube.counts() # Write header - if self._logTerse(): - self._log('\n') - self._log.header1('Generate model map (ctmodel)') + self._log_header1(gammalib.TERSE, 'Generate model map (ctmodel)') # Create model map model = ctools.ctmodel(self._obs)