diff --git a/examples/generate_prod3_irfs.py b/examples/generate_prod3_irfs.py index fbb263d..15e4a91 100755 --- a/examples/generate_prod3_irfs.py +++ b/examples/generate_prod3_irfs.py @@ -30,12 +30,21 @@ def set_prod3_desy(): Set Prod3 DESY database. """ # Set database attributes - path = "/project-data/cta/performance/prod3" - psftype = "Gauss" + #path = '/project-data/cta/performance/prod3' + #file = 'DESY.d20160304.V5.ID0NIM2.prod3-paranalp05-NN.S.3HB1-ND-3.180000s.root' + path = 'data' + file = 'irf.root' + psftype = 'Gauss' + oversample = 3 + norm1d = True + bgdinfill = False + bgdethres = 10.0 # Set database content - db = [{'inst': "prod3", 'id': "South_50h", 'psftype': psftype, 'path': path, - 'file': "DESY.d20160304.V5.ID0NIM2.prod3-paranalp05-NN.S.3HB1-ND-3.180000s.root"} + db = [{'inst': 'prod3', 'id': 'South_50h', 'psftype': psftype, + 'oversample': oversample, 'norm1d': norm1d, + 'bgdinfill': bgdinfill, 'bgdethres': bgdethres, + 'path': path, 'file': file} ] # Return database @@ -66,23 +75,43 @@ if __name__ == '__main__': bgdscale = entry['bgdscale'] else: bgdscale = 1.0 + if entry.has_key('bgdethres'): + bgdethres = entry['bgdethres'] + else: + bgdethres = 1000.0 + if entry.has_key('bgdinfill'): + bgdinfill = entry['bgdinfill'] + else: + bgdinfill = False + if entry.has_key('oversample'): + oversample = entry['oversample'] + else: + oversample = 1 + if entry.has_key('norm1d'): + norm1d = entry['norm1d'] + else: + norm1d = False # Set filename - filename = entry['path']+"/"+entry['file'] + filename = entry['path']+'/'+entry['file'] # Set-up csroot2caldb caldb = cscripts.csroot2caldb() - caldb["infile"] = filename - caldb["outdir"] = "prod3" - caldb["inst"] = entry['inst'] - caldb["id"] = entry['id'] - caldb["version"] = entry['inst'] - caldb["analysis"] = "DESY" - caldb["psftype"] = entry['psftype'] - caldb["rebin"] = rebin - caldb["eascale"] = eascale - caldb["bgdscale"] = bgdscale - caldb["logfile"] = "generate_prod3_irfs.log" + caldb['infile'] = filename + caldb['outdir'] = 'prod3' + caldb['inst'] = entry['inst'] + caldb['id'] = entry['id'] + caldb['version'] = entry['inst'] + caldb['analysis'] = 'DESY' + caldb['psftype'] = entry['psftype'] + caldb['norm1d'] = norm1d + caldb['rebin'] = rebin + caldb['eascale'] = eascale + caldb['bgdscale'] = bgdscale + caldb['bgdoversample'] = oversample + caldb['bgdethres'] = bgdethres + caldb['bgdinfill'] = bgdinfill + caldb['logfile'] = 'generate_prod3_irfs.log' # Add CALDB entry caldb.execute() diff --git a/examples/benchmark_cta_analysis.py b/test/dev/benchmark_cta_analysis.py index 5fa01d4..5fa01d4 100755 --- a/examples/benchmark_cta_analysis.py +++ b/test/dev/benchmark_cta_analysis.py diff --git a/examples/check_models.py b/test/dev/check_models.py index 2a4902b..2a4902b 100755 --- a/examples/check_models.py +++ b/test/dev/check_models.py diff --git a/examples/simulate_events.py b/test/dev/simulate_events.py index 01fcac6..01fcac6 100755 --- a/examples/simulate_events.py +++ b/test/dev/simulate_events.py diff --git a/test/test_examples.py b/test/test_examples.py index 78b174c..b8ceb0e 100755 --- a/test/test_examples.py +++ b/test/test_examples.py @@ -77,6 +77,7 @@ class Test(gammalib.GPythonTestSuite): self.name('examples') # Append tests + self.append(self.test_generate_prod3_irfs, 'Test generate_prod3_irfs') self.append(self.test_pipeline_binned_disk, 'Test pipeline_binned_disk') self.append(self.test_pipeline_binned_mem, 'Test pipeline_binned_mem') self.append(self.test_pipeline_stacked_disk, 'Test pipeline_stacked_disk') @@ -87,6 +88,19 @@ class Test(gammalib.GPythonTestSuite): # Return return + # Test generate_prod3_irfs + def test_generate_prod3_irfs(self): + """ + Test generate_prod3_irfs + """ + # Execute script + self._execute_python('generate_prod3_irfs') + + #TODO: Do any testing + + # Return + return + # Test pipeline_binned_disk def test_pipeline_binned_disk(self): """