Skip to content

Commit

Permalink
Panel test: fixed error caused by modifications on the panel paramete…
Browse files Browse the repository at this point in the history
…r dictionary
  • Loading branch information
Victor de Souza Magalhaes committed Oct 12, 2023
1 parent f8963be commit ea6f10e
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions docs/tutorial_vla.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2510,7 +2510,7 @@
"2023-10-12 11:19:26,199 - \u001b[33;34mINFO \u001b[0m - astrohack - (_check_parms.py:135) - [panel]: Setting default panel_name to data/ea25_cal_small_after_fixed.split.panel.zarr.\n",
"2023-10-12 11:19:26,201 - \u001b[33;34mINFO \u001b[0m - astrohack - (_check_parms.py:135) - [panel]: Setting default ant to all.\n",
"2023-10-12 11:19:26,201 - \u001b[33;34mINFO \u001b[0m - astrohack - (_check_parms.py:135) - [panel]: Setting default ddi to all.\n",
"2023-10-12 11:19:26,202 - \u001b[33;34mINFO \u001b[0m - astrohack - (_check_parms.py:135) - [panel]: Setting default panel_kind to rigid.\n",
"2023-10-12 11:19:26,202 - \u001b[33;34mINFO \u001b[0m - astrohack - (_check_parms.py:135) - [panel]: Setting default panel_model to rigid.\n",
"2023-10-12 11:19:26,270 - \u001b[33;33mWARNING \u001b[0m - astrohack - (_dio.py:43) - [panel]: data/ea25_cal_small_after_fixed.split.panel.zarr will be overwritten.\n",
"2023-10-12 11:19:30,756 - \u001b[33;34mINFO \u001b[0m - astrohack - (panel.py:112) - [panel]: Finished processing\n"
]
Expand Down Expand Up @@ -3709,7 +3709,7 @@
"| parallel | True |\n",
"| overwrite | True |\n",
"| ant | all |\n",
"| panel_kind | rigid |\n",
"| panel_model | rigid |\n",
"| version | 0.3.0 |\n",
"| origin | panel |\n",
"+---------------+--------------------------------------------------+\n",
Expand Down
2 changes: 1 addition & 1 deletion docs/visualization_tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1153,7 +1153,7 @@
"| parallel | True |\n",
"| overwrite | True |\n",
"| ant | all |\n",
"| panel_kind | rigid |\n",
"| panel_model | rigid |\n",
"| version | 0.3.0 |\n",
"| origin | panel |\n",
"+---------------+--------------------------------------------------+\n",
Expand Down
6 changes: 3 additions & 3 deletions examples/astrohack_ALMA_demo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4259,7 +4259,7 @@
" input_rms: 3.088073112958419e-05\n",
" ... ...\n",
" output_rms: 4.996970214900966e-06\n",
" panel_kind: rigid\n",
" panel_model: rigid\n",
" panel_margin: 0.2\n",
" telescope_name: ALMA DA\n",
" theoretical_gain: 107.05251326572127\n",
Expand Down Expand Up @@ -4920,7 +4920,7 @@
" 6.3712734032524665, 6.401469011798686, 6.431664620344907,\n",
" 6.461860228891126, 6.492055837437347, 6.522251445983567,\n",
" 6.552447054529787],\n",
" dtype=&#x27;float64&#x27;, name=&#x27;v&#x27;, length=436))</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-3c57b7d4-9772-491c-81bd-4204b6600c71' class='xr-section-summary-in' type='checkbox' ><label for='section-3c57b7d4-9772-491c-81bd-4204b6600c71' class='xr-section-summary' >Attributes: <span>(13)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><dl class='xr-attrs'><dt><span>AIPS :</span></dt><dd>False</dd><dt><span>amp_unit :</span></dt><dd>V</dd><dt><span>antenna_name :</span></dt><dd>DA44</dd><dt><span>cutoff :</span></dt><dd>6.264889248212903</dd><dt><span>input_gain :</span></dt><dd>107.01944579499491</dd><dt><span>input_rms :</span></dt><dd>3.088073112958419e-05</dd><dt><span>output_gain :</span></dt><dd>107.05168917397985</dd><dt><span>output_rms :</span></dt><dd>4.996970214900966e-06</dd><dt><span>panel_kind :</span></dt><dd>rigid</dd><dt><span>panel_margin :</span></dt><dd>0.2</dd><dt><span>telescope_name :</span></dt><dd>ALMA DA</dd><dt><span>theoretical_gain :</span></dt><dd>107.05251326572127</dd><dt><span>wavelength :</span></dt><dd>0.002725520399528795</dd></dl></div></li></ul></div></div>"
" dtype=&#x27;float64&#x27;, name=&#x27;v&#x27;, length=436))</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-3c57b7d4-9772-491c-81bd-4204b6600c71' class='xr-section-summary-in' type='checkbox' ><label for='section-3c57b7d4-9772-491c-81bd-4204b6600c71' class='xr-section-summary' >Attributes: <span>(13)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><dl class='xr-attrs'><dt><span>AIPS :</span></dt><dd>False</dd><dt><span>amp_unit :</span></dt><dd>V</dd><dt><span>antenna_name :</span></dt><dd>DA44</dd><dt><span>cutoff :</span></dt><dd>6.264889248212903</dd><dt><span>input_gain :</span></dt><dd>107.01944579499491</dd><dt><span>input_rms :</span></dt><dd>3.088073112958419e-05</dd><dt><span>output_gain :</span></dt><dd>107.05168917397985</dd><dt><span>output_rms :</span></dt><dd>4.996970214900966e-06</dd><dt><span>panel_model :</span></dt><dd>rigid</dd><dt><span>panel_margin :</span></dt><dd>0.2</dd><dt><span>telescope_name :</span></dt><dd>ALMA DA</dd><dt><span>theoretical_gain :</span></dt><dd>107.05251326572127</dd><dt><span>wavelength :</span></dt><dd>0.002725520399528795</dd></dl></div></li></ul></div></div>"
],
"text/plain": [
"<xarray.Dataset>\n",
Expand Down Expand Up @@ -4952,7 +4952,7 @@
" input_rms: 3.088073112958419e-05\n",
" ... ...\n",
" output_rms: 4.996970214900966e-06\n",
" panel_kind: rigid\n",
" panel_model: rigid\n",
" panel_margin: 0.2\n",
" telescope_name: ALMA DA\n",
" theoretical_gain: 107.05251326572127\n",
Expand Down
6 changes: 3 additions & 3 deletions examples/astrohack_VLA_demo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4391,7 +4391,7 @@
" input_rms: 0.0004743264995194888\n",
" ... ...\n",
" output_rms: 0.00020614589829760581\n",
" panel_kind: rigid\n",
" panel_model: rigid\n",
" panel_margin: 0.2\n",
" telescope_name: VLA\n",
" theoretical_gain: 99.52367440251265\n",
Expand Down Expand Up @@ -5060,7 +5060,7 @@
" 13.284462809009957, 13.347125369429818, 13.409787929849676,\n",
" 13.472450490269534, 13.535113050689393, 13.59777561110925,\n",
" 13.660438171529108],\n",
" dtype=&#x27;float64&#x27;, name=&#x27;v&#x27;, length=438))</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-f9de4eff-37c2-45df-b1d9-d710c7bf9915' class='xr-section-summary-in' type='checkbox' ><label for='section-f9de4eff-37c2-45df-b1d9-d710c7bf9915' class='xr-section-summary' >Attributes: <span>(13)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><dl class='xr-attrs'><dt><span>AIPS :</span></dt><dd>False</dd><dt><span>amp_unit :</span></dt><dd>V</dd><dt><span>antenna_name :</span></dt><dd>ea25</dd><dt><span>cutoff :</span></dt><dd>0.7481209609253406</dd><dt><span>input_gain :</span></dt><dd>99.40058629858581</dd><dt><span>input_rms :</span></dt><dd>0.0004743264995194888</dd><dt><span>output_gain :</span></dt><dd>99.49841849429275</dd><dt><span>output_rms :</span></dt><dd>0.00020614589829760581</dd><dt><span>panel_kind :</span></dt><dd>rigid</dd><dt><span>panel_margin :</span></dt><dd>0.2</dd><dt><span>telescope_name :</span></dt><dd>VLA</dd><dt><span>theoretical_gain :</span></dt><dd>99.52367440251265</dd><dt><span>wavelength :</span></dt><dd>0.02135426013248807</dd></dl></div></li></ul></div></div>"
" dtype=&#x27;float64&#x27;, name=&#x27;v&#x27;, length=438))</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-f9de4eff-37c2-45df-b1d9-d710c7bf9915' class='xr-section-summary-in' type='checkbox' ><label for='section-f9de4eff-37c2-45df-b1d9-d710c7bf9915' class='xr-section-summary' >Attributes: <span>(13)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><dl class='xr-attrs'><dt><span>AIPS :</span></dt><dd>False</dd><dt><span>amp_unit :</span></dt><dd>V</dd><dt><span>antenna_name :</span></dt><dd>ea25</dd><dt><span>cutoff :</span></dt><dd>0.7481209609253406</dd><dt><span>input_gain :</span></dt><dd>99.40058629858581</dd><dt><span>input_rms :</span></dt><dd>0.0004743264995194888</dd><dt><span>output_gain :</span></dt><dd>99.49841849429275</dd><dt><span>output_rms :</span></dt><dd>0.00020614589829760581</dd><dt><span>panel_model :</span></dt><dd>rigid</dd><dt><span>panel_margin :</span></dt><dd>0.2</dd><dt><span>telescope_name :</span></dt><dd>VLA</dd><dt><span>theoretical_gain :</span></dt><dd>99.52367440251265</dd><dt><span>wavelength :</span></dt><dd>0.02135426013248807</dd></dl></div></li></ul></div></div>"
],
"text/plain": [
"<xarray.Dataset>\n",
Expand Down Expand Up @@ -5092,7 +5092,7 @@
" input_rms: 0.0004743264995194888\n",
" ... ...\n",
" output_rms: 0.00020614589829760581\n",
" panel_kind: rigid\n",
" panel_model: rigid\n",
" panel_margin: 0.2\n",
" telescope_name: VLA\n",
" theoretical_gain: 99.52367440251265\n",
Expand Down
2 changes: 1 addition & 1 deletion src/astrohack/_utils/_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def _panel_chunk(panel_chunk_params):

telescope = _get_correct_telescope_from_name(inputxds)

surface = AntennaSurface(inputxds, telescope, panel_chunk_params['cutoff'], panel_chunk_params['panel_kind'],
surface = AntennaSurface(inputxds, telescope, panel_chunk_params['cutoff'], panel_chunk_params['panel_model'],
panel_margins=panel_chunk_params['panel_margins'])

surface.compile_panel_points()
Expand Down
2 changes: 1 addition & 1 deletion src/astrohack/panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def _check_panel_parms(fname, panel_params):
list_acceptable_data_types=[int], default='all')
parms_passed = parms_passed and _check_parms(fname, panel_params, 'cutoff', [float], acceptable_range=[0, 1],
default=0.2)
parms_passed = parms_passed and _check_parms(fname, panel_params, 'panel_kind', [str], acceptable_data=panel_models,
parms_passed = parms_passed and _check_parms(fname, panel_params, 'panel_model', [str], acceptable_data=panel_models,
default="rigid")
parms_passed = parms_passed and _check_parms(fname, panel_params, 'panel_margins', [float],
acceptable_range=[0, 0.5], default=0.2)
Expand Down

0 comments on commit ea6f10e

Please sign in to comment.