hyper-py-photometry 0.1.3__tar.gz → 0.1.5__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 (79) hide show
  1. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/.github/workflows/Hyper-py_paper.yml +4 -4
  2. {hyper_py_photometry-0.1.3/src/hyper_py_photometry.egg-info → hyper_py_photometry-0.1.5}/PKG-INFO +152 -72
  3. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/README.md +152 -72
  4. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/environment.yml +2 -1
  5. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/paper/paper.md +5 -3
  6. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/requirements.txt +2 -1
  7. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/src/hyper_py/__init__.py +1 -1
  8. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/src/hyper_py/run_hyper.py +6 -2
  9. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5/src/hyper_py_photometry.egg-info}/PKG-INFO +152 -72
  10. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/.github/workflows/pypi-publish.yml +0 -0
  11. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/.gitignore +0 -0
  12. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/.vscode/launch.json +0 -0
  13. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/IDL_comparison/Gaussian_comparison_Hyper_py_IDL_ALL.py +0 -0
  14. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/IDL_comparison/ellipses_map_500_Gaussians_1_centroids.reg +0 -0
  15. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/IDL_comparison/ellipses_map_500_Gaussians_1_ellipses.reg +0 -0
  16. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/IDL_comparison/ellipses_map_500_Gaussians_2_centroids.reg +0 -0
  17. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/IDL_comparison/ellipses_map_500_Gaussians_2_ellipses.reg +0 -0
  18. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/IDL_comparison/hyper_output_map_500_Gaussians_1.txt +0 -0
  19. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/IDL_comparison/hyper_output_map_500_Gaussians_2.txt +0 -0
  20. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/IDL_comparison/map_500_Gaussians_1.fits +0 -0
  21. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/IDL_comparison/map_500_Gaussians_2.fits +0 -0
  22. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/IDL_comparison/matched_flux_comparison_table.txt +0 -0
  23. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/IDL_comparison/output/Flux_Comparison_Hyper_IDL_Int_1.png +0 -0
  24. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/IDL_comparison/output/Flux_Comparison_Hyper_IDL_Int_2.png +0 -0
  25. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/IDL_comparison/output/Flux_Comparison_Hyper_IDL_Peak_1.png +0 -0
  26. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/IDL_comparison/output/Flux_Comparison_Hyper_IDL_Peak_2.png +0 -0
  27. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/IDL_comparison/output/Flux_Comparison_Hyper_IDL_vs_py_Int_1.png +0 -0
  28. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/IDL_comparison/output/Flux_Comparison_Hyper_IDL_vs_py_Int_2.png +0 -0
  29. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/IDL_comparison/output/Flux_Comparison_Hyper_IDL_vs_py_Peak_1.png +0 -0
  30. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/IDL_comparison/output/Flux_Comparison_Hyper_IDL_vs_py_Peak_2.png +0 -0
  31. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/IDL_comparison/output/Flux_Comparison_Hyper_py_Int_1.png +0 -0
  32. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/IDL_comparison/output/Flux_Comparison_Hyper_py_Int_2.png +0 -0
  33. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/IDL_comparison/output/Flux_Comparison_Hyper_py_Peak_1.png +0 -0
  34. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/IDL_comparison/output/Flux_Comparison_Hyper_py_Peak_2.png +0 -0
  35. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/IDL_comparison/output/Flux_Diff_Histogram_Int.png +0 -0
  36. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/IDL_comparison/output/Flux_Diff_Histogram_Peak.png +0 -0
  37. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/IDL_comparison/output/combined_source_counts_comparison.txt +0 -0
  38. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/IDL_comparison/output/matched_flux_comparison_table.txt +0 -0
  39. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/IDL_comparison/photometry_sources_1300_ellipses_1300_polynomial_background_4sigma_ipac_1.txt +0 -0
  40. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/IDL_comparison/photometry_sources_1300_ellipses_1300_polynomial_background_4sigma_ipac_2.txt +0 -0
  41. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/IDL_comparison/table_500_Gaussians_1.txt +0 -0
  42. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/IDL_comparison/table_500_Gaussians_2.txt +0 -0
  43. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/LICENSE +0 -0
  44. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/paper/Figures/Flux_Diff_Histogram_Int.png +0 -0
  45. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/paper/Figures/Flux_Diff_Histogram_Peak.png +0 -0
  46. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/paper/paper.bib +0 -0
  47. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/pyproject.toml +0 -0
  48. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/setup.cfg +0 -0
  49. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/src/hyper_py/__main__.py +0 -0
  50. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/src/hyper_py/assets/default_config.yaml +0 -0
  51. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/src/hyper_py/bkg_multigauss.py +0 -0
  52. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/src/hyper_py/bkg_single.py +0 -0
  53. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/src/hyper_py/config.py +0 -0
  54. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/src/hyper_py/create_background_slices.py +0 -0
  55. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/src/hyper_py/data_output.py +0 -0
  56. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/src/hyper_py/detection.py +0 -0
  57. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/src/hyper_py/extract_cubes.py +0 -0
  58. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/src/hyper_py/fitting.py +0 -0
  59. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/src/hyper_py/gaussfit.py +0 -0
  60. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/src/hyper_py/groups.py +0 -0
  61. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/src/hyper_py/hyper.py +0 -0
  62. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/src/hyper_py/logger.py +0 -0
  63. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/src/hyper_py/map_io.py +0 -0
  64. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/src/hyper_py/paths_io.py +0 -0
  65. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/src/hyper_py/photometry.py +0 -0
  66. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/src/hyper_py/single_map.py +0 -0
  67. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/src/hyper_py/survey.py +0 -0
  68. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/src/hyper_py/visualization.py +0 -0
  69. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/src/hyper_py_photometry.egg-info/SOURCES.txt +0 -0
  70. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/src/hyper_py_photometry.egg-info/dependency_links.txt +0 -0
  71. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/src/hyper_py_photometry.egg-info/entry_points.txt +0 -0
  72. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/src/hyper_py_photometry.egg-info/requires.txt +0 -0
  73. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/src/hyper_py_photometry.egg-info/top_level.txt +0 -0
  74. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/test/maps/test_2d_map_1.fits +0 -0
  75. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/test/maps/test_2d_map_2.fits +0 -0
  76. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/test/maps/test_2dmap.txt +0 -0
  77. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/test/maps/test_datacube.fits +0 -0
  78. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/test/maps/test_datacube.txt +0 -0
  79. {hyper_py_photometry-0.1.3 → hyper_py_photometry-0.1.5}/test/test_hyper.py +0 -0
