astrohack 1.0.2__tar.gz → 1.0.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (133) hide show
  1. {astrohack-1.0.2/src/astrohack.egg-info → astrohack-1.0.3}/PKG-INFO +6 -11
  2. {astrohack-1.0.2 → astrohack-1.0.3}/pyproject.toml +7 -3
  3. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/__init__.py +18 -3
  4. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/antenna/antenna_surface.py +22 -15
  5. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/antenna/base_panel.py +1 -1
  6. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/antenna/panel_fitting.py +1 -1
  7. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/antenna/polygon_panel.py +4 -2
  8. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/antenna/ring_panel.py +2 -1
  9. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/antenna/telescope.py +8 -12
  10. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/beamcut.py +10 -11
  11. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/cassegrain_ray_tracing.py +5 -7
  12. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/combine.py +2 -2
  13. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/config/beamcut_mds.param.json +5 -5
  14. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/config/extract_holog.param.json +1 -1
  15. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/config/extract_pointing.param.json +0 -5
  16. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/config/panel_mds.param.json +5 -0
  17. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/config/position_mds.param.json +9 -1
  18. astrohack-1.0.3/src/astrohack/core/__init__.py +0 -0
  19. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/core/beamcut.py +61 -21
  20. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/core/cassegrain_ray_tracing.py +14 -12
  21. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/core/combine.py +2 -1
  22. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/core/extract_holog.py +26 -28
  23. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/core/extract_locit.py +2 -2
  24. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/core/extract_pointing.py +35 -18
  25. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/core/holog.py +1 -1
  26. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/core/holog_obs_dict.py +12 -1
  27. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/core/image_comparison_tool.py +10 -7
  28. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/core/locit.py +1 -1
  29. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/core/panel.py +3 -5
  30. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/extract_holog.py +8 -8
  31. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/extract_locit.py +1 -1
  32. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/extract_pointing.py +5 -6
  33. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/holog.py +4 -4
  34. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/image_comparison_tool.py +3 -3
  35. astrohack-1.0.3/src/astrohack/io/__init__.py +0 -0
  36. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/io/base_mds.py +2 -2
  37. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/io/beamcut_mds.py +51 -90
  38. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/io/dio.py +8 -9
  39. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/io/holog_mds.py +56 -58
  40. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/io/image_mds.py +52 -64
  41. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/io/locit_mds.py +13 -11
  42. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/io/panel_mds.py +42 -49
  43. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/io/point_mds.py +11 -11
  44. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/io/position_mds.py +69 -48
  45. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/locit.py +2 -3
  46. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/panel.py +3 -3
  47. astrohack-1.0.3/src/astrohack/scripts/__init__.py +0 -0
  48. astrohack-1.0.3/src/astrohack/scripts/baseline/__init__.py +0 -0
  49. astrohack-1.0.3/src/astrohack/scripts/baseline/baseline_reduction_pipeline.py +588 -0
  50. astrohack-1.0.3/src/astrohack/scripts/beamcuts/__init__.py +0 -0
  51. astrohack-1.0.3/src/astrohack/scripts/beamcuts/beamcut_reduction_pipeline.py +493 -0
  52. astrohack-1.0.3/src/astrohack/scripts/verification/__init__.py +0 -0
  53. astrohack-1.0.3/src/astrohack/scripts/verification/execute-and-upload-tests.py +144 -0
  54. astrohack-1.0.3/src/astrohack/scripts/verification/file_uploader.py +200 -0
  55. astrohack-1.0.3/src/astrohack/utils/__init__.py +0 -0
  56. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/utils/constants.py +1 -0
  57. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/utils/conversion.py +2 -1
  58. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/utils/file.py +4 -4
  59. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/utils/fits.py +6 -4
  60. astrohack-1.0.3/src/astrohack/utils/graph.py +309 -0
  61. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/utils/gridding.py +4 -2
  62. astrohack-1.0.3/src/astrohack/utils/package_info.py +12 -0
  63. astrohack-1.0.3/src/astrohack/utils/pipeline_support.py +296 -0
  64. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/utils/text.py +217 -28
  65. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/utils/validation.py +2 -2
  66. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/utils/verification_tools.py +29 -6
  67. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/utils/zernike_aperture_fitting.py +1 -1
  68. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/visualization/array_cfg_plot.py +54 -10
  69. astrohack-1.0.3/src/astrohack/visualization/observation_summary.py +60 -0
  70. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/visualization/plot_tools.py +200 -101
  71. {astrohack-1.0.2 → astrohack-1.0.3/src/astrohack.egg-info}/PKG-INFO +6 -11
  72. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack.egg-info/SOURCES.txt +11 -0
  73. astrohack-1.0.3/src/astrohack.egg-info/entry_points.txt +3 -0
  74. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack.egg-info/requires.txt +5 -12
  75. astrohack-1.0.2/src/astrohack/antenna/__init__.py +0 -5
  76. astrohack-1.0.2/src/astrohack/io/__init__.py +0 -9
  77. astrohack-1.0.2/src/astrohack/utils/__init__.py +0 -5
  78. astrohack-1.0.2/src/astrohack/utils/graph.py +0 -165
  79. astrohack-1.0.2/src/astrohack/visualization/observation_summary.py +0 -44
  80. {astrohack-1.0.2 → astrohack-1.0.3}/LICENSE +0 -0
  81. {astrohack-1.0.2 → astrohack-1.0.3}/MANIFEST.in +0 -0
  82. {astrohack-1.0.2 → astrohack-1.0.3}/README.rst +0 -0
  83. {astrohack-1.0.2 → astrohack-1.0.3}/setup.cfg +0 -0
  84. {astrohack-1.0.2/src/astrohack/core → astrohack-1.0.3/src/astrohack/antenna}/__init__.py +0 -0
  85. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/config/beamcut.param.json +0 -0
  86. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/config/cassegrain_ray_tracing.param.json +0 -0
  87. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/config/combine.param.json +0 -0
  88. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/config/create_param_json.py +0 -0
  89. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/config/dask.config.yaml +0 -0
  90. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/config/extract_locit.param.json +0 -0
  91. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/config/holog.param.json +0 -0
  92. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/config/holog_mds.param.json +0 -0
  93. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/config/image_comparison_tool.param.json +0 -0
  94. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/config/image_mds.param.json +0 -0
  95. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/config/locit.param.json +0 -0
  96. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/config/locit_mds.param.json +0 -0
  97. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/config/panel.param.json +0 -0
  98. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/config/point_mds.param.json +0 -0
  99. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/data/telescopes/aca_7m.zarr/.zattrs +0 -0
  100. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/data/telescopes/aca_7m.zarr/.zgroup +0 -0
  101. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/data/telescopes/aca_7m.zarr/.zmetadata +0 -0
  102. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/data/telescopes/alma_da.zarr/.zattrs +0 -0
  103. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/data/telescopes/alma_da.zarr/.zgroup +0 -0
  104. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/data/telescopes/alma_da.zarr/.zmetadata +0 -0
  105. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/data/telescopes/alma_dv.zarr/.zattrs +0 -0
  106. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/data/telescopes/alma_dv.zarr/.zgroup +0 -0
  107. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/data/telescopes/alma_dv.zarr/.zmetadata +0 -0
  108. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/data/telescopes/alma_tp.zarr/.zattrs +0 -0
  109. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/data/telescopes/alma_tp.zarr/.zgroup +0 -0
  110. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/data/telescopes/alma_tp.zarr/.zmetadata +0 -0
  111. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/data/telescopes/fix_telescope_files.bash +0 -0
  112. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/data/telescopes/ngvla_proto_2025.zarr/.zattrs +0 -0
  113. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/data/telescopes/ngvla_proto_2025.zarr/.zgroup +0 -0
  114. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/data/telescopes/ngvla_proto_2025.zarr/.zmetadata +0 -0
  115. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/data/telescopes/ngvla_proto_2025.zarr/point_cloud/.zarray +0 -0
  116. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/data/telescopes/ngvla_proto_2025.zarr/point_cloud/0.0 +0 -0
  117. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/data/telescopes/ngvla_proto_2025.zarr/qps_coefficients/.zarray +0 -0
  118. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/data/telescopes/ngvla_proto_2025.zarr/qps_coefficients/0 +0 -0
  119. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/data/telescopes/vla.zarr/.zattrs +0 -0
  120. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/data/telescopes/vla.zarr/.zgroup +0 -0
  121. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/data/telescopes/vla.zarr/.zmetadata +0 -0
  122. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/data/telescopes/vlba.zarr/.zattrs +0 -0
  123. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/data/telescopes/vlba.zarr/.zgroup +0 -0
  124. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/data/telescopes/vlba.zarr/.zmetadata +0 -0
  125. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/utils/algorithms.py +0 -0
  126. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/utils/imaging.py +0 -0
  127. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/utils/phase_fitting.py +0 -0
  128. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/utils/ray_tracing_general.py +0 -0
  129. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/utils/tools.py +0 -0
  130. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/utils/veritas.py +0 -0
  131. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack/visualization/__init__.py +0 -0
  132. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack.egg-info/dependency_links.txt +0 -0
  133. {astrohack-1.0.2 → astrohack-1.0.3}/src/astrohack.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: astrohack
