Skip to content

Commit

Permalink
Replace data_loader with data_inferface in the image deconvolution no…
Browse files Browse the repository at this point in the history
…tebooks and added links to related notebooks on the image deconvolution notebooks
  • Loading branch information
hiyoneda committed Jul 29, 2024
1 parent 14fc4c4 commit b8c24dd
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 67 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
"source": [
"# DC2 Image Analysis, 511 keV, Image Deconvolution using CDS in the Galactic coordinate system\n",
"\n",
"updated on 2024-07-02 (the commit 1d5cb62597aab7598a0c92ded2d0c381aaa3fd10)\n",
"updated on 2024-07-29 (the commit 14fc4c42f8b33749bd2053603643ca693dbc3954)\n",
"\n",
"This notebook focuses on the image deconvolution with the Compton data space (CDS) in the Galactic coordinate system.\n",
"An example of the image analysis will be presented using the 511keV thin disk 3-month simulation data created for DC2.\n",
"\n",
"In DC2, we have two options on the coordinate system to describe the Compton scattering direction ($\\chi\\psi$) in the image deconvolution. Please also check the notes written in 511keV-DC2-ScAtt-DataReduction.ipynb."
"In DC2, we have two options on the coordinate system to describe the Compton scattering direction ($\\chi\\psi$) in the image deconvolution. Please also check the notes written in [511keV-DC2-ScAtt-DataReduction.ipynb](https://github.com/cositools/cosipy/blob/main/docs/tutorials/image_deconvolution/511keV/ScAttBinning/511keV-DC2-ScAtt-DataReduction.ipynb)"
]
},
{
Expand Down Expand Up @@ -488,7 +488,7 @@
"id": "e0a2582e",
"metadata": {},
"source": [
"## 3-1. Prepare DataLoader containing all neccesary datasets"
"## 3-1. Prepare DataInterface containing all necessary datasets"
]
},
{
Expand Down Expand Up @@ -528,12 +528,12 @@
"source": [
"%%time\n",
"\n",
"dataloader = DataIF_COSI_DC2.load(name = \"511keV\",\n",
" event_binned_data = event.project(['Em', 'Phi', 'PsiChi']),\n",
" dict_bkg_binned_data = {\"albedo\": bkg.project(['Em', 'Phi', 'PsiChi'])},\n",
" rsp = image_response,\n",
" coordsys_conv_matrix=None,\n",
" is_miniDC2_format=False)"
"data_interface = DataIF_COSI_DC2.load(name = \"511keV\",\n",
" event_binned_data = event.project(['Em', 'Phi', 'PsiChi']),\n",
" dict_bkg_binned_data = {\"albedo\": bkg.project(['Em', 'Phi', 'PsiChi'])},\n",
" rsp = image_response,\n",
" coordsys_conv_matrix=None,\n",
" is_miniDC2_format=False)"
]
},
{
Expand Down Expand Up @@ -573,8 +573,8 @@
"source": [
"image_deconvolution = ImageDeconvolution()\n",
"\n",
"# set dataloader to image_deconvolution\n",
"image_deconvolution.set_dataset([dataloader])\n",
"# set data_interface to image_deconvolution\n",
"image_deconvolution.set_dataset([data_interface])\n",
"\n",
"# set a parameter file for the image deconvolution\n",
"image_deconvolution.read_parameterfile(parameter_filepath)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"\n",
"This notebook focuses on how to produce the binned datasets with the spacecraft attitude (scatt) binning method for DC2.\n",
"Using the 511keV thin disk 3-month simulation data created for DC2, an example of the image analysis will be presented.\n",
"After running through this notebook, you can go to the next notebook, 511keV-DC2-ScAtt-ImageDeconvolution.ipynb.\n",
"After running through this notebook, you can go to the next notebook, [511keV-DC2-ScAtt-ImageDeconvolution.ipynb](https://github.com/cositools/cosipy/blob/main/docs/tutorials/image_deconvolution/511keV/ScAttBinning/511keV-DC2-ScAtt-ImageDeconvolution.ipynb).\n",
"\n",
"### Notes on the coordinate system of Compton data space in the image deconvolution ###\n",
"\n",
Expand All @@ -26,11 +26,11 @@
"While both methods have pros and cons, our baseline is to eventually use the Galactic coordinate. But we still need to carefully investigate how they will be scaled with longer exposure, finer pixel resolution, etc. Thus, we provide the notebooks of both methods for the image deconvolution in DC2.\n",
"\n",
"For the Crab image analysis, the following notebooks are based on the scatt binning method\n",
"- ScAttBinning/511keV-DC2-ScAtt-DataReduction.ipynb\n",
"- ScAttBinning/511keV-DC2-ScAtt-ImageDeconvolution.ipynb\n",
"- ScAttBinning/511keV-DC2-ScAtt-Upsampling.ipynb\n",
"- [ScAttBinning/511keV-DC2-ScAtt-DataReduction.ipynb](https://github.com/cositools/cosipy/blob/main/docs/tutorials/image_deconvolution/511keV/ScAttBinning/511keV-DC2-ScAtt-DataReduction.ipynb)\n",
"- [ScAttBinning/511keV-DC2-ScAtt-ImageDeconvolution.ipynb](https://github.com/cositools/cosipy/blob/main/docs/tutorials/image_deconvolution/511keV/ScAttBinning/511keV-DC2-ScAtt-ImageDeconvolution.ipynb)\n",
"- [ScAttBinning/511keV-DC2-ScAtt-Upsampling.ipynb](https://github.com/cositools/cosipy/blob/main/docs/tutorials/image_deconvolution/511keV/ScAttBinning/511keV-DC2-ScAtt-Upsampling.ipynb)\n",
"\n",
"GalacticCDS/511keV-DC2-Galactic-ImageDeconvolution.ipynb uses the galactic coordinate.\n",
"[GalacticCDS/511keV-DC2-Galactic-ImageDeconvolution.ipynb](https://github.com/cositools/cosipy/blob/main/docs/tutorials/image_deconvolution/511keV/GalacticCDS/511keV-DC2-Galactic-ImageDeconvolution.ipynb) uses the galactic coordinate.\n",
"\n",
"If you want to know about the other analysis, e.g., the spectral analysis, you can see the notebooks in docs/tutorials/spectral_fits."
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"source": [
"# DC2 Image Analysis, 511 keV, Image Deconvolution\n",
"\n",
"updated on 2024-07-02 (the commit 1d5cb62597aab7598a0c92ded2d0c381aaa3fd10)\n",
"updated on 2024-07-29 (the commit 14fc4c42f8b33749bd2053603643ca693dbc3954)\n",
"\n",
"This notebook focuses on the image deconvolution with the spacecraft attitude (scatt) binning method for DC2.\n",
"Using the 511 keV thin disk 3-month simulation data created for DC2, an example of the image analysis will be presented.\n",
Expand Down Expand Up @@ -327,7 +327,7 @@
"id": "e0a2582e",
"metadata": {},
"source": [
"### 4-1. Prepare DataLoader containing all neccesary datasets"
"## 4-1. Prepare DataInterface containing all necessary datasets"
]
},
{
Expand Down Expand Up @@ -372,12 +372,12 @@
"source": [
"%%time\n",
"\n",
"dataloader = DataIF_COSI_DC2.load(name = \"511keV\",\n",
" event_binned_data = data_511keV.binned_data,\n",
" dict_bkg_binned_data = {\"albedo\": data_bkg.binned_data},\n",
" rsp = response,\n",
" coordsys_conv_matrix=ccm,\n",
" is_miniDC2_format=False)"
"data_interface = DataIF_COSI_DC2.load(name = \"511keV\",\n",
" event_binned_data = data_511keV.binned_data,\n",
" dict_bkg_binned_data = {\"albedo\": data_bkg.binned_data},\n",
" rsp = response,\n",
" coordsys_conv_matrix=ccm,\n",
" is_miniDC2_format=False)"
]
},
{
Expand Down Expand Up @@ -417,8 +417,8 @@
"source": [
"image_deconvolution = ImageDeconvolution()\n",
"\n",
"# set dataloader to image_deconvolution\n",
"image_deconvolution.set_dataset([dataloader])\n",
"# set data_interface to image_deconvolution\n",
"image_deconvolution.set_dataset([data_interface])\n",
"\n",
"# set a parameter file for the image deconvolution\n",
"image_deconvolution.read_parameterfile(parameter_filepath)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"source": [
"# DC2 Image Analysis, 511keV, Upsampling\n",
"\n",
"updated on 2024-07-02 (the commit 1d5cb62597aab7598a0c92ded2d0c381aaa3fd10)\n",
"updated on 2024-07-29 (the commit 14fc4c42f8b33749bd2053603643ca693dbc3954)\n",
"\n",
"This notebook explains image reconstruction using the pixel resolution of the model map finer than that of the response matrix.\n",
"\n",
Expand Down Expand Up @@ -1202,7 +1202,7 @@
"id": "42ae33b7",
"metadata": {},
"source": [
"## 4-1. Prepare DataLoader containing all neccesary datasets"
"## 4-1. Prepare DataInterface containing all necessary datasets"
]
},
{
Expand Down Expand Up @@ -1247,12 +1247,12 @@
"source": [
"%%time\n",
"\n",
"dataloader = DataIF_COSI_DC2.load(name = \"511keV\",\n",
" event_binned_data = binned_event,\n",
" dict_bkg_binned_data = {\"albedo\": binned_bkg},\n",
" rsp = full_detector_response,\n",
" coordsys_conv_matrix=coordsys_conv_matrix,\n",
" is_miniDC2_format=False)"
"data_interface = DataIF_COSI_DC2.load(name = \"511keV\",\n",
" event_binned_data = binned_event,\n",
" dict_bkg_binned_data = {\"albedo\": binned_bkg},\n",
" rsp = full_detector_response,\n",
" coordsys_conv_matrix=coordsys_conv_matrix,\n",
" is_miniDC2_format=False)"
]
},
{
Expand Down Expand Up @@ -1282,8 +1282,8 @@
"source": [
"image_deconvolution = ImageDeconvolution()\n",
"\n",
"# set dataloader to image_deconvolution\n",
"image_deconvolution.set_dataset([dataloader])\n",
"# set data_interface to image_deconvolution\n",
"image_deconvolution.set_dataset([data_interface])\n",
"\n",
"# set a parameter file for the image deconvolution\n",
"image_deconvolution.read_parameterfile(parameter_filepath)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"source": [
"# DC2 Image Analysis, Crab, Image Deconvolution using CDS in the Galactic coordinate system\n",
"\n",
"updated on 2024-07-02 (the commit 1d5cb62597aab7598a0c92ded2d0c381aaa3fd10)\n",
"updated on 2024-07-29 (the commit 14fc4c42f8b33749bd2053603643ca693dbc3954)\n",
"\n",
"This notebook focuses on the image deconvolution with the Compton data space (CDS) in the Galactic coordinate system.\n",
"An example of the image analysis will be presented using the the Crab 3-month simulation data created for DC2.\n",
Expand Down Expand Up @@ -487,7 +487,7 @@
"id": "e0a2582e",
"metadata": {},
"source": [
"## 3-1. Prepare DataLoader containing all neccesary datasets"
"## 3-1. Prepare DataInterface containing all necessary datasets"
]
},
{
Expand Down Expand Up @@ -527,12 +527,12 @@
"source": [
"%%time\n",
"\n",
"dataloader = DataIF_COSI_DC2.load(name = \"Crab\",\n",
" event_binned_data = event.project([\"Em\", \"Phi\", \"PsiChi\"]),\n",
" dict_bkg_binned_data = {\"albedo\": bkg.project([\"Em\", \"Phi\", \"PsiChi\"])},\n",
" rsp = image_response,\n",
" coordsys_conv_matrix=None,\n",
" is_miniDC2_format=False)\n"
"data_interface = DataIF_COSI_DC2.load(name = \"Crab\",\n",
" event_binned_data = event.project([\"Em\", \"Phi\", \"PsiChi\"]),\n",
" dict_bkg_binned_data = {\"albedo\": bkg.project([\"Em\", \"Phi\", \"PsiChi\"])},\n",
" rsp = image_response,\n",
" coordsys_conv_matrix=None,\n",
" is_miniDC2_format=False)\n"
]
},
{
Expand Down Expand Up @@ -572,8 +572,8 @@
"source": [
"image_deconvolution = ImageDeconvolution()\n",
"\n",
"# set dataloader to image_deconvolution\n",
"image_deconvolution.set_dataset([dataloader])\n",
"# set data_interface to image_deconvolution\n",
"image_deconvolution.set_dataset([data_interface])\n",
"\n",
"# set a parameter file for the image deconvolution\n",
"image_deconvolution.read_parameterfile(parameter_filepath)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"source": [
"# DC2 Image Analysis, Crab, Image Deconvolution\n",
"\n",
"updated on 2024-07-02 (the commit 1d5cb62597aab7598a0c92ded2d0c381aaa3fd10)\n",
"updated on 2024-07-29 (the commit 14fc4c42f8b33749bd2053603643ca693dbc3954)\n",
"\n",
"This notebook focuses on the image deconvolution with the spacecraft attitude (scatt) binning method for DC2.\n",
"Using the Crab 3-month simulation data created for DC2, an example of the image analysis will be presented.\n",
Expand Down Expand Up @@ -340,7 +340,7 @@
"id": "e0a2582e",
"metadata": {},
"source": [
"## 4-1. Prepare DataLoader containing all neccesary datasets"
"## 4-1. Prepare DataInterface containing all necessary datasets"
]
},
{
Expand Down Expand Up @@ -385,12 +385,12 @@
"source": [
"%%time\n",
"\n",
"dataloader = DataIF_COSI_DC2.load(name = \"Crab\",\n",
" event_binned_data = Crab_data.binned_data, \n",
" dict_bkg_binned_data = {\"albedo\": bkg_data.binned_data},\n",
" rsp = response,\n",
" coordsys_conv_matrix=ccm,\n",
" is_miniDC2_format=False)"
"data_interface = DataIF_COSI_DC2.load(name = \"Crab\",\n",
" event_binned_data = Crab_data.binned_data, \n",
" dict_bkg_binned_data = {\"albedo\": bkg_data.binned_data},\n",
" rsp = response,\n",
" coordsys_conv_matrix=ccm,\n",
" is_miniDC2_format=False)"
]
},
{
Expand Down Expand Up @@ -439,8 +439,8 @@
"source": [
"image_deconvolution = ImageDeconvolution()\n",
"\n",
"# set dataloader to image_deconvolution\n",
"image_deconvolution.set_dataset([dataloader])\n",
"# set data_interface to image_deconvolution\n",
"image_deconvolution.set_dataset([data_interface])\n",
"\n",
"# set a parameter file for the image deconvolution\n",
"image_deconvolution.read_parameterfile(parameter_filepath)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"source": [
"# GRB image analysis (miniDC2)\n",
"\n",
"updated on 2024-07-02 (the commit 1d5cb62597aab7598a0c92ded2d0c381aaa3fd10)\n",
"updated on 2024-07-29 (the commit 14fc4c42f8b33749bd2053603643ca693dbc3954)\n",
"\n",
"Using the GRB simulation data created for miniDC2, an example of the image analysis will be presented.\n",
"\n",
Expand Down Expand Up @@ -757,7 +757,7 @@
"id": "e0a2582e",
"metadata": {},
"source": [
"## 4-1. Prepare DataLoader containing all neccesary datasets"
"## 4-1. Prepare DataInterface containing all neccesary datasets"
]
},
{
Expand Down Expand Up @@ -822,20 +822,20 @@
"source": [
"%%time\n",
"\n",
"dataloader = DataIF_COSI_DC2.load(name = \"GRB\",\n",
" event_binned_data = grb_data.binned_data, \n",
" dict_bkg_binned_data = {\"bkg_model\": bkg_data.binned_data}, \n",
" rsp = response, \n",
" coordsys_conv_matrix = coordsys_conv_matrix,\n",
" is_miniDC2_format = True)"
"data_interface = DataIF_COSI_DC2.load(name = \"GRB\",\n",
" event_binned_data = grb_data.binned_data, \n",
" dict_bkg_binned_data = {\"bkg_model\": bkg_data.binned_data}, \n",
" rsp = response, \n",
" coordsys_conv_matrix = coordsys_conv_matrix,\n",
" is_miniDC2_format = True)"
]
},
{
"cell_type": "markdown",
"id": "b23f1fbe",
"metadata": {},
"source": [
"DataLoader is a data container for the image deconvolution. It also calculates several auxiliary matrices for the analysis.\n",
"DataInterface is a data container for the image deconvolution. It also calculates several auxiliary matrices for the analysis.\n",
"The response file will be loaded on the CPU memory. It requires a few GB. In the actual COSI satellite analysis, the response could be much larger, perhaps ~1TB wiht finer bin size. \n",
"So loading it on the memory might be unrealistic in the future. The optimized (lazy) loading would be a next work."
]
Expand Down Expand Up @@ -877,8 +877,8 @@
"source": [
"image_deconvolution = ImageDeconvolution()\n",
"\n",
"# set dataloader to image_deconvolution\n",
"image_deconvolution.set_dataset([dataloader])\n",
"# set data_interface to image_deconvolution\n",
"image_deconvolution.set_dataset([data_interface])\n",
"\n",
"# set a parameter file for the image deconvolution\n",
"image_deconvolution.read_parameterfile(parameter_filepath)"
Expand Down

0 comments on commit b8c24dd

Please sign in to comment.