Commit bd42954f6ebb44686394b0e879c4c9c491ff82cf

Authored by Jürgen Knödlseder
1 parent 0ffbb73c

Remove "pattern" and "offset" parameters from cspull and cstsdist

These parameters are no longer needed since an observation definition file with arbitrary pointings can now be specified on input
cscripts/cspull.par
... ... @@ -30,6 +30,7 @@ outfile, f, a, pull.dat,,, "Output pull distribution file"
30 30 ntrials, i, a, 10,,, "Number of trials"
31 31 ra, r, a, 83.6331,0,360, "RA of pointing (degrees)"
32 32 dec, r, a, 22.0145,-90,90, "Dec of pointing (degrees)"
  33 +rad, r, h, 5.0,0,180, "Radius of ROI (degrees)"
33 34 coordsys, s, a, CEL,CEL|GAL,, "Coordinate system (CEL - celestial, GAL - galactic)"
34 35 proj, s, a, TAN,AIT|AZP|CAR|GLS|MER|MOL|SFL|SIN|STG|TAN,, "Projection method"
35 36 emin, r, a, 0.1,,, "Lower energy limit (TeV)"
... ... @@ -39,13 +40,9 @@ tmin, t, a, 2020-01-01T00:00:00,,, "Start time (UTC string, JD, MJD or MET i
39 40 tmax, t, a, 2020-01-01T00:30:00,,, "Stop time (UTC string, JD, MJD or MET in seconds)"
40 41 npix, i, a, 200,,, "Number of pixels for binned"
41 42 binsz, r, a, 0.05,,, "Pixel size for binned (degrees/pixel)"
42   -rad, r, h, 5.0,0,180, "Radius of ROI (degrees)"
43   -pattern, s, h, single,single|four,, "Observation pattern"
44   -offset, r, h, 1.5,,, "Observation pattern offset (degrees)"
45 43 profile, b, h, no,,, "Use likelihood profile method for errors?"
46 44 seed, i, h, 1,,, "Initial random number generator seed"
47 45  
48   -
49 46 #
50 47 # Standard parameters
51 48 #====================
... ...
cscripts/cspull.py
... ... @@ -47,7 +47,6 @@ class cspull(ctools.cscript):
47 47 self._coordsys = 'CEL'
48 48 self._proj = 'TAN'
49 49 self._log_clients = False # Static parameter
50   - self._offset = 0.0
51 50 self._ntrials = 0
52 51 self._npix = 0
53 52 self._binsz = 0.0
... ... @@ -74,17 +73,6 @@ class cspull(ctools.cscript):
74 73 if self._obs.size() == 0:
75 74 self._obs = self._get_observations()
76 75  
77   - # Check for requested pattern and set wobble pattern
78   - if self['pattern'].string() == 'four':
79   - tmin = self['tmin'].time(self._time_reference()).secs()
80   - duration = self['tmax'].time(self._time_reference()).secs() - tmin
81   - self._obs = obsutils.set_observations(self['ra'].real(), self['dec'].real(), self['rad'].real(),
82   - tmin, duration,
83   - self['emin'].real(), self['emax'].real(),
84   - self['irf'].string(), self['caldb'].string(),
85   - deadc=self['deadc'].real(),
86   - pattern=self['pattern'].string(), offset=self['offset'].real())
87   -
88 76 # ... otherwise add response information and energy boundaries
89 77 # in case they are missing
90 78 else:
... ... @@ -107,7 +95,6 @@ class cspull(ctools.cscript):
107 95 # Read other parameters
108 96 self._ntrials = self['ntrials'].integer()
109 97 self._edisp = self['edisp'].boolean()
110   - self._offset = self['offset'].real()
111 98 self._seed = self['seed'].integer()
112 99 self._chatter = self['chatter'].integer()
113 100  
... ...
cscripts/cstsdist.par
... ... @@ -35,6 +35,7 @@ outfile, f, a, ts.dat,,, "Output Test Statistic distribution file"
35 35 ntrials, i, a, 10,,, "Number of trials"
36 36 ra, r, a, 83.63,0,360, "RA of pointing (degrees)"
37 37 dec, r, a, 22.01,-90,90, "Dec of pointing (degrees)"
  38 +rad, r, h, 5.0,0,180, "Radius of ROI (degrees)"
