Update simulate_3d notebook to use FixedPointingInfo
"from gammapy.cube.models import SkyModel, SkyModels, BackgroundModel\n",
"from gammapy.cube import MapDataset, MapEvaluator, PSFKernel\n",
"from gammapy.cube import make_map_exposure_true_energy, make_map_background_irf\n",
- "from gammapy.utils.fitting import Fit"
+ "from gammapy.utils.fitting import Fit\n",
+ "from gammapy.data import FixedPointingInfo"
]
},
{
"outputs": [],
"source": [
"# Define some observation parameters\n",
- "# Here we just have a single observation,\n",
- "# we are not simulating many pointings / observations\n",
- "pointing = SkyCoord(1, 0.5, unit=\"deg\", frame=\"galactic\")\n",
+ "# We read in the pointing info from one of the 1dc event list files as an example\n",
+ "pointing = FixedPointingInfo.read(\"$GAMMAPY_DATA/cta-1dc/data/baseline/gps/gps_baseline_110380.fits\")\n",
+ "\n",
"livetime = 1 * u.hour\n",
"offset_max = 2 * u.deg\n",
"offset = Angle(\"2 deg\")"
"outputs": [],
"source": [
"exposure = make_map_exposure_true_energy(\n",
- " pointing=pointing, livetime=livetime, aeff=irfs[\"aeff\"], geom=geom\n",
+ " pointing=pointing.radec, livetime=livetime, aeff=irfs[\"aeff\"], geom=geom\n",
")\n",
"exposure.slice_by_idx({\"energy\": 3}).plot(add_cbar=True);"
]
"background = make_map_background_irf(\n",
" pointing=pointing, ontime=livetime, bkg=irfs[\"bkg\"], geom=geom\n",
")\n",
- "background.slice_by_idx({\"energy\": 3}).plot(add_cbar=True);\n"
+ "background.slice_by_idx({\"energy\": 3}).plot(add_cbar=True);"
]
},
{
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
- "version": "3.7.0"
+ "version": "3.6.0"
}
},
"nbformat": 4,
