Commit c9766620 authored by Ambra Di Piano's avatar Ambra Di Piano
Browse files

add mapper configuration

parent 0b2b272f
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@ class CheckConfiguration():
        return self

    def check_simulator(self):
        keys = ['name', 'array', 'irf', 'prod', 'pointing', 'duration', 'samples', 'seed', 'model']
        keys = ['name', 'array', 'irf', 'prod', 'pointing', 'duration', 'samples', 'seed', 'model', 'output']
        assert self.conf['simulator'].keys() == keys
        assert type(self.conf['simulator']['name']) == str
        assert type(self.conf['simulator']['array']) in ['lst', 'mst', 'sst', 'cta', 'north', 'south']
@@ -36,6 +36,7 @@ class CheckConfiguration():
        assert type(self.conf['simulator']['samples']) == int
        assert type(self.conf['simulator']['seed']) == int
        assert type(self.conf['simulator']['model']) == str
        assert type(self.conf['simulator']['output']) == str
        return self

    def check_visibility(self):
@@ -64,3 +65,13 @@ class CheckConfiguration():
        assert type(self.conf['slurm']['account']) == str 
        assert type(self.conf['slurm']['partition']) == str 
        return self
    
    def check_mapper(self):
        keys = ['exposure', 'smooth', 'center', 'region', 'output']
        assert self.conf['mapper'].keys() == keys
        assert type(self.conf['mapper']['exposure']) == int
        assert type(self.conf['mapper']['smooth']) == (float or int)
        assert type(self.conf['mapper']['center']) in ['pointing', 'source'] 
        assert type(self.conf['mapper']['region']) == bool
        assert type(self.conf['mapper']['output']) == str
        return self
 No newline at end of file
+7 −0
Original line number Diff line number Diff line
@@ -10,6 +10,13 @@ simulator:
  model: $TEMPLATES$/crab.xml
  output: /data01/homes/dipiano/astroRT/astrort/testing/tmp
  
mapper:
  exposure: 10
  smooth: 1
  center: pointing
  region: false
  output: /data01/homes/dipiano/astroRT/astrort/testing/tmp

visibility:
  start_time: '2030-01-01T00:00:00'

+7 −0
Original line number Diff line number Diff line
@@ -54,3 +54,10 @@ class TestCheckConfiguration:
            CheckConfiguration(configuration=configuration).check_logging()
        except AssertionError as e:
            type(e) == AssertionError

    def test_check_mapper(self, test_conf_file):
        configuration = load_yaml_conf(test_conf_file)
        try:
            CheckConfiguration(configuration=configuration).check_mapper()
        except AssertionError as e:
            type(e) == AssertionError
 No newline at end of file