Remove old and unused DataStore methods
@@ -241,100 +241,6 @@ class DataStore(object):
return things
- def check_observations(self):
- """Perform some sanity checks for all observations.
-
- Returns
- -------
- results : OrderedDict
- dictionary containing failure messages for all runs that fail a check.
- """
-
- results = OrderedDict()
-
- # Loop over all obs_ids in obs_table
- for obs_id in self.obs_table['OBS_ID']:
- messages = self.obs(obs_id).check_observation()
- if len(messages) > 0:
- results[obs_id] = messages
-
- return results
-
- def check_integrity(self, logger=None):
- """Check integrity, i.e. whether index and observation table match.
- """
- # Todo: This is broken - remove or fix?
- sane = True
- if logger is None:
- logger = logging.getLogger('default')
-
- logger.info('Checking event list files')
- available = self.check_available_event_lists(logger)
- if np.any(~available):
- logger.warning('Number of missing event list files: {}'.format(np.invert(available).sum()))
-
- # TODO: implement better, more complete integrity checks.
- return sane
-
- def make_table_of_files(self, observation_table=None, filetypes=['events']):
- """Make list of files in the datastore directory.
-
- Parameters
- ----------
- observation_table : `~gammapy.data.ObservationTable` or None
- Observation table (``None`` means select all observations).
- filetypes : list of str
- File types (TODO: document in a central location and reference from here).
-
- Returns
- -------
- table : `~astropy.table.Table`
- Table summarising info about files.
- """
- # TODO : remove or fix
- raise NotImplementedError
-
- if observation_table is None:
- observation_table = ObservationTable(self.obs_table)
-
- data = []
- for observation in observation_table:
- for filetype in filetypes:
- row = dict()
- row['OBS_ID'] = observation['OBS_ID']
- row['filetype'] = filetype
- filename = self.filename(observation['OBS_ID'], filetype=filetype, abspath=True)
- row['filename'] = filename
- data.append(row)
-
- return Table(data=data, names=['OBS_ID', 'filetype', 'filename'])
-
- def check_available_event_lists(self, logger=None):
- """Check if all event lists are available.
-
- TODO: extend this function, or combine e.g. with ``make_table_of_files``.
-
- Returns
- -------
- file_available : `~numpy.ndarray`
- Boolean mask which files are available.
- """
- # TODO: This is broken. Remove (covered by HDUlocation class)?
- raise NotImplementedError
-
- observation_table = self.obs_table
- file_available = np.ones(len(observation_table), dtype='bool')
- for ii in range(len(observation_table)):
- obs_id = observation_table['OBS_ID'][ii]
- filename = self.filename(obs_id)
- if not make_path(filename).is_file():
- file_available[ii] = False
- if logger:
- logger.warning('For OBS_ID = {:06d} the event list file is missing: {}'
- ''.format(obs_id, filename))
-
- return file_available
-
def copy_obs(self, obs_id, outdir, hdu_class=None, verbose=False, overwrite=False):
"""Create a new `~gammapy.data.DataStore` containing a subset of observations.
