events_paths list from loop
"%%time\n",
"n_obs = len(tstarts)\n",
"irf_paths = [Path(irf_filename)] * n_obs\n",
+ "events_paths = []\n",
"for idx, tstart in enumerate(tstarts):\n",
" irf_path = load_cta_irfs(irf_paths[idx])\n",
" observation = Observation.create(\n",
"\n",
" dataset = maker.run(empty, observation)\n",
" dataset.models = models\n",
- "\n",
" sampler = MapDatasetEventSampler(random_state=idx)\n",
" events = sampler.run(dataset, observation)\n",
- " events.table.write(\n",
- " f\"./event_sampling/events_{idx:04d}.fits\", overwrite=True\n",
- " )"
+ " \n",
+ " path = Path(f\"./event_sampling/events_{idx:04d}.fits\")\n",
+ " events_paths.append(path)\n",
+ " events.table.write(path, overwrite=True)"
]
},
{
