33 Inspect an IACT data storage
35 This script inspects the available FITS data storage on the user machine
36 and writes information about the available FITS configurations into a log
37 file or prints it on the screen. These information can be used as input
47 self._init_cscript(self.__class__.__name__, ctools.__version__, argv)
62 Get parameters from parfile and setup the observation
66 datapath = self[
'datapath'].string()
67 if gammalib.toupper(datapath) !=
'NONE':
81 raise RuntimeError(
'Master index file "'+self.
_master_file+
82 '" not found. Use hidden parameter '+
83 '"master_indx" to specifiy a different '+
87 self._log_parameters(gammalib.TERSE)
100 Dictionary containing data configuration
103 self._log_header3(gammalib.TERSE, str(config[
'name']))
104 self._log_value(gammalib.TERSE,
'Name', config[
'name'])
105 self._log_value(gammalib.TERSE,
'Observation index', config[
'obsindx'])
106 self._log_value(gammalib.TERSE,
'HDU index', config[
'hduindx'])
112 if key
in [
'name',
'hduindx',
'obsindx']:
114 self._log_value(gammalib.TERSE, key, config[key])
131 self._log.header1(
'Data storage entries')
132 self._log.parformat(
'Master index file')
138 data = json.loads(json_data)
139 configs = data[
'datasets']
146 self._log.header2(
'Available data configs')
149 for config
in configs:
152 hdu = os.path.join(self.
_datapath, config[
'hduindx'])
153 obs = os.path.join(self.
_datapath, config[
'obsindx'])
154 filename_hdu = gammalib.GFilename(str(hdu)+
'[HDU_INDEX]')
155 filename_obs = gammalib.GFilename(str(obs)+
'[OBS_INDEX]')
159 if (filename_hdu.is_fits()
and filename_obs.is_fits()):
162 self._prodnames.append(str(config[
'name']))
170 self._log.header3(str(config[
'name']))
171 self._log(
' Not available\n')
178 Return available FITS production names
183 List of available FITS production names.
192 if __name__ ==
'__main__':