hyper-py-photometry 0.1.3__py3-none-any.whl → 0.1.5__py3-none-any.whl
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.
- hyper_py/__init__.py +1 -1
- hyper_py/run_hyper.py +6 -2
- {hyper_py_photometry-0.1.3.dist-info → hyper_py_photometry-0.1.5.dist-info}/METADATA +152 -72
- {hyper_py_photometry-0.1.3.dist-info → hyper_py_photometry-0.1.5.dist-info}/RECORD +8 -8
- {hyper_py_photometry-0.1.3.dist-info → hyper_py_photometry-0.1.5.dist-info}/WHEEL +0 -0
- {hyper_py_photometry-0.1.3.dist-info → hyper_py_photometry-0.1.5.dist-info}/entry_points.txt +0 -0
- {hyper_py_photometry-0.1.3.dist-info → hyper_py_photometry-0.1.5.dist-info}/licenses/LICENSE +0 -0
- {hyper_py_photometry-0.1.3.dist-info → hyper_py_photometry-0.1.5.dist-info}/top_level.txt +0 -0
hyper_py/__init__.py
CHANGED
hyper_py/run_hyper.py
CHANGED
|
@@ -13,8 +13,12 @@ warnings.filterwarnings("ignore", message=".*more axes \\(4\\) than the image it
|
|
|
13
13
|
warnings.filterwarnings("ignore", message=".*Set MJD-OBS to.*")
|
|
14
14
|
|
|
15
15
|
# Import the main entry point of the package
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
try:
|
|
17
|
+
from hyper_py.hyper import start_hyper
|
|
18
|
+
except ModuleNotFoundError:
|
|
19
|
+
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
|
|
20
|
+
from hyper_py.hyper import start_hyper
|
|
21
|
+
|
|
18
22
|
# importlib.resources for packaged data (fallback to importlib_resources on older Python)
|
|
19
23
|
try:
|
|
20
24
|
from importlib.resources import files as ir_files
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: hyper-py-photometry
|
|
3
|
-
Version: 0.1.
|
|
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 `
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
120
|
-
|
|
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
|
|
125
|
+
pip install -r requirements.txt
|
|
123
126
|
```
|
|
124
127
|
|
|
125
128
|
|
|
126
|
-
##
|
|
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
|
-
>
|
|
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 `
|
|
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/
|
|
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/
|
|
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/
|
|
196
|
+
hyper_py path/to/hyper_config.yaml
|
|
158
197
|
```
|
|
159
198
|
OR
|
|
160
199
|
```bash
|
|
161
|
-
hyper-py path/to/
|
|
200
|
+
hyper-py path/to/hyper_config.yaml
|
|
162
201
|
```
|
|
163
202
|
OR
|
|
164
203
|
```bash
|
|
165
|
-
hyper path/to/
|
|
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
|
-
-
|
|
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/
|
|
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 (`
|
|
245
|
+
## ⚙️ Configuration File Reference (`hyper_config.yaml`)
|
|
207
246
|
|
|
208
|
-
The `
|
|
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
|
|
217
|
-
| `paths.output.dir_region_out`| Subdirectory of `dir_root` for region files
|
|
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
|
|
226
|
-
| `files.file_region_base` | Base filename for
|
|
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
|
-
|
|
269
|
-
|
|
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.
|
|
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.
|
|
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.
|
|
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` |
|
|
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
|
|
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
|
|
351
|
-
| `visualization.output_dir_fitting` | Subdirectory of `dir_root` for
|
|
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 `
|
|
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
|
|
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.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
hyper_py/__init__.py,sha256=
|
|
1
|
+
hyper_py/__init__.py,sha256=11pucLbbhjgiTjT0_HYsgSXqtRje5XtbbI-blW-DZ9g,469
|
|
2
2
|
hyper_py/__main__.py,sha256=VEzRWxxjj8Jja0FY5TiqDWaYkqYsFhHirbAK2gxRFTg,208
|
|
3
3
|
hyper_py/bkg_multigauss.py,sha256=SuVlEMkPOccqOuATCaoEBU_WpQARAlHJa2qwAkglHII,22778
|
|
4
4
|
hyper_py/bkg_single.py,sha256=stGiZIAFabOW3QHxakA2pJ0__HjgyvcPD2TnB3ARbZc,20269
|
|
@@ -15,14 +15,14 @@ hyper_py/logger.py,sha256=He18tjVOvG7_OVGY6262wj30HExoEa7vCFO6WziHSFk,2864
|
|
|
15
15
|
hyper_py/map_io.py,sha256=QHYsMFOA1Jzmx-ou_CFHAdRLXl00ynf2dYK8PZGh2CQ,2363
|
|
16
16
|
hyper_py/paths_io.py,sha256=fUl0GjwUZLEDXZAUlLK88DB6mBQ_il7fIa-vvKVUxRI,3770
|
|
17
17
|
hyper_py/photometry.py,sha256=4oCRZy8FVjV9BZL5f85LlcNnXuNq0wgtGAm8_cL5f9w,3869
|
|
18
|
-
hyper_py/run_hyper.py,sha256=
|
|
18
|
+
hyper_py/run_hyper.py,sha256=ed2n7yf8mLATWXtjPxOAs1odiBcUsDsEU4bwDiXd24w,5388
|
|
19
19
|
hyper_py/single_map.py,sha256=YXlMiixK-CLfiFjmLiqP8RkKu6JkekEDjVi-3bQu05w,28831
|
|
20
20
|
hyper_py/survey.py,sha256=ymOJk-H4Bf515OwSNFkmODKk7x3MteT6l51ylaYy9Cg,2807
|
|
21
21
|
hyper_py/visualization.py,sha256=AJRuR_Y-_AaZ2NwX1w07lRABV0C2-w8QP1tSqs9_kvk,5662
|
|
22
22
|
hyper_py/assets/default_config.yaml,sha256=64DJtYhwHX6XkbOyuGMmn51WwjK0uJpNafRe8CwkkO4,10616
|
|
23
|
-
hyper_py_photometry-0.1.
|
|
24
|
-
hyper_py_photometry-0.1.
|
|
25
|
-
hyper_py_photometry-0.1.
|
|
26
|
-
hyper_py_photometry-0.1.
|
|
27
|
-
hyper_py_photometry-0.1.
|
|
28
|
-
hyper_py_photometry-0.1.
|
|
23
|
+
hyper_py_photometry-0.1.5.dist-info/licenses/LICENSE,sha256=aB7cqE2-X_8mxy-EmQuVMkKmP8DQA2BnQaqD5k5C5nE,584
|
|
24
|
+
hyper_py_photometry-0.1.5.dist-info/METADATA,sha256=iduEhNj98qoQyvPUvP3-SjRM0RFRMCLSqx3Yj3WB0aE,37007
|
|
25
|
+
hyper_py_photometry-0.1.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
26
|
+
hyper_py_photometry-0.1.5.dist-info/entry_points.txt,sha256=0AVwuatL0ri5juy_Ccgt_9Bd4V0McpOrWSSnNX8cCzs,120
|
|
27
|
+
hyper_py_photometry-0.1.5.dist-info/top_level.txt,sha256=Pw-Iuf0SQwcibLdOwx4RkmEas3I6s0Ym_D0_oUnXEr4,9
|
|
28
|
+
hyper_py_photometry-0.1.5.dist-info/RECORD,,
|
|
File without changes
|
{hyper_py_photometry-0.1.3.dist-info → hyper_py_photometry-0.1.5.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
{hyper_py_photometry-0.1.3.dist-info → hyper_py_photometry-0.1.5.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|
|
File without changes
|