3
- Version: 1.0.2
3
+ Version: 1.0.3
4
4
  Summary: Holography Antenna Commissioning Kit
5
5
  Author-email: Joshua Hoskins <jhoskins@nrao.edu>, Victor de Souza Magalhaes <vdesouza@nrao.edu>, Jan-Willem Steeb <jsteeb@nrao.edu>
6
6
  Requires-Python: <3.14,>=3.11
@@ -29,18 +29,13 @@ Requires-Dist: zarr<3.0.0
29
29
  Requires-Dist: bokeh
30
30
  Requires-Dist: pillow
31
31
  Requires-Dist: jupyterlab
32
- Requires-Dist: python_casacore>=3.6.1; sys_platform != "darwin"
32
+ Requires-Dist: casacoretables>=0.0.3
33
33
  Provides-Extra: docs
34
- Requires-Dist: ipykernel; extra == "docs"
35
- Requires-Dist: ipympl; extra == "docs"
36
- Requires-Dist: ipython; extra == "docs"
37
- Requires-Dist: jupyter-client; extra == "docs"
34
+ Requires-Dist: pandoc; extra == "docs"
35
+ Requires-Dist: sphinx-autosummary-accessors; extra == "docs"
38
36
  Requires-Dist: nbsphinx; extra == "docs"