38 39 coordsys, s, a, CEL,CEL|GAL,, "Coordinate system (CEL - celestial, GAL - galactic)"
39 40 proj, s, a, TAN,AIT|AZP|CAR|GLS|MER|MOL|SFL|SIN|STG|TAN,, "Projection method"
40 41 emin, r, a, 0.1,,, "Lower energy limit (TeV)"
... ... @@ -44,9 +45,6 @@ tmin, t, a, 2020-01-01T00:00:00,,, "Start time (UTC string, JD, MJD or MET i
44 45 tmax, t, a, 2020-01-01T00:30:00,,, "Stop time (UTC string, JD, MJD or MET in seconds)"
45 46 npix, i, a, 200,,, "Number of pixels for binned"
46 47 binsz, r, a, 0.05,,, "Pixel size for binned (degrees/pixel)"
47   -rad, r, h, 5.0,0,180, "Radius of ROI (degrees)"
48   -pattern, s, h, single,single|four,, "Observation pattern"
49   -offset, r, h, 1.5,,, "Observation pattern offset (degrees)"
50 48  
51 49 #
52 50 # Standard parameters
... ...
cscripts/cstsdist.py
... ... @@ -66,17 +66,6 @@ class cstsdist(ctools.cscript):
66 66 if self._obs.size() == 0:
67 67 self._obs = self._get_observations()
68 68  
69   - # Check for requested pattern and set wobble pattern
70   - if self['pattern'].string() == 'four':
71   - tmin = self['tmin'].time(self._time_reference()).secs()
72   - duration = self['tmax'].time(self._time_reference()).secs() - tmin
73   - self._obs = obsutils.set_observations(self['ra'].real(), self['dec'].real(), self['rad'].real(),
74   - tmin, duration,
75   - self['emin'].real(), self['emax'].real(),
76   - self['irf'].string(), self['caldb'].string(),
77   - deadc=self['deadc'].real(),
78   - pattern=self['pattern'].string(), offset=self['offset'].real())
79   -
80 69 # Get source name
81 70 self._srcname = self['srcname'].string()
82 71  
... ...
doc/source/users/reference_manual/cspull.rst
... ... @@ -50,7 +50,7 @@ General parameters
50 50 ``irf [string]``
51 51 Instrumental response function.
52 52  
53   -``(deadc = 0.95) [real]``
  53 +``(deadc = 0.98) [real]``
54 54 Average deadtime correction factor.
55 55  
56 56 ``(edisp = no) [boolean]``
... ... @@ -68,6 +68,9 @@ General parameters
68 68 ``dec [real]``
69 69 Declination of CTA pointing (J2000, in degrees).
70 70  
  71 +``(rad = 5.0) [real]``
  72 + ROI radius (in degrees).
  73 +
71 74 ``coordsys <CEL|GAL> [string]``
72 75 Coordinate system (CEL - celestial, GAL - galactic).
73 76  
... ... @@ -95,15 +98,6 @@ General parameters
95 98 ``binsz [real]``
96 99 Pixel size for binned analysis.
97 100  
98   -``(rad = 5.0) [real]``
99   - ROI radius (in degrees).
100   -
101   -``(pattern = single) [string]``
102   - Pattern for pointing simulation (single/four).
103   -
104   -``(offset = 1.5) [real]``
105   - Observation pattern offset (in degrees).
106   -
107 101  
108 102 Standard parameters
109 103 -------------------
... ...
doc/source/users/reference_manual/cstsdist.rst
... ... @@ -63,7 +63,7 @@ General parameters
63 63 ``irf [string]``
64 64 Instrumental response function.
65 65  
66   -``(deadc = 0.95) [real]``
  66 +``(deadc = 0.98) [real]``
67 67 Average deadtime correction factor.
68 68  
69 69 ``(edisp = no) [boolean]``
... ... @@ -78,6 +78,9 @@ General parameters
78 78 ``dec [real]``
79 79 Declination of CTA pointing (J2000, in degrees).
80 80  
  81 +``(rad = 5.0) [real]``
  82 + ROI radius (in degrees).
  83 +
81 84 ``coordsys <CEL|GAL> [string]``
82 85 Coordinate system (CEL - celestial, GAL - galactic).
83 86  
... ... @@ -105,15 +108,6 @@ General parameters
105 108 ``binsz [real]``
106 109 Pixel size for binned analysis.
107 110  
108   -``(rad = 5.0) [real]``
109   - Radius of ROI (in degrees).
110   -
111   -``(pattern = single) [string]``
112   - Pattern for pointing simulation (single/four).
113   -
114   -``(offset = 1.5) [real]``
115   - Observation pattern offset (in degrees).
116   -
117 111  
118 112 Standard parameters
119 113 -------------------
... ...
test/test_cstsdist.py
... ... @@ -138,36 +138,6 @@ class Test(test):
138 138 # Check pull distribution file
139 139 self._check_result_file('cstsdist_py1.dat')
140 140  
141   - # Set-up binned cstsdist in four observation wobble mode
142   - tsdist = cscripts.cstsdist()
143   - tsdist['inmodel'] = self._model
144   - tsdist['srcname'] = 'Crab'
145   - tsdist['caldb'] = self._caldb
146   - tsdist['irf'] = self._irf
147   - tsdist['ntrials'] = 1
148   - tsdist['ra'] = 83.63
149   - tsdist['dec'] = 22.01
150   - tsdist['coordsys'] = 'CEL'
151   - tsdist['proj'] = 'TAN'
152   - tsdist['emin'] = 0.1
153   - tsdist['emax'] = 100.0
154   - tsdist['enumbins'] = 10
155   - tsdist['tmin'] = 0.0
156   - tsdist['tmax'] = 1800.0
157   - tsdist['rad'] = 5.0
158   - tsdist['npix'] = 50
159   - tsdist['binsz'] = 0.1
160   - tsdist['pattern'] = 'four'
161   - tsdist['outfile'] = 'cstsdist_py2.dat'
162   - tsdist['logfile'] = 'cstsdist_py2.log'
163   - tsdist['chatter'] = 4
164   -
165   - # Execute cstsdist script
166   - tsdist.execute()
167   -
168   - # Check pull distribution file
169   - self._check_result_file('cstsdist_py2.dat', ncols=9)
170   -
171 141 # Return
172 142 return
173 143  
... ...