Commit 30eeb6af6136ad9b771fec29c3cc3604ab5da904
1 parent
c0ee50ae
Correct code formatting.
Showing
28 changed files
with
561 additions
and
566 deletions
examples/benchmark_cta_analysis.py
| @@ -56,22 +56,22 @@ def unbinned_pipeline(duration): | @@ -56,22 +56,22 @@ def unbinned_pipeline(duration): | ||
| 56 | # Simulate events | 56 | # Simulate events |
| 57 | sim = ctools.ctobssim() | 57 | sim = ctools.ctobssim() |
| 58 | sim["inmodel"] = model_name | 58 | sim["inmodel"] = model_name |
| 59 | - sim["caldb"] = caldb | ||
| 60 | - sim["irf"] = irf | ||
| 61 | - sim["ra"] = ra | ||
| 62 | - sim["dec"] = dec | ||
| 63 | - sim["rad"] = rad_sim | ||
| 64 | - sim["tmin"] = tstart | ||
| 65 | - sim["tmax"] = tstop | ||
| 66 | - sim["emin"] = emin | ||
| 67 | - sim["emax"] = emax | 59 | + sim["caldb"] = caldb |
| 60 | + sim["irf"] = irf | ||
| 61 | + sim["ra"] = ra | ||
| 62 | + sim["dec"] = dec | ||
| 63 | + sim["rad"] = rad_sim | ||
| 64 | + sim["tmin"] = tstart | ||
| 65 | + sim["tmax"] = tstop | ||
| 66 | + sim["emin"] = emin | ||
| 67 | + sim["emax"] = emax | ||
| 68 | sim.run() | 68 | sim.run() |
| 69 | 69 | ||
| 70 | # Select events | 70 | # Select events |
| 71 | select = ctools.ctselect(sim.obs()) | 71 | select = ctools.ctselect(sim.obs()) |
| 72 | - select["ra"] = ra | ||
| 73 | - select["dec"] = dec | ||
| 74 | - select["rad"] = rad_select | 72 | + select["ra"] = ra |
| 73 | + select["dec"] = dec | ||
| 74 | + select["rad"] = rad_select | ||
| 75 | select["tmin"] = tstart | 75 | select["tmin"] = tstart |
| 76 | select["tmax"] = tstop | 76 | select["tmax"] = tstop |
| 77 | select["emin"] = emin | 77 | select["emin"] = emin |
| @@ -125,30 +125,30 @@ def binned_pipeline(duration): | @@ -125,30 +125,30 @@ def binned_pipeline(duration): | ||
| 125 | # Simulate events | 125 | # Simulate events |
| 126 | sim = ctools.ctobssim() | 126 | sim = ctools.ctobssim() |
| 127 | sim["inmodel"] = model_name | 127 | sim["inmodel"] = model_name |
| 128 | - sim["caldb"] = caldb | ||
| 129 | - sim["irf"] = irf | ||
| 130 | - sim["ra"] = ra | ||
| 131 | - sim["dec"] = dec | ||
| 132 | - sim["rad"] = rad_sim | ||
| 133 | - sim["tmin"] = tstart | ||
| 134 | - sim["tmax"] = tstop | ||
| 135 | - sim["emin"] = emin | ||
| 136 | - sim["emax"] = emax | 128 | + sim["caldb"] = caldb |
| 129 | + sim["irf"] = irf | ||
| 130 | + sim["ra"] = ra | ||
| 131 | + sim["dec"] = dec | ||
| 132 | + sim["rad"] = rad_sim | ||
| 133 | + sim["tmin"] = tstart | ||
| 134 | + sim["tmax"] = tstop | ||
| 135 | + sim["emin"] = emin | ||
| 136 | + sim["emax"] = emax | ||
| 137 | sim.run() | 137 | sim.run() |
| 138 | 138 | ||
| 139 | # Bin events into counts map | 139 | # Bin events into counts map |
| 140 | bin = ctools.ctbin(sim.obs()) | 140 | bin = ctools.ctbin(sim.obs()) |
| 141 | - bin["ebinalg"] = "LOG" | ||
| 142 | - bin["emin"] = emin | ||
| 143 | - bin["emax"] = emax | 141 | + bin["ebinalg"] = "LOG" |
| 142 | + bin["emin"] = emin | ||
| 143 | + bin["emax"] = emax | ||
| 144 | bin["enumbins"] = enumbins | 144 | bin["enumbins"] = enumbins |
| 145 | - bin["nxpix"] = nxpix | ||
| 146 | - bin["nypix"] = nypix | ||
| 147 | - bin["binsz"] = binsz | 145 | + bin["nxpix"] = nxpix |
| 146 | + bin["nypix"] = nypix | ||
| 147 | + bin["binsz"] = binsz | ||
| 148 | bin["coordsys"] = coordsys | 148 | bin["coordsys"] = coordsys |
| 149 | - bin["xref"] = ra | ||
| 150 | - bin["yref"] = dec | ||
| 151 | - bin["proj"] = proj | 149 | + bin["xref"] = ra |
| 150 | + bin["yref"] = dec | ||
| 151 | + bin["proj"] = proj | ||
| 152 | bin.run() | 152 | bin.run() |
| 153 | 153 | ||
| 154 | # Get ctlike start CPU time | 154 | # Get ctlike start CPU time |
| @@ -198,82 +198,82 @@ def stacked_pipeline(duration): | @@ -198,82 +198,82 @@ def stacked_pipeline(duration): | ||
| 198 | # Simulate events | 198 | # Simulate events |
| 199 | sim = ctools.ctobssim() | 199 | sim = ctools.ctobssim() |
| 200 | sim["inmodel"] = model_name | 200 | sim["inmodel"] = model_name |
| 201 | - sim["caldb"] = caldb | ||
| 202 | - sim["irf"] = irf | ||
| 203 | - sim["ra"] = ra | ||
| 204 | - sim["dec"] = dec | ||
| 205 | - sim["rad"] = rad_sim | ||
| 206 | - sim["tmin"] = tstart | ||
| 207 | - sim["tmax"] = tstop | ||
| 208 | - sim["emin"] = emin | ||
| 209 | - sim["emax"] = emax | 201 | + sim["caldb"] = caldb |
| 202 | + sim["irf"] = irf | ||
| 203 | + sim["ra"] = ra | ||
| 204 | + sim["dec"] = dec | ||
| 205 | + sim["rad"] = rad_sim | ||
| 206 | + sim["tmin"] = tstart | ||
| 207 | + sim["tmax"] = tstop | ||
| 208 | + sim["emin"] = emin | ||
| 209 | + sim["emax"] = emax | ||
| 210 | sim.run() | 210 | sim.run() |
| 211 | 211 | ||
| 212 | # Bin events into counts map | 212 | # Bin events into counts map |
| 213 | bin = ctools.ctbin(sim.obs()) | 213 | bin = ctools.ctbin(sim.obs()) |
| 214 | - bin["ebinalg"] = "LOG" | ||
| 215 | - bin["emin"] = emin | ||
| 216 | - bin["emax"] = emax | 214 | + bin["ebinalg"] = "LOG" |
| 215 | + bin["emin"] = emin | ||
| 216 | + bin["emax"] = emax | ||
| 217 | bin["enumbins"] = enumbins | 217 | bin["enumbins"] = enumbins |
| 218 | - bin["nxpix"] = nxpix | ||
| 219 | - bin["nypix"] = nypix | ||
| 220 | - bin["binsz"] = binsz | 218 | + bin["nxpix"] = nxpix |
| 219 | + bin["nypix"] = nypix | ||
| 220 | + bin["binsz"] = binsz | ||
| 221 | bin["coordsys"] = coordsys | 221 | bin["coordsys"] = coordsys |
| 222 | - bin["proj"] = proj | ||
| 223 | - bin["xref"] = ra | ||
| 224 | - bin["yref"] = dec | 222 | + bin["proj"] = proj |
| 223 | + bin["xref"] = ra | ||
| 224 | + bin["yref"] = dec | ||
| 225 | bin.run() | 225 | bin.run() |
| 226 | 226 | ||
| 227 | # Create exposure cube | 227 | # Create exposure cube |
| 228 | expcube = ctools.ctexpcube(sim.obs()) | 228 | expcube = ctools.ctexpcube(sim.obs()) |
| 229 | - expcube["incube"] = "NONE" | ||
| 230 | - expcube["caldb"] = caldb | ||
| 231 | - expcube["irf"] = irf | ||
| 232 | - expcube["ebinalg"] = "LOG" | ||
| 233 | - expcube["emin"] = emin | ||
| 234 | - expcube["emax"] = emax | 229 | + expcube["incube"] = "NONE" |
| 230 | + expcube["caldb"] = caldb | ||
| 231 | + expcube["irf"] = irf | ||
| 232 | + expcube["ebinalg"] = "LOG" | ||
| 233 | + expcube["emin"] = emin | ||
| 234 | + expcube["emax"] = emax | ||
| 235 | expcube["enumbins"] = enumbins | 235 | expcube["enumbins"] = enumbins |
| 236 | - expcube["nxpix"] = nxpix | ||
| 237 | - expcube["nypix"] = nypix | ||
| 238 | - expcube["binsz"] = binsz | 236 | + expcube["nxpix"] = nxpix |
| 237 | + expcube["nypix"] = nypix | ||
| 238 | + expcube["binsz"] = binsz | ||
| 239 | expcube["coordsys"] = coordsys | 239 | expcube["coordsys"] = coordsys |
| 240 | - expcube["proj"] = proj | ||
| 241 | - expcube["xref"] = ra | ||
| 242 | - expcube["yref"] = dec | 240 | + expcube["proj"] = proj |
| 241 | + expcube["xref"] = ra | ||
| 242 | + expcube["yref"] = dec | ||
| 243 | expcube.run() | 243 | expcube.run() |
| 244 | 244 | ||
| 245 | # Create PSF cube | 245 | # Create PSF cube |
| 246 | psfcube = ctools.ctpsfcube(sim.obs()) | 246 | psfcube = ctools.ctpsfcube(sim.obs()) |
| 247 | - psfcube["incube"] = "NONE" | ||
| 248 | - psfcube["caldb"] = caldb | ||
| 249 | - psfcube["irf"] = irf | ||
| 250 | - psfcube["ebinalg"] = "LOG" | ||
| 251 | - psfcube["emin"] = emin | ||
| 252 | - psfcube["emax"] = emax | 247 | + psfcube["incube"] = "NONE" |
| 248 | + psfcube["caldb"] = caldb | ||
| 249 | + psfcube["irf"] = irf | ||
| 250 | + psfcube["ebinalg"] = "LOG" | ||
| 251 | + psfcube["emin"] = emin | ||
| 252 | + psfcube["emax"] = emax | ||
| 253 | psfcube["enumbins"] = enumbins | 253 | psfcube["enumbins"] = enumbins |
| 254 | - psfcube["nxpix"] = 10 | ||
| 255 | - psfcube["nypix"] = 10 | ||
| 256 | - psfcube["binsz"] = 1.0 | 254 | + psfcube["nxpix"] = 10 |
| 255 | + psfcube["nypix"] = 10 | ||
| 256 | + psfcube["binsz"] = 1.0 | ||
| 257 | psfcube["coordsys"] = coordsys | 257 | psfcube["coordsys"] = coordsys |
| 258 | - psfcube["proj"] = proj | ||
| 259 | - psfcube["xref"] = ra | ||
| 260 | - psfcube["yref"] = dec | 258 | + psfcube["proj"] = proj |
| 259 | + psfcube["xref"] = ra | ||
| 260 | + psfcube["yref"] = dec | ||
| 261 | psfcube.run() | 261 | psfcube.run() |
| 262 | 262 | ||
| 263 | # Create background cube | 263 | # Create background cube |
| 264 | bkgcube = ctools.ctbkgcube(sim.obs()) | 264 | bkgcube = ctools.ctbkgcube(sim.obs()) |
| 265 | - bkgcube["incube"] = "NONE" | ||
| 266 | - bkgcube["ebinalg"] = "LOG" | ||
| 267 | - bkgcube["emin"] = emin | ||
| 268 | - bkgcube["emax"] = emax | 265 | + bkgcube["incube"] = "NONE" |
| 266 | + bkgcube["ebinalg"] = "LOG" | ||
| 267 | + bkgcube["emin"] = emin | ||
| 268 | + bkgcube["emax"] = emax | ||
| 269 | bkgcube["enumbins"] = enumbins | 269 | bkgcube["enumbins"] = enumbins |
| 270 | - bkgcube["nxpix"] = 10 | ||
| 271 | - bkgcube["nypix"] = 10 | ||
| 272 | - bkgcube["binsz"] = 1.0 | 270 | + bkgcube["nxpix"] = 10 |
| 271 | + bkgcube["nypix"] = 10 | ||
| 272 | + bkgcube["binsz"] = 1.0 | ||
| 273 | bkgcube["coordsys"] = coordsys | 273 | bkgcube["coordsys"] = coordsys |
| 274 | - bkgcube["proj"] = proj | ||
| 275 | - bkgcube["xref"] = ra | ||
| 276 | - bkgcube["yref"] = dec | 274 | + bkgcube["proj"] = proj |
| 275 | + bkgcube["xref"] = ra | ||
| 276 | + bkgcube["yref"] = dec | ||
| 277 | bkgcube.run() | 277 | bkgcube.run() |
| 278 | 278 | ||
| 279 | # Attach background model to observation container | 279 | # Attach background model to observation container |
examples/check_models.py
| @@ -62,22 +62,22 @@ def pipeline(model_name): | @@ -62,22 +62,22 @@ def pipeline(model_name): | ||
| 62 | # Simulate events | 62 | # Simulate events |
| 63 | sim = ctools.ctobssim() | 63 | sim = ctools.ctobssim() |
| 64 | sim["inmodel"] = model_name | 64 | sim["inmodel"] = model_name |
| 65 | - sim["caldb"] = caldb | ||
| 66 | - sim["irf"] = irf | ||
| 67 | - sim["ra"] = ra | ||
| 68 | - sim["dec"] = dec | ||
| 69 | - sim["rad"] = rad_sim | ||
| 70 | - sim["tmin"] = tstart | ||
| 71 | - sim["tmax"] = tstop | ||
| 72 | - sim["emin"] = emin | ||
| 73 | - sim["emax"] = emax | 65 | + sim["caldb"] = caldb |
| 66 | + sim["irf"] = irf | ||
| 67 | + sim["ra"] = ra | ||
| 68 | + sim["dec"] = dec | ||
| 69 | + sim["rad"] = rad_sim | ||
| 70 | + sim["tmin"] = tstart | ||
| 71 | + sim["tmax"] = tstop | ||
| 72 | + sim["emin"] = emin | ||
| 73 | + sim["emax"] = emax | ||
| 74 | sim.run() | 74 | sim.run() |
| 75 | 75 | ||
| 76 | # Select events | 76 | # Select events |
| 77 | select = ctools.ctselect(sim.obs()) | 77 | select = ctools.ctselect(sim.obs()) |
| 78 | - select["ra"] = ra | ||
| 79 | - select["dec"] = dec | ||
| 80 | - select["rad"] = rad_select | 78 | + select["ra"] = ra |
| 79 | + select["dec"] = dec | ||
| 80 | + select["rad"] = rad_select | ||
| 81 | select["tmin"] = tstart | 81 | select["tmin"] = tstart |
| 82 | select["tmax"] = tstop | 82 | select["tmax"] = tstop |
| 83 | select["emin"] = emin | 83 | select["emin"] = emin |
examples/make_spectrum.py
| @@ -49,15 +49,15 @@ def make_spectrum(): | @@ -49,15 +49,15 @@ def make_spectrum(): | ||
| 49 | # Simulate events | 49 | # Simulate events |
| 50 | sim = ctools.ctobssim() | 50 | sim = ctools.ctobssim() |
| 51 | sim["inmodel"] = model_name | 51 | sim["inmodel"] = model_name |
| 52 | - sim["caldb"] = caldb | ||
| 53 | - sim["irf"] = irf | ||
| 54 | - sim["ra"] = ra | ||
| 55 | - sim["dec"] = dec | ||
| 56 | - sim["rad"] = rad_sim | ||
| 57 | - sim["tmin"] = tstart | ||
| 58 | - sim["tmax"] = tstop | ||
| 59 | - sim["emin"] = emin | ||
| 60 | - sim["emax"] = emax | 52 | + sim["caldb"] = caldb |
| 53 | + sim["irf"] = irf | ||
| 54 | + sim["ra"] = ra | ||
| 55 | + sim["dec"] = dec | ||
| 56 | + sim["rad"] = rad_sim | ||
| 57 | + sim["tmin"] = tstart | ||
| 58 | + sim["tmax"] = tstop | ||
| 59 | + sim["emin"] = emin | ||
| 60 | + sim["emax"] = emax | ||
| 61 | sim.run() | 61 | sim.run() |
| 62 | 62 | ||
| 63 | # Generate an energy binning | 63 | # Generate an energy binning |
examples/make_ts_distributions.py
| @@ -61,22 +61,22 @@ def create_ts(loge, emin, emax, ntrials=100, duration=180000.0, \ | @@ -61,22 +61,22 @@ def create_ts(loge, emin, emax, ntrials=100, duration=180000.0, \ | ||
| 61 | 61 | ||
| 62 | # Setup cstsdist tool | 62 | # Setup cstsdist tool |
| 63 | tsdist = cstsdist() | 63 | tsdist = cstsdist() |
| 64 | - tsdist["inmodel"] = "$CTOOLS/share/models/crab.xml" | ||
| 65 | - tsdist["srcname"] = "Crab" | ||
| 66 | - tsdist["outfile"] = outfile | ||
| 67 | - tsdist["ntrials"] = ntrials | ||
| 68 | - tsdist["caldb"] = "prod2" | ||
| 69 | - tsdist["irf"] = "South_50h" | ||
| 70 | - tsdist["ra"] = 83.63 | ||
| 71 | - tsdist["dec"] = 22.01 | ||
| 72 | - tsdist["emin"] = emin | ||
| 73 | - tsdist["emax"] = emax | 64 | + tsdist["inmodel"] = "$CTOOLS/share/models/crab.xml" |
| 65 | + tsdist["srcname"] = "Crab" | ||
| 66 | + tsdist["outfile"] = outfile | ||
| 67 | + tsdist["ntrials"] = ntrials | ||
| 68 | + tsdist["caldb"] = "prod2" | ||
| 69 | + tsdist["irf"] = "South_50h" | ||
| 70 | + tsdist["ra"] = 83.63 | ||
| 71 | + tsdist["dec"] = 22.01 | ||
| 72 | + tsdist["emin"] = emin | ||
| 73 | + tsdist["emax"] = emax | ||
| 74 | tsdist["enumbins"] = enumbins | 74 | tsdist["enumbins"] = enumbins |
| 75 | - tsdist["tmin"] = 0 | ||
| 76 | - tsdist["tmax"] = duration | ||
| 77 | - tsdist["rad"] = 5.0 | ||
| 78 | - tsdist["npix"] = 200 | ||
| 79 | - tsdist["binsz"] = 0.05 | 75 | + tsdist["tmin"] = 0 |
| 76 | + tsdist["tmax"] = duration | ||
| 77 | + tsdist["rad"] = 5.0 | ||
| 78 | + tsdist["npix"] = 200 | ||
| 79 | + tsdist["binsz"] = 0.05 | ||
| 80 | #tsdist["debug"].boolean(True) | 80 | #tsdist["debug"].boolean(True) |
| 81 | 81 | ||
| 82 | # Optionally open the log file | 82 | # Optionally open the log file |
examples/pipeline_binned_disk.py
| @@ -132,18 +132,18 @@ def run_pipeline(obs, emin=0.1, emax=100.0, \ | @@ -132,18 +132,18 @@ def run_pipeline(obs, emin=0.1, emax=100.0, \ | ||
| 132 | 132 | ||
| 133 | # Bin events for that observation | 133 | # Bin events for that observation |
| 134 | bin = ctools.ctbin() | 134 | bin = ctools.ctbin() |
| 135 | - bin["inobs"] = eventfile | ||
| 136 | - bin["outcube"] = cubefile | ||
| 137 | - bin["ebinalg"] = "LOG" | ||
| 138 | - bin["emin"] = emin | ||
| 139 | - bin["emax"] = emax | 135 | + bin["inobs"] = eventfile |
| 136 | + bin["outcube"] = cubefile | ||
| 137 | + bin["ebinalg"] = "LOG" | ||
| 138 | + bin["emin"] = emin | ||
| 139 | + bin["emax"] = emax | ||
| 140 | bin["enumbins"] = enumbins | 140 | bin["enumbins"] = enumbins |
| 141 | - bin["nxpix"] = nxpix | ||
| 142 | - bin["nypix"] = nypix | ||
| 143 | - bin["binsz"] = binsz | 141 | + bin["nxpix"] = nxpix |
| 142 | + bin["nypix"] = nypix | ||
| 143 | + bin["binsz"] = binsz | ||
| 144 | bin["coordsys"] = coordsys | 144 | bin["coordsys"] = coordsys |
| 145 | - bin["usepnt"] = True | ||
| 146 | - bin["proj"] = proj | 145 | + bin["usepnt"] = True |
| 146 | + bin["proj"] = proj | ||
| 147 | bin.execute() | 147 | bin.execute() |
| 148 | 148 | ||
| 149 | # Set observation ID | 149 | # Set observation ID |
| @@ -160,15 +160,15 @@ def run_pipeline(obs, emin=0.1, emax=100.0, \ | @@ -160,15 +160,15 @@ def run_pipeline(obs, emin=0.1, emax=100.0, \ | ||
| 160 | 160 | ||
| 161 | # Perform maximum likelihood fitting | 161 | # Perform maximum likelihood fitting |
| 162 | like = ctools.ctlike() | 162 | like = ctools.ctlike() |
| 163 | - like["inobs"] = "obs_cube.xml" | ||
| 164 | - like["inmodel"] = model | 163 | + like["inobs"] = "obs_cube.xml" |
| 164 | + like["inmodel"] = model | ||
| 165 | like["outmodel"] = "fit_results.xml" | 165 | like["outmodel"] = "fit_results.xml" |
| 166 | - like["expcube"] = "NONE" | ||
| 167 | - like["psfcube"] = "NONE" | ||
| 168 | - like["bkgcube"] = "NONE" | ||
| 169 | - like["caldb"] = caldb | ||
| 170 | - like["irf"] = irf | ||
| 171 | - like["debug"] = True # Switch this always on for results in console | 166 | + like["expcube"] = "NONE" |
| 167 | + like["psfcube"] = "NONE" | ||
| 168 | + like["bkgcube"] = "NONE" | ||
| 169 | + like["caldb"] = caldb | ||
| 170 | + like["irf"] = irf | ||
| 171 | + like["debug"] = True # Switch this always on for results in console | ||
| 172 | like.execute() | 172 | like.execute() |
| 173 | 173 | ||
| 174 | # Return | 174 | # Return |
examples/pipeline_binned_mem.py
| @@ -125,16 +125,16 @@ def run_pipeline(obs, emin=0.1, emax=100.0, \ | @@ -125,16 +125,16 @@ def run_pipeline(obs, emin=0.1, emax=100.0, \ | ||
| 125 | 125 | ||
| 126 | # Bin events for that observation | 126 | # Bin events for that observation |
| 127 | bin = ctools.ctbin(container) | 127 | bin = ctools.ctbin(container) |
| 128 | - bin["ebinalg"] = "LOG" | ||
| 129 | - bin["emin"] = emin | ||
| 130 | - bin["emax"] = emax | 128 | + bin["ebinalg"] = "LOG" |
| 129 | + bin["emin"] = emin | ||
| 130 | + bin["emax"] = emax | ||
| 131 | bin["enumbins"] = enumbins | 131 | bin["enumbins"] = enumbins |
| 132 | - bin["nxpix"] = nxpix | ||
| 133 | - bin["nypix"] = nypix | ||
| 134 | - bin["binsz"] = binsz | 132 | + bin["nxpix"] = nxpix |
| 133 | + bin["nypix"] = nypix | ||
| 134 | + bin["binsz"] = binsz | ||
| 135 | bin["coordsys"] = coordsys | 135 | bin["coordsys"] = coordsys |
| 136 | - bin["usepnt"] = True | ||
| 137 | - bin["proj"] = proj | 136 | + bin["usepnt"] = True |
| 137 | + bin["proj"] = proj | ||
| 138 | bin.run() | 138 | bin.run() |
| 139 | 139 | ||
| 140 | # Append result to observations | 140 | # Append result to observations |
examples/pipeline_stacked_disk.py
| @@ -116,104 +116,104 @@ def run_pipeline(obs, ra=83.63, dec=22.01, emin=0.1, emax=100.0, \ | @@ -116,104 +116,104 @@ def run_pipeline(obs, ra=83.63, dec=22.01, emin=0.1, emax=100.0, \ | ||
| 116 | """ | 116 | """ |
| 117 | # Simulate events | 117 | # Simulate events |
| 118 | sim = ctools.ctobssim(obs) | 118 | sim = ctools.ctobssim(obs) |
| 119 | - sim["debug"] = debug | 119 | + sim["debug"] = debug |
| 120 | sim["outevents"] = "obs.xml" | 120 | sim["outevents"] = "obs.xml" |
| 121 | sim.execute() | 121 | sim.execute() |
| 122 | 122 | ||
| 123 | # Bin events into counts map | 123 | # Bin events into counts map |
| 124 | bin = ctools.ctbin() | 124 | bin = ctools.ctbin() |
| 125 | - bin["inobs"] = "obs.xml" | ||
| 126 | - bin["outcube"] = "cntcube.fits" | ||
| 127 | - bin["ebinalg"] = "LOG" | ||
| 128 | - bin["emin"] = emin | ||
| 129 | - bin["emax"] = emax | 125 | + bin["inobs"] = "obs.xml" |
| 126 | + bin["outcube"] = "cntcube.fits" | ||
| 127 | + bin["ebinalg"] = "LOG" | ||
| 128 | + bin["emin"] = emin | ||
| 129 | + bin["emax"] = emax | ||
| 130 | bin["enumbins"] = enumbins | 130 | bin["enumbins"] = enumbins |
| 131 | - bin["nxpix"] = nxpix | ||
| 132 | - bin["nypix"] = nypix | ||
| 133 | - bin["binsz"] = binsz | 131 | + bin["nxpix"] = nxpix |
| 132 | + bin["nypix"] = nypix | ||
| 133 | + bin["binsz"] = binsz | ||
| 134 | bin["coordsys"] = coordsys | 134 | bin["coordsys"] = coordsys |
| 135 | - bin["proj"] = proj | ||
| 136 | - bin["xref"] = ra | ||
| 137 | - bin["yref"] = dec | ||
| 138 | - bin["debug"] = debug | 135 | + bin["proj"] = proj |
| 136 | + bin["xref"] = ra | ||
| 137 | + bin["yref"] = dec | ||
| 138 | + bin["debug"] = debug | ||
| 139 | bin.execute() | 139 | bin.execute() |
| 140 | 140 | ||
| 141 | # Create exposure cube | 141 | # Create exposure cube |
| 142 | expcube = ctools.ctexpcube() | 142 | expcube = ctools.ctexpcube() |
| 143 | - expcube["inobs"] = "obs.xml" | ||
| 144 | - expcube["incube"] = "cntcube.fits" | ||
| 145 | - expcube["outcube"] = "expcube.fits" | ||
| 146 | - expcube["caldb"] = caldb | ||
| 147 | - expcube["irf"] = irf | ||
| 148 | - expcube["ebinalg"] = "LOG" | ||
| 149 | - expcube["emin"] = emin | ||
| 150 | - expcube["emax"] = emax | 143 | + expcube["inobs"] = "obs.xml" |
| 144 | + expcube["incube"] = "cntcube.fits" | ||
| 145 | + expcube["outcube"] = "expcube.fits" | ||
| 146 | + expcube["caldb"] = caldb | ||
| 147 | + expcube["irf"] = irf | ||
| 148 | + expcube["ebinalg"] = "LOG" | ||
| 149 | + expcube["emin"] = emin | ||
| 150 | + expcube["emax"] = emax | ||
| 151 | expcube["enumbins"] = enumbins | 151 | expcube["enumbins"] = enumbins |
| 152 | - expcube["nxpix"] = nxpix | ||
| 153 | - expcube["nypix"] = nypix | ||
| 154 | - expcube["binsz"] = binsz | 152 | + expcube["nxpix"] = nxpix |
| 153 | + expcube["nypix"] = nypix | ||
| 154 | + expcube["binsz"] = binsz | ||
| 155 | expcube["coordsys"] = coordsys | 155 | expcube["coordsys"] = coordsys |
| 156 | - expcube["proj"] = proj | ||
| 157 | - expcube["xref"] = ra | ||
| 158 | - expcube["yref"] = dec | ||
| 159 | - expcube["debug"] = debug | 156 | + expcube["proj"] = proj |
| 157 | + expcube["xref"] = ra | ||
| 158 | + expcube["yref"] = dec | ||
| 159 | + expcube["debug"] = debug | ||
| 160 | expcube.execute() | 160 | expcube.execute() |
| 161 | 161 | ||
| 162 | # Create PSF cube | 162 | # Create PSF cube |
| 163 | psfcube = ctools.ctpsfcube() | 163 | psfcube = ctools.ctpsfcube() |
| 164 | - psfcube["inobs"] = "obs.xml" | ||
| 165 | - psfcube["incube"] = "NONE" | ||
| 166 | - psfcube["outcube"] = "psfcube.fits" | ||
| 167 | - psfcube["caldb"] = caldb | ||
| 168 | - psfcube["irf"] = irf | ||
| 169 | - psfcube["ebinalg"] = "LOG" | ||
| 170 | - psfcube["emin"] = emin | ||
| 171 | - psfcube["emax"] = emax | 164 | + psfcube["inobs"] = "obs.xml" |
| 165 | + psfcube["incube"] = "NONE" | ||
| 166 | + psfcube["outcube"] = "psfcube.fits" | ||
| 167 | + psfcube["caldb"] = caldb | ||
| 168 | + psfcube["irf"] = irf | ||
| 169 | + psfcube["ebinalg"] = "LOG" | ||
| 170 | + psfcube["emin"] = emin | ||
| 171 | + psfcube["emax"] = emax | ||
| 172 | psfcube["enumbins"] = enumbins | 172 | psfcube["enumbins"] = enumbins |
| 173 | - psfcube["nxpix"] = 10 | ||
| 174 | - psfcube["nypix"] = 10 | ||
| 175 | - psfcube["binsz"] = 1.0 | 173 | + psfcube["nxpix"] = 10 |
| 174 | + psfcube["nypix"] = 10 | ||
| 175 | + psfcube["binsz"] = 1.0 | ||
| 176 | psfcube["coordsys"] = coordsys | 176 | psfcube["coordsys"] = coordsys |
| 177 | - psfcube["proj"] = proj | ||
| 178 | - psfcube["xref"] = ra | ||
| 179 | - psfcube["yref"] = dec | ||
| 180 | - psfcube["debug"] = debug | 177 | + psfcube["proj"] = proj |
| 178 | + psfcube["xref"] = ra | ||
| 179 | + psfcube["yref"] = dec | ||
| 180 | + psfcube["debug"] = debug | ||
| 181 | psfcube.execute() | 181 | psfcube.execute() |
| 182 | 182 | ||
| 183 | # Create background cube | 183 | # Create background cube |
| 184 | bkgcube = ctools.ctbkgcube() | 184 | bkgcube = ctools.ctbkgcube() |
| 185 | - bkgcube["inobs"] = "obs.xml" | ||
| 186 | - bkgcube["inmodel"] = model | ||
| 187 | - bkgcube["incube"] = "cntcube.fits" | ||
| 188 | - bkgcube["outcube"] = "bkgcube.fits" | 185 | + bkgcube["inobs"] = "obs.xml" |
| 186 | + bkgcube["inmodel"] = model | ||
| 187 | + bkgcube["incube"] = "cntcube.fits" | ||
| 188 | + bkgcube["outcube"] = "bkgcube.fits" | ||
| 189 | bkgcube["outmodel"] = "model_bkg.xml" | 189 | bkgcube["outmodel"] = "model_bkg.xml" |
| 190 | - bkgcube["caldb"] = caldb | ||
| 191 | - bkgcube["irf"] = irf | ||
| 192 | - bkgcube["ebinalg"] = "LOG" | ||
| 193 | - bkgcube["emin"] = emin | ||
| 194 | - bkgcube["emax"] = emax | 190 | + bkgcube["caldb"] = caldb |
| 191 | + bkgcube["irf"] = irf | ||
| 192 | + bkgcube["ebinalg"] = "LOG" | ||
| 193 | + bkgcube["emin"] = emin | ||
| 194 | + bkgcube["emax"] = emax | ||
| 195 | bkgcube["enumbins"] = enumbins | 195 | bkgcube["enumbins"] = enumbins |
| 196 | - bkgcube["nxpix"] = 10 | ||
| 197 | - bkgcube["nypix"] = 10 | ||
| 198 | - bkgcube["binsz"] = 1.0 | 196 | + bkgcube["nxpix"] = 10 |
| 197 | + bkgcube["nypix"] = 10 | ||
| 198 | + bkgcube["binsz"] = 1.0 | ||
| 199 | bkgcube["coordsys"] = coordsys | 199 | bkgcube["coordsys"] = coordsys |
| 200 | - bkgcube["proj"] = proj | ||
| 201 | - bkgcube["xref"] = ra | ||
| 202 | - bkgcube["yref"] = dec | ||
| 203 | - bkgcube["debug"] = debug | 200 | + bkgcube["proj"] = proj |
| 201 | + bkgcube["xref"] = ra | ||
| 202 | + bkgcube["yref"] = dec | ||
| 203 | + bkgcube["debug"] = debug | ||
| 204 | bkgcube.execute() | 204 | bkgcube.execute() |
| 205 | 205 | ||
| 206 | # Perform maximum likelihood fitting | 206 | # Perform maximum likelihood fitting |
| 207 | like = ctools.ctlike() | 207 | like = ctools.ctlike() |
| 208 | - like["inobs"] = "cntcube.fits" | ||
| 209 | - like["inmodel"] = "model_bkg.xml" | 208 | + like["inobs"] = "cntcube.fits" |
| 209 | + like["inmodel"] = "model_bkg.xml" | ||
| 210 | like["outmodel"] = "fit_results.xml" | 210 | like["outmodel"] = "fit_results.xml" |
| 211 | - like["expcube"] = "expcube.fits" | ||
| 212 | - like["psfcube"] = "psfcube.fits" | ||
| 213 | - like["bkgcube"] = "bkgcube.fits" | ||
| 214 | - like["caldb"] = caldb | ||
| 215 | - like["irf"] = irf | ||
| 216 | - like["debug"] = True # Switch this always on for results in console | 211 | + like["expcube"] = "expcube.fits" |
| 212 | + like["psfcube"] = "psfcube.fits" | ||
| 213 | + like["bkgcube"] = "bkgcube.fits" | ||
| 214 | + like["caldb"] = caldb | ||
| 215 | + like["irf"] = irf | ||
| 216 | + like["debug"] = True # Switch this always on for results in console | ||
| 217 | like.execute() | 217 | like.execute() |
| 218 | 218 | ||
| 219 | # Return | 219 | # Return |
examples/pipeline_stacked_mem.py
| @@ -118,69 +118,69 @@ def run_pipeline(obs, ra=83.63, dec=22.01, emin=0.1, emax=100.0, \ | @@ -118,69 +118,69 @@ def run_pipeline(obs, ra=83.63, dec=22.01, emin=0.1, emax=100.0, \ | ||
| 118 | 118 | ||
| 119 | # Bin events into counts map | 119 | # Bin events into counts map |
| 120 | bin = ctools.ctbin(sim.obs()) | 120 | bin = ctools.ctbin(sim.obs()) |
| 121 | - bin["ebinalg"] = "LOG" | ||
| 122 | - bin["emin"] = emin | ||
| 123 | - bin["emax"] = emax | 121 | + bin["ebinalg"] = "LOG" |
| 122 | + bin["emin"] = emin | ||
| 123 | + bin["emax"] = emax | ||
| 124 | bin["enumbins"] = enumbins | 124 | bin["enumbins"] = enumbins |
| 125 | - bin["nxpix"] = nxpix | ||
| 126 | - bin["nypix"] = nypix | ||
| 127 | - bin["binsz"] = binsz | 125 | + bin["nxpix"] = nxpix |
| 126 | + bin["nypix"] = nypix | ||
| 127 | + bin["binsz"] = binsz | ||
| 128 | bin["coordsys"] = coordsys | 128 | bin["coordsys"] = coordsys |
| 129 | - bin["proj"] = proj | ||
| 130 | - bin["xref"] = ra | ||
| 131 | - bin["yref"] = dec | ||
| 132 | - bin["debug"] = debug | 129 | + bin["proj"] = proj |
| 130 | + bin["xref"] = ra | ||
| 131 | + bin["yref"] = dec | ||
| 132 | + bin["debug"] = debug | ||
| 133 | bin.run() | 133 | bin.run() |
| 134 | 134 | ||
| 135 | # Create exposure cube | 135 | # Create exposure cube |
| 136 | expcube = ctools.ctexpcube(sim.obs()) | 136 | expcube = ctools.ctexpcube(sim.obs()) |
| 137 | - expcube["incube"] = "NONE" | ||
| 138 | - expcube["ebinalg"] = "LOG" | ||
| 139 | - expcube["emin"] = emin | ||
| 140 | - expcube["emax"] = emax | 137 | + expcube["incube"] = "NONE" |
| 138 | + expcube["ebinalg"] = "LOG" | ||
| 139 | + expcube["emin"] = emin | ||
| 140 | + expcube["emax"] = emax | ||
| 141 | expcube["enumbins"] = enumbins | 141 | expcube["enumbins"] = enumbins |
| 142 | - expcube["nxpix"] = nxpix | ||
| 143 | - expcube["nypix"] = nypix | ||
| 144 | - expcube["binsz"] = binsz | 142 | + expcube["nxpix"] = nxpix |
| 143 | + expcube["nypix"] = nypix | ||
| 144 | + expcube["binsz"] = binsz | ||
| 145 | expcube["coordsys"] = coordsys | 145 | expcube["coordsys"] = coordsys |
| 146 | - expcube["proj"] = proj | ||
| 147 | - expcube["xref"] = ra | ||
| 148 | - expcube["yref"] = dec | ||
| 149 | - expcube["debug"] = debug | 146 | + expcube["proj"] = proj |
| 147 | + expcube["xref"] = ra | ||
| 148 | + expcube["yref"] = dec | ||
| 149 | + expcube["debug"] = debug | ||
| 150 | expcube.run() | 150 | expcube.run() |
| 151 | 151 | ||
| 152 | # Create PSF cube | 152 | # Create PSF cube |
| 153 | psfcube = ctools.ctpsfcube(sim.obs()) | 153 | psfcube = ctools.ctpsfcube(sim.obs()) |
| 154 | - psfcube["incube"] = "NONE" | ||
| 155 | - psfcube["ebinalg"] = "LOG" | ||
| 156 | - psfcube["emin"] = emin | ||
| 157 | - psfcube["emax"] = emax | 154 | + psfcube["incube"] = "NONE" |
| 155 | + psfcube["ebinalg"] = "LOG" | ||
| 156 | + psfcube["emin"] = emin | ||
| 157 | + psfcube["emax"] = emax | ||
| 158 | psfcube["enumbins"] = enumbins | 158 | psfcube["enumbins"] = enumbins |
| 159 | - psfcube["nxpix"] = 10 | ||
| 160 | - psfcube["nypix"] = 10 | ||
| 161 | - psfcube["binsz"] = 1.0 | 159 | + psfcube["nxpix"] = 10 |
| 160 | + psfcube["nypix"] = 10 | ||
| 161 | + psfcube["binsz"] = 1.0 | ||
| 162 | psfcube["coordsys"] = coordsys | 162 | psfcube["coordsys"] = coordsys |
| 163 | - psfcube["proj"] = proj | ||
| 164 | - psfcube["xref"] = ra | ||
| 165 | - psfcube["yref"] = dec | ||
| 166 | - psfcube["debug"] = debug | 163 | + psfcube["proj"] = proj |
| 164 | + psfcube["xref"] = ra | ||
| 165 | + psfcube["yref"] = dec | ||
| 166 | + psfcube["debug"] = debug | ||
| 167 | psfcube.run() | 167 | psfcube.run() |
| 168 | 168 | ||
| 169 | # Create background cube | 169 | # Create background cube |
| 170 | bkgcube = ctools.ctbkgcube(sim.obs()) | 170 | bkgcube = ctools.ctbkgcube(sim.obs()) |
| 171 | - bkgcube["incube"] = "NONE" | ||
| 172 | - bkgcube["ebinalg"] = "LOG" | ||
| 173 | - bkgcube["emin"] = emin | ||
| 174 | - bkgcube["emax"] = emax | 171 | + bkgcube["incube"] = "NONE" |
| 172 | + bkgcube["ebinalg"] = "LOG" | ||
| 173 | + bkgcube["emin"] = emin | ||
| 174 | + bkgcube["emax"] = emax | ||
| 175 | bkgcube["enumbins"] = enumbins | 175 | bkgcube["enumbins"] = enumbins |
| 176 | - bkgcube["nxpix"] = 10 | ||
| 177 | - bkgcube["nypix"] = 10 | ||
| 178 | - bkgcube["binsz"] = 1.0 | 176 | + bkgcube["nxpix"] = 10 |
| 177 | + bkgcube["nypix"] = 10 | ||
| 178 | + bkgcube["binsz"] = 1.0 | ||
| 179 | bkgcube["coordsys"] = coordsys | 179 | bkgcube["coordsys"] = coordsys |
| 180 | - bkgcube["proj"] = proj | ||
| 181 | - bkgcube["xref"] = ra | ||
| 182 | - bkgcube["yref"] = dec | ||
| 183 | - bkgcube["debug"] = debug | 180 | + bkgcube["proj"] = proj |
| 181 | + bkgcube["xref"] = ra | ||
| 182 | + bkgcube["yref"] = dec | ||
| 183 | + bkgcube["debug"] = debug | ||
| 184 | bkgcube.run() | 184 | bkgcube.run() |
| 185 | 185 | ||
| 186 | # Attach background model to observation container | 186 | # Attach background model to observation container |
examples/pipeline_unbinned_disk.py
| @@ -118,32 +118,32 @@ def run_pipeline(obs, ra=83.63, dec=22.01, rad=3.0, \ | @@ -118,32 +118,32 @@ def run_pipeline(obs, ra=83.63, dec=22.01, rad=3.0, \ | ||
| 118 | 118 | ||
| 119 | # Simulate events | 119 | # Simulate events |
| 120 | sim = ctools.ctobssim(obs) | 120 | sim = ctools.ctobssim(obs) |
| 121 | - sim["debug"] = debug | 121 | + sim["debug"] = debug |
| 122 | sim["outevents"] = "obs.xml" | 122 | sim["outevents"] = "obs.xml" |
| 123 | sim.execute() | 123 | sim.execute() |
| 124 | 124 | ||
| 125 | # Select events | 125 | # Select events |
| 126 | select = ctools.ctselect() | 126 | select = ctools.ctselect() |
| 127 | - select["inobs"] = "obs.xml" | 127 | + select["inobs"] = "obs.xml" |
| 128 | select["outobs"] = "obs_selected.xml" | 128 | select["outobs"] = "obs_selected.xml" |
| 129 | - select["ra"] = ra | ||
| 130 | - select["dec"] = dec | ||
| 131 | - select["rad"] = rad | ||
| 132 | - select["emin"] = emin | ||
| 133 | - select["emax"] = emax | ||
| 134 | - select["tmin"] = tmin | ||
| 135 | - select["tmax"] = tmax | ||
| 136 | - select["debug"] = debug | 129 | + select["ra"] = ra |
| 130 | + select["dec"] = dec | ||
| 131 | + select["rad"] = rad | ||
| 132 | + select["emin"] = emin | ||
| 133 | + select["emax"] = emax | ||
| 134 | + select["tmin"] = tmin | ||
| 135 | + select["tmax"] = tmax | ||
| 136 | + select["debug"] = debug | ||
| 137 | select.execute() | 137 | select.execute() |
| 138 | 138 | ||
| 139 | # Perform maximum likelihood fitting | 139 | # Perform maximum likelihood fitting |
| 140 | like = ctools.ctlike() | 140 | like = ctools.ctlike() |
| 141 | - like["inobs"] = "obs_selected.xml" | ||
| 142 | - like["inmodel"] = model | 141 | + like["inobs"] = "obs_selected.xml" |
| 142 | + like["inmodel"] = model | ||
| 143 | like["outmodel"] = "fit_results.xml" | 143 | like["outmodel"] = "fit_results.xml" |
| 144 | - like["caldb"] = caldb | ||
| 145 | - like["irf"] = irf | ||
| 146 | - like["debug"] = True # Switch this always on for results in console | 144 | + like["caldb"] = caldb |
| 145 | + like["irf"] = irf | ||
| 146 | + like["debug"] = True # Switch this always on for results in console | ||
| 147 | like.execute() | 147 | like.execute() |
| 148 | 148 | ||
| 149 | # Return | 149 | # Return |
examples/pipeline_unbinned_mem.py
| @@ -116,13 +116,13 @@ def run_pipeline(obs, ra=83.63, dec=22.01, rad=3.0, \ | @@ -116,13 +116,13 @@ def run_pipeline(obs, ra=83.63, dec=22.01, rad=3.0, \ | ||
| 116 | 116 | ||
| 117 | # Select events | 117 | # Select events |
| 118 | select = ctools.ctselect(sim.obs()) | 118 | select = ctools.ctselect(sim.obs()) |
| 119 | - select["ra"] = ra | ||
| 120 | - select["dec"] = dec | ||
| 121 | - select["rad"] = rad | ||
| 122 | - select["emin"] = emin | ||
| 123 | - select["emax"] = emax | ||
| 124 | - select["tmin"] = tmin | ||
| 125 | - select["tmax"] = tmax | 119 | + select["ra"] = ra |
| 120 | + select["dec"] = dec | ||
| 121 | + select["rad"] = rad | ||
| 122 | + select["emin"] = emin | ||
| 123 | + select["emax"] = emax | ||
| 124 | + select["tmin"] = tmin | ||
| 125 | + select["tmax"] = tmax | ||
| 126 | select["debug"] = debug | 126 | select["debug"] = debug |
| 127 | select.run() | 127 | select.run() |
| 128 | 128 |
scripts/cslightcrv.py
| @@ -112,7 +112,6 @@ class cslightcrv(ctools.cscript): | @@ -112,7 +112,6 @@ class cslightcrv(ctools.cscript): | ||
| 112 | pars.append(gammalib.GApplicationPar("tmax","r","a","51544.6","","days","Lightcurve stop time [MJD]")) | 112 | pars.append(gammalib.GApplicationPar("tmax","r","a","51544.6","","days","Lightcurve stop time [MJD]")) |
| 113 | pars.append(gammalib.GApplicationPar("tbins","i","a","5","","","Number of time bins")) | 113 | pars.append(gammalib.GApplicationPar("tbins","i","a","5","","","Number of time bins")) |
| 114 | pars.append(gammalib.GApplicationPar("tbinfile","f","a","tbins.fits","","", "File defining the time binning")) | 114 | pars.append(gammalib.GApplicationPar("tbinfile","f","a","tbins.fits","","", "File defining the time binning")) |
| 115 | - #pars.append(gammalib.GApplicationPar("binned","b","a","no","yes|no","","Use binned analysis in each time bin")) | ||
| 116 | pars.append(gammalib.GApplicationPar("enumbins","i","a","0","","","Number of energy bins per light curve bin (0=unbinned)")) | 115 | pars.append(gammalib.GApplicationPar("enumbins","i","a","0","","","Number of energy bins per light curve bin (0=unbinned)")) |
| 117 | pars.append(gammalib.GApplicationPar("emin","r","a","0.1","","","Lower energy limit of events (TeV)")) | 116 | pars.append(gammalib.GApplicationPar("emin","r","a","0.1","","","Lower energy limit of events (TeV)")) |
| 118 | pars.append(gammalib.GApplicationPar("emax","r","a","100.0","","","Upper energy limit of events (TeV)")) | 117 | pars.append(gammalib.GApplicationPar("emax","r","a","100.0","","","Upper energy limit of events (TeV)")) |
| @@ -205,7 +204,6 @@ class cslightcrv(ctools.cscript): | @@ -205,7 +204,6 @@ class cslightcrv(ctools.cscript): | ||
| 205 | self.m_emax = self["emax"].real() | 204 | self.m_emax = self["emax"].real() |
| 206 | 205 | ||
| 207 | # Get binning flag | 206 | # Get binning flag |
| 208 | - #self.m_binned = self["binned"].boolean() | ||
| 209 | if self.m_binned: | 207 | if self.m_binned: |
| 210 | self.m_coordsys = self["coordsys"].string() | 208 | self.m_coordsys = self["coordsys"].string() |
| 211 | self.m_proj = self["proj"].string() | 209 | self.m_proj = self["proj"].string() |
| @@ -214,9 +212,6 @@ class cslightcrv(ctools.cscript): | @@ -214,9 +212,6 @@ class cslightcrv(ctools.cscript): | ||
| 214 | self.m_nxpix = self["nxpix"].integer() | 212 | self.m_nxpix = self["nxpix"].integer() |
| 215 | self.m_nypix = self["nypix"].integer() | 213 | self.m_nypix = self["nypix"].integer() |
| 216 | self.m_binsz = self["binsz"].real() | 214 | self.m_binsz = self["binsz"].real() |
| 217 | - #self.m_ebins = self["enumbins"].integer() | ||
| 218 | - #self.m_emin = self["emin"].real() | ||
| 219 | - #self.m_emax = self["emax"].real() | ||
| 220 | 215 | ||
| 221 | # Read other parameters | 216 | # Read other parameters |
| 222 | self.m_outfile = self["outfile"].filename() | 217 | self.m_outfile = self["outfile"].filename() |
| @@ -382,9 +377,9 @@ class cslightcrv(ctools.cscript): | @@ -382,9 +377,9 @@ class cslightcrv(ctools.cscript): | ||
| 382 | select["emax"] = self.m_emax | 377 | select["emax"] = self.m_emax |
| 383 | select["tmin"] = tmin.convert(select.time_reference()) | 378 | select["tmin"] = tmin.convert(select.time_reference()) |
| 384 | select["tmax"] = tmax.convert(select.time_reference()) | 379 | select["tmax"] = tmax.convert(select.time_reference()) |
| 385 | - select["rad"] = "UNDEFINED" | ||
| 386 | - select["ra"] = "UNDEFINED" | ||
| 387 | - select["dec"] = "UNDEFINED" | 380 | + select["rad"] = "UNDEFINED" |
| 381 | + select["ra"] = "UNDEFINED" | ||
| 382 | + select["dec"] = "UNDEFINED" | ||
| 388 | select.run() | 383 | select.run() |
| 389 | 384 | ||
| 390 | # Retrieve observation | 385 | # Retrieve observation |
| @@ -399,18 +394,18 @@ class cslightcrv(ctools.cscript): | @@ -399,18 +394,18 @@ class cslightcrv(ctools.cscript): | ||
| 399 | 394 | ||
| 400 | # Bin events | 395 | # Bin events |
| 401 | bin = ctools.ctbin(select.obs()) | 396 | bin = ctools.ctbin(select.obs()) |
| 402 | - bin["usepnt"] = False | ||
| 403 | - bin["ebinalg"] = "LOG" | ||
| 404 | - bin["xref"] = self.m_xref | ||
| 405 | - bin["yref"] = self.m_yref | ||
| 406 | - bin["binsz"] = self.m_binsz | ||
| 407 | - bin["nxpix"] = self.m_nxpix | ||
| 408 | - bin["nypix"] = self.m_nypix | 397 | + bin["usepnt"] = False |
| 398 | + bin["ebinalg"] = "LOG" | ||
| 399 | + bin["xref"] = self.m_xref | ||
| 400 | + bin["yref"] = self.m_yref | ||
| 401 | + bin["binsz"] = self.m_binsz | ||
| 402 | + bin["nxpix"] = self.m_nxpix | ||
| 403 | + bin["nypix"] = self.m_nypix | ||
| 409 | bin["enumbins"] = self.m_ebins | 404 | bin["enumbins"] = self.m_ebins |
| 410 | - bin["emin"] = self.m_emin | ||
| 411 | - bin["emax"] = self.m_emax | 405 | + bin["emin"] = self.m_emin |
| 406 | + bin["emax"] = self.m_emax | ||
| 412 | bin["coordsys"] = self.m_coordsys | 407 | bin["coordsys"] = self.m_coordsys |
| 413 | - bin["proj"] = self.m_proj | 408 | + bin["proj"] = self.m_proj |
| 414 | bin.run() | 409 | bin.run() |
| 415 | 410 | ||
| 416 | # Header | 411 | # Header |
| @@ -419,19 +414,19 @@ class cslightcrv(ctools.cscript): | @@ -419,19 +414,19 @@ class cslightcrv(ctools.cscript): | ||
| 419 | 414 | ||
| 420 | # Create exposure cube | 415 | # Create exposure cube |
| 421 | expcube = ctools.ctexpcube(select.obs()) | 416 | expcube = ctools.ctexpcube(select.obs()) |
| 422 | - expcube["incube"] = "NONE" | ||
| 423 | - expcube["usepnt"] = False | ||
| 424 | - expcube["ebinalg"] = "LOG" | ||
| 425 | - expcube["xref"] = self.m_xref | ||
| 426 | - expcube["yref"] = self.m_yref | ||
| 427 | - expcube["binsz"] = self.m_binsz | ||
| 428 | - expcube["nxpix"] = self.m_nxpix | ||
| 429 | - expcube["nypix"] = self.m_nypix | 417 | + expcube["incube"] = "NONE" |
| 418 | + expcube["usepnt"] = False | ||
| 419 | + expcube["ebinalg"] = "LOG" | ||
| 420 | + expcube["xref"] = self.m_xref | ||
| 421 | + expcube["yref"] = self.m_yref | ||
| 422 | + expcube["binsz"] = self.m_binsz | ||
| 423 | + expcube["nxpix"] = self.m_nxpix | ||
| 424 | + expcube["nypix"] = self.m_nypix | ||
| 430 | expcube["enumbins"] = self.m_ebins | 425 | expcube["enumbins"] = self.m_ebins |
| 431 | - expcube["emin"] = self.m_emin | ||
| 432 | - expcube["emax"] = self.m_emax | 426 | + expcube["emin"] = self.m_emin |
| 427 | + expcube["emax"] = self.m_emax | ||
| 433 | expcube["coordsys"] = self.m_coordsys | 428 | expcube["coordsys"] = self.m_coordsys |
| 434 | - expcube["proj"] = self.m_proj | 429 | + expcube["proj"] = self.m_proj |
| 435 | expcube.run() | 430 | expcube.run() |
| 436 | 431 | ||
| 437 | # Header | 432 | # Header |
| @@ -440,19 +435,19 @@ class cslightcrv(ctools.cscript): | @@ -440,19 +435,19 @@ class cslightcrv(ctools.cscript): | ||
| 440 | 435 | ||
| 441 | # Create psf cube | 436 | # Create psf cube |
| 442 | psfcube = ctools.ctpsfcube(select.obs()) | 437 | psfcube = ctools.ctpsfcube(select.obs()) |
| 443 | - psfcube["incube"] = "NONE" | ||
| 444 | - psfcube["usepnt"] = False | ||
| 445 | - psfcube["ebinalg"] = "LOG" | ||
| 446 | - psfcube["xref"] = self.m_xref | ||
| 447 | - psfcube["yref"] = self.m_yref | ||
| 448 | - psfcube["binsz"] = self.m_binsz | ||
| 449 | - psfcube["nxpix"] = self.m_nxpix | ||
| 450 | - psfcube["nypix"] = self.m_nypix | 438 | + psfcube["incube"] = "NONE" |
| 439 | + psfcube["usepnt"] = False | ||
| 440 | + psfcube["ebinalg"] = "LOG" | ||
| 441 | + psfcube["xref"] = self.m_xref | ||
| 442 | + psfcube["yref"] = self.m_yref | ||
| 443 | + psfcube["binsz"] = self.m_binsz | ||
| 444 | + psfcube["nxpix"] = self.m_nxpix | ||
| 445 | + psfcube["nypix"] = self.m_nypix | ||
| 451 | psfcube["enumbins"] = self.m_ebins | 446 | psfcube["enumbins"] = self.m_ebins |
| 452 | - psfcube["emin"] = self.m_emin | ||
| 453 | - psfcube["emax"] = self.m_emax | 447 | + psfcube["emin"] = self.m_emin |
| 448 | + psfcube["emax"] = self.m_emax | ||
| 454 | psfcube["coordsys"] = self.m_coordsys | 449 | psfcube["coordsys"] = self.m_coordsys |
| 455 | - psfcube["proj"] = self.m_proj | 450 | + psfcube["proj"] = self.m_proj |
| 456 | psfcube.run() | 451 | psfcube.run() |
| 457 | 452 | ||
| 458 | # Header | 453 | # Header |
| @@ -461,19 +456,19 @@ class cslightcrv(ctools.cscript): | @@ -461,19 +456,19 @@ class cslightcrv(ctools.cscript): | ||
| 461 | 456 | ||
| 462 | # Create background cube | 457 | # Create background cube |
| 463 | bkgcube = ctools.ctbkgcube(select.obs()) | 458 | bkgcube = ctools.ctbkgcube(select.obs()) |
| 464 | - bkgcube["incube"] = "NONE" | ||
| 465 | - bkgcube["usepnt"] = False | ||
| 466 | - bkgcube["ebinalg"] = "LOG" | ||
| 467 | - bkgcube["xref"] = self.m_xref | ||
| 468 | - bkgcube["yref"] = self.m_yref | ||
| 469 | - bkgcube["binsz"] = self.m_binsz | ||
| 470 | - bkgcube["nxpix"] = self.m_nxpix | ||
| 471 | - bkgcube["nypix"] = self.m_nypix | 459 | + bkgcube["incube"] = "NONE" |
| 460 | + bkgcube["usepnt"] = False | ||
| 461 | + bkgcube["ebinalg"] = "LOG" | ||
| 462 | + bkgcube["xref"] = self.m_xref | ||
| 463 | + bkgcube["yref"] = self.m_yref | ||
| 464 | + bkgcube["binsz"] = self.m_binsz | ||
| 465 | + bkgcube["nxpix"] = self.m_nxpix | ||
| 466 | + bkgcube["nypix"] = self.m_nypix | ||
| 472 | bkgcube["enumbins"] = self.m_ebins | 467 | bkgcube["enumbins"] = self.m_ebins |
| 473 | - bkgcube["emin"] = self.m_emin | ||
| 474 | - bkgcube["emax"] = self.m_emax | 468 | + bkgcube["emin"] = self.m_emin |
| 469 | + bkgcube["emax"] = self.m_emax | ||
| 475 | bkgcube["coordsys"] = self.m_coordsys | 470 | bkgcube["coordsys"] = self.m_coordsys |
| 476 | - bkgcube["proj"] = self.m_proj | 471 | + bkgcube["proj"] = self.m_proj |
| 477 | bkgcube.run() | 472 | bkgcube.run() |
| 478 | 473 | ||
| 479 | # Set new binned observation | 474 | # Set new binned observation |
scripts/csresmap.py
| @@ -217,20 +217,20 @@ class csresmap(ctools.cscript): | @@ -217,20 +217,20 @@ class csresmap(ctools.cscript): | ||
| 217 | 217 | ||
| 218 | # Create countsmap | 218 | # Create countsmap |
| 219 | bin = ctools.ctbin(self.obs) | 219 | bin = ctools.ctbin(self.obs) |
| 220 | - bin["nxpix"] = self.m_nxpix | ||
| 221 | - bin["nypix"] = self.m_nypix | ||
| 222 | - bin["proj"] = self.m_proj | 220 | + bin["nxpix"] = self.m_nxpix |
| 221 | + bin["nypix"] = self.m_nypix | ||
| 222 | + bin["proj"] = self.m_proj | ||
| 223 | bin["coordsys"] = self.m_coordsys | 223 | bin["coordsys"] = self.m_coordsys |
| 224 | - bin["xref"] = self.m_xref | ||
| 225 | - bin["yref"] = self.m_yref | 224 | + bin["xref"] = self.m_xref |
| 225 | + bin["yref"] = self.m_yref | ||
| 226 | bin["enumbins"] = self.m_enumbins | 226 | bin["enumbins"] = self.m_enumbins |
| 227 | - bin["ebinalg"] = self.m_ebinalg | ||
| 228 | - bin["emin"] = self.m_emin | ||
| 229 | - bin["emax"] = self.m_emax | ||
| 230 | - bin["binsz"] = self.m_binsz | ||
| 231 | - bin["chatter"] = self.m_chatter | ||
| 232 | - bin["clobber"] = self.m_clobber | ||
| 233 | - bin["debug"] = self.m_debug | 227 | + bin["ebinalg"] = self.m_ebinalg |
| 228 | + bin["emin"] = self.m_emin | ||
| 229 | + bin["emax"] = self.m_emax | ||
| 230 | + bin["binsz"] = self.m_binsz | ||
| 231 | + bin["chatter"] = self.m_chatter | ||
| 232 | + bin["clobber"] = self.m_clobber | ||
| 233 | + bin["debug"] = self.m_debug | ||
| 234 | bin.run() | 234 | bin.run() |
| 235 | 235 | ||
| 236 | # Store counts map as residual map. Note that we need a | 236 | # Store counts map as residual map. Note that we need a |
| @@ -252,7 +252,7 @@ class csresmap(ctools.cscript): | @@ -252,7 +252,7 @@ class csresmap(ctools.cscript): | ||
| 252 | model.cube(bin.cube()) | 252 | model.cube(bin.cube()) |
| 253 | model["chatter"] = self.m_chatter | 253 | model["chatter"] = self.m_chatter |
| 254 | model["clobber"] = self.m_clobber | 254 | model["clobber"] = self.m_clobber |
| 255 | - model["debug"] = self.m_debug | 255 | + model["debug"] = self.m_debug |
| 256 | model.run() | 256 | model.run() |
| 257 | 257 | ||
| 258 | # Get model map into GSkymap object | 258 | # Get model map into GSkymap object |
scripts/csspec.py
| @@ -326,9 +326,9 @@ class csspec(ctools.cscript): | @@ -326,9 +326,9 @@ class csspec(ctools.cscript): | ||
| 326 | select["emax"] = emax.TeV() | 326 | select["emax"] = emax.TeV() |
| 327 | select["tmin"] = "UNDEFINED" | 327 | select["tmin"] = "UNDEFINED" |
| 328 | select["tmax"] = "UNDEFINED" | 328 | select["tmax"] = "UNDEFINED" |
| 329 | - select["rad"] = "UNDEFINED" | ||
| 330 | - select["ra"] = "UNDEFINED" | ||
| 331 | - select["dec"] = "UNDEFINED" | 329 | + select["rad"] = "UNDEFINED" |
| 330 | + select["ra"] = "UNDEFINED" | ||
| 331 | + select["dec"] = "UNDEFINED" | ||
| 332 | select.run() | 332 | select.run() |
| 333 | 333 | ||
| 334 | # Retrieve observation | 334 | # Retrieve observation |
| @@ -343,18 +343,18 @@ class csspec(ctools.cscript): | @@ -343,18 +343,18 @@ class csspec(ctools.cscript): | ||
| 343 | 343 | ||
| 344 | # Bin events | 344 | # Bin events |
| 345 | bin = ctools.ctbin(select.obs()) | 345 | bin = ctools.ctbin(select.obs()) |
| 346 | - bin["usepnt"] = False | ||
| 347 | - bin["ebinalg"] = "LOG" | ||
| 348 | - bin["xref"] = self.m_xref | ||
| 349 | - bin["yref"] = self.m_yref | ||
| 350 | - bin["binsz"] = self.m_binsz | ||
| 351 | - bin["nxpix"] = self.m_nxpix | ||
| 352 | - bin["nypix"] = self.m_nypix | 346 | + bin["usepnt"] = False |
| 347 | + bin["ebinalg"] = "LOG" | ||
| 348 | + bin["xref"] = self.m_xref | ||
| 349 | + bin["yref"] = self.m_yref | ||
| 350 | + bin["binsz"] = self.m_binsz | ||
| 351 | + bin["nxpix"] = self.m_nxpix | ||
| 352 | + bin["nypix"] = self.m_nypix | ||
| 353 | bin["enumbins"] = self.m_ebins | 353 | bin["enumbins"] = self.m_ebins |
| 354 | - bin["emin"] = emin.TeV() | ||
| 355 | - bin["emax"] = emax.TeV() | 354 | + bin["emin"] = emin.TeV() |
| 355 | + bin["emax"] = emax.TeV() | ||
| 356 | bin["coordsys"] = self.m_coordsys | 356 | bin["coordsys"] = self.m_coordsys |
| 357 | - bin["proj"] = self.m_proj | 357 | + bin["proj"] = self.m_proj |
| 358 | bin.run() | 358 | bin.run() |
| 359 | 359 | ||
| 360 | # Header | 360 | # Header |
| @@ -363,19 +363,19 @@ class csspec(ctools.cscript): | @@ -363,19 +363,19 @@ class csspec(ctools.cscript): | ||
| 363 | 363 | ||
| 364 | # Create exposure cube | 364 | # Create exposure cube |
| 365 | expcube = ctools.ctexpcube(select.obs()) | 365 | expcube = ctools.ctexpcube(select.obs()) |
| 366 | - expcube["incube"] = "NONE" | ||
| 367 | - expcube["usepnt"] = False | ||
| 368 | - expcube["ebinalg"] = "LOG" | ||
| 369 | - expcube["xref"] = self.m_xref | ||
| 370 | - expcube["yref"] = self.m_yref | ||
| 371 | - expcube["binsz"] = self.m_binsz | ||
| 372 | - expcube["nxpix"] = self.m_nxpix | ||
| 373 | - expcube["nypix"] = self.m_nypix | 366 | + expcube["incube"] = "NONE" |
| 367 | + expcube["usepnt"] = False | ||
| 368 | + expcube["ebinalg"] = "LOG" | ||
| 369 | + expcube["xref"] = self.m_xref | ||
| 370 | + expcube["yref"] = self.m_yref | ||
| 371 | + expcube["binsz"] = self.m_binsz | ||
| 372 | + expcube["nxpix"] = self.m_nxpix | ||
| 373 | + expcube["nypix"] = self.m_nypix | ||
| 374 | expcube["enumbins"] = self.m_ebins | 374 | expcube["enumbins"] = self.m_ebins |
| 375 | - expcube["emin"] = emin.TeV() | ||
| 376 | - expcube["emax"] = emax.TeV() | 375 | + expcube["emin"] = emin.TeV() |
| 376 | + expcube["emax"] = emax.TeV() | ||
| 377 | expcube["coordsys"] = self.m_coordsys | 377 | expcube["coordsys"] = self.m_coordsys |
| 378 | - expcube["proj"] = self.m_proj | 378 | + expcube["proj"] = self.m_proj |
| 379 | expcube.run() | 379 | expcube.run() |
| 380 | 380 | ||
| 381 | # Header | 381 | # Header |
| @@ -384,19 +384,19 @@ class csspec(ctools.cscript): | @@ -384,19 +384,19 @@ class csspec(ctools.cscript): | ||
| 384 | 384 | ||
| 385 | # Create psf cube | 385 | # Create psf cube |
| 386 | psfcube = ctools.ctpsfcube(select.obs()) | 386 | psfcube = ctools.ctpsfcube(select.obs()) |
| 387 | - psfcube["incube"] = "NONE" | ||
| 388 | - psfcube["usepnt"] = False | ||
| 389 | - psfcube["ebinalg"] = "LOG" | ||
| 390 | - psfcube["xref"] = self.m_xref | ||
| 391 | - psfcube["yref"] = self.m_yref | ||
| 392 | - psfcube["binsz"] = self.m_binsz | ||
| 393 | - psfcube["nxpix"] = self.m_nxpix | ||
| 394 | - psfcube["nypix"] = self.m_nypix | 387 | + psfcube["incube"] = "NONE" |
| 388 | + psfcube["usepnt"] = False | ||
| 389 | + psfcube["ebinalg"] = "LOG" | ||
| 390 | + psfcube["xref"] = self.m_xref | ||
| 391 | + psfcube["yref"] = self.m_yref | ||
| 392 | + psfcube["binsz"] = self.m_binsz | ||
| 393 | + psfcube["nxpix"] = self.m_nxpix | ||
| 394 | + psfcube["nypix"] = self.m_nypix | ||
| 395 | psfcube["enumbins"] = self.m_ebins | 395 | psfcube["enumbins"] = self.m_ebins |
| 396 | - psfcube["emin"] = emin.TeV() | ||
| 397 | - psfcube["emax"] = emax.TeV() | 396 | + psfcube["emin"] = emin.TeV() |
| 397 | + psfcube["emax"] = emax.TeV() | ||
| 398 | psfcube["coordsys"] = self.m_coordsys | 398 | psfcube["coordsys"] = self.m_coordsys |
| 399 | - psfcube["proj"] = self.m_proj | 399 | + psfcube["proj"] = self.m_proj |
| 400 | psfcube.run() | 400 | psfcube.run() |
| 401 | 401 | ||
| 402 | # Header | 402 | # Header |
| @@ -405,19 +405,19 @@ class csspec(ctools.cscript): | @@ -405,19 +405,19 @@ class csspec(ctools.cscript): | ||
| 405 | 405 | ||
| 406 | # Create background cube | 406 | # Create background cube |
| 407 | bkgcube = ctools.ctbkgcube(select.obs()) | 407 | bkgcube = ctools.ctbkgcube(select.obs()) |
| 408 | - bkgcube["incube"] = "NONE" | ||
| 409 | - bkgcube["usepnt"] = False | ||
| 410 | - bkgcube["ebinalg"] = "LOG" | ||
| 411 | - bkgcube["xref"] = self.m_xref | ||
| 412 | - bkgcube["yref"] = self.m_yref | ||
| 413 | - bkgcube["binsz"] = self.m_binsz | ||
| 414 | - bkgcube["nxpix"] = self.m_nxpix | ||
| 415 | - bkgcube["nypix"] = self.m_nypix | 408 | + bkgcube["incube"] = "NONE" |
| 409 | + bkgcube["usepnt"] = False | ||
| 410 | + bkgcube["ebinalg"] = "LOG" | ||
| 411 | + bkgcube["xref"] = self.m_xref | ||
| 412 | + bkgcube["yref"] = self.m_yref | ||
| 413 | + bkgcube["binsz"] = self.m_binsz | ||
| 414 | + bkgcube["nxpix"] = self.m_nxpix | ||
| 415 | + bkgcube["nypix"] = self.m_nypix | ||
| 416 | bkgcube["enumbins"] = self.m_ebins | 416 | bkgcube["enumbins"] = self.m_ebins |
| 417 | - bkgcube["emin"] = emin.TeV() | ||
| 418 | - bkgcube["emax"] = emax.TeV() | 417 | + bkgcube["emin"] = emin.TeV() |
| 418 | + bkgcube["emax"] = emax.TeV() | ||
| 419 | bkgcube["coordsys"] = self.m_coordsys | 419 | bkgcube["coordsys"] = self.m_coordsys |
| 420 | - bkgcube["proj"] = self.m_proj | 420 | + bkgcube["proj"] = self.m_proj |
| 421 | bkgcube.run() | 421 | bkgcube.run() |
| 422 | 422 | ||
| 423 | # Set new binned observation | 423 | # Set new binned observation |
test/test_ctbin.py
| @@ -64,19 +64,19 @@ class Test(gammalib.GPythonTestSuite): | @@ -64,19 +64,19 @@ class Test(gammalib.GPythonTestSuite): | ||
| 64 | """ | 64 | """ |
| 65 | # Set-up ctbin | 65 | # Set-up ctbin |
| 66 | bin = ctools.ctbin() | 66 | bin = ctools.ctbin() |
| 67 | - bin["inobs"] = self.events_name | ||
| 68 | - bin["outcube"] = "cntmap.fits" | ||
| 69 | - bin["ebinalg"] = "LOG" | ||
| 70 | - bin["emin"] = 0.1 | ||
| 71 | - bin["emax"] = 100.0 | 67 | + bin["inobs"] = self.events_name |
| 68 | + bin["outcube"] = "cntmap.fits" | ||
| 69 | + bin["ebinalg"] = "LOG" | ||
| 70 | + bin["emin"] = 0.1 | ||
| 71 | + bin["emax"] = 100.0 | ||
| 72 | bin["enumbins"] = 20 | 72 | bin["enumbins"] = 20 |
| 73 | - bin["nxpix"] = 200 | ||
| 74 | - bin["nypix"] = 200 | ||
| 75 | - bin["binsz"] = 0.02 | 73 | + bin["nxpix"] = 200 |
| 74 | + bin["nypix"] = 200 | ||
| 75 | + bin["binsz"] = 0.02 | ||
| 76 | bin["coordsys"] = "CEL" | 76 | bin["coordsys"] = "CEL" |
| 77 | - bin["proj"] = "CAR" | ||
| 78 | - bin["xref"] = 83.63 | ||
| 79 | - bin["yref"] = 22.01 | 77 | + bin["proj"] = "CAR" |
| 78 | + bin["xref"] = 83.63 | ||
| 79 | + bin["yref"] = 22.01 | ||
| 80 | 80 | ||
| 81 | # Run tool | 81 | # Run tool |
| 82 | self.test_try("Run ctbin") | 82 | self.test_try("Run ctbin") |
test/test_ctbkgcube.py
| @@ -67,24 +67,24 @@ class Test(gammalib.GPythonTestSuite): | @@ -67,24 +67,24 @@ class Test(gammalib.GPythonTestSuite): | ||
| 67 | """ | 67 | """ |
| 68 | # Set-up ctbkgcube | 68 | # Set-up ctbkgcube |
| 69 | bkgcube = ctools.ctbkgcube() | 69 | bkgcube = ctools.ctbkgcube() |
| 70 | - bkgcube["inobs"] = self.events_name | ||
| 71 | - bkgcube["inmodel"] = self.bkg_model | ||
| 72 | - bkgcube["incube"] = "NONE" | ||
| 73 | - bkgcube["outcube"] = "bkgcube.fits" | 70 | + bkgcube["inobs"] = self.events_name |
| 71 | + bkgcube["inmodel"] = self.bkg_model | ||
| 72 | + bkgcube["incube"] = "NONE" | ||
| 73 | + bkgcube["outcube"] = "bkgcube.fits" | ||
| 74 | bkgcube["outmodel"] = "bkgcube.xml" | 74 | bkgcube["outmodel"] = "bkgcube.xml" |
| 75 | - bkgcube["caldb"] = self.caldb | ||
| 76 | - bkgcube["irf"] = self.irf | ||
| 77 | - bkgcube["ebinalg"] = "LOG" | ||
| 78 | - bkgcube["emin"] = 0.1 | ||
| 79 | - bkgcube["emax"] = 100 | 75 | + bkgcube["caldb"] = self.caldb |
| 76 | + bkgcube["irf"] = self.irf | ||
| 77 | + bkgcube["ebinalg"] = "LOG" | ||
| 78 | + bkgcube["emin"] = 0.1 | ||
| 79 | + bkgcube["emax"] = 100 | ||
| 80 | bkgcube["enumbins"] = 20 | 80 | bkgcube["enumbins"] = 20 |
| 81 | - bkgcube["nxpix"] = 10 | ||
| 82 | - bkgcube["nypix"] = 10 | ||
| 83 | - bkgcube["binsz"] = 0.4 | 81 | + bkgcube["nxpix"] = 10 |
| 82 | + bkgcube["nypix"] = 10 | ||
| 83 | + bkgcube["binsz"] = 0.4 | ||
| 84 | bkgcube["coordsys"] = "CEL" | 84 | bkgcube["coordsys"] = "CEL" |
| 85 | - bkgcube["proj"] = "CAR" | ||
| 86 | - bkgcube["xref"] = 83.63 | ||
| 87 | - bkgcube["yref"] = 22.01 | 85 | + bkgcube["proj"] = "CAR" |
| 86 | + bkgcube["xref"] = 83.63 | ||
| 87 | + bkgcube["yref"] = 22.01 | ||
| 88 | 88 | ||
| 89 | # Run tool | 89 | # Run tool |
| 90 | self.test_try("Run ctbkgcube") | 90 | self.test_try("Run ctbkgcube") |
test/test_ctbutterfly.py
| @@ -67,13 +67,13 @@ class Test(gammalib.GPythonTestSuite): | @@ -67,13 +67,13 @@ class Test(gammalib.GPythonTestSuite): | ||
| 67 | """ | 67 | """ |
| 68 | # Set-up ctbutterfly | 68 | # Set-up ctbutterfly |
| 69 | butterfly = ctools.ctbutterfly() | 69 | butterfly = ctools.ctbutterfly() |
| 70 | - butterfly["inobs"] = self.events_name | 70 | + butterfly["inobs"] = self.events_name |
| 71 | butterfly["inmodel"] = self.model_name | 71 | butterfly["inmodel"] = self.model_name |
| 72 | butterfly["srcname"] = "Crab" | 72 | butterfly["srcname"] = "Crab" |
| 73 | - butterfly["caldb"] = self.caldb | ||
| 74 | - butterfly["irf"] = self.irf | ||
| 75 | - butterfly["emin"] = 0.1 | ||
| 76 | - butterfly["emax"] = 100 | 73 | + butterfly["caldb"] = self.caldb |
| 74 | + butterfly["irf"] = self.irf | ||
| 75 | + butterfly["emin"] = 0.1 | ||
| 76 | + butterfly["emax"] = 100 | ||
| 77 | butterfly["outfile"] = "butterfly.txt" | 77 | butterfly["outfile"] = "butterfly.txt" |
| 78 | 78 | ||
| 79 | # Run tool | 79 | # Run tool |
test/test_ctcubemask.py
| @@ -65,14 +65,14 @@ class Test(gammalib.GPythonTestSuite): | @@ -65,14 +65,14 @@ class Test(gammalib.GPythonTestSuite): | ||
| 65 | """ | 65 | """ |
| 66 | # Set-up ctcubemask | 66 | # Set-up ctcubemask |
| 67 | mask = ctools.ctcubemask() | 67 | mask = ctools.ctcubemask() |
| 68 | - mask["inobs"] = self.cntmap_name | 68 | + mask["inobs"] = self.cntmap_name |
| 69 | mask["regfile"] = self.regfile | 69 | mask["regfile"] = self.regfile |
| 70 | mask["outcube"] = "filtered_cntmap.fits" | 70 | mask["outcube"] = "filtered_cntmap.fits" |
| 71 | - mask["ra"] = 83.63 | ||
| 72 | - mask["dec"] = 22.01 | ||
| 73 | - mask["rad"] = 2.0 | ||
| 74 | - mask["emin"] = 0.1 | ||
| 75 | - mask["emax"] = 100 | 71 | + mask["ra"] = 83.63 |
| 72 | + mask["dec"] = 22.01 | ||
| 73 | + mask["rad"] = 2.0 | ||
| 74 | + mask["emin"] = 0.1 | ||
| 75 | + mask["emax"] = 100 | ||
| 76 | 76 | ||
| 77 | # Run tool | 77 | # Run tool |
| 78 | self.test_try("Run ctcubemask") | 78 | self.test_try("Run ctcubemask") |
test/test_cterror.py
| @@ -68,12 +68,12 @@ class Test(gammalib.GPythonTestSuite): | @@ -68,12 +68,12 @@ class Test(gammalib.GPythonTestSuite): | ||
| 68 | """ | 68 | """ |
| 69 | # Set-up cterror | 69 | # Set-up cterror |
| 70 | error = ctools.cterror() | 70 | error = ctools.cterror() |
| 71 | - error["inobs"].filename(self.events_name) | ||
| 72 | - error["inmodel"].filename(self.model_name) | ||
| 73 | - error["outmodel"].filename(self.result_name) | ||
| 74 | - error["srcname"].string("Crab") | ||
| 75 | - error["caldb"].string(self.caldb) | ||
| 76 | - error["irf"].string(self.irf) | 71 | + error["inobs"] = self.events_name |
| 72 | + error["inmodel"] = self.model_name | ||
| 73 | + error["outmodel"] = self.result_name | ||
| 74 | + error["srcname"] = "Crab" | ||
| 75 | + error["caldb"] = self.caldb | ||
| 76 | + error["irf"] = self.irf | ||
| 77 | 77 | ||
| 78 | # Run tool | 78 | # Run tool |
| 79 | self.test_try("Run cterror") | 79 | self.test_try("Run cterror") |
test/test_ctexpcube.py
| @@ -66,22 +66,22 @@ class Test(gammalib.GPythonTestSuite): | @@ -66,22 +66,22 @@ class Test(gammalib.GPythonTestSuite): | ||
| 66 | """ | 66 | """ |
| 67 | # Set-up ctexpcube | 67 | # Set-up ctexpcube |
| 68 | expcube = ctools.ctexpcube() | 68 | expcube = ctools.ctexpcube() |
| 69 | - expcube["inobs"] = self.events_name | ||
| 70 | - expcube["incube"] = "NONE" | ||
| 71 | - expcube["outcube"] = "expcube.fits" | ||
| 72 | - expcube["caldb"] = self.caldb | ||
| 73 | - expcube["irf"] = self.irf | ||
| 74 | - expcube["ebinalg"] = "LOG" | ||
| 75 | - expcube["emin"] = 0.1 | ||
| 76 | - expcube["emax"] = 100 | 69 | + expcube["inobs"] = self.events_name |
| 70 | + expcube["incube"] = "NONE" | ||
| 71 | + expcube["outcube"] = "expcube.fits" | ||
| 72 | + expcube["caldb"] = self.caldb | ||
| 73 | + expcube["irf"] = self.irf | ||
| 74 | + expcube["ebinalg"] = "LOG" | ||
| 75 | + expcube["emin"] = 0.1 | ||
| 76 | + expcube["emax"] = 100 | ||
| 77 | expcube["enumbins"] = 20 | 77 | expcube["enumbins"] = 20 |
| 78 | - expcube["nxpix"] = 200 | ||
| 79 | - expcube["nypix"] = 200 | ||
| 80 | - expcube["binsz"] = 0.02 | 78 | + expcube["nxpix"] = 200 |
| 79 | + expcube["nypix"] = 200 | ||
| 80 | + expcube["binsz"] = 0.02 | ||
| 81 | expcube["coordsys"] = "CEL" | 81 | expcube["coordsys"] = "CEL" |
| 82 | - expcube["proj"] = "CAR" | ||
| 83 | - expcube["xref"] = 83.63 | ||
| 84 | - expcube["yref"] = 22.01 | 82 | + expcube["proj"] = "CAR" |
| 83 | + expcube["xref"] = 83.63 | ||
| 84 | + expcube["yref"] = 22.01 | ||
| 85 | 85 | ||
| 86 | # Run tool | 86 | # Run tool |
| 87 | self.test_try("Run ctexpcube") | 87 | self.test_try("Run ctexpcube") |
test/test_ctlike.py
| @@ -67,11 +67,11 @@ class Test(gammalib.GPythonTestSuite): | @@ -67,11 +67,11 @@ class Test(gammalib.GPythonTestSuite): | ||
| 67 | """ | 67 | """ |
| 68 | # Set-up ctlike | 68 | # Set-up ctlike |
| 69 | like = ctools.ctlike() | 69 | like = ctools.ctlike() |
| 70 | - like["inobs"].filename(self.events_name) | ||
| 71 | - like["inmodel"].filename(self.model_name) | ||
| 72 | - like["caldb"].string(self.caldb) | ||
| 73 | - like["irf"].string(self.irf) | ||
| 74 | - like["outmodel"].filename("result.xml") | 70 | + like["inobs"] = self.events_name |
| 71 | + like["inmodel"] = self.model_name | ||
| 72 | + like["caldb"] = self.caldb | ||
| 73 | + like["irf"] = self.irf | ||
| 74 | + like["outmodel"] = "result.xml" | ||
| 75 | 75 | ||
| 76 | # Run tool | 76 | # Run tool |
| 77 | self.test_try("Run ctlike") | 77 | self.test_try("Run ctlike") |
test/test_ctmodel.py
| @@ -66,30 +66,30 @@ class Test(gammalib.GPythonTestSuite): | @@ -66,30 +66,30 @@ class Test(gammalib.GPythonTestSuite): | ||
| 66 | """ | 66 | """ |
| 67 | # Set-up ctmodel from scratch | 67 | # Set-up ctmodel from scratch |
| 68 | model = ctools.ctmodel() | 68 | model = ctools.ctmodel() |
| 69 | - model["incube"] = "NONE" | ||
| 70 | - model["outcube"] = "modmap.fits" | ||
| 71 | - model["inmodel"] = self.model_name | ||
| 72 | - model["inobs"] = "NONE" | ||
| 73 | - model["expcube"] = "NONE" | ||
| 74 | - model["psfcube"] = "NONE" | ||
| 75 | - model["bkgcube"] = "NONE" | ||
| 76 | - model["caldb"] = self.caldb | ||
| 77 | - model["irf"] = self.irf | ||
| 78 | - model["rad"] = 5 | ||
| 79 | - model["ra"] = 83.63 | ||
| 80 | - model["dec"] = 22.01 | ||
| 81 | - model["tmin"] = 0 | ||
| 82 | - model["tmax"] = 1800 | ||
| 83 | - model["emin"] = 0.1 | ||
| 84 | - model["emax"] = 100 | 69 | + model["incube"] = "NONE" |
| 70 | + model["outcube"] = "modmap.fits" | ||
| 71 | + model["inmodel"] = self.model_name | ||
| 72 | + model["inobs"] = "NONE" | ||
| 73 | + model["expcube"] = "NONE" | ||
| 74 | + model["psfcube"] = "NONE" | ||
| 75 | + model["bkgcube"] = "NONE" | ||
| 76 | + model["caldb"] = self.caldb | ||
| 77 | + model["irf"] = self.irf | ||
| 78 | + model["rad"] = 5 | ||
| 79 | + model["ra"] = 83.63 | ||
| 80 | + model["dec"] = 22.01 | ||
| 81 | + model["tmin"] = 0 | ||
| 82 | + model["tmax"] = 1800 | ||
| 83 | + model["emin"] = 0.1 | ||
| 84 | + model["emax"] = 100 | ||
| 85 | model["enumbins"] = 20 | 85 | model["enumbins"] = 20 |
| 86 | - model["nxpix"] = 200 | ||
| 87 | - model["nypix"] = 200 | ||
| 88 | - model["binsz"] = 0.02 | 86 | + model["nxpix"] = 200 |
| 87 | + model["nypix"] = 200 | ||
| 88 | + model["binsz"] = 0.02 | ||
| 89 | model["coordsys"] = "CEL" | 89 | model["coordsys"] = "CEL" |
| 90 | - model["proj"] = "CAR" | ||
| 91 | - model["xref"] = 83.63 | ||
| 92 | - model["yref"] = 22.01 | 90 | + model["proj"] = "CAR" |
| 91 | + model["xref"] = 83.63 | ||
| 92 | + model["yref"] = 22.01 | ||
| 93 | 93 | ||
| 94 | # Run tool | 94 | # Run tool |
| 95 | self.test_try("Run ctmodel") | 95 | self.test_try("Run ctmodel") |
test/test_ctobssim.py
| @@ -67,17 +67,17 @@ class Test(gammalib.GPythonTestSuite): | @@ -67,17 +67,17 @@ class Test(gammalib.GPythonTestSuite): | ||
| 67 | """ | 67 | """ |
| 68 | # Set-up ctobssim | 68 | # Set-up ctobssim |
| 69 | sim = ctools.ctobssim() | 69 | sim = ctools.ctobssim() |
| 70 | - sim["inmodel"] = self.model_name | 70 | + sim["inmodel"] = self.model_name |
| 71 | sim["outevents"] = "events.fits" | 71 | sim["outevents"] = "events.fits" |
| 72 | - sim["caldb"] = self.caldb | ||
| 73 | - sim["irf"] = self.irf | ||
| 74 | - sim["ra"] = 83.63 | ||
| 75 | - sim["dec"] = 22.01 | ||
| 76 | - sim["rad"] = 10.0 | ||
| 77 | - sim["tmin"] = 0.0 | ||
| 78 | - sim["tmax"] = 1800.0 | ||
| 79 | - sim["emin"] = 0.1 | ||
| 80 | - sim["emax"] = 100.0 | 72 | + sim["caldb"] = self.caldb |
| 73 | + sim["irf"] = self.irf | ||
| 74 | + sim["ra"] = 83.63 | ||
| 75 | + sim["dec"] = 22.01 | ||
| 76 | + sim["rad"] = 10.0 | ||
| 77 | + sim["tmin"] = 0.0 | ||
| 78 | + sim["tmax"] = 1800.0 | ||
| 79 | + sim["emin"] = 0.1 | ||
| 80 | + sim["emax"] = 100.0 | ||
| 81 | 81 | ||
| 82 | # Run tool | 82 | # Run tool |
| 83 | self.test_try("Run ctobssim") | 83 | self.test_try("Run ctobssim") |
| @@ -118,7 +118,7 @@ class Test(gammalib.GPythonTestSuite): | @@ -118,7 +118,7 @@ class Test(gammalib.GPythonTestSuite): | ||
| 118 | # Set-up ctobssim | 118 | # Set-up ctobssim |
| 119 | sim = ctools.ctobssim(obs) | 119 | sim = ctools.ctobssim(obs) |
| 120 | sim["outevents"] = "sim_events.xml" | 120 | sim["outevents"] = "sim_events.xml" |
| 121 | - sim["inmodel"] = self.model_name | 121 | + sim["inmodel"] = self.model_name |
| 122 | # Run tool | 122 | # Run tool |
| 123 | self.test_try("Run ctobssim") | 123 | self.test_try("Run ctobssim") |
| 124 | try: | 124 | try: |
test/test_ctpsfcube.py
| @@ -66,23 +66,23 @@ class Test(gammalib.GPythonTestSuite): | @@ -66,23 +66,23 @@ class Test(gammalib.GPythonTestSuite): | ||
| 66 | """ | 66 | """ |
| 67 | # Set-up ctpsfcube | 67 | # Set-up ctpsfcube |
| 68 | psfcube = ctools.ctpsfcube() | 68 | psfcube = ctools.ctpsfcube() |
| 69 | - psfcube["inobs"] = self.events_name | ||
| 70 | - psfcube["incube"] = "NONE" | ||
| 71 | - psfcube["outcube"] = "psfcube.fits" | ||
| 72 | - psfcube["caldb"] = self.caldb | ||
| 73 | - psfcube["irf"] = self.irf | ||
| 74 | - psfcube["ebinalg"] = "LOG" | ||
| 75 | - psfcube["emin"] = 0.1 | ||
| 76 | - psfcube["emax"] = 100 | 69 | + psfcube["inobs"] = self.events_name |
| 70 | + psfcube["incube"] = "NONE" | ||
| 71 | + psfcube["outcube"] = "psfcube.fits" | ||
| 72 | + psfcube["caldb"] = self.caldb | ||
| 73 | + psfcube["irf"] = self.irf | ||
| 74 | + psfcube["ebinalg"] = "LOG" | ||
| 75 | + psfcube["emin"] = 0.1 | ||
| 76 | + psfcube["emax"] = 100 | ||
| 77 | psfcube["enumbins"] = 20 | 77 | psfcube["enumbins"] = 20 |
| 78 | - psfcube["nxpix"] = 10 | ||
| 79 | - psfcube["nypix"] = 10 | ||
| 80 | - psfcube["binsz"] = 0.4 | 78 | + psfcube["nxpix"] = 10 |
| 79 | + psfcube["nypix"] = 10 | ||
| 80 | + psfcube["binsz"] = 0.4 | ||
| 81 | psfcube["coordsys"] = "CEL" | 81 | psfcube["coordsys"] = "CEL" |
| 82 | - psfcube["proj"] = "CAR" | ||
| 83 | - psfcube["xref"] = 83.63 | ||
| 84 | - psfcube["yref"] = 22.01 | ||
| 85 | - psfcube["amax"] = 0.3 | 82 | + psfcube["proj"] = "CAR" |
| 83 | + psfcube["xref"] = 83.63 | ||
| 84 | + psfcube["yref"] = 22.01 | ||
| 85 | + psfcube["amax"] = 0.3 | ||
| 86 | psfcube["anumbins"] = 10 | 86 | psfcube["anumbins"] = 10 |
| 87 | 87 | ||
| 88 | # Run tool | 88 | # Run tool |
test/test_ctselect.py
| @@ -64,15 +64,15 @@ class Test(gammalib.GPythonTestSuite): | @@ -64,15 +64,15 @@ class Test(gammalib.GPythonTestSuite): | ||
| 64 | """ | 64 | """ |
| 65 | # Set-up ctselect | 65 | # Set-up ctselect |
| 66 | select = ctools.ctselect() | 66 | select = ctools.ctselect() |
| 67 | - select["inobs"] = self.events_name | 67 | + select["inobs"] = self.events_name |
| 68 | select["outobs"] = "selected_events.fits" | 68 | select["outobs"] = "selected_events.fits" |
| 69 | - select["ra"] = 83.63 | ||
| 70 | - select["dec"] = 22.01 | ||
| 71 | - select["rad"] = 3 | ||
| 72 | - select["tmin"] = 0 | ||
| 73 | - select["tmax"] = 1800 | ||
| 74 | - select["emin"] = 0.1 | ||
| 75 | - select["emax"] = 100 | 69 | + select["ra"] = 83.63 |
| 70 | + select["dec"] = 22.01 | ||
| 71 | + select["rad"] = 3 | ||
| 72 | + select["tmin"] = 0 | ||
| 73 | + select["tmax"] = 1800 | ||
| 74 | + select["emin"] = 0.1 | ||
| 75 | + select["emax"] = 100 | ||
| 76 | 76 | ||
| 77 | # Run tool | 77 | # Run tool |
| 78 | self.test_try("Run ctselect") | 78 | self.test_try("Run ctselect") |
test/test_ctskymap.py
| @@ -64,17 +64,17 @@ class Test(gammalib.GPythonTestSuite): | @@ -64,17 +64,17 @@ class Test(gammalib.GPythonTestSuite): | ||
| 64 | """ | 64 | """ |
| 65 | # Set-up ctskymap | 65 | # Set-up ctskymap |
| 66 | skymap = ctools.ctskymap() | 66 | skymap = ctools.ctskymap() |
| 67 | - skymap["inobs"] = self.events_name | ||
| 68 | - skymap["outmap"] = "skymap.fits" | ||
| 69 | - skymap["emin"] = 0.1 | ||
| 70 | - skymap["emax"] = 100 | ||
| 71 | - skymap["nxpix"] = 200 | ||
| 72 | - skymap["nypix"] = 200 | ||
| 73 | - skymap["binsz"] = 0.02 | 67 | + skymap["inobs"] = self.events_name |
| 68 | + skymap["outmap"] = "skymap.fits" | ||
| 69 | + skymap["emin"] = 0.1 | ||
| 70 | + skymap["emax"] = 100 | ||
| 71 | + skymap["nxpix"] = 200 | ||
| 72 | + skymap["nypix"] = 200 | ||
| 73 | + skymap["binsz"] = 0.02 | ||
| 74 | skymap["coordsys"] = "CEL" | 74 | skymap["coordsys"] = "CEL" |
| 75 | - skymap["proj"] = "CAR" | ||
| 76 | - skymap["xref"] = 83.63 | ||
| 77 | - skymap["yref"] = 22.01 | 75 | + skymap["proj"] = "CAR" |
| 76 | + skymap["xref"] = 83.63 | ||
| 77 | + skymap["yref"] = 22.01 | ||
| 78 | 78 | ||
| 79 | # Run tool | 79 | # Run tool |
| 80 | self.test_try("Run ctskymap") | 80 | self.test_try("Run ctskymap") |
test/test_cttsmap.py
| @@ -63,23 +63,23 @@ class Test(gammalib.GPythonTestSuite): | @@ -63,23 +63,23 @@ class Test(gammalib.GPythonTestSuite): | ||
| 63 | # Test cttsmap functionnality | 63 | # Test cttsmap functionnality |
| 64 | def test_functional(self): | 64 | def test_functional(self): |
| 65 | """ | 65 | """ |
| 66 | - Test cttsmap functionnality. | 66 | + Test cttsmap functionality. |
| 67 | """ | 67 | """ |
| 68 | # Set-up cttsmap | 68 | # Set-up cttsmap |
| 69 | tsmap = ctools.cttsmap() | 69 | tsmap = ctools.cttsmap() |
| 70 | - tsmap["inobs"] = self.events_name | ||
| 71 | - tsmap["inmodel"] = self.model_name | ||
| 72 | - tsmap["srcname"] = "Crab" | ||
| 73 | - tsmap["caldb"] = self.caldb | ||
| 74 | - tsmap["irf"] = self.irf | ||
| 75 | - tsmap["outmap"] = "tsmap.fits" | ||
| 76 | - tsmap["nxpix"] = 5 | ||
| 77 | - tsmap["nypix"] = 5 | ||
| 78 | - tsmap["binsz"] = 0.02 | 70 | + tsmap["inobs"] = self.events_name |
| 71 | + tsmap["inmodel"] = self.model_name | ||
| 72 | + tsmap["srcname"] = "Crab" | ||
| 73 | + tsmap["caldb"] = self.caldb | ||
| 74 | + tsmap["irf"] = self.irf | ||
| 75 | + tsmap["outmap"] = "tsmap.fits" | ||
| 76 | + tsmap["nxpix"] = 5 | ||
| 77 | + tsmap["nypix"] = 5 | ||
| 78 | + tsmap["binsz"] = 0.02 | ||
| 79 | tsmap["coordsys"] = "CEL" | 79 | tsmap["coordsys"] = "CEL" |
| 80 | - tsmap["proj"] = "CAR" | ||
| 81 | - tsmap["xref"] = 83.63 | ||
| 82 | - tsmap["yref"] = 22.01 | 80 | + tsmap["proj"] = "CAR" |
| 81 | + tsmap["xref"] = 83.63 | ||
| 82 | + tsmap["yref"] = 22.01 | ||
| 83 | 83 | ||
| 84 | # Run tool | 84 | # Run tool |
| 85 | self.test_try("Run cttsmap") | 85 | self.test_try("Run cttsmap") |
test/test_ctulimit.py
| @@ -67,11 +67,11 @@ class Test(gammalib.GPythonTestSuite): | @@ -67,11 +67,11 @@ class Test(gammalib.GPythonTestSuite): | ||
| 67 | """ | 67 | """ |
| 68 | # Set-up cttsmap | 68 | # Set-up cttsmap |
| 69 | ulimit = ctools.ctulimit() | 69 | ulimit = ctools.ctulimit() |
| 70 | - ulimit["inobs"].filename(self.events_name) | ||
| 71 | - ulimit["inmodel"].filename(self.model_name) | ||
| 72 | - ulimit["srcname"].string("Crab") | ||
| 73 | - ulimit["caldb"].string(self.caldb) | ||
| 74 | - ulimit["irf"].string(self.irf) | 70 | + ulimit["inobs"] = self.events_name |
| 71 | + ulimit["inmodel"] = self.model_name | ||
| 72 | + ulimit["srcname"] = "Crab" | ||
| 73 | + ulimit["caldb"] = self.caldb | ||
| 74 | + ulimit["irf"] = self.irf | ||
| 75 | 75 | ||
| 76 | # Run tool | 76 | # Run tool |
| 77 | self.test_try("Run ctulimit") | 77 | self.test_try("Run ctulimit") |
test/test_pipelines.py
| @@ -78,17 +78,17 @@ class Test(gammalib.GPythonTestSuite): | @@ -78,17 +78,17 @@ class Test(gammalib.GPythonTestSuite): | ||
| 78 | 78 | ||
| 79 | # Simulate events | 79 | # Simulate events |
| 80 | sim = ctools.ctobssim() | 80 | sim = ctools.ctobssim() |
| 81 | - sim["inmodel"] = model_name | 81 | + sim["inmodel"] = model_name |
| 82 | sim["outevents"] = events_name | 82 | sim["outevents"] = events_name |
| 83 | - sim["caldb"] = caldb | ||
| 84 | - sim["irf"] = irf | ||
| 85 | - sim["ra"] = ra | ||
| 86 | - sim["dec"] = dec | ||
| 87 | - sim["rad"] = rad_sim | ||
| 88 | - sim["tmin"] = tstart | ||
| 89 | - sim["tmax"] = tstop | ||
| 90 | - sim["emin"] = emin | ||
| 91 | - sim["emax"] = emax | 83 | + sim["caldb"] = caldb |
| 84 | + sim["irf"] = irf | ||
| 85 | + sim["ra"] = ra | ||
| 86 | + sim["dec"] = dec | ||
| 87 | + sim["rad"] = rad_sim | ||
| 88 | + sim["tmin"] = tstart | ||
| 89 | + sim["tmax"] = tstop | ||
| 90 | + sim["emin"] = emin | ||
| 91 | + sim["emax"] = emax | ||
| 92 | self.test_try("Execute ctobssim") | 92 | self.test_try("Execute ctobssim") |
| 93 | try: | 93 | try: |
| 94 | sim.execute() | 94 | sim.execute() |
| @@ -98,15 +98,15 @@ class Test(gammalib.GPythonTestSuite): | @@ -98,15 +98,15 @@ class Test(gammalib.GPythonTestSuite): | ||
| 98 | 98 | ||
| 99 | # Select events | 99 | # Select events |
| 100 | select = ctools.ctselect() | 100 | select = ctools.ctselect() |
| 101 | - select["inobs"] = events_name | 101 | + select["inobs"] = events_name |
| 102 | select["outobs"] = selected_events_name | 102 | select["outobs"] = selected_events_name |
| 103 | - select["ra"] = ra | ||
| 104 | - select["dec"] = dec | ||
| 105 | - select["rad"] = rad_select | ||
| 106 | - select["tmin"] = tstart | ||
| 107 | - select["tmax"] = tstop | ||
| 108 | - select["emin"] = emin | ||
| 109 | - select["emax"] = emax | 103 | + select["ra"] = ra |
| 104 | + select["dec"] = dec | ||
| 105 | + select["rad"] = rad_select | ||
| 106 | + select["tmin"] = tstart | ||
| 107 | + select["tmax"] = tstop | ||
| 108 | + select["emin"] = emin | ||
| 109 | + select["emax"] = emax | ||
| 110 | self.test_try("Execute ctselect") | 110 | self.test_try("Execute ctselect") |
| 111 | try: | 111 | try: |
| 112 | select.execute() | 112 | select.execute() |
| @@ -116,11 +116,11 @@ class Test(gammalib.GPythonTestSuite): | @@ -116,11 +116,11 @@ class Test(gammalib.GPythonTestSuite): | ||
| 116 | 116 | ||
| 117 | # Perform maximum likelihood fitting | 117 | # Perform maximum likelihood fitting |
| 118 | like = ctools.ctlike() | 118 | like = ctools.ctlike() |
| 119 | - like["inobs"] = selected_events_name | ||
| 120 | - like["inmodel"] = model_name | 119 | + like["inobs"] = selected_events_name |
| 120 | + like["inmodel"] = model_name | ||
| 121 | like["outmodel"] = result_name | 121 | like["outmodel"] = result_name |
| 122 | - like["caldb"] = caldb | ||
| 123 | - like["irf"] = irf | 122 | + like["caldb"] = caldb |
| 123 | + like["irf"] = irf | ||
| 124 | self.test_try("Execute ctlike") | 124 | self.test_try("Execute ctlike") |
| 125 | try: | 125 | try: |
| 126 | like.execute() | 126 | like.execute() |
| @@ -150,15 +150,15 @@ class Test(gammalib.GPythonTestSuite): | @@ -150,15 +150,15 @@ class Test(gammalib.GPythonTestSuite): | ||
| 150 | # Simulate events | 150 | # Simulate events |
| 151 | sim = ctools.ctobssim() | 151 | sim = ctools.ctobssim() |
| 152 | sim["inmodel"] = model_name | 152 | sim["inmodel"] = model_name |
| 153 | - sim["caldb"] = caldb | ||
| 154 | - sim["irf"] = irf | ||
| 155 | - sim["ra"] = ra | ||
| 156 | - sim["dec"] = dec | ||
| 157 | - sim["rad"] = rad_sim | ||
| 158 | - sim["tmin"] = tstart | ||
| 159 | - sim["tmax"] = tstop | ||
| 160 | - sim["emin"] = emin | ||
| 161 | - sim["emax"] = emax | 153 | + sim["caldb"] = caldb |
| 154 | + sim["irf"] = irf | ||
| 155 | + sim["ra"] = ra | ||
| 156 | + sim["dec"] = dec | ||
| 157 | + sim["rad"] = rad_sim | ||
| 158 | + sim["tmin"] = tstart | ||
| 159 | + sim["tmax"] = tstop | ||
| 160 | + sim["emin"] = emin | ||
| 161 | + sim["emax"] = emax | ||
| 162 | self.test_try("Run ctobssim") | 162 | self.test_try("Run ctobssim") |
| 163 | try: | 163 | try: |
| 164 | sim.run() | 164 | sim.run() |
| @@ -168,9 +168,9 @@ class Test(gammalib.GPythonTestSuite): | @@ -168,9 +168,9 @@ class Test(gammalib.GPythonTestSuite): | ||
| 168 | 168 | ||
| 169 | # Select events | 169 | # Select events |
| 170 | select = ctools.ctselect(sim.obs()) | 170 | select = ctools.ctselect(sim.obs()) |
| 171 | - select["ra"] = ra | ||
| 172 | - select["dec"] = dec | ||
| 173 | - select["rad"] = rad_select | 171 | + select["ra"] = ra |
| 172 | + select["dec"] = dec | ||
| 173 | + select["rad"] = rad_select | ||
| 174 | select["tmin"] = tstart | 174 | select["tmin"] = tstart |
| 175 | select["tmax"] = tstop | 175 | select["tmax"] = tstop |
| 176 | select["emin"] = emin | 176 | select["emin"] = emin |