37
+ Requires-Dist: sphinx_rtd_theme; extra == "docs"
39
38
  Requires-Dist: recommonmark; extra == "docs"
40
- Requires-Dist: scanpydoc; extra == "docs"
41
39
  Requires-Dist: sphinx-autoapi; extra == "docs"
42
- Requires-Dist: sphinx-autosummary-accessors; extra == "docs"
43
- Requires-Dist: sphinx_rtd_theme; extra == "docs"
44
- Requires-Dist: twine; extra == "docs"
45
- Requires-Dist: pandoc; extra == "docs"
40
+ Requires-Dist: ipython; extra == "docs"
46
41
  Dynamic: license-file
@@ -1,10 +1,10 @@
1
1
  [project]
2
2
  name = "astrohack"
3
- version = "1.0.2"
3
+ version = "1.0.3"
4
4
  description = "Holography Antenna Commissioning Kit"
5
5
  readme = "README.md"
6
6
  requires-python = ">= 3.11, < 3.14"
7
- dependencies = [ "astropy", "dask", "shapely", "distributed", "toolviper", "ipywidgets", "matplotlib", "numba>=0.57.0", "numpy<=2.2", "prettytable", "pycryptodome", "pytest", "pytest-cov", "pytest-html", "scikit_image", "scikit-learn", "scipy", "rich", "xarray", "zarr<3.0.0", "bokeh", "pillow", "jupyterlab", "python_casacore>=3.6.1; sys_platform != \"darwin\" ",]
7
+ dependencies = [ "astropy", "dask", "shapely", "distributed", "toolviper", "ipywidgets", "matplotlib", "numba>=0.57.0", "numpy<=2.2", "prettytable", "pycryptodome", "pytest", "pytest-cov", "pytest-html", "scikit_image", "scikit-learn", "scipy", "rich", "xarray", "zarr<3.0.0", "bokeh", "pillow", "jupyterlab", "casacoretables>=0.0.3",]
8
8
  [[project.authors]]
9
9
  name = "Joshua Hoskins"
10
10
  email = "jhoskins@nrao.edu"
@@ -21,4 +21,8 @@ email = "jsteeb@nrao.edu"
21
21
  file = "LICENSE.txt"
22
22
 
23
23
  [project.optional-dependencies]
24
- docs = [ "ipykernel", "ipympl", "ipython", "jupyter-client", "nbsphinx", "recommonmark", "scanpydoc", "sphinx-autoapi", "sphinx-autosummary-accessors", "sphinx_rtd_theme", "twine", "pandoc",]
24
+ docs = [ "pandoc", "sphinx-autosummary-accessors", "nbsphinx", "sphinx_rtd_theme", "recommonmark", "sphinx-autoapi", "ipython",]
25
+
26
+ [project.scripts]
27
+ beamcut-reduction-pipeline = "astrohack.scripts.beamcuts.beamcut_reduction_pipeline:main"
28
+ baseline-reduction-pipeline = "astrohack.scripts.baseline.baseline_reduction_pipeline:main"
@@ -3,12 +3,27 @@ from importlib.metadata import version
3
3
 
4
4
  __version__ = version("astrohack")
5
5
 
