Skip to content

Commit

Permalink
putting combined product information back into this tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
Jessica Pilling committed Mar 28, 2024
1 parent f80da52 commit b606c55
Showing 1 changed file with 62 additions and 15 deletions.
77 changes: 62 additions & 15 deletions docs/source/notebooks/tutorials/photometry.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1069,43 +1069,83 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"For XMM observations of a source, it is possible to combine each photometric product (ie. for each instrument for each observation). This is fully detailed in [the multi mission tutorial](multimission.ipynb)."
"As there are generated images for all the ObsIDs and instruments associated with the source, it is possible to bring all that information together by creating a combined image. Most XGA analyses take place on combined products, because that ability to find all relevant data for a particular source is one of XGA's key strengths. For XMM data this is done through XGA's interaction with the SAS routine emosaic. (eROSITA photometric products already combine all instruments when they are initally generated)"
]
},
{
"cell_type": "markdown",
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"## Retrieving and using masks from a source"
"# For the single source\n",
"demo_src = emosaic(demo_src, 'image', lo_en=lo_en, hi_en=hi_en)\n",
"\n",
"# For the sample\n",
"demo_smp = emosaic(demo_smp, 'image', lo_en=lo_en, hi_en=hi_en)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"It is common practise in photometric analyses to mask out any sources that might bias or interfere with the source that you are investigating, and as such each XGA source object is able to produce masking arrays. These masking arrays are filled with ones and zeros, where any zero elements are to be considered 'masked', and masked image/expmap/ratemap data can be calculated by multiplying the image/expmap/ratemap data by the masking array.\n",
"\n",
"XGA is capable of producing several types of mask; interloper masks (where non-relevant sources are masked), source masks (where any part of the product not within a certain source region is masked out), and standard masks (which are a combination of the last two types).\n",
"\n",
"An XGA source can generate masks for any of the ObsIDs associated with it. \n",
"\n",
"This will be demonstrated on an XMM ratemap that is a combination of all observations of this source for every instrument (for more details on combined products see [the multi mission tutorial](multimission.ipynb)). Firstly, let's generate it:"
"Similarly this may be done with exposure maps."
]
},
{
"cell_type": "code",
"execution_count": 39,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# To get a combined ratemap, the combined images and exposure maps must first be made\n",
"demo_src = emosaic(demo_src, 'image', lo_en=lo_en, hi_en=hi_en)\n",
"# For the single source\n",
"demo_src = emosaic(demo_src, 'expmap', lo_en=lo_en, hi_en=hi_en)\n",
"\n",
"\n",
"# For the sample\n",
"demo_smp = emosaic(demo_smp, 'expmap', lo_en=lo_en, hi_en=hi_en)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"XGA will then automatically create a combined ratemap, which may be retrieved as follows:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"chosen_comb_rt = demo_src.get_combined_ratemaps(lo_en=lo_en, hi_en=hi_en)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"This ratemap is used for the rest of this tutorial to demonstrate XGA's inbuilt photometric functions."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Retrieving and using masks from a source"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"It is common practise in photometric analyses to mask out any sources that might bias or interfere with the source that you are investigating, and as such each XGA source object is able to produce masking arrays. These masking arrays are filled with ones and zeros, where any zero elements are to be considered 'masked', and masked image/expmap/ratemap data can be calculated by multiplying the image/expmap/ratemap data by the masking array.\n",
"\n",
"XGA is capable of producing several types of mask; interloper masks (where non-relevant sources are masked), source masks (where any part of the product not within a certain source region is masked out), and standard masks (which are a combination of the last two types).\n",
"\n",
"An XGA source can generate masks for any of the ObsIDs associated with it. "
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down Expand Up @@ -1684,6 +1724,13 @@
"# And of course we can generate images and exposure maps in the same way as with the other sources\n",
"evselect_image(bulk_src, lo_en=lo_en, hi_en=hi_en)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**For NullSources** combined photometric products can only be made if the associated observations have a coordinate in common."
]
}
],
"metadata": {
Expand All @@ -1702,7 +1749,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.13"
"version": "3.9.13"
},
"vscode": {
"interpreter": {
Expand Down

0 comments on commit b606c55

Please sign in to comment.