Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
519 changes: 188 additions & 331 deletions docs/tutorials/beamcut_tutorial.ipynb

Large diffs are not rendered by default.

23 changes: 21 additions & 2 deletions src/astrohack/beamcut.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pathlib
import numpy as np

from toolviper.utils.parameter import validate

Expand All @@ -10,7 +11,7 @@
from astrohack.io.dio import open_holog
from astrohack.utils.validation import custom_plots_checker

from typing import Union, List
from typing import Union, List, Tuple


@validate(custom_checker=custom_plots_checker)
Expand All @@ -22,9 +23,11 @@ def beamcut(
destination: str = None,
lm_unit: str = "amin",
azel_unit: str = "deg",
phase_unit: str = "deg",
phase_scale: Union[List[float], Tuple[float], np.array] = None,
y_scale: list[float] = None,
dpi: int = 300,
display: bool = False,
y_scale: list[float] = None,
parallel: bool = False,
overwrite: bool = False,
):
Expand Down Expand Up @@ -52,6 +55,12 @@ def beamcut(
:param azel_unit: Unit for Az/El information in plots and report, default is "deg".
:type azel_unit: str, optional

:param phase_unit: Unit for phase plots, default is "deg".
:type phase_unit: str, optional

:param phase_scale: Scale for the phase plots, in phase_unit, default is None, meaning 1 full cycle.
:type phase_scale: Union[List[float], Tuple[float], np.array], optional

:param dpi: Resolution in pixels, defaults to 300.
:type dpi: int, optional

Expand Down Expand Up @@ -152,6 +161,16 @@ def beamcut(
dpi=dpi,
parallel=parallel,
)
beamcut_mds.plot_beamcut_in_phase(
destination,
lm_unit=lm_unit,
azel_unit=azel_unit,
phase_unit=phase_unit,
phase_scale=phase_scale,
display=display,
dpi=dpi,
parallel=parallel,
)
beamcut_mds.plot_beam_cuts_over_sky(
destination,
lm_unit=lm_unit,
Expand Down
21 changes: 21 additions & 0 deletions src/astrohack/config/beamcut.param.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@
"type": ["string"],
"check allowed with": "units.trig"
},
"phase_unit":{
"nullable": false,
"required": false,
"type": ["string"],
"check allowed with": "units.trig"
},
"dpi":{
"nullable": false,
"required": false,
Expand Down Expand Up @@ -65,6 +71,21 @@
"ndarray"
]
},
"phase_scale":{
"nullable": true,
"required": false,
"struct_type": [
"float",
"int"
],
"minlength": 2,
"maxlength": 2,
"type": [
"list",
"tuple",
"ndarray"
]
},
"parallel":{
"nullable": false,
"required": false,
Expand Down
82 changes: 82 additions & 0 deletions src/astrohack/config/beamcut_mds.param.json
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,88 @@
"type": ["boolean"]
}
},
"AstrohackBeamcutFile.plot_beamcut_in_phase":{
"destination":{
"nullable": false,
"required": true,
"type": ["string"]
},
"ant": {
"nullable": false,
"required": false,
"struct_type": [
"str"
],
"minlength": 1,
"type": [
"string",
"list"
]
},
"ddi": {
"nullable": false,
"required": false,
"struct_type": [
"int"
],
"minlength": 1,
"type": [
"int",
"list",
"string"
]
},
"lm_unit":{
"nullable": false,
"required": false,
"type": ["string"],
"check allowed with": "units.trig"
},
"azel_unit":{
"nullable": false,
"required": false,
"type": ["string"],
"check allowed with": "units.trig"
},
"phase_unit":{
"nullable": false,
"required": false,
"type": ["string"],
"check allowed with": "units.trig"
},
"dpi":{
"nullable": false,
"required": false,
"type": ["int"],
"min": 1,
"max": 1200
},
"display":{
"nullable": false,
"required": false,
"type": ["boolean"]
},
"phase_scale":{
"nullable": true,
"required": false,
"struct_type": [
"float",
"int"
],
"minlength": 2,
"maxlength": 2,
"type": [
"list",
"tuple",
"ndarray"
]
},
"parallel":{
"nullable": false,
"required": false,
"type": ["boolean"]
}
},
"AstrohackBeamcutFile.create_beam_fit_report":{
"destination":{
"nullable": false,
Expand Down
1 change: 0 additions & 1 deletion src/astrohack/io/base_mds.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@ def summary(self) -> None:
outstr += get_method_list_string(self)
outstr += get_data_content_string(self.root)
print(outstr)
return outstr

@classmethod
def create_from_input_parameters(cls, file_name: str, input_parameters: dict):
Expand Down
Loading
Loading