6
+
7
+ from astrohack.io.dio import (
8
+ open_beamcut,
9
+ open_pointing,
10
+ open_holog,
11
+ open_image,
12
+ open_locit,
13
+ open_panel,
14
+ open_position,
15
+ )
16
+ from astrohack.io.point_mds import AstrohackPointFile
17
+ from astrohack.io.locit_mds import AstrohackLocitFile
18
+ from astrohack.io.holog_mds import AstrohackHologFile
19
+ from astrohack.io.panel_mds import AstrohackPanelFile
20
+ from astrohack.io.beamcut_mds import AstrohackBeamcutFile
21
+ from astrohack.io.position_mds import AstrohackPositionFile
22
+ from astrohack.io.image_mds import AstrohackImageFile
6
23
  from .extract_holog import (
7
24
  extract_holog,
8
25
  generate_holog_obs_dict,
9
26
  )
10
- from .io import *
11
-
12
27
  from .beamcut import beamcut
13
28
  from .extract_pointing import extract_pointing
14
29
  from .holog import holog
@@ -24,7 +39,7 @@ from .cassegrain_ray_tracing import (
24
39
  apply_holog_phase_fitting_to_rt_xds,
25
40
  )
26
41
  from .image_comparison_tool import compare_fits_images, rms_table_from_zarr_datatree
27
- from .antenna import get_proper_telescope
42
+ from .antenna.telescope import get_proper_telescope
28
43
 
29
44
  # This installs a slick, informational tracebacks logger
30
45
  from rich.traceback import install
@@ -5,11 +5,8 @@ from matplotlib import patches
5
5
  import toolviper.utils.logger as logger
6
6
 
7
7
  from astrohack.antenna.telescope import get_proper_telescope
