hyper-py-photometry 0.1.2__tar.gz → 0.1.4__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.
- {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/.vscode/launch.json +3 -3
- {hyper_py_photometry-0.1.2/src/hyper_py_photometry.egg-info → hyper_py_photometry-0.1.4}/PKG-INFO +70 -39
- {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/README.md +68 -38
- {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/pyproject.toml +5 -1
- {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/requirements.txt +2 -1
- hyper_py_photometry-0.1.4/src/hyper_py/__init__.py +21 -0
- hyper_py_photometry-0.1.4/src/hyper_py/__main__.py +7 -0
- {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/src/hyper_py/hyper.py +1 -1
- hyper_py_photometry-0.1.4/src/hyper_py/run_hyper.py +154 -0
- {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4/src/hyper_py_photometry.egg-info}/PKG-INFO +70 -39
- {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/src/hyper_py_photometry.egg-info/SOURCES.txt +2 -1
- {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/src/hyper_py_photometry.egg-info/requires.txt +1 -0
- {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/test/test_hyper.py +4 -0
- hyper_py_photometry-0.1.2/src/hyper_py/__init__.py +0 -1
- hyper_py_photometry-0.1.2/src/hyper_py/run_hyper.py +0 -45
- {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/.github/workflows/Hyper-py_paper.yml +0 -0
- {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/.github/workflows/pypi-publish.yml +0 -0
- {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/.gitignore +0 -0
- {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/IDL_comparison/Gaussian_comparison_Hyper_py_IDL_ALL.py +0 -0
- {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/IDL_comparison/ellipses_map_500_Gaussians_1_centroids.reg +0 -0
- {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/IDL_comparison/ellipses_map_500_Gaussians_1_ellipses.reg +0 -0
- {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/IDL_comparison/ellipses_map_500_Gaussians_2_centroids.reg +0 -0
- {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/IDL_comparison/ellipses_map_500_Gaussians_2_ellipses.reg +0 -0
- {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/IDL_comparison/hyper_output_map_500_Gaussians_1.txt +0 -0
- {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/IDL_comparison/hyper_output_map_500_Gaussians_2.txt +0 -0
- {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/IDL_comparison/map_500_Gaussians_1.fits +0 -0
- {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/IDL_comparison/map_500_Gaussians_2.fits +0 -0
- {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/IDL_comparison/matched_flux_comparison_table.txt +0 -0
- {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/IDL_comparison/output/Flux_Comparison_Hyper_IDL_Int_1.png +0 -0
- {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/IDL_comparison/output/Flux_Comparison_Hyper_IDL_Int_2.png +0 -0
- {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/IDL_comparison/output/Flux_Comparison_Hyper_IDL_Peak_1.png +0 -0
- {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/IDL_comparison/output/Flux_Comparison_Hyper_IDL_Peak_2.png +0 -0
- {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/IDL_comparison/output/Flux_Comparison_Hyper_IDL_vs_py_Int_1.png +0 -0
- {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/IDL_comparison/output/Flux_Comparison_Hyper_IDL_vs_py_Int_2.png +0 -0
- {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/IDL_comparison/output/Flux_Comparison_Hyper_IDL_vs_py_Peak_1.png +0 -0
- {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/IDL_comparison/output/Flux_Comparison_Hyper_IDL_vs_py_Peak_2.png +0 -0
- {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/IDL_comparison/output/Flux_Comparison_Hyper_py_Int_1.png +0 -0
- {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/IDL_comparison/output/Flux_Comparison_Hyper_py_Int_2.png +0 -0
- {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/IDL_comparison/output/Flux_Comparison_Hyper_py_Peak_1.png +0 -0
- {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/IDL_comparison/output/Flux_Comparison_Hyper_py_Peak_2.png +0 -0
- {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/IDL_comparison/output/Flux_Diff_Histogram_Int.png +0 -0
- {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/IDL_comparison/output/Flux_Diff_Histogram_Peak.png +0 -0
- {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/IDL_comparison/output/combined_source_counts_comparison.txt +0 -0
- {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/IDL_comparison/output/matched_flux_comparison_table.txt +0 -0
- {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/IDL_comparison/photometry_sources_1300_ellipses_1300_polynomial_background_4sigma_ipac_1.txt +0 -0
- {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/IDL_comparison/photometry_sources_1300_ellipses_1300_polynomial_background_4sigma_ipac_2.txt +0 -0
- {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/IDL_comparison/table_500_Gaussians_1.txt +0 -0
- {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/IDL_comparison/table_500_Gaussians_2.txt +0 -0
- {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/LICENSE +0 -0
- {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/environment.yml +0 -0
- {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/paper/Figures/Flux_Diff_Histogram_Int.png +0 -0
- {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/paper/Figures/Flux_Diff_Histogram_Peak.png +0 -0
- {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/paper/paper.bib +0 -0
- {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/paper/paper.md +0 -0
- {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/setup.cfg +0 -0
- /hyper_py_photometry-0.1.2/src/hyper_py/config.yaml → /hyper_py_photometry-0.1.4/src/hyper_py/assets/default_config.yaml +0 -0
- {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/src/hyper_py/bkg_multigauss.py +0 -0
- {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/src/hyper_py/bkg_single.py +0 -0
- {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/src/hyper_py/config.py +0 -0
- {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/src/hyper_py/create_background_slices.py +0 -0
- {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/src/hyper_py/data_output.py +0 -0
- {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/src/hyper_py/detection.py +0 -0
- {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/src/hyper_py/extract_cubes.py +0 -0
- {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/src/hyper_py/fitting.py +0 -0
- {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/src/hyper_py/gaussfit.py +0 -0
- {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/src/hyper_py/groups.py +0 -0
- {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/src/hyper_py/logger.py +0 -0
- {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/src/hyper_py/map_io.py +0 -0
- {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/src/hyper_py/paths_io.py +0 -0
- {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/src/hyper_py/photometry.py +0 -0
- {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/src/hyper_py/single_map.py +0 -0
- {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/src/hyper_py/survey.py +0 -0
- {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/src/hyper_py/visualization.py +0 -0
- {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/src/hyper_py_photometry.egg-info/dependency_links.txt +0 -0
- {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/src/hyper_py_photometry.egg-info/entry_points.txt +0 -0
- {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/src/hyper_py_photometry.egg-info/top_level.txt +0 -0
- {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/test/maps/test_2d_map_1.fits +0 -0
- {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/test/maps/test_2d_map_2.fits +0 -0
- {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/test/maps/test_2dmap.txt +0 -0
- {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/test/maps/test_datacube.fits +0 -0
- {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/test/maps/test_datacube.txt +0 -0
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
"name": "Python Debugger: Current File",
|
|
7
7
|
"type": "debugpy",
|
|
8
8
|
"request": "launch",
|
|
9
|
-
|
|
10
|
-
"program": "${workspaceFolder}/test/test_hyper.py",
|
|
9
|
+
"program": "${workspaceFolder}/src/hyper_py/run_hyper.py",
|
|
10
|
+
//"program": "${workspaceFolder}/test/test_hyper.py",
|
|
11
11
|
"console": "integratedTerminal",
|
|
12
|
-
"args": ["${workspaceFolder}/src/hyper_py/config.yaml"],
|
|
12
|
+
//"args": ["${workspaceFolder}/src/hyper_py/config.yaml"],
|
|
13
13
|
"env": {
|
|
14
14
|
"MPLBACKEND": "TkAgg"
|
|
15
15
|
}
|
{hyper_py_photometry-0.1.2/src/hyper_py_photometry.egg-info → hyper_py_photometry-0.1.4}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: hyper-py-photometry
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.4
|
|
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
|
|
@@ -15,6 +15,7 @@ Requires-Dist: scipy
|
|
|
15
15
|
Requires-Dist: lmfit
|
|
16
16
|
Requires-Dist: matplotlib
|
|
17
17
|
Requires-Dist: scikit-learn<1.6,>=1.4
|
|
18
|
+
Requires-Dist: ruamel.yaml>=0.18
|
|
18
19
|
Dynamic: license-file
|
|
19
20
|
|
|
20
21
|
# 💫 `Hyper-py`: Hybrid Photometry Photometry and Extraction Routine in Python
|
|
@@ -61,7 +62,7 @@ Hyper-py now supports **parallel execution** over multiple maps or datacube slic
|
|
|
61
62
|
- Maintain **individual log files** for each map
|
|
62
63
|
- Merge the final outputs (tables and diagnostics) into a single, combined summary
|
|
63
64
|
|
|
64
|
-
To enable parallelism, set the following parameters in your `
|
|
65
|
+
To enable parallelism, set the following parameters in your `hyper_config.yaml` file under the `control` section:
|
|
65
66
|
|
|
66
67
|
```yaml
|
|
67
68
|
control:
|
|
@@ -72,30 +73,16 @@ control:
|
|
|
72
73
|
If `parallel_maps` is set to `false`, the pipeline will run in serial mode.
|
|
73
74
|
|
|
74
75
|
|
|
76
|
+
## 🛠️ Installation
|
|
77
|
+
You can install and use `Hyper-py` in two different ways, depending on your needs:
|
|
75
78
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
Before using `Hyper-py`, make sure you have all the necessary Python dependencies installed. The following core libraries are required:
|
|
79
|
-
• astropy
|
|
80
|
-
• photutils
|
|
81
|
-
• matplotlib
|
|
82
|
-
• lmfit
|
|
83
|
-
• pyyaml
|
|
84
|
-
• numpy
|
|
85
|
-
• scipy
|
|
86
|
-
• scikit-learn>=1.4,<1.6
|
|
87
|
-
|
|
88
|
-
This will install the necessary packages using `pip`:
|
|
89
|
-
|
|
79
|
+
### Option 1: Install via `pip` (for direct usage)
|
|
80
|
+
Install via PyPI:
|
|
90
81
|
```bash
|
|
91
|
-
|
|
82
|
+
pip install hyper-py-photometry
|
|
92
83
|
```
|
|
93
84
|
|
|
94
|
-
|
|
95
|
-
## 🛠️ Installation
|
|
96
|
-
You can install and use `Hyper-py` in two different ways, depending on your needs:
|
|
97
|
-
|
|
98
|
-
### Option 1: Use the Source Code (for development or integration)
|
|
85
|
+
### Option 2: Use the Source Code (for development or integration)
|
|
99
86
|
|
|
100
87
|
If you want to modify, extend, or integrate `Hyper-py` in your own projects:
|
|
101
88
|
|
|
@@ -115,27 +102,71 @@ export PYTHONPATH=$(pwd)/src
|
|
|
115
102
|
import sys
|
|
116
103
|
sys.path.insert(0, "/absolute/path/to/hyper_py/src")
|
|
117
104
|
```
|
|
118
|
-
|
|
119
|
-
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
## ✅ Requirements
|
|
108
|
+
|
|
109
|
+
Before using `Hyper-py`, make sure you have all the necessary Python dependencies installed.
|
|
110
|
+
|
|
111
|
+
If you have installed `Hyper-py` via pip, all the requirements are automatically installed.
|
|
112
|
+
Otherwise, you can use the `requirements.txt` file, this will install the necessary packages using `pip`::
|
|
120
113
|
```bash
|
|
121
|
-
pip install
|
|
114
|
+
pip install -r requirements.txt
|
|
122
115
|
```
|
|
123
116
|
|
|
124
117
|
|
|
125
|
-
##
|
|
118
|
+
## 📄 Configuration File
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
`Hyper-py` requires a configuration file named **`hyper_config.yaml`** in order to run.
|
|
122
|
+
|
|
123
|
+
>The first time you run `Hyper-py` a new hyper_config.yaml will be created automatically in the CWD, then you must setup all paths and paramenters.<br>
|
|
124
|
+
>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.
|
|
125
|
+
|
|
126
|
+
If no path is provided, the application will look for it in this order:
|
|
127
|
+
1. Path passed as CLI argument
|
|
128
|
+
2. `hyper_config.yaml` in the current working directory (CWD)
|
|
129
|
+
3. User configuration directory
|
|
130
|
+
- Linux/macOS: `~/.config/hyper-py/hyper_config.yaml`
|
|
131
|
+
- Windows: `%APPDATA%\HyperPy\hyper_config.yaml`
|
|
132
|
+
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`).
|
|
126
133
|
|
|
127
|
-
You can use `Hyper-py` either by importing and running it directly from Python, or via command line.
|
|
128
134
|
> [!IMPORTANT]
|
|
129
|
-
>
|
|
135
|
+
> <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>
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
### Configuration file lookup order
|
|
139
|
+
|
|
140
|
+
| Priority | Location | Description |
|
|
141
|
+
|----------|--------------------------------------------|-----------------------------------------------------------------------------|
|
|
142
|
+
| 1 | CLI argument | Path explicitly provided by the user, e.g. `hyper-py /path/to/hyper_config.yaml`. |
|
|
143
|
+
| 2 | Current Working Directory (CWD) | Looks for `./hyper_config.yaml` in the folder where the command is executed. |
|
|
144
|
+
| 3 | User configuration directory | - **Linux/macOS:** `~/.config/hyper-py/hyper_config.yaml`<br> - **Windows:** `%APPDATA%\HyperPy\hyper_config.yaml` |
|
|
145
|
+
| 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`). |
|
|
146
|
+
|
|
147
|
+
### 💡 Tips & Tricks
|
|
148
|
+
|
|
149
|
+
- **Use different configs**
|
|
150
|
+
You can maintain multiple configuration files (e.g., `hyper_config.dev.yaml` and `hyper_config.prod.yaml`) and choose which one to run.
|
|
151
|
+
<br>Eg. If you have installed via pip:
|
|
152
|
+
```bash
|
|
153
|
+
hyper-py ./hyper_config.dev.yaml
|
|
154
|
+
hyper-py ./hyper_config.prod.yaml
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
## 🚀 Usage
|
|
159
|
+
|
|
160
|
+
You can use `Hyper-py` either by importing and running it directly from Python, or via command line.
|
|
130
161
|
|
|
131
162
|
### 1. From Python
|
|
132
163
|
|
|
133
|
-
Import and run the `
|
|
164
|
+
Import and run the `run_hyper` function, passing the path to your YAML configuration file.
|
|
134
165
|
|
|
135
166
|
```python
|
|
136
167
|
from hyper_py import run_hyper
|
|
137
168
|
|
|
138
|
-
run_hyper("path/to/
|
|
169
|
+
run_hyper("path/to/hyper_config.yaml")
|
|
139
170
|
```
|
|
140
171
|
This is the recommended approach if you want to integrate `Hyper-py` into a larger Python application or workflow.
|
|
141
172
|
|
|
@@ -145,7 +176,7 @@ I) Using the source code:
|
|
|
145
176
|
|
|
146
177
|
You can execute the tool from the terminal:
|
|
147
178
|
```bash
|
|
148
|
-
python -m hyper_py path/to/
|
|
179
|
+
python -m hyper_py path/to/hyper_config.yaml
|
|
149
180
|
```
|
|
150
181
|
This runs the main process using the configuration file specified.
|
|
151
182
|
|
|
@@ -153,18 +184,18 @@ II) If installed via pip:
|
|
|
153
184
|
|
|
154
185
|
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:
|
|
155
186
|
```bash
|
|
156
|
-
hyper_py path/to/
|
|
187
|
+
hyper_py path/to/hyper_config.yaml
|
|
157
188
|
```
|
|
158
189
|
OR
|
|
159
190
|
```bash
|
|
160
|
-
hyper-py path/to/
|
|
191
|
+
hyper-py path/to/hyper_config.yaml
|
|
161
192
|
```
|
|
162
193
|
OR
|
|
163
194
|
```bash
|
|
164
|
-
hyper path/to/
|
|
195
|
+
hyper path/to/hyper_config.yaml
|
|
165
196
|
```
|
|
166
197
|
|
|
167
|
-
## Using the Source Code in Visual Studio Code
|
|
198
|
+
## 💻 Using the Source Code in Visual Studio Code
|
|
168
199
|
To run or debug the source code using Visual Studio Code:
|
|
169
200
|
### 1. Open the project
|
|
170
201
|
- Open the project folder in VS Code.
|
|
@@ -193,7 +224,7 @@ Optional: You can add this to `.vscode/launch.json` for convenience:
|
|
|
193
224
|
"request": "launch",
|
|
194
225
|
"program": "${workspaceFolder}/src/hyper_py/run_hyper.py",
|
|
195
226
|
"console": "integratedTerminal",
|
|
196
|
-
"args": ["path/to/
|
|
227
|
+
"args": ["path/to/hyper_config.yaml"],
|
|
197
228
|
}
|
|
198
229
|
]
|
|
199
230
|
}
|
|
@@ -202,9 +233,9 @@ Optional: You can add this to `.vscode/launch.json` for convenience:
|
|
|
202
233
|
<br/><br/>
|
|
203
234
|
|
|
204
235
|
|
|
205
|
-
## ⚙️ Configuration File Reference (`
|
|
236
|
+
## ⚙️ Configuration File Reference (`hyper_config.yaml`)
|
|
206
237
|
|
|
207
|
-
The `
|
|
238
|
+
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.
|
|
208
239
|
|
|
209
240
|
### File Paths
|
|
210
241
|
|
|
@@ -354,7 +385,7 @@ The `config.yaml` file controls all aspects of the Hyper-py pipeline. Below is a
|
|
|
354
385
|
---
|
|
355
386
|
|
|
356
387
|
**Tip:**
|
|
357
|
-
All entries can be customized in your `
|
|
388
|
+
All entries can be customized in your `hyper_config.yaml`. If an entry is omitted, the default value will be used.
|
|
358
389
|
|
|
359
390
|
|
|
360
391
|
|
|
@@ -42,7 +42,7 @@ Hyper-py now supports **parallel execution** over multiple maps or datacube slic
|
|
|
42
42
|
- Maintain **individual log files** for each map
|
|
43
43
|
- Merge the final outputs (tables and diagnostics) into a single, combined summary
|
|
44
44
|
|
|
45
|
-
To enable parallelism, set the following parameters in your `
|
|
45
|
+
To enable parallelism, set the following parameters in your `hyper_config.yaml` file under the `control` section:
|
|
46
46
|
|
|
47
47
|
```yaml
|
|
48
48
|
control:
|
|
@@ -53,30 +53,16 @@ control:
|
|
|
53
53
|
If `parallel_maps` is set to `false`, the pipeline will run in serial mode.
|
|
54
54
|
|
|
55
55
|
|
|
56
|
+
## 🛠️ Installation
|
|
57
|
+
You can install and use `Hyper-py` in two different ways, depending on your needs:
|
|
56
58
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
Before using `Hyper-py`, make sure you have all the necessary Python dependencies installed. The following core libraries are required:
|
|
60
|
-
• astropy
|
|
61
|
-
• photutils
|
|
62
|
-
• matplotlib
|
|
63
|
-
• lmfit
|
|
64
|
-
• pyyaml
|
|
65
|
-
• numpy
|
|
66
|
-
• scipy
|
|
67
|
-
• scikit-learn>=1.4,<1.6
|
|
68
|
-
|
|
69
|
-
This will install the necessary packages using `pip`:
|
|
70
|
-
|
|
59
|
+
### Option 1: Install via `pip` (for direct usage)
|
|
60
|
+
Install via PyPI:
|
|
71
61
|
```bash
|
|
72
|
-
|
|
62
|
+
pip install hyper-py-photometry
|
|
73
63
|
```
|
|
74
64
|
|
|
75
|
-
|
|
76
|
-
## 🛠️ Installation
|
|
77
|
-
You can install and use `Hyper-py` in two different ways, depending on your needs:
|
|
78
|
-
|
|
79
|
-
### Option 1: Use the Source Code (for development or integration)
|
|
65
|
+
### Option 2: Use the Source Code (for development or integration)
|
|
80
66
|
|
|
81
67
|
If you want to modify, extend, or integrate `Hyper-py` in your own projects:
|
|
82
68
|
|
|
@@ -96,27 +82,71 @@ export PYTHONPATH=$(pwd)/src
|
|
|
96
82
|
import sys
|
|
97
83
|
sys.path.insert(0, "/absolute/path/to/hyper_py/src")
|
|
98
84
|
```
|
|
99
|
-
|
|
100
|
-
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
## ✅ Requirements
|
|
88
|
+
|
|
89
|
+
Before using `Hyper-py`, make sure you have all the necessary Python dependencies installed.
|
|
90
|
+
|
|
91
|
+
If you have installed `Hyper-py` via pip, all the requirements are automatically installed.
|
|
92
|
+
Otherwise, you can use the `requirements.txt` file, this will install the necessary packages using `pip`::
|
|
101
93
|
```bash
|
|
102
|
-
pip install
|
|
94
|
+
pip install -r requirements.txt
|
|
103
95
|
```
|
|
104
96
|
|
|
105
97
|
|
|
106
|
-
##
|
|
98
|
+
## 📄 Configuration File
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
`Hyper-py` requires a configuration file named **`hyper_config.yaml`** in order to run.
|
|
102
|
+
|
|
103
|
+
>The first time you run `Hyper-py` a new hyper_config.yaml will be created automatically in the CWD, then you must setup all paths and paramenters.<br>
|
|
104
|
+
>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.
|
|
105
|
+
|
|
106
|
+
If no path is provided, the application will look for it in this order:
|
|
107
|
+
1. Path passed as CLI argument
|
|
108
|
+
2. `hyper_config.yaml` in the current working directory (CWD)
|
|
109
|
+
3. User configuration directory
|
|
110
|
+
- Linux/macOS: `~/.config/hyper-py/hyper_config.yaml`
|
|
111
|
+
- Windows: `%APPDATA%\HyperPy\hyper_config.yaml`
|
|
112
|
+
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`).
|
|
107
113
|
|
|
108
|
-
You can use `Hyper-py` either by importing and running it directly from Python, or via command line.
|
|
109
114
|
> [!IMPORTANT]
|
|
110
|
-
>
|
|
115
|
+
> <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>
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
### Configuration file lookup order
|
|
119
|
+
|
|
120
|
+
| Priority | Location | Description |
|
|
121
|
+
|----------|--------------------------------------------|-----------------------------------------------------------------------------|
|
|
122
|
+
| 1 | CLI argument | Path explicitly provided by the user, e.g. `hyper-py /path/to/hyper_config.yaml`. |
|
|
123
|
+
| 2 | Current Working Directory (CWD) | Looks for `./hyper_config.yaml` in the folder where the command is executed. |
|
|
124
|
+
| 3 | User configuration directory | - **Linux/macOS:** `~/.config/hyper-py/hyper_config.yaml`<br> - **Windows:** `%APPDATA%\HyperPy\hyper_config.yaml` |
|
|
125
|
+
| 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`). |
|
|
126
|
+
|
|
127
|
+
### 💡 Tips & Tricks
|
|
128
|
+
|
|
129
|
+
- **Use different configs**
|
|
130
|
+
You can maintain multiple configuration files (e.g., `hyper_config.dev.yaml` and `hyper_config.prod.yaml`) and choose which one to run.
|
|
131
|
+
<br>Eg. If you have installed via pip:
|
|
132
|
+
```bash
|
|
133
|
+
hyper-py ./hyper_config.dev.yaml
|
|
134
|
+
hyper-py ./hyper_config.prod.yaml
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
## 🚀 Usage
|
|
139
|
+
|
|
140
|
+
You can use `Hyper-py` either by importing and running it directly from Python, or via command line.
|
|
111
141
|
|
|
112
142
|
### 1. From Python
|
|
113
143
|
|
|
114
|
-
Import and run the `
|
|
144
|
+
Import and run the `run_hyper` function, passing the path to your YAML configuration file.
|
|
115
145
|
|
|
116
146
|
```python
|
|
117
147
|
from hyper_py import run_hyper
|
|
118
148
|
|
|
119
|
-
run_hyper("path/to/
|
|
149
|
+
run_hyper("path/to/hyper_config.yaml")
|
|
120
150
|
```
|
|
121
151
|
This is the recommended approach if you want to integrate `Hyper-py` into a larger Python application or workflow.
|
|
122
152
|
|
|
@@ -126,7 +156,7 @@ I) Using the source code:
|
|
|
126
156
|
|
|
127
157
|
You can execute the tool from the terminal:
|
|
128
158
|
```bash
|
|
129
|
-
python -m hyper_py path/to/
|
|
159
|
+
python -m hyper_py path/to/hyper_config.yaml
|
|
130
160
|
```
|
|
131
161
|
This runs the main process using the configuration file specified.
|
|
132
162
|
|
|
@@ -134,18 +164,18 @@ II) If installed via pip:
|
|
|
134
164
|
|
|
135
165
|
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:
|
|
136
166
|
```bash
|
|
137
|
-
hyper_py path/to/
|
|
167
|
+
hyper_py path/to/hyper_config.yaml
|
|
138
168
|
```
|
|
139
169
|
OR
|
|
140
170
|
```bash
|
|
141
|
-
hyper-py path/to/
|
|
171
|
+
hyper-py path/to/hyper_config.yaml
|
|
142
172
|
```
|
|
143
173
|
OR
|
|
144
174
|
```bash
|
|
145
|
-
hyper path/to/
|
|
175
|
+
hyper path/to/hyper_config.yaml
|
|
146
176
|
```
|
|
147
177
|
|
|
148
|
-
## Using the Source Code in Visual Studio Code
|
|
178
|
+
## 💻 Using the Source Code in Visual Studio Code
|
|
149
179
|
To run or debug the source code using Visual Studio Code:
|
|
150
180
|
### 1. Open the project
|
|
151
181
|
- Open the project folder in VS Code.
|
|
@@ -174,7 +204,7 @@ Optional: You can add this to `.vscode/launch.json` for convenience:
|
|
|
174
204
|
"request": "launch",
|
|
175
205
|
"program": "${workspaceFolder}/src/hyper_py/run_hyper.py",
|
|
176
206
|
"console": "integratedTerminal",
|
|
177
|
-
"args": ["path/to/
|
|
207
|
+
"args": ["path/to/hyper_config.yaml"],
|
|
178
208
|
}
|
|
179
209
|
]
|
|
180
210
|
}
|
|
@@ -183,9 +213,9 @@ Optional: You can add this to `.vscode/launch.json` for convenience:
|
|
|
183
213
|
<br/><br/>
|
|
184
214
|
|
|
185
215
|
|
|
186
|
-
## ⚙️ Configuration File Reference (`
|
|
216
|
+
## ⚙️ Configuration File Reference (`hyper_config.yaml`)
|
|
187
217
|
|
|
188
|
-
The `
|
|
218
|
+
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.
|
|
189
219
|
|
|
190
220
|
### File Paths
|
|
191
221
|
|
|
@@ -335,7 +365,7 @@ The `config.yaml` file controls all aspects of the Hyper-py pipeline. Below is a
|
|
|
335
365
|
---
|
|
336
366
|
|
|
337
367
|
**Tip:**
|
|
338
|
-
All entries can be customized in your `
|
|
368
|
+
All entries can be customized in your `hyper_config.yaml`. If an entry is omitted, the default value will be used.
|
|
339
369
|
|
|
340
370
|
|
|
341
371
|
|
|
@@ -18,7 +18,8 @@ dependencies = [
|
|
|
18
18
|
"scipy",
|
|
19
19
|
"lmfit",
|
|
20
20
|
"matplotlib",
|
|
21
|
-
"scikit-learn>=1.4,<1.6"
|
|
21
|
+
"scikit-learn>=1.4,<1.6",
|
|
22
|
+
"ruamel.yaml>=0.18"
|
|
22
23
|
]
|
|
23
24
|
|
|
24
25
|
[project.urls]
|
|
@@ -32,6 +33,9 @@ hyper_py = "hyper_py.run_hyper:main"
|
|
|
32
33
|
[tool.setuptools]
|
|
33
34
|
package-dir = {"" = "src"}
|
|
34
35
|
|
|
36
|
+
[tool.setuptools.package-data]
|
|
37
|
+
hyper_py = ["assets/default_config.yaml"]
|
|
38
|
+
|
|
35
39
|
[tool.setuptools.packages.find]
|
|
36
40
|
where = ["src"]
|
|
37
41
|
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Hyper-Py package initializer.
|
|
3
|
+
|
|
4
|
+
This file defines the public API and version metadata.
|
|
5
|
+
It does not run the application automatically; use
|
|
6
|
+
either `python -m hyper_py` or the console script entry point.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from importlib.metadata import version, PackageNotFoundError
|
|
10
|
+
|
|
11
|
+
from .hyper import start_hyper
|
|
12
|
+
|
|
13
|
+
try:
|
|
14
|
+
__version__ = version("hyper-py-photometry")
|
|
15
|
+
except PackageNotFoundError:
|
|
16
|
+
__version__ = "0.0.0-dev"
|
|
17
|
+
|
|
18
|
+
__all__ = [
|
|
19
|
+
"start_hyper",
|
|
20
|
+
"__version__",
|
|
21
|
+
]
|
|
@@ -22,7 +22,7 @@ def start_hyper(cfg_path):
|
|
|
22
22
|
# === Load config ===
|
|
23
23
|
os.chdir(os.path.dirname(__file__))
|
|
24
24
|
|
|
25
|
-
config_path = cfg_path if not None else "
|
|
25
|
+
config_path = cfg_path if not None else "hyper_config.yaml"
|
|
26
26
|
|
|
27
27
|
if not os.path.exists(config_path):
|
|
28
28
|
raise FileNotFoundError(f"Config file not found: {config_path}")
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import sys
|
|
2
|
+
import os
|
|
3
|
+
import warnings
|
|
4
|
+
import shutil
|
|
5
|
+
import platform
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
|
|
8
|
+
# Silence some known irrelevant warnings
|
|
9
|
+
warnings.filterwarnings("ignore", message="Using UFloat objects with std_dev==0 may give unexpected results.")
|
|
10
|
+
warnings.filterwarnings("ignore", message=".*Set OBSGEO-L to.*")
|
|
11
|
+
warnings.filterwarnings("ignore", message=".*Wrapping comment lines > 78 characters.*")
|
|
12
|
+
warnings.filterwarnings("ignore", message=".*more axes \\(4\\) than the image it is associated with \\(2\\).*")
|
|
13
|
+
warnings.filterwarnings("ignore", message=".*Set MJD-OBS to.*")
|
|
14
|
+
|
|
15
|
+
# Import the main entry point of the package
|
|
16
|
+
from hyper_py.hyper import start_hyper
|
|
17
|
+
|
|
18
|
+
# importlib.resources for packaged data (fallback to importlib_resources on older Python)
|
|
19
|
+
try:
|
|
20
|
+
from importlib.resources import files as ir_files
|
|
21
|
+
except Exception: # Python <3.9
|
|
22
|
+
from importlib_resources import files as ir_files # type: ignore
|
|
23
|
+
|
|
24
|
+
# Try ruamel.yaml for comment-preserving roundtrips
|
|
25
|
+
try:
|
|
26
|
+
from ruamel.yaml import YAML # type: ignore
|
|
27
|
+
_HAS_RUAMEL = True
|
|
28
|
+
except Exception:
|
|
29
|
+
_HAS_RUAMEL = False
|
|
30
|
+
|
|
31
|
+
_PKG = "hyper_py" # top-level package name
|
|
32
|
+
_CONFIG_FILENAME = "hyper_config.yaml" # custom config filename
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def _user_config_path() -> Path:
|
|
36
|
+
"""Return the user-level config path depending on the operating system."""
|
|
37
|
+
if platform.system() == "Windows":
|
|
38
|
+
base = Path(os.environ.get("APPDATA", Path.home() / "AppData" / "Roaming"))
|
|
39
|
+
return base / "HyperPy" / _CONFIG_FILENAME
|
|
40
|
+
base = Path(os.environ.get("XDG_CONFIG_HOME", Path.home() / ".config"))
|
|
41
|
+
return base / "hyper-py" / _CONFIG_FILENAME
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def _load_default_template_path() -> Path:
|
|
45
|
+
"""
|
|
46
|
+
Locate the packaged default config template.
|
|
47
|
+
Fallback to local files when running directly from src (dev mode).
|
|
48
|
+
"""
|
|
49
|
+
try:
|
|
50
|
+
res = ir_files(_PKG).joinpath("assets/default_config.yaml")
|
|
51
|
+
if res and os.path.isfile(str(res)):
|
|
52
|
+
return Path(str(res))
|
|
53
|
+
except Exception:
|
|
54
|
+
pass
|
|
55
|
+
|
|
56
|
+
# Fallbacks for development mode
|
|
57
|
+
here = Path(__file__).parent
|
|
58
|
+
for cand in (
|
|
59
|
+
here / "assets" / "default_config.yaml",
|
|
60
|
+
here / "config.yaml",
|
|
61
|
+
here.parent / "config.yaml",
|
|
62
|
+
):
|
|
63
|
+
if cand.is_file():
|
|
64
|
+
return cand
|
|
65
|
+
|
|
66
|
+
print("Error: default config template not found in package or src.")
|
|
67
|
+
sys.exit(1)
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
def _ensure_parent(p: Path) -> None:
|
|
71
|
+
"""Ensure the parent directory exists."""
|
|
72
|
+
p.parent.mkdir(parents=True, exist_ok=True)
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
def _copy_template_to(dest: Path) -> None:
|
|
76
|
+
"""Copy the default template into the destination config file."""
|
|
77
|
+
src = _load_default_template_path()
|
|
78
|
+
_ensure_parent(dest)
|
|
79
|
+
with src.open("rb") as s, dest.open("wb") as d:
|
|
80
|
+
shutil.copyfileobj(s, d)
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
def _resolve_config_path(argv: list[str]) -> Path:
|
|
84
|
+
"""Resolve the path of the configuration file from CLI args or default locations."""
|
|
85
|
+
# 1) CLI argument
|
|
86
|
+
if len(argv) > 1:
|
|
87
|
+
return Path(argv[1]).expanduser().resolve()
|
|
88
|
+
# 2) config file in the current working directory
|
|
89
|
+
cwd_cfg = Path.cwd() / _CONFIG_FILENAME
|
|
90
|
+
if cwd_cfg.is_file():
|
|
91
|
+
return cwd_cfg
|
|
92
|
+
# 3) user config path
|
|
93
|
+
ucfg = _user_config_path()
|
|
94
|
+
if ucfg.is_file():
|
|
95
|
+
return ucfg
|
|
96
|
+
# 4) if nothing found, suggest CWD/hyper_config.yaml as creation target
|
|
97
|
+
return cwd_cfg
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
def _update_dir_root_preserving_comments(config_path: Path, new_dir_root: Path) -> None:
|
|
101
|
+
"""
|
|
102
|
+
Update paths.output.dir_root preserving comments and formatting using ruamel.yaml.
|
|
103
|
+
If ruamel.yaml is not available, do nothing (keep template intact and let the user edit).
|
|
104
|
+
"""
|
|
105
|
+
if not _HAS_RUAMEL:
|
|
106
|
+
print("Note: ruamel.yaml not installed; left config comments intact. "
|
|
107
|
+
"Please edit 'paths.output.dir_root' manually in hyper_config.yaml.")
|
|
108
|
+
return
|
|
109
|
+
|
|
110
|
+
yaml = YAML()
|
|
111
|
+
yaml.preserve_quotes = True
|
|
112
|
+
yaml.indent(mapping=2, sequence=4, offset=2)
|
|
113
|
+
|
|
114
|
+
with config_path.open("r", encoding="utf-8") as f:
|
|
115
|
+
data = yaml.load(f) or {}
|
|
116
|
+
|
|
117
|
+
# Ensure nested mapping exists without destroying comments
|
|
118
|
+
paths = data.get("paths")
|
|
119
|
+
if paths is None:
|
|
120
|
+
from ruamel.yaml.comments import CommentedMap # type: ignore
|
|
121
|
+
paths = CommentedMap()
|
|
122
|
+
data["paths"] = paths
|
|
123
|
+
|
|
124
|
+
output = paths.get("output")
|
|
125
|
+
if output is None:
|
|
126
|
+
from ruamel.yaml.comments import CommentedMap # type: ignore
|
|
127
|
+
output = CommentedMap()
|
|
128
|
+
paths["output"] = output
|
|
129
|
+
|
|
130
|
+
output["dir_root"] = str(new_dir_root / "output")
|
|
131
|
+
|
|
132
|
+
with config_path.open("w", encoding="utf-8") as f:
|
|
133
|
+
yaml.dump(data, f)
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
def main() -> None:
|
|
137
|
+
"""Main entry point for CLI execution."""
|
|
138
|
+
cfg_path = _resolve_config_path(sys.argv)
|
|
139
|
+
|
|
140
|
+
if not cfg_path.exists():
|
|
141
|
+
# Create new hyper_config.yaml from packaged template
|
|
142
|
+
_copy_template_to(cfg_path)
|
|
143
|
+
# Update dir_root while preserving comments (if ruamel.yaml is available)
|
|
144
|
+
_update_dir_root_preserving_comments(cfg_path, Path.cwd())
|
|
145
|
+
print(f"⚠️ New {_CONFIG_FILENAME} created at: {cfg_path}")
|
|
146
|
+
print("⚠️ Please edit it and run the command again.")
|
|
147
|
+
sys.exit(0)
|
|
148
|
+
|
|
149
|
+
# Run the real application
|
|
150
|
+
start_hyper(str(cfg_path))
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
if __name__ == "__main__":
|
|
154
|
+
main()
|
{hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4/src/hyper_py_photometry.egg-info}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: hyper-py-photometry
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.4
|
|
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
|
|
@@ -15,6 +15,7 @@ Requires-Dist: scipy
|
|
|
15
15
|
Requires-Dist: lmfit
|
|
16
16
|
Requires-Dist: matplotlib
|
|
17
17
|
Requires-Dist: scikit-learn<1.6,>=1.4
|
|
18
|
+
Requires-Dist: ruamel.yaml>=0.18
|
|
18
19
|
Dynamic: license-file
|
|
19
20
|
|
|
20
21
|
# 💫 `Hyper-py`: Hybrid Photometry Photometry and Extraction Routine in Python
|
|
@@ -61,7 +62,7 @@ Hyper-py now supports **parallel execution** over multiple maps or datacube slic
|
|
|
61
62
|
- Maintain **individual log files** for each map
|
|
62
63
|
- Merge the final outputs (tables and diagnostics) into a single, combined summary
|
|
63
64
|
|
|
64
|
-
To enable parallelism, set the following parameters in your `
|
|
65
|
+
To enable parallelism, set the following parameters in your `hyper_config.yaml` file under the `control` section:
|
|
65
66
|
|
|
66
67
|
```yaml
|
|
67
68
|
control:
|
|
@@ -72,30 +73,16 @@ control:
|
|
|
72
73
|
If `parallel_maps` is set to `false`, the pipeline will run in serial mode.
|
|
73
74
|
|
|
74
75
|
|
|
76
|
+
## 🛠️ Installation
|
|
77
|
+
You can install and use `Hyper-py` in two different ways, depending on your needs:
|
|
75
78
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
Before using `Hyper-py`, make sure you have all the necessary Python dependencies installed. The following core libraries are required:
|
|
79
|
-
• astropy
|
|
80
|
-
• photutils
|
|
81
|
-
• matplotlib
|
|
82
|
-
• lmfit
|
|
83
|
-
• pyyaml
|
|
84
|
-
• numpy
|
|
85
|
-
• scipy
|
|
86
|
-
• scikit-learn>=1.4,<1.6
|
|
87
|
-
|
|
88
|
-
This will install the necessary packages using `pip`:
|
|
89
|
-
|
|
79
|
+
### Option 1: Install via `pip` (for direct usage)
|
|
80
|
+
Install via PyPI:
|
|
90
81
|
```bash
|
|
91
|
-
|
|
82
|
+
pip install hyper-py-photometry
|
|
92
83
|
```
|
|
93
84
|
|
|
94
|
-
|
|
95
|
-
## 🛠️ Installation
|
|
96
|
-
You can install and use `Hyper-py` in two different ways, depending on your needs:
|
|
97
|
-
|
|
98
|
-
### Option 1: Use the Source Code (for development or integration)
|
|
85
|
+
### Option 2: Use the Source Code (for development or integration)
|
|
99
86
|
|
|
100
87
|
If you want to modify, extend, or integrate `Hyper-py` in your own projects:
|
|
101
88
|
|
|
@@ -115,27 +102,71 @@ export PYTHONPATH=$(pwd)/src
|
|
|
115
102
|
import sys
|
|
116
103
|
sys.path.insert(0, "/absolute/path/to/hyper_py/src")
|
|
117
104
|
```
|
|
118
|
-
|
|
119
|
-
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
## ✅ Requirements
|
|
108
|
+
|
|
109
|
+
Before using `Hyper-py`, make sure you have all the necessary Python dependencies installed.
|
|
110
|
+
|
|
111
|
+
If you have installed `Hyper-py` via pip, all the requirements are automatically installed.
|
|
112
|
+
Otherwise, you can use the `requirements.txt` file, this will install the necessary packages using `pip`::
|
|
120
113
|
```bash
|
|
121
|
-
pip install
|
|
114
|
+
pip install -r requirements.txt
|
|
122
115
|
```
|
|
123
116
|
|
|
124
117
|
|
|
125
|
-
##
|
|
118
|
+
## 📄 Configuration File
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
`Hyper-py` requires a configuration file named **`hyper_config.yaml`** in order to run.
|
|
122
|
+
|
|
123
|
+
>The first time you run `Hyper-py` a new hyper_config.yaml will be created automatically in the CWD, then you must setup all paths and paramenters.<br>
|
|
124
|
+
>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.
|
|
125
|
+
|
|
126
|
+
If no path is provided, the application will look for it in this order:
|
|
127
|
+
1. Path passed as CLI argument
|
|
128
|
+
2. `hyper_config.yaml` in the current working directory (CWD)
|
|
129
|
+
3. User configuration directory
|
|
130
|
+
- Linux/macOS: `~/.config/hyper-py/hyper_config.yaml`
|
|
131
|
+
- Windows: `%APPDATA%\HyperPy\hyper_config.yaml`
|
|
132
|
+
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`).
|
|
126
133
|
|
|
127
|
-
You can use `Hyper-py` either by importing and running it directly from Python, or via command line.
|
|
128
134
|
> [!IMPORTANT]
|
|
129
|
-
>
|
|
135
|
+
> <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>
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
### Configuration file lookup order
|
|
139
|
+
|
|
140
|
+
| Priority | Location | Description |
|
|
141
|
+
|----------|--------------------------------------------|-----------------------------------------------------------------------------|
|
|
142
|
+
| 1 | CLI argument | Path explicitly provided by the user, e.g. `hyper-py /path/to/hyper_config.yaml`. |
|
|
143
|
+
| 2 | Current Working Directory (CWD) | Looks for `./hyper_config.yaml` in the folder where the command is executed. |
|
|
144
|
+
| 3 | User configuration directory | - **Linux/macOS:** `~/.config/hyper-py/hyper_config.yaml`<br> - **Windows:** `%APPDATA%\HyperPy\hyper_config.yaml` |
|
|
145
|
+
| 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`). |
|
|
146
|
+
|
|
147
|
+
### 💡 Tips & Tricks
|
|
148
|
+
|
|
149
|
+
- **Use different configs**
|
|
150
|
+
You can maintain multiple configuration files (e.g., `hyper_config.dev.yaml` and `hyper_config.prod.yaml`) and choose which one to run.
|
|
151
|
+
<br>Eg. If you have installed via pip:
|
|
152
|
+
```bash
|
|
153
|
+
hyper-py ./hyper_config.dev.yaml
|
|
154
|
+
hyper-py ./hyper_config.prod.yaml
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
## 🚀 Usage
|
|
159
|
+
|
|
160
|
+
You can use `Hyper-py` either by importing and running it directly from Python, or via command line.
|
|
130
161
|
|
|
131
162
|
### 1. From Python
|
|
132
163
|
|
|
133
|
-
Import and run the `
|
|
164
|
+
Import and run the `run_hyper` function, passing the path to your YAML configuration file.
|
|
134
165
|
|
|
135
166
|
```python
|
|
136
167
|
from hyper_py import run_hyper
|
|
137
168
|
|
|
138
|
-
run_hyper("path/to/
|
|
169
|
+
run_hyper("path/to/hyper_config.yaml")
|
|
139
170
|
```
|
|
140
171
|
This is the recommended approach if you want to integrate `Hyper-py` into a larger Python application or workflow.
|
|
141
172
|
|
|
@@ -145,7 +176,7 @@ I) Using the source code:
|
|
|
145
176
|
|
|
146
177
|
You can execute the tool from the terminal:
|
|
147
178
|
```bash
|
|
148
|
-
python -m hyper_py path/to/
|
|
179
|
+
python -m hyper_py path/to/hyper_config.yaml
|
|
149
180
|
```
|
|
150
181
|
This runs the main process using the configuration file specified.
|
|
151
182
|
|
|
@@ -153,18 +184,18 @@ II) If installed via pip:
|
|
|
153
184
|
|
|
154
185
|
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:
|
|
155
186
|
```bash
|
|
156
|
-
hyper_py path/to/
|
|
187
|
+
hyper_py path/to/hyper_config.yaml
|
|
157
188
|
```
|
|
158
189
|
OR
|
|
159
190
|
```bash
|
|
160
|
-
hyper-py path/to/
|
|
191
|
+
hyper-py path/to/hyper_config.yaml
|
|
161
192
|
```
|
|
162
193
|
OR
|
|
163
194
|
```bash
|
|
164
|
-
hyper path/to/
|
|
195
|
+
hyper path/to/hyper_config.yaml
|
|
165
196
|
```
|
|
166
197
|
|
|
167
|
-
## Using the Source Code in Visual Studio Code
|
|
198
|
+
## 💻 Using the Source Code in Visual Studio Code
|
|
168
199
|
To run or debug the source code using Visual Studio Code:
|
|
169
200
|
### 1. Open the project
|
|
170
201
|
- Open the project folder in VS Code.
|
|
@@ -193,7 +224,7 @@ Optional: You can add this to `.vscode/launch.json` for convenience:
|
|
|
193
224
|
"request": "launch",
|
|
194
225
|
"program": "${workspaceFolder}/src/hyper_py/run_hyper.py",
|
|
195
226
|
"console": "integratedTerminal",
|
|
196
|
-
"args": ["path/to/
|
|
227
|
+
"args": ["path/to/hyper_config.yaml"],
|
|
197
228
|
}
|
|
198
229
|
]
|
|
199
230
|
}
|
|
@@ -202,9 +233,9 @@ Optional: You can add this to `.vscode/launch.json` for convenience:
|
|
|
202
233
|
<br/><br/>
|
|
203
234
|
|
|
204
235
|
|
|
205
|
-
## ⚙️ Configuration File Reference (`
|
|
236
|
+
## ⚙️ Configuration File Reference (`hyper_config.yaml`)
|
|
206
237
|
|
|
207
|
-
The `
|
|
238
|
+
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.
|
|
208
239
|
|
|
209
240
|
### File Paths
|
|
210
241
|
|
|
@@ -354,7 +385,7 @@ The `config.yaml` file controls all aspects of the Hyper-py pipeline. Below is a
|
|
|
354
385
|
---
|
|
355
386
|
|
|
356
387
|
**Tip:**
|
|
357
|
-
All entries can be customized in your `
|
|
388
|
+
All entries can be customized in your `hyper_config.yaml`. If an entry is omitted, the default value will be used.
|
|
358
389
|
|
|
359
390
|
|
|
360
391
|
|
{hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/src/hyper_py_photometry.egg-info/SOURCES.txt
RENAMED
|
@@ -42,10 +42,10 @@ paper/paper.md
|
|
|
42
42
|
paper/Figures/Flux_Diff_Histogram_Int.png
|
|
43
43
|
paper/Figures/Flux_Diff_Histogram_Peak.png
|
|
44
44
|
src/hyper_py/__init__.py
|
|
45
|
+
src/hyper_py/__main__.py
|
|
45
46
|
src/hyper_py/bkg_multigauss.py
|
|
46
47
|
src/hyper_py/bkg_single.py
|
|
47
48
|
src/hyper_py/config.py
|
|
48
|
-
src/hyper_py/config.yaml
|
|
49
49
|
src/hyper_py/create_background_slices.py
|
|
50
50
|
src/hyper_py/data_output.py
|
|
51
51
|
src/hyper_py/detection.py
|
|
@@ -62,6 +62,7 @@ src/hyper_py/run_hyper.py
|
|
|
62
62
|
src/hyper_py/single_map.py
|
|
63
63
|
src/hyper_py/survey.py
|
|
64
64
|
src/hyper_py/visualization.py
|
|
65
|
+
src/hyper_py/assets/default_config.yaml
|
|
65
66
|
src/hyper_py_photometry.egg-info/PKG-INFO
|
|
66
67
|
src/hyper_py_photometry.egg-info/SOURCES.txt
|
|
67
68
|
src/hyper_py_photometry.egg-info/dependency_links.txt
|
|
@@ -16,6 +16,10 @@ def find_package_config(pkg_dir: Path) -> Path:
|
|
|
16
16
|
p = pkg_dir / name
|
|
17
17
|
if p.exists():
|
|
18
18
|
return p
|
|
19
|
+
for name in ("config.yaml","config.yml","default_config.yaml","config_default.yaml","config_base.yaml"):
|
|
20
|
+
p = pkg_dir / "assets" / name
|
|
21
|
+
if p.exists():
|
|
22
|
+
return p
|
|
19
23
|
alts: List[Path] = list(pkg_dir.glob("*.yaml")) + list(pkg_dir.glob("*.yml"))
|
|
20
24
|
if alts:
|
|
21
25
|
return alts[0]
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
from hyper_py.hyper import start_hyper
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import sys
|
|
2
|
-
import os
|
|
3
|
-
import shutil
|
|
4
|
-
import warnings
|
|
5
|
-
import yaml
|
|
6
|
-
from pathlib import Path
|
|
7
|
-
|
|
8
|
-
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
|
|
9
|
-
|
|
10
|
-
# Block warnings
|
|
11
|
-
warnings.filterwarnings("ignore", message="Using UFloat objects with std_dev==0 may give unexpected results.")
|
|
12
|
-
warnings.filterwarnings("ignore", message=".*Set OBSGEO-L to.*")
|
|
13
|
-
warnings.filterwarnings("ignore", message=".*Wrapping comment lines > 78 characters.*")
|
|
14
|
-
warnings.filterwarnings("ignore", message=".*more axes \(4\) than the image it is associated with \(2\).*")
|
|
15
|
-
warnings.filterwarnings("ignore", message=".*Set MJD-OBS to.*")
|
|
16
|
-
|
|
17
|
-
from hyper_py.hyper import start_hyper
|
|
18
|
-
|
|
19
|
-
def update_dir_root(default_config, config_path, new_dir_root):
|
|
20
|
-
"""Create a new config.yaml in the specified directory with updated dir_root."""
|
|
21
|
-
default_config = Path(default_config)
|
|
22
|
-
config_path = Path(config_path)
|
|
23
|
-
cfg = yaml.safe_load(default_config.read_text(encoding="utf-8")) or {}
|
|
24
|
-
cfg['paths']['output']['dir_root'] = str(Path(new_dir_root, "output"))
|
|
25
|
-
config_path.write_text(yaml.safe_dump(cfg, sort_keys=False), encoding="utf-8")
|
|
26
|
-
|
|
27
|
-
def main():
|
|
28
|
-
config_path = sys.argv[1] if len(sys.argv) > 1 else "config.yaml"
|
|
29
|
-
if not os.path.exists(config_path):
|
|
30
|
-
default_config = os.path.join(os.path.dirname(__file__), "config.yaml")
|
|
31
|
-
if not os.path.exists(default_config):
|
|
32
|
-
print("Error: default config.yaml not found.")
|
|
33
|
-
sys.exit(1)
|
|
34
|
-
|
|
35
|
-
config_path = os.path.join(os.getcwd(), "config.yaml")
|
|
36
|
-
|
|
37
|
-
update_dir_root(default_config, config_path, os.getcwd())
|
|
38
|
-
print(f"⚠️ New config.yaml created in {config_path}")
|
|
39
|
-
print("⚠️ Please edit the configuration file and set the correct parameters and paths before running again.")
|
|
40
|
-
sys.exit(0)
|
|
41
|
-
|
|
42
|
-
start_hyper(config_path)
|
|
43
|
-
|
|
44
|
-
if __name__ == "__main__":
|
|
45
|
-
main()
|
{hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/.github/workflows/Hyper-py_paper.yml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/IDL_comparison/map_500_Gaussians_1.fits
RENAMED
|
File without changes
|
{hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/IDL_comparison/map_500_Gaussians_2.fits
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/IDL_comparison/table_500_Gaussians_1.txt
RENAMED
|
File without changes
|
{hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/IDL_comparison/table_500_Gaussians_2.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/paper/Figures/Flux_Diff_Histogram_Int.png
RENAMED
|
File without changes
|
{hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/paper/Figures/Flux_Diff_Histogram_Peak.png
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.4}/src/hyper_py/create_background_slices.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|