@@ -1,10 +1,10 @@
1
1
  name: JOSS PDF
2
2
 
3
3
  on:
4
- push:
5
- paths:
6
- - paper/**
7
- - .github/workflows/Hyper-py_paper.yml
4
+ # push:
5
+ # paths:
6
+ # - paper/**
7
+ # - .github/workflows/Hyper-py_paper.yml
8
8
  workflow_dispatch: # allow manual trigger
9
9
 
10
10
  jobs:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hyper-py-photometry
3
- Version: 0.1.3
3
+ Version: 0.1.5
4
4
  Summary: HYPER: Hybrid Photometry Photometry and Extraction Routine
5
5
  Author-email: Alessio Traficante <alessio.traficante@inaf.it>
6
6
  Project-URL: Homepage, https://github.com/alessio-traficante/hyper-py
@@ -21,6 +21,7 @@ Dynamic: license-file
21
21
  # 💫 `Hyper-py`: Hybrid Photometry Photometry and Extraction Routine in Python
22
22
 
23
23
  **Authors:** Alessio Traficante; Fabrizio De Angelis; Alice Nucara; Milena Benedettini
24
+
24
25
  **Original reference:** Traficante et al. (2015), *MNRAS, 451, 3089*
25
26
 
26
27
  ---
@@ -62,7 +63,7 @@ Hyper-py now supports **parallel execution** over multiple maps or datacube slic
62
63
  - Maintain **individual log files** for each map
63
64
  - Merge the final outputs (tables and diagnostics) into a single, combined summary
64
65
 
65
- To enable parallelism, set the following parameters in your `config.yaml` file under the `control` section:
66
+ To enable parallelism, set the following parameters in your `hyper_config.yaml` file under the `control` section:
66
67
 
67
68
  ```yaml
68
69
  control:
@@ -72,31 +73,27 @@ control:
72
73
 
73
74
  If `parallel_maps` is set to `false`, the pipeline will run in serial mode.
74
75
 
76
+ ### 💡 Tips & Tricks
77
+
78
+ - **Create a virtual environment before installation**
79
+ For convenience, you could set up a Python virtual environment before working with the code.
80
+ <br>Eg.
81
+ ```bash
82
+ python -m venv .venv
83
+ source .venv/bin/activate # Linux / macOS
84
+ .venv\Scripts\activate # Windows
85
+ ```
86
+ P.S.: Remember to activate it every time you work with the code! :)
87
+ ## 🛠️ Installation
88
+ You can install and use `Hyper-py` in two different ways, depending on your needs:
75
89
 
76
-
77
- ## 🚀 Prerequisites
78
-
79
- Before using `Hyper-py`, make sure you have all the necessary Python dependencies installed. The following core libraries are required:
80
- • astropy
81
- • photutils
82
- • matplotlib
83
- • lmfit
84
- • pyyaml
85
- • numpy
86
- • scipy
87
- • scikit-learn>=1.4,<1.6
88
-
89
- This will install the necessary packages using `pip`:
90
-
90
+ ### Option 1: Install via `pip` (for direct usage)
91
+ Install via PyPI:
91
92
  ```bash
92
- astropy photutils matplotlib lmfit
93
+ pip install hyper-py-photometry
93
94
  ```
94
95
 
95
-
96
- ## 🛠️ Installation
97
- You can install and use `Hyper-py` in two different ways, depending on your needs:
98
-
99
- ### Option 1: Use the Source Code (for development or integration)
96
+ ### Option 2: Use the Source Code (for development or integration)
100
97
 
101
98
  If you want to modify, extend, or integrate `Hyper-py` in your own projects:
102
99
 
@@ -116,27 +113,71 @@ export PYTHONPATH=$(pwd)/src
116
113
  import sys
117
114
  sys.path.insert(0, "/absolute/path/to/hyper_py/src")
118
115
  ```
119
- ### Option 2: Install via `pip` (for direct usage)
120
- Install via PyPI:
116
+
117
+
118
+ ## ✅ Requirements
119
+
120
+ Before using `Hyper-py`, make sure you have all the necessary Python dependencies installed.
121
+
122
+ If you have installed `Hyper-py` via pip, all the requirements are automatically installed.
123
+ Otherwise, you can use the `requirements.txt` file, this will install the necessary packages using `pip`::
121
124
  ```bash
122
- pip install hyper-py-photometry
125
+ pip install -r requirements.txt
123
126
  ```
124
127
 
125
128
 
126
- ## 🎯 Usage
129
+ ## 📄 Configuration File
130
+
131
+
132
+ `Hyper-py` requires a configuration file named **`hyper_config.yaml`** in order to run.
133
+
134
+ >The first time you run `Hyper-py` a new hyper_config.yaml will be created automatically in the Current Working Directory (CWD), then you must setup all paths and parameters.<br>
135
+ >If you already have a configuration file ready or you have moved the new configuration file to a different folder, provide the path as argument.
136
+
137
+ If no path is provided, the application will look for it in this order:
138
+ 1. Path passed as Command Line Interface (CLI) argument
139
+ 2. `hyper_config.yaml` in the CWD
140
+ 3. User configuration directory
141
+ - Linux/macOS: `~/.config/hyper-py/hyper_config.yaml`
142
+ - Windows: `%APPDATA%\HyperPy\hyper_config.yaml`
143
+ 4. If not found, a new `hyper_config.yaml` will be created automatically in the CWD, copied from the package template (`assets/default_config.yaml`).
127
144
 
128
- You can use `Hyper-py` either by importing and running it directly from Python, or via command line.
129
145
  > [!IMPORTANT]
130
- > `Hyper-py` needs a configuration file in order to run. If no configuration file path is provided, the default file located in the `src/` folder will be used.
146
+ > <span style="font-weight:bold;">Before running the pipeline, you <span style="color:red; font-weight:bold;">must</span> edit **`hyper_config.yaml`** and set the correct parameters and paths.</span>
147
+
148
+
149
+ ### Configuration file lookup order
150
+
151
+ | Priority | Location | Description |
152
+ |----------|--------------------------------------------|-----------------------------------------------------------------------------|
153
+ | 1 | CLI argument | Path explicitly provided by the user, e.g. `hyper-py /path/to/hyper_config.yaml`. |
154
+ | 2 | CWD | Looks for `./hyper_config.yaml` in the folder where the command is executed. |
155
+ | 3 | User configuration directory | - **Linux/macOS:** `~/.config/hyper-py/hyper_config.yaml`<br> - **Windows:** `%APPDATA%\HyperPy\hyper_config.yaml` |
156
+ | 4 | Auto-generated in CWD if none is found | A new `hyper_config.yaml` is created, copied from the package template (`assets/default_config.yaml`). |
157
+
158
+ ### 💡 Tips & Tricks
159
+
160
+ - **Use different configs**
161
+ You can maintain multiple configuration files (e.g., `hyper_config.dev.yaml` and `hyper_config.prod.yaml`) and choose which one to run.
162
+ <br>Eg. If you have installed via pip:
163
+ ```bash
164
+ hyper-py ./hyper_config.dev.yaml
165
+ hyper-py ./hyper_config.prod.yaml
166
+ ```
167
+
168
+
169
+ ## 🚀 Usage
170
+
171
+ You can use `Hyper-py` either by importing and running it directly from Python, or via command line.
131
172
 
132
173
  ### 1. From Python
133
174
 
134
- Import and run the `start_hyper` function, passing the path to your YAML configuration file.
175
+ Import and run the `run_hyper` function, passing the path to your YAML configuration file.
135
176
 
136
177
  ```python
137
178
  from hyper_py import run_hyper
138
179
 
139
- run_hyper("path/to/config.yaml")
180
+ run_hyper("path/to/hyper_config.yaml")
140
181
  ```
141
182
  This is the recommended approach if you want to integrate `Hyper-py` into a larger Python application or workflow.
142
183
 
@@ -146,32 +187,30 @@ I) Using the source code:
146
187
 
147
188
  You can execute the tool from the terminal:
148
189
  ```bash
149
- python -m hyper_py path/to/config.yaml
190
+ python -m hyper_py path/to/hyper_config.yaml
150
191
  ```
151
192
  This runs the main process using the configuration file specified.
152
193
 
153
- II) If installed via pip:
154
-
155
- Once the .whl package is installed (e.g., via pip install hyper_py-X.X.X-py3-none-any.whl), you can run it directly:
194
+ II) If installed via pip you can run it directly:
156
195
  ```bash
157
- hyper_py path/to/config.yaml
196
+ hyper_py path/to/hyper_config.yaml
158
197
  ```
159
198
  OR
160
199
  ```bash
161
- hyper-py path/to/config.yaml
200
+ hyper-py path/to/hyper_config.yaml
162
201
  ```
163
202
  OR
164
203
  ```bash
165
- hyper path/to/config.yaml
204
+ hyper path/to/hyper_config.yaml
166
205
  ```
167
206
 
168
- ## Using the Source Code in Visual Studio Code
207
+ ## 💻 Using the Source Code in Visual Studio Code
169
208
  To run or debug the source code using Visual Studio Code:
170
209
  ### 1. Open the project
171
210
  - Open the project folder in VS Code.
172
211
  - Make sure the Python extension is installed.
173
212
  - Press Ctrl+Shift+P (or Cmd+Shift+P on macOS) and run Python: Select Interpreter.
174
- - Choose the Hyper Conda environment (or another where the dependencies are installed).
213
+ - If you have set up an environment, choose the one where the dependencies are installed.
175
214
 
176
215
  ### 2. Run and debug the code
177
216
 
@@ -194,7 +233,7 @@ Optional: You can add this to `.vscode/launch.json` for convenience:
194
233
  "request": "launch",
195
234
  "program": "${workspaceFolder}/src/hyper_py/run_hyper.py",
196
235
  "console": "integratedTerminal",
197
- "args": ["path/to/config.yaml"], // Specify a different config file
236
+ "args": ["path/to/hyper_config.yaml"],
198
237
  }
199
238
  ]
200
239
  }
@@ -203,9 +242,9 @@ Optional: You can add this to `.vscode/launch.json` for convenience:
203
242
  <br/><br/>
204
243
 
205
244
 
206
- ## ⚙️ Configuration File Reference (`config.yaml`)
245
+ ## ⚙️ Configuration File Reference (`hyper_config.yaml`)
207
246
 
208
- The `config.yaml` file controls all aspects of the Hyper-py pipeline. Below is a detailed explanation of every entry, including its purpose, accepted values, default, and type.
247
+ The `hyper_config.yaml` file controls all aspects of the Hyper-py pipeline. Below is a detailed explanation of every entry, including its purpose, accepted values, default, and type.
209
248
 
210
249
  ### File Paths
211
250
 
@@ -213,8 +252,8 @@ The `config.yaml` file controls all aspects of the Hyper-py pipeline. Below is a
213
252
  |----------------------|-----------------------------------------------------------------------------|-----------------|-----------|
214
253
  | `paths.input.dir_maps` | Directory containing input map files. | `./maps` | REQUIRED |
215
254
  | `paths.output.dir_root` | Root directory for output data. | `./output` | REQUIRED |
216
- | `paths.output.dir_table_out`| Subdirectory of `dir_root` for photometry output tables. | `params` | REQUIRED |
217
- | `paths.output.dir_region_out`| Subdirectory of `dir_root` for region files (output). | `regions` | REQUIRED |
255
+ | `paths.output.dir_table_out`| Subdirectory of `dir_root` for photometry tables. | `params` | REQUIRED |
256
+ | `paths.output.dir_region_out`| Subdirectory of `dir_root` for region files. | `regions` | REQUIRED |
218
257
  | `paths.output.dir_log_out` | Subdirectory of `dir_root` for log files. | `logs` | REQUIRED |
219
258
 
220
259
  ### File Names
@@ -222,8 +261,8 @@ The `config.yaml` file controls all aspects of the Hyper-py pipeline. Below is a
222
261
  | Entry | Description | Default | Type |
223
262
  |----------------------|-----------------------------------------------------------------------------|-----------------|-----------|
224
263
  | `files.file_map_name` | Input FITS map(s) list for analysis (in `dir_maps`). | `maps_list.txt` | REQUIRED |
225
- | `files.file_table_base` | Base filename for photometry output tables (in `dir_table_out`). | `params` | REQUIRED |
226
- | `files.file_region_base` | Base filename for output ellipse region files (in `dir_region_out`). | `region_files` | REQUIRED |
264
+ | `files.file_table_base` | Base filename for photometry tables (in `dir_table_out`). | `params` | REQUIRED |
265
+ | `files.file_region_base` | Base filename for ellipse region files (in `dir_region_out`). | `region_files` | REQUIRED |
227
266
  | `files.file_log_name` | Name of the global log file (in `dir_log_out`). | `hyper_py.log` | REQUIRED |
228
267
 
229
268
  ### Pipeline Control
@@ -258,17 +297,21 @@ The `config.yaml` file controls all aspects of the Hyper-py pipeline. Below is a
258
297
  | `detection.roundlim` | Allowed source roundness range (min, max for DAOFIND). | `[-4.0, 4.0]` | ADVANCED |
259
298
  | `detection.sharplim` | Allowed source sharpness range (min, max for DAOFIND). | `[-2.0, 2.0]` | ADVANCED |
260
299
  | `detection.use_fixed_source_table`| Use external IPAC table for peak/aperture (`True`/`False`). | `False` | OPTIONAL |
261
- | `detection.fixed_source_table_path` | Path to an external IPAC table with source information (in `dir_root`). The table must have **6 columns**:
300
+ | `detection.fixed_source_table_path` | Path to an external IPAC table with source information (in `dir_root`). The table must have **6 columns**| `source_table.txt` | OPTIONAL |
301
+ | `detection.fixed_peaks` | Use fixed peaks instead of automatic (`True`/`False`). | `False` | OPTIONAL |
302
+ | `detection.xcen_fix` | Fixed peak X coordinates (deg; used if `fixed_peaks` is `True`). | `[1.0, 1.0]` | OPTIONAL |
303
+ | `detection.ycen_fix` | Fixed peak Y coordinates (deg; used if `fixed_peaks` is `True`). | `[1.0, 1.0]` | OPTIONAL |
304
+
305
+ Columns description for the external IPAC table with source information (only if detection.use_fixed_source_table is `True`):
306
+
262
307
  - **ID**: Source identifier
263
308
  - **xcen**: X coordinate (in map units, e.g. degrees or pixels)
264
309
  - **ycen**: Y coordinate (in map units, e.g. degrees or pixels)
265
- - **fwhm_1**: Major axis FWHM (arcsec)
266
- - **fwhm_2**: Minor axis FWHM (arcsec)
310
+ - **fwhm_1**: Major axis FWHM (arcsec, used as minimum radius for aperture photometry)
311
+ - **fwhm_2**: Minor axis FWHM (arcsec, used as minimum radius for aperture photometry)
267
312
  - **PA**: Position angle (degrees, East of North)
268
- The code will use only `xcen` and `ycen` if `detection.fixed_peaks = true`, only `fwhm_1`, `fwhm_2`, and `PA` if `photometry.fixed_radius = true`, or both sets of parameters if both options are enabled. | `source_table.txt` | OPTIONAL |
269
- | `detection.fixed_peaks` | Use fixed peaks instead of automatic (`True`/`False`). | `False` | OPTIONAL |
270
- | `detection.xcen_fix` | Fixed peak X coordinates (deg; used if `fixed_peaks` is `True`). | `[1.0, 1.0]` | OPTIONAL |
271
- | `detection.ycen_fix` | Fixed peak Y coordinates (deg; used if `fixed_peaks` is `True`). | `[1.0, 1.0]` | OPTIONAL |
313
+
314
+ The code will use only `xcen` and `ycen` if `detection.fixed_peaks = true`, only `fwhm_1`, `fwhm_2`, and `PA` if `photometry.fixed_radius = true`, or both sets of parameters if both options are enabled.
272
315
 
273
316
  ### Photometry Settings
274
317
 
@@ -286,32 +329,47 @@ The `config.yaml` file controls all aspects of the Hyper-py pipeline. Below is a
286
329
  | Entry | Description | Default | Type |
287
330
  |----------------------|-----------------------------------------------------------------------------|-----------------|-----------|
288
331
  | `fit_options.fit_method` | Optimization algorithm for Gaussian fitting. | `"least_squares"`| ADVANCED |
289
- | `fit_options.loss` | Specifies the loss function used during Gaussian fitting optimization.
332
+ | `fit_options.loss` | Specifies the loss function used during Gaussian fitting optimization. | `"linear"` | ADVANCED |
333
+
334
+ Loss function options:
290
335
  - `"linear"`: Standard least-squares loss (minimizes squared residuals; most common for well-behaved data).
291
336
  - `"soft_l1"`: Soft L1 loss, less sensitive to outliers than linear; combines properties of L1 and L2 norms.
292
337
  - `"huber"`: Huber loss, robust to outliers; behaves like linear for small residuals and like L1 for large residuals.
293
338
  - `"cauchy"`: Cauchy loss, strongly suppresses the influence of outliers.
294
- Choose a robust loss (e.g., `"huber"` or `"cauchy"`) if your data contains significant outliers or non-Gaussian noise. | `"linear"` | ADVANCED |
339
+ Choose a robust loss (e.g., `"huber"` or `"cauchy"`) if your data contains significant outliers or non-Gaussian noise.
340
+
341
+ | Entry | Description | Default | Type |
342
+ |----------------------|-----------------------------------------------------------------------------|-----------------|-----------|
295
343
  | `fit_options.f_scale` | Relevant for `soft_l1`, `huber`, `cauchy` loss functions. | `0.1` | ADVANCED |
296
344
  | `fit_options.max_nfev` | Maximum number of function evaluations. | `50000` | ADVANCED |
297
345
  | `fit_options.xtol` | Tolerance on parameter change for convergence. | `1e-8` | ADVANCED |
298
346
  | `fit_options.ftol` | Tolerance on cost function change for convergence. | `1e-8` | ADVANCED |
299
347
  | `fit_options.gtol` | Tolerance on gradient orthogonality. | `1e-8` | ADVANCED |
300
- | `fit_options.weights` | Specifies the weighting scheme used during Gaussian fitting.
348
+ | `fit_options.weights` | Specifies the weighting scheme used during Gaussian fitting. | `"snr"` | OPTIONAL |
349
+
350
+ Weighting scheme options:
301
351
  - `"null"`: No weighting; all pixels are treated equally.
302
352
  - `"inverse_rms"`: Weights are set as the inverse of the RMS noise, giving less weight to noisier pixels.
303
353
  - `"snr"`: Weights are proportional to the signal-to-noise ratio (SNR) of each pixel.
304
354
  - `"power_snr"`: Weights are proportional to the SNR raised to a user-defined power (`fit_options.power_snr`).
305
355
  - `"map"`: Weights are set equal to the user-provided input map.
306
356
  - `"mask"`: Weights are set to zero for masked pixels and one elsewhere, effectively ignoring masked regions.
307
- Choose the scheme that best matches your data quality and analysis goals. | `"snr"` | OPTIONAL |
357
+ Choose the scheme that best matches your data quality and analysis goals.
358
+
359
+ | Entry | Description | Default | Type |
360
+ |----------------------|-----------------------------------------------------------------------------|-----------------|-----------|
308
361
  | `fit_options.power_snr` | SNR exponent for weighting (if `weights` is `"power_snr"`). | `5` | OPTIONAL |
309
362
  | `fit_options.calc_covar` | Estimate parameter covariance matrix (`True`/`False`). | `False` | ADVANCED |
310
- | `fit_options.min_method` | Criterion used to select the best fit among multiple solutions:
363
+ | `fit_options.min_method` | Criterion used to select the best fit among multiple solutions | `"nmse"` | ADVANCED |
364
+
365
+ Selection criterion to identify the best fit:
311
366
  - `"nmse"`: Normalized Mean Squared Error; selects the fit with the lowest mean squared residuals normalized by the data variance.
312
367
  - `"redchi"`: Reduced Chi-Squared; selects the fit with the lowest reduced chi-squared statistic, accounting for the number of degrees of freedom.
313
368
  - `"bic"`: Bayesian Information Criterion; selects the fit with the lowest BIC value, which penalizes model complexity to avoid overfitting.
314
- Choose the method that best matches your scientific goals and data characteristics. | `"nmse"` | ADVANCED |
369
+ Choose the method that best matches your scientific goals and data characteristics.
370
+
371
+ | Entry | Description | Default | Type |
372
+ |----------------------|-----------------------------------------------------------------------------|-----------------|-----------|
315
373
  | `fit_options.verbose` | Print full fit report (`True`/`False`). | `False` | ADVANCED |
316
374
  | `fit_options.use_l2_regularization`| Enable L2 regularization on background terms (`True`/`False`). | `True` | ADVANCED |
317
375
  | `fit_options.lambda_l2` | Regularization strength. | `1e-4` | ADVANCED |
@@ -323,7 +381,7 @@ The `config.yaml` file controls all aspects of the Hyper-py pipeline. Below is a
323
381
 
324
382
  | Entry | Description | Default | Type |
325
383
  |----------------------|-----------------------------------------------------------------------------|-----------------|-----------|
326
- | `background.fit_gauss_and_bg_separately`| Estimate Gaussian and background separately (`True`/`False`). | `True` | OPTIONAL |
384
+ | `background.fit_gauss_and_bg_separately`| Estimate Gaussian and background separately (`True`/`False`). | `True` | REQUIRED |
327
385
  | `background.pol_orders_separate` | Polynomial orders for separated background subtraction. | `[0, 1, 2]` | OPTIONAL |
328
386
  | `background.fix_min_box` | Minimum box size for variable-size background fitting, expressed as a multiple of the source FWHM (half-size increment). **If set to `0`, the background is estimated over the entire map.** | `3` | OPTIONAL |
329
387
  | `background.fix_max_box` | Maximum box size (multiple of FWHMs) for background fitting. | `5` | OPTIONAL |
@@ -334,10 +392,10 @@ The `config.yaml` file controls all aspects of the Hyper-py pipeline. Below is a
334
392
 
335
393
  | Entry | Description | Default | Type |
336
394
  |----------------------|-----------------------------------------------------------------------------|-----------------|-----------|
337
- | `fits_output.fits_fitting` | Save best fit model group FITS files (`True`/`False`). | `False` | OPTIONAL |
395
+ | `fits_output.fits_fitting` | Save best fit model and original group FITS files (`True`/`False`). | `False` | OPTIONAL |
338
396
  | `fits_output.fits_deblended` | Save deblended per-source FITS files (`True`/`False`). | `False` | OPTIONAL |
339
397
  | `fits_output.fits_bg_separate` | Save best fit background separated model group FITS files (`True`/`False`).| `False` | OPTIONAL |
340
- | `fits_output.fits_output_dir_fitting`| Subdirectory of `dir_root` for fitting FITS files. | `fits/fitting` | OPTIONAL |
398
+ | `fits_output.fits_output_dir_fitting`| Subdirectory of `dir_root` for best model and original FITS files. | `fits/fitting` | OPTIONAL |
341
399
  | `fits_output.fits_output_dir_deblended`| Subdirectory of `dir_root` for deblended FITS files. | `fits/deblended`| OPTIONAL |
342
400
  | `fits_output.fits_output_dir_bg_separate`| Subdirectory of `dir_root` for background FITS files. | `fits/bg_separate`| OPTIONAL |
343
401
 
@@ -347,15 +405,15 @@ The `config.yaml` file controls all aspects of the Hyper-py pipeline. Below is a
347
405
  |----------------------|-----------------------------------------------------------------------------|-----------------|-----------|
348
406
  | `visualization.visualize_fitting` | Visualize final Gaussian+background fit (`True`/`False`). | `False` | OPTIONAL |
349
407
  | `visualization.visualize_deblended` | Visualize per-source blended maps (`True`/`False`). | `False` | OPTIONAL |
350
- | `visualization.visualize_bg_separate` | Visualize background model from masked fit (`True`/`False`). | `False` | OPTIONAL |
351
- | `visualization.output_dir_fitting` | Subdirectory of `dir_root` for fitting plots. | `plots/fitting` | OPTIONAL |
408
+ | `visualization.visualize_bg_separate` | Visualize background separated model (`True`/`False`). | `False` | OPTIONAL |
409
+ | `visualization.output_dir_fitting` | Subdirectory of `dir_root` for best model and original FITS plots. | `plots/fitting` | OPTIONAL |
352
410
  | `visualization.output_dir_deblended` | Subdirectory of `dir_root` for deblended plots. | `plots/deblended`| OPTIONAL |
353
411
  | `visualization.output_dir_bg_separate` | Subdirectory of `dir_root` for background plots. | `plots/bg_separate`| OPTIONAL |
354
412
 
355
413
  ---
356
414
 
357
415
  **Tip:**
358
- All entries can be customized in your `config.yaml`. If an entry is omitted, the default value will be used.
416
+ All entries can be customized in your `hyper_config.yaml`. If an entry is omitted, the default value will be used.
359
417
 
360
418
 
361
419
 
@@ -365,7 +423,7 @@ All entries can be customized in your `config.yaml`. If an entry is omitted, the
365
423
  |-------------------------------|-------------|
366
424
  | `run_hyper.py` | Main launcher for multi-map analysis (parallel or serial)
367
425
  | `hyper.py` | Core logic for initializing the code run
368
- | `single_map.py` | Core logic for running detection + photometry on one map
426
+ | `single_map.py` | Core logic for running detection + photometry on each map
369
427
  | `config.py` | YAML parser with access interface
370
428
  | `logger.py` | Custom logger supporting log file + screen separation
371
429
  | `paths_io.py` | Handles file path construction for input/output files
@@ -453,12 +511,12 @@ To ensure compatibility with Hyper-py, each input FITS file (2D map or 3D datacu
453
511
  - Common values for `CTYPE1`/`CTYPE2` are `'RA---SIN'`, `'RA---TAN'`, `'DEC--SIN'`, `'DEC--TAN'`, `'GLON--CAR'`, `'GLAT--CAR'`.
454
512
  - For cubes, `CTYPE3` can be `'VRAD'` (velocity), `'VELO-LSR'`, or `'FREQ'` (frequency).
455
513
  - **Units:**
456
- - `CUNIT1`/`CUNIT2`: `'deg'` (degrees), `'arcsec'` (arcseconds)
457
- - `CUNIT3`: `'km s-1'` (velocity), `'Hz'` (frequency)
458
- - `BUNIT`: `'Jy'`, `'Jy/beam'`, `'beam-1 Jy'`, `'MJy/sr'` (must match your science case)
514
+ - `CUNIT1`/`CUNIT2`: `'deg'` (degrees), `'arcsec'` (arcseconds).
515
+ - `CUNIT3`: `'km s-1'` (velocity), `'Hz'` (frequency).
516
+ - `BUNIT`: `'Jy'`, `'Jy/beam'`, `'beam-1 Jy'`, `'MJy/sr'` (must match your science case).
459
517
  - **Beam Parameters:**
460
- - `BMAJ`, `BMIN`: Beam size in degrees (convert from arcsec if needed: 1 arcsec = 1/3600 deg)
461
- - `BPA`: Beam position angle in degrees
518
+ - `BMAJ`, `BMIN`: Beam size in degrees (convert from arcsec if needed: 1 arcsec = 1/3600 deg).
519
+ - `BPA`: Beam position angle in degrees.
462
520
  - **Other:**
463
521
  - Additional header keywords may be present, but the above are required for Hyper-py to interpret the map/cube correctly.
464
522
 
@@ -520,3 +578,25 @@ BPA = 0.0
520
578
  OBJECT = 'Datacube for Hyper-py test'
521
579
  END
522
580
  ```
581
+
582
+ ## 🔬 Test Mode
583
+
584
+ In order to quickly test the full functionality of **Hyper_py**, a dedicated **test mode** is available.
585
+
586
+ You can run the code in test mode by executing the `test_hyper.py` script located in the `test/` folder:
587
+
588
+ ```bash
589
+ python test/test_hyper.py
590
+ ```
591
+
592
+ When launched, the script will:
593
+ - Automatically generate a minimal working config.yaml file;
594
+ - Analyze two synthetic 2D maps and one synthetic datacube with 4 slices;
595
+ - Run the analysis using 2 parallel cores (if available);
596
+ - Generate all intermediate and final FITS files and diagnostic plots, including:
597
+ - Background models;
598
+ - Gaussian + background fits;
599
+ - Residual maps;
600
+ - Photometric results.
601
+
602
+ This mode is designed to validate the installation and ensure that all the core functionalities of the pipeline are working properly. It is particularly useful for new users, developers, or during CI testing.