8
- from astrohack.utils import (
9
- string_to_ascii_file,
10
- create_dataset_label,
8
+ from astrohack.utils.algorithms import (
11
9
  data_statistics,
12
- statistics_to_text,
13
10
  phase_wrapping,
14
11
  )
15
12
  from astrohack.utils.constants import *
@@ -20,6 +17,12 @@ from astrohack.utils.text import (
20
17
  bool_to_str,
21
18
  format_frequency,
22
19
  format_value_unit,
20
+ string_to_ascii_file,
21
+ create_dataset_label,
22
+ statistics_to_text,
23
+ lnbr,
24
+ spc,
25
+ create_informative_label_from_summary,
23
26
  )
24
27
  from astrohack.visualization.plot_tools import (
25
28
  create_figure_and_axes,
@@ -36,7 +39,6 @@ from astrohack.utils.fits import (
36
39
  put_axis_in_fits_header,
37
40
  )
38
41
 
39
- lnbr = "\n"
40
42
  SUPPORTED_POL_STATES = ["I", "RR", "LL", "XX", "YY"]
41
43
 
42
44
 
@@ -414,7 +416,7 @@ class AntennaSurface:
414
416
  plotmask = np.where(self.mask, 1, np.nan)
415
417
  plotname = add_prefix(basename, f"{caller}_mask")
416
418
  parm_dict["z_lim"] = [0, 1]
417
- parm_dict["unit"] = " "
419
+ parm_dict["unit"] = spc
418
420
  self._plot_map(plotname, plotmask, "Mask", parm_dict)
419
421
 
420
422
  def plot_amplitude(self, basename, caller, parm_dict):
@@ -551,7 +553,8 @@ class AntennaSurface:
551
553
  ax, screws=parm_dict["plot_screws"], label=parm_dict["panel_labels"]
552
554
  )
553
555
 
554
- suptitle = f"{self.label}, Pol. state: {self.pol_state}"
556
+ suptitle = create_informative_label_from_summary(self.summary, "deg")
557
+ suptitle += f", Pol. state: {self.pol_state}"
555
558
  close_figure(fig, suptitle, filename, parm_dict["dpi"], parm_dict["display"])
556
559
 
557
560
  def _add_resolution_to_plot(self, ax, xpos=0.9, ypos=0.1):
@@ -610,7 +613,7 @@ class AntennaSurface:
610
613
  else:
611
614
  threshold = np.abs(threshold)
612
615
 
613
- ax.set_title(f"\nThreshold = {threshold:.2f} {unit}", fontsize="small")
616
+ ax.set_title(f"{lnbr}Threshold = {threshold:.2f} {unit}", fontsize="small")
614
617
  # set the limits of the plot to the limits of the data
615
618
  extent = compute_extent(self.u_axis, self.v_axis)
616
619
  im = ax.imshow(
@@ -643,7 +646,8 @@ class AntennaSurface:
643
646
  ax, cmap, fac * self.screw_adjustments[ipanel], threshold, vmin, vmax
644
647
  )
645
648
 
646
- suptitle = f"{self.label}, Pol. state: {self.pol_state}"
649
+ suptitle = create_informative_label_from_summary(self.summary, "deg")
650
+ suptitle += f", Pol. state: {self.pol_state}"
647
651
  close_figure(fig, suptitle, filename, parm_dict["dpi"], parm_dict["display"])
648
652
 
649
653
  def _build_panel_data_arrays(self):
@@ -685,22 +689,26 @@ class AntennaSurface:
685
689
  unit: unit for panel screw adjustments ['mm','miliinches']
686
690
  comment_char: Character used for comments
687
691
  """
688
- outfile = f"# Screw adjustments for {self.telescope.name}'s {self.label}, pol. state {self.pol_state}\n"
692
+ date_str = create_informative_label_from_summary(self.summary, "deg").split(
693
+ ","
694
+ )[-1]
695
+ outfile = f"# Screw adjustments for {self.telescope.name}'s {self.label}, pol. state {self.pol_state}{lnbr}"
696
+ outfile += f"# Observation date:{date_str}{lnbr}"
689
697
  freq = clight / self.wavelength
690
698
  rmses = self.get_rms(unit)
691
699
  outfile += f"# Frequency = {format_frequency(freq)}{lnbr}"
692
700
  if unit == "mm":
693
- outfile += f"# Antenna surface RMS before adjustment: {format_value_unit(rmses[0], unit)}\n"
694
- outfile += f"# Antenna surface RMS after adjustment: {format_value_unit(rmses[1], unit)}\n"
701
+ outfile += f"# Antenna surface RMS before adjustment: {format_value_unit(rmses[0], unit)}{lnbr}"
702
+ outfile += f"# Antenna surface RMS after adjustment: {format_value_unit(rmses[1], unit)}{lnbr}"
695
703
  else:
696
704
  mmrms = self.get_rms("mm")
697
705
  outfile += (
698
706
  f"# Antenna surface RMS before adjustment: {format_value_unit(rmses[0], unit)} or "
699
- f'{format_value_unit(mmrms[0], "mm")}\n'
707
+ f'{format_value_unit(mmrms[0], "mm")}{lnbr}'
700
708
  )
701
709
  outfile += (
702
710
  f"# Antenna surface RMS after adjustment: {format_value_unit(rmses[1], unit)} or "
703
- f'{format_value_unit(mmrms[1], "mm")}\n'
711
+ f'{format_value_unit(mmrms[1], "mm")}{lnbr}'
704
712
  )
705
713
  outfile += "# Lower means away from subreflector" + lnbr
706
714
  outfile += "# Raise means toward the subreflector" + lnbr
@@ -708,7 +716,6 @@ class AntennaSurface:
708
716
  outfile += "# RAISE the panel if the number is NEGATIVE" + lnbr
709
717
  outfile += "# Adjustments are in " + unit + lnbr
710
718
  outfile += lnbr
711
- spc = " "
712
719
  outfile += f"{comment_char} Panel{2*spc}"
713
720
  nscrews = len(self.telescope.screw_description)
714
721
  for screw in self.telescope.screw_description:
@@ -5,7 +5,7 @@ from matplotlib.colors import Normalize
5
5
 
6
6
  from astrohack.antenna.panel_fitting import PANEL_MODEL_DICT, PanelPoint, PanelModel
7
7
  from astrohack.utils.constants import *
8
- from astrohack.utils import convert_unit
8
+ from astrohack.utils.conversion import convert_unit
9
9
 
10
10
 
11
11
  class BasePanel:
@@ -3,7 +3,7 @@ import scipy.optimize as opt
3
3
 
4
4
  import toolviper.utils.logger as logger
5
5
 
6
- from astrohack.utils import gauss_elimination, least_squares_jit
6
+ from astrohack.utils.algorithms import gauss_elimination, least_squares_jit
7
7
 
8
8
  ###################################
9
9
  # General purpose #
@@ -1,11 +1,13 @@
1
1
  from shapely import Polygon, Point
2
2
  from shapely.plotting import plot_polygon
3
3
 
4
- from astrohack.utils import markersize
4
+ from astrohack.utils.constants import markersize
5
5
  from astrohack.antenna.base_panel import BasePanel
6
6
  from astrohack.antenna.panel_fitting import PanelPoint
7
7
  import numpy as np
8
8
 
9
+ from astrohack.utils.text import spc
10
+
9
11
 
10
12
  class PolygonPanel(BasePanel):
11
13
 
@@ -89,7 +91,7 @@ class PolygonPanel(BasePanel):
89
91
  """
90
92
  print("########################################")
91
93
  print("{0:20s}={1:8d}".format("label", self.label))
92
- print("{0:20s}={1:8s}".format("model", " " + self.model_name))
94
+ print("{0:20s}={1:8s}".format("model", spc + self.model_name))
93
95
  print("{0:20s}={1:8d}".format("nsamp", len(self.samples)))
94
96
  if verbose:
95
97
  for sample in self.samples:
@@ -2,6 +2,7 @@ import numpy as np
2
2
  from matplotlib import pyplot as plt
3
3
  from astrohack.antenna.base_panel import BasePanel, markersize
4
4
  from astrohack.antenna.panel_fitting import PanelPoint
5
+ from astrohack.utils.text import spc
5
6
 
6
7
 
7
8
  class RingPanel(BasePanel):
@@ -139,7 +140,7 @@ class RingPanel(BasePanel):
139
140
  """
140
141
  print("########################################")
141
142
  print("{0:20s}={1:8s}".format("ipanel", self.label))
142
- print("{0:20s}={1:8s}".format("model", " " + self.model_name))
143
+ print("{0:20s}={1:8s}".format("model", spc + self.model_name))
143
144
  print("{0:20s}={1:8.5f}".format("inrad", self.inrad))
144
145
  print("{0:20s}={1:8.5f}".format("ourad", self.ourad))
145
146
  print("{0:20s}={1:8.5f}".format("theta1", self.theta1))
@@ -2,18 +2,18 @@ from shapely.geometry.point import Point
2
2
  from shapely.geometry.polygon import Polygon
3
3
  from shapely.strtree import STRtree
4
4
 
5
- import astrohack
6
5
  import pathlib
7
6
 
8
7
  import xarray as xr
9
8
  import toolviper.utils.logger as logger
10
9
 
11
- import astrohack.utils.tools
12
10
  from astrohack.antenna.polygon_panel import PolygonPanel
13
11
  from astrohack.utils.constants import *
14
12
  from astrohack.antenna.ring_panel import RingPanel
15
13
  from astrohack.utils.algorithms import create_coordinate_images, arm_shadow_masking
16
14
  from astrohack.utils.ray_tracing_general import GlobalQPS
15
+ from astrohack.utils.package_info import get_astrohack_path
16
+ from astrohack.utils.text import spc, lnbr, undscr
17
17
 
18
18
 
19
19
  class Telescope:
@@ -76,9 +76,7 @@ class Telescope:
76
76
  Returns:
77
77
  None
78
78
  """
79
- dest_path = "/".join(
80
- [astrohack.__path__[0], f"data/telescopes/{name.lower()}.zarr"]
81
- )
79
+ dest_path = get_astrohack_path() / f"data/telescopes/{name.lower()}.zarr"
82
80
  self.read(dest_path)
83
81
 
84
82
  def write(self, filename):
@@ -105,11 +103,9 @@ class Telescope:
105
103
  return
106
104
 
107
105
  def write_to_distro(self):
108
- dest_path = "/".join(
109
- [
110
- astrohack.__path__[0],
111
- f'data/telescopes/{self.name.lower().replace(" ", "_")}.zarr',
112
- ]
106
+ dest_path = (
107
+ get_astrohack_path()
108
+ / f"data/telescopes/{self.name.lower().replace(spc, undscr)}.zarr"
113
109
  )
114
110
  self.write(dest_path)
115
111
 
@@ -124,9 +120,9 @@ class Telescope:
124
120
  for key, item in obj_dict.items():
125
121
  if isinstance(item, dict):
126
122
  key_list = list(item.keys())
127
- outstr += f"{key:20s} = dict({str(key_list)})\n"
123
+ outstr += f"{key:20s} = dict({str(key_list)}){lnbr}"
128
124
  else:
129
- outstr += f"{key:20s} = {str(item)}\n"
125
+ outstr += f"{key:20s} = {str(item)}{lnbr}"
130
126
  return outstr
131
127
 
132
128
 
@@ -5,7 +5,7 @@ from toolviper.utils.parameter import validate
5
5
  import toolviper.utils.logger as logger
6
6
 
7
7
  from astrohack.core.beamcut import process_beamcut_chunk
8
- from astrohack.utils import get_default_file_name
8
+ from astrohack.utils.text import get_default_file_name
9
9
  from astrohack.utils.file import overwrite_file
10
10
  from astrohack.utils.graph import create_and_execute_graph_from_dict
11
11
  from astrohack.io.beamcut_mds import AstrohackBeamcutFile
@@ -18,15 +18,15 @@ from typing import Union, List, Tuple
18
18
  @validate(custom_checker=custom_plots_checker)
19
19
  def beamcut(
20
20
  holog_name: str,
21
- beamcut_name: str = None,
21
+ beamcut_name: str | None = None,
22
22
  ant: Union[str, List[str]] = "all",
23
23
  ddi: Union[int, List[int], str] = "all",
24
- destination: str = None,
24
+ destination: str | None = None,
25
25
  lm_unit: str = "amin",
26
26
  azel_unit: str = "deg",
27
27
  phase_unit: str = "deg",
28
- phase_scale: Union[List[float], Tuple[float], np.array] = None,
29
- y_scale: list[float] = None,
28
+ phase_scale: Union[List[float | int], Tuple[float | int], np.ndarray, None] = None,
29
+ y_scale: list[float | int] | None = None,
30
30
  dpi: int = 300,
31
31
  display: bool = False,
32
32
  parallel: bool = False,
@@ -140,12 +140,11 @@ def beamcut(
140
140
  param_dict=beamcut_params,
141
141
  key_order=["ant", "ddi"],
142
142
  output_mds=beamcut_mds,
143
- parallel=parallel,
144
143
  )
145
144
  if executed_graph:
146
145
  if destination is not None:
147
146
  logger.info("Producing plots...")
148
- beamcut_mds.plot_beamcut_in_amplitude(
147
+ beamcut_mds.plot_in_amplitude(
149
148
  destination,
150
149
  lm_unit=lm_unit,
151
150
  azel_unit=azel_unit,
@@ -154,7 +153,7 @@ def beamcut(
154
153
  dpi=dpi,
155
154
  parallel=parallel,
156
155
  )
157
- beamcut_mds.plot_beamcut_in_attenuation(
156
+ beamcut_mds.plot_in_db(
158
157
  destination,
159
158
  lm_unit=lm_unit,
160
159
  azel_unit=azel_unit,
@@ -163,7 +162,7 @@ def beamcut(
163
162
  dpi=dpi,
164
163
  parallel=parallel,
165
164
  )
166
- beamcut_mds.plot_beamcut_in_phase(
165
+ beamcut_mds.plot_in_phase(
167
166
  destination,
168
167
  lm_unit=lm_unit,
169
168
  azel_unit=azel_unit,
@@ -173,7 +172,7 @@ def beamcut(
173
172
  dpi=dpi,
174
173
  parallel=parallel,
175
174
  )
176
- beamcut_mds.plot_beam_cuts_over_sky(
175
+ beamcut_mds.plot_lm_offsets(
177
176
  destination,
178
177
  lm_unit=lm_unit,
179
178
  azel_unit=azel_unit,
@@ -181,7 +180,7 @@ def beamcut(
181
180
  dpi=dpi,
182
181
  parallel=parallel,
183
182
  )
184
- beamcut_mds.create_beam_fit_report(
183
+ beamcut_mds.export_report(
185
184
  destination,
186
185
  lm_unit=lm_unit,
187
186
  azel_unit=azel_unit,
@@ -3,15 +3,13 @@ import xarray as xr
3
3
 
4
4
  from astrohack.utils.validation import custom_unit_checker, custom_plots_checker
5
5
  from astrohack.core.cassegrain_ray_tracing import *
6
- from astrohack.utils import (
7
- convert_unit,
8
- clight,
9
- regrid_data_onto_2d_grid,
10
- )
6
+ from astrohack.utils.conversion import convert_unit, clight
7
+ from astrohack.utils.algorithms import regrid_data_onto_2d_grid
11
8
  from astrohack.utils.file import add_caller_and_version_to_dict
12
9
  from astrohack.utils.phase_fitting import aips_like_phase_fitting
13
10
  from astrohack.visualization.plot_tools import create_figure_and_axes, close_figure
14
11
  from typing import Union
12
+ from astrohack.utils.text import spc, undscr
15
13
 
16
14
 
17
15
  @toolviper.utils.parameter.validate(custom_checker=custom_unit_checker)
@@ -273,13 +271,13 @@ def plot_2d_maps_from_rt_xds(
273
271
  if isinstance(keys, str):
274
272
  keys = [keys]
275
273
 
276
- suptitle = "Cassegrain Ray tracing model for:\n" + title_from_input_parameters(
274
+ suptitle = "Cassegrain Ray tracing model for:{lnbr}" + title_from_input_parameters(
277
275
  rt_xds.attrs["input_parameters"]
278
276
  )
279
277
  for key in keys:
280
278
  filename = f"{rootname}_{key}.png"
281
279
 
282
- zlabel = key.capitalize().replace("_", " ")
280
+ zlabel = key.capitalize().replace(undscr, spc)
283
281
  if key == "phase":
284
282
  fac = convert_unit("rad", phase_unit, "trigonometric")
285
283
  zlabel += f" [{phase_unit}]"
@@ -2,7 +2,7 @@ from typing import Union, List
2
2
 
3
3
  import toolviper.utils.parameter
4
4
 
5
- from astrohack import open_image
5
+ from astrohack.io.dio import open_image
6
6
  from astrohack.core.combine import process_combine_chunk
7
7
  from astrohack.utils.graph import create_and_execute_graph_from_dict
8
8
  from astrohack.utils.file import overwrite_file
@@ -13,7 +13,7 @@ from astrohack.io.image_mds import AstrohackImageFile
13
13
  @toolviper.utils.parameter.validate()
14
14
  def combine(
15
15
  image_name: str,
16
- combine_name: str = None,
16
+ combine_name: str | None = None,
17
17
  ant: Union[str, List[str]] = "all",
18
18
  ddi: Union[int, List[int], str] = "all",
19
19
  weighted: bool = False,
@@ -74,7 +74,7 @@
74
74
  ]
75
75
  }
76
76
  },
77
- "AstrohackBeamcutFile.plot_beamcut_in_amplitude":{
77
+ "AstrohackBeamcutFile.plot_in_amplitude":{
78
78
  "destination":{
79
79
  "nullable": false,
80
80
  "required": true,
@@ -150,7 +150,7 @@
150
150
  "type": ["boolean"]
151
151
  }
152
152
  },
153
- "AstrohackBeamcutFile.plot_beamcut_in_attenuation":{
153
+ "AstrohackBeamcutFile.plot_in_db":{
154
154
  "destination":{
155
155
  "nullable": false,
156
156
  "required": true,
@@ -226,7 +226,7 @@
226
226
  "type": ["boolean"]
227
227
  }
228
228
  },
229
- "AstrohackBeamcutFile.plot_beam_cuts_over_sky":{
229
+ "AstrohackBeamcutFile.plot_lm_offsets":{
230
230
  "destination":{
231
231
  "nullable": false,
232
232
  "required": true,
@@ -287,7 +287,7 @@
287
287
  "type": ["boolean"]
288
288
  }
289
289
  },
290
- "AstrohackBeamcutFile.plot_beamcut_in_phase":{
290
+ "AstrohackBeamcutFile.plot_in_phase":{
291
291
  "destination":{
292
292
  "nullable": false,
293
293
  "required": true,
@@ -369,7 +369,7 @@
369
369
  "type": ["boolean"]
370
370
  }
371
371
  },
372
- "AstrohackBeamcutFile.create_beam_fit_report":{
372
+ "AstrohackBeamcutFile.export_report":{
373
373
  "destination":{
374
374
  "nullable": false,
375
375
  "required": true,
@@ -23,7 +23,7 @@
23
23
  },
24
24
  "exclude_antennas": {
25
25
  "type":["ndarray", "list", "str"],
26
- "struct type": ["int"],
26
+ "struct type": ["str"],
27
27
  "nullable": true
28
28
  },
29
29
  "holog_name":{
@@ -7,11 +7,6 @@
7
7
  "type":["str"],
8
8
  "nullable": true
9
9
  },
10
- "exclude":{
11
- "type":["list", "str"],
12
- "nullable": true,
13
- "struct_type": ["str"]
14
- },
15
10
  "parallel":{
16
11
  "type":["boolean"]
17
12
  },
@@ -73,6 +73,11 @@
73
73
  "type": ["int"],
74
74
  "min": 1,
75
75
  "max": 1200
76
+ },
77
+ "parallel":{
78
+ "nullable": false,
79
+ "required": false,
80
+ "type": ["boolean"]
76
81
  }
77
82
  },
78
83
  "AstrohackPanelFile.plot_antennas":{
@@ -140,6 +140,14 @@
140
140
  "type": ["string"],
141
141
  "check allowed with": "units.time"
142
142
  },
143
+ "delay_limits": {
144
+ "nullable": true,
145
+ "required": false,
146
+ "struct_type": ["float"],
147
+ "minlength": 2,
148
+ "maxlength": 2,
149
+ "type": ["list", "tuple", "ndarray"]
150
+ },
143
151
  "plot_model":{
144
152
  "nullable": false,
145
153
  "required": false,
@@ -198,7 +206,7 @@
198
206
  "check allowed with": "units.length"
199
207
  },
200
208
  "box_size":{
201
- "nullable": false,
209
+ "nullable": true,
202
210
  "required": false,
203
211
  "type": ["int", "float"],
204
212
  "min": 0
File without changes