stdpipe 0.2.4__tar.gz → 0.2.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.
- stdpipe-0.2.5/.gitignore +85 -0
- stdpipe-0.2.5/PKG-INFO +158 -0
- stdpipe-0.2.5/pyproject.toml +268 -0
- stdpipe-0.2.5/setup.py +24 -0
- {stdpipe-0.2.4 → stdpipe-0.2.5}/stdpipe/__init__.py +2 -0
- {stdpipe-0.2.4 → stdpipe-0.2.5}/stdpipe/astrometry.py +30 -38
- {stdpipe-0.2.4 → stdpipe-0.2.5}/stdpipe/catalogs.py +24 -1
- {stdpipe-0.2.4 → stdpipe-0.2.5}/stdpipe/cutouts.py +1 -1
- {stdpipe-0.2.4 → stdpipe-0.2.5}/stdpipe/db.py +2 -1
- {stdpipe-0.2.4 → stdpipe-0.2.5}/stdpipe/photometry.py +28 -53
- {stdpipe-0.2.4 → stdpipe-0.2.5}/stdpipe/pipeline.py +43 -11
- {stdpipe-0.2.4 → stdpipe-0.2.5}/stdpipe/plots.py +6 -6
- {stdpipe-0.2.4 → stdpipe-0.2.5}/stdpipe/resolve.py +1 -1
- {stdpipe-0.2.4 → stdpipe-0.2.5}/stdpipe/subtraction.py +15 -0
- {stdpipe-0.2.4 → stdpipe-0.2.5}/stdpipe/templates.py +2 -2
- {stdpipe-0.2.4 → stdpipe-0.2.5}/stdpipe/utils.py +13 -0
- stdpipe-0.2.5/stdpipe.egg-info/PKG-INFO +158 -0
- {stdpipe-0.2.4 → stdpipe-0.2.5}/stdpipe.egg-info/SOURCES.txt +7 -2
- stdpipe-0.2.5/stdpipe.egg-info/not-zip-safe +1 -0
- stdpipe-0.2.5/stdpipe.egg-info/requires.txt +36 -0
- stdpipe-0.2.5/tests/test_astrometry.py +184 -0
- stdpipe-0.2.5/tests/test_catalogs.py +144 -0
- stdpipe-0.2.5/tests/test_photometry.py +275 -0
- stdpipe-0.2.5/tests/test_pipeline.py +193 -0
- stdpipe-0.2.5/tests/test_utils.py +183 -0
- stdpipe-0.2.4/.gitignore +0 -121
- stdpipe-0.2.4/PKG-INFO +0 -29
- stdpipe-0.2.4/setup.py +0 -37
- stdpipe-0.2.4/stdpipe/flycheck_catalogs.py +0 -637
- stdpipe-0.2.4/stdpipe.egg-info/PKG-INFO +0 -29
- stdpipe-0.2.4/stdpipe.egg-info/requires.txt +0 -15
- stdpipe-0.2.4/tests/test_dependencies.py +0 -1
- {stdpipe-0.2.4 → stdpipe-0.2.5}/LICENSE.md +0 -0
- {stdpipe-0.2.4 → stdpipe-0.2.5}/MANIFEST.in +0 -0
- {stdpipe-0.2.4 → stdpipe-0.2.5}/README.md +0 -0
- {stdpipe-0.2.4 → stdpipe-0.2.5}/setup.cfg +0 -0
- {stdpipe-0.2.4 → stdpipe-0.2.5}/stdpipe/data/legacysurvey.py +0 -0
- {stdpipe-0.2.4 → stdpipe-0.2.5}/stdpipe/data/legacysurvey_bricks.fits.gz +0 -0
- {stdpipe-0.2.4 → stdpipe-0.2.5}/stdpipe/data/ps1skycells.txt +0 -0
- {stdpipe-0.2.4 → stdpipe-0.2.5}/stdpipe/data/ps1skycells.txt.orig +0 -0
- {stdpipe-0.2.4 → stdpipe-0.2.5}/stdpipe/lcs.py +0 -0
- {stdpipe-0.2.4 → stdpipe-0.2.5}/stdpipe/psf.py +0 -0
- {stdpipe-0.2.4 → stdpipe-0.2.5}/stdpipe.egg-info/dependency_links.txt +0 -0
- {stdpipe-0.2.4 → stdpipe-0.2.5}/stdpipe.egg-info/top_level.txt +0 -0
stdpipe-0.2.5/.gitignore
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
*.so
|
|
6
|
+
.Python
|
|
7
|
+
build/
|
|
8
|
+
develop-eggs/
|
|
9
|
+
dist/
|
|
10
|
+
downloads/
|
|
11
|
+
eggs/
|
|
12
|
+
.eggs/
|
|
13
|
+
lib/
|
|
14
|
+
lib64/
|
|
15
|
+
parts/
|
|
16
|
+
sdist/
|
|
17
|
+
var/
|
|
18
|
+
wheels/
|
|
19
|
+
*.egg-info/
|
|
20
|
+
.installed.cfg
|
|
21
|
+
*.egg
|
|
22
|
+
MANIFEST
|
|
23
|
+
|
|
24
|
+
# Virtual environments
|
|
25
|
+
venv/
|
|
26
|
+
ENV/
|
|
27
|
+
env/
|
|
28
|
+
.venv
|
|
29
|
+
|
|
30
|
+
# IDEs
|
|
31
|
+
.vscode/
|
|
32
|
+
.idea/
|
|
33
|
+
*.swp
|
|
34
|
+
*.swo
|
|
35
|
+
*~
|
|
36
|
+
.dir-locals.el
|
|
37
|
+
flycheck_*.py
|
|
38
|
+
|
|
39
|
+
# Testing
|
|
40
|
+
.pytest_cache/
|
|
41
|
+
.coverage
|
|
42
|
+
.coverage.*
|
|
43
|
+
htmlcov/
|
|
44
|
+
.tox/
|
|
45
|
+
.hypothesis/
|
|
46
|
+
*.cover
|
|
47
|
+
.cache
|
|
48
|
+
nosetests.xml
|
|
49
|
+
coverage.xml
|
|
50
|
+
*.log
|
|
51
|
+
|
|
52
|
+
# Documentation
|
|
53
|
+
docs/_build/
|
|
54
|
+
docs/_static/
|
|
55
|
+
docs/_templates/
|
|
56
|
+
doc/_build/
|
|
57
|
+
.readthedocs.yaml.1
|
|
58
|
+
|
|
59
|
+
# Jupyter
|
|
60
|
+
.ipynb_checkpoints/
|
|
61
|
+
notebooks/Untitled*.ipynb
|
|
62
|
+
|
|
63
|
+
# OS
|
|
64
|
+
.DS_Store
|
|
65
|
+
.Rhistory
|
|
66
|
+
.RData
|
|
67
|
+
|
|
68
|
+
# Build and distribution
|
|
69
|
+
*.tar.gz
|
|
70
|
+
*.whl
|
|
71
|
+
|
|
72
|
+
# Aider
|
|
73
|
+
.aider*
|
|
74
|
+
|
|
75
|
+
# Temporary files
|
|
76
|
+
backup/
|
|
77
|
+
*.tmp
|
|
78
|
+
*.bak
|
|
79
|
+
*~
|
|
80
|
+
|
|
81
|
+
# Misc files
|
|
82
|
+
*.new
|
|
83
|
+
*.orig
|
|
84
|
+
|
|
85
|
+
test_data/
|
stdpipe-0.2.5/PKG-INFO
ADDED
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: stdpipe
|
|
3
|
+
Version: 0.2.5
|
|
4
|
+
Summary: Simple Transient Detection Pipeline
|
|
5
|
+
Author-email: Sergey Karpov <karpov.sv@gmail.com>
|
|
6
|
+
Maintainer-email: Sergey Karpov <karpov.sv@gmail.com>
|
|
7
|
+
License: MIT License
|
|
8
|
+
|
|
9
|
+
Copyright (c) 2022 Sergey Karpov
|
|
10
|
+
|
|
11
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
12
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
13
|
+
in the Software without restriction, including without limitation the rights
|
|
14
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
15
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
16
|
+
furnished to do so, subject to the following conditions:
|
|
17
|
+
|
|
18
|
+
The above copyright notice and this permission notice shall be included in all
|
|
19
|
+
copies or substantial portions of the Software.
|
|
20
|
+
|
|
21
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
22
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
23
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
24
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
25
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
26
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
27
|
+
SOFTWARE.
|
|
28
|
+
|
|
29
|
+
Project-URL: Homepage, https://github.com/karpov-sv/stdpipe
|
|
30
|
+
Project-URL: Documentation, https://stdpipe.readthedocs.io/
|
|
31
|
+
Project-URL: Repository, https://github.com/karpov-sv/stdpipe
|
|
32
|
+
Project-URL: Bug Tracker, https://github.com/karpov-sv/stdpipe/issues
|
|
33
|
+
Project-URL: Changelog, https://github.com/karpov-sv/stdpipe/commits/master
|
|
34
|
+
Keywords: astronomy,astrophysics,transients,photometry,astrometry,image-processing,pipeline
|
|
35
|
+
Classifier: Development Status :: 4 - Beta
|
|
36
|
+
Classifier: Intended Audience :: Science/Research
|
|
37
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
38
|
+
Classifier: Operating System :: OS Independent
|
|
39
|
+
Classifier: Programming Language :: Python :: 3
|
|
40
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
41
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
42
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
43
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
44
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
45
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
46
|
+
Classifier: Topic :: Scientific/Engineering :: Astronomy
|
|
47
|
+
Classifier: Topic :: Scientific/Engineering :: Image Processing
|
|
48
|
+
Requires-Python: >=3.8
|
|
49
|
+
Description-Content-Type: text/markdown
|
|
50
|
+
License-File: LICENSE.md
|
|
51
|
+
Requires-Dist: numpy
|
|
52
|
+
Requires-Dist: scipy
|
|
53
|
+
Requires-Dist: astropy>=4.1
|
|
54
|
+
Requires-Dist: matplotlib
|
|
55
|
+
Requires-Dist: astroquery>0.4.1
|
|
56
|
+
Requires-Dist: sep
|
|
57
|
+
Requires-Dist: astroscrappy
|
|
58
|
+
Requires-Dist: photutils>1.9
|
|
59
|
+
Requires-Dist: statsmodels
|
|
60
|
+
Requires-Dist: tqdm
|
|
61
|
+
Requires-Dist: regions
|
|
62
|
+
Requires-Dist: python-dateutil
|
|
63
|
+
Requires-Dist: requests
|
|
64
|
+
Requires-Dist: sip_tpv
|
|
65
|
+
Requires-Dist: pyfftw
|
|
66
|
+
Provides-Extra: dev
|
|
67
|
+
Requires-Dist: pytest>=6.0; extra == "dev"
|
|
68
|
+
Requires-Dist: pytest-cov>=2.10; extra == "dev"
|
|
69
|
+
Requires-Dist: pytest-xdist>=2.0; extra == "dev"
|
|
70
|
+
Requires-Dist: pytest-mock>=3.0; extra == "dev"
|
|
71
|
+
Requires-Dist: pytest-timeout>=2.0; extra == "dev"
|
|
72
|
+
Requires-Dist: pytest-benchmark>=3.4; extra == "dev"
|
|
73
|
+
Requires-Dist: hypothesis>=6.0; extra == "dev"
|
|
74
|
+
Provides-Extra: docs
|
|
75
|
+
Requires-Dist: sphinx>=4.0; extra == "docs"
|
|
76
|
+
Requires-Dist: sphinx-rtd-theme; extra == "docs"
|
|
77
|
+
Requires-Dist: sphinx-math-dollar; extra == "docs"
|
|
78
|
+
Requires-Dist: numpydoc; extra == "docs"
|
|
79
|
+
Requires-Dist: myst-parser; extra == "docs"
|
|
80
|
+
Requires-Dist: sphinxcontrib-apidoc; extra == "docs"
|
|
81
|
+
Requires-Dist: sphinx-prompt; extra == "docs"
|
|
82
|
+
Provides-Extra: all
|
|
83
|
+
Requires-Dist: stdpipe[dev,docs]; extra == "all"
|
|
84
|
+
Dynamic: license-file
|
|
85
|
+
|
|
86
|
+
# STDPipe - Simple Transient Detection Pipeline
|
|
87
|
+
*AKA: random codes noone else will ever use*
|
|
88
|
+
|
|
89
|
+
*STDPipe* is a set of Python routines for astrometry, photometry and transient detection related tasks, intended for quick and easy implementation of custom pipelines, as well as for interactive data analysis.
|
|
90
|
+
|
|
91
|
+
### Design principles
|
|
92
|
+
- implemented as a library of routines covering most common tasks
|
|
93
|
+
- operates on standard Python objects: NumPy arrays for images, Astropy Tables for catalogs and object lists, etc
|
|
94
|
+
- does not try to re-implement the things already implemented in other Python packages
|
|
95
|
+
- conveniently wraps external codes that do not have their own Python interfaces (*SExtractor*, *SCAMP*, *PSFEx*, *HOTPANTS*, *Astrometry.Net*, ...)
|
|
96
|
+
- wrapping is transparent: all data passed from Python, all options customizable from Python, all (or most of) outputs available back
|
|
97
|
+
- everything operates on temporary files, nothing is kept after the run unless explicitly asked for
|
|
98
|
+
|
|
99
|
+
### Features
|
|
100
|
+
- ~~pre-processing~~ - should be handled before in an instrument-specific way
|
|
101
|
+
- bias/dark subtraction, flatfielding, masking
|
|
102
|
+
- object detection and photometry
|
|
103
|
+
- SExtractor or SEP for detection, photutils for photometry
|
|
104
|
+
- astrometric calibration
|
|
105
|
+
- Astrometry.Net for blind WCS solving
|
|
106
|
+
- SCAMP or Astropy-based code for refinement
|
|
107
|
+
- photometric calibration
|
|
108
|
+
- Vizier catalogues, passband conversion (PS1 to Johnson, Gaia to Johnson, ...)
|
|
109
|
+
- spatial polynomial + color term + intrinsic scatter
|
|
110
|
+
- image subtraction
|
|
111
|
+
- HiPS templates
|
|
112
|
+
- PanSTARRS DR1 or Legacy Survey templates
|
|
113
|
+
- HOTPANTS + custom noise model
|
|
114
|
+
- ZOGY
|
|
115
|
+
- transient detection and photometry
|
|
116
|
+
- noise-weighted detection, cutout adjustment, ...
|
|
117
|
+
- auxiliary functions
|
|
118
|
+
- PSF estimation, simulated stars, FITS header utilities, plotting, ...
|
|
119
|
+
- light curve creation (soon)
|
|
120
|
+
- spatial clustering, color regression, variability analysis, ...
|
|
121
|
+
|
|
122
|
+
# Installation
|
|
123
|
+
|
|
124
|
+
*STDpipe* is available at https://github.com/karpov-sv/stdpipe and is mirrored at https://gitlab.in2p3.fr/icare/stdpipe
|
|
125
|
+
|
|
126
|
+
The package is in constant development, so to keep track of the changes the suggested way of installing it is by cloning the repository
|
|
127
|
+
```
|
|
128
|
+
git clone https://github.com/karpov-sv/stdpipe.git
|
|
129
|
+
```
|
|
130
|
+
and then installing from it in development (or "editable") mode by running the command
|
|
131
|
+
```
|
|
132
|
+
cd stdpipe
|
|
133
|
+
python3 -m pip install -e .
|
|
134
|
+
```
|
|
135
|
+
This way you may update the repository or apply local patches, and it will immediately be reflected in the installed package.
|
|
136
|
+
|
|
137
|
+
Apart of Python requirements that will be installed automatically, *STDPipe* also (optionally) makes use of the following external software:
|
|
138
|
+
- [SExtractor](https://github.com/astromatic/sextractor)
|
|
139
|
+
- [SCAMP](https://github.com/astromatic/scamp)
|
|
140
|
+
- [PSFEx](https://github.com/astromatic/psfex)
|
|
141
|
+
- [SWarp](https://github.com/astromatic/swarp)
|
|
142
|
+
- [HOTPANTS](https://github.com/acbecker/hotpants)
|
|
143
|
+
- [Astrometry.Net](https://github.com/dstndstn/astrometry.net)
|
|
144
|
+
|
|
145
|
+
Most of them may be installed from your package manager. E.g. on Debian or Ubuntu systems it may look like that:
|
|
146
|
+
```
|
|
147
|
+
sudo apt install sextractor scamp psfex swarp
|
|
148
|
+
```
|
|
149
|
+
or, on Miniconda/Anaconda, like that:
|
|
150
|
+
```
|
|
151
|
+
conda install -c conda-forge astromatic-source-extractor astromatic-scamp astromatic-psfex astromatic-swarp
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
You may also check more detailed installation instructions [here](https://stdpipe.readthedocs.io/en/latest/installation.html).
|
|
155
|
+
|
|
156
|
+
# Usage
|
|
157
|
+
|
|
158
|
+
Please consult the [documentation for *STDPipe*](https://stdpipe.readthedocs.io/) for the basic usage patterns and description of its API. You may check the examples inside [notebooks/](notebooks/) folder, especially the [tutorial](notebooks/stdpipe_tutorial.ipynb) that demonstrates basic steps of a typical image processing.
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "stdpipe"
|
|
7
|
+
version = "0.2.5"
|
|
8
|
+
description = "Simple Transient Detection Pipeline"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = {file = "LICENSE.md"}
|
|
11
|
+
authors = [
|
|
12
|
+
{name = "Sergey Karpov", email = "karpov.sv@gmail.com"}
|
|
13
|
+
]
|
|
14
|
+
maintainers = [
|
|
15
|
+
{name = "Sergey Karpov", email = "karpov.sv@gmail.com"}
|
|
16
|
+
]
|
|
17
|
+
keywords = [
|
|
18
|
+
"astronomy",
|
|
19
|
+
"astrophysics",
|
|
20
|
+
"transients",
|
|
21
|
+
"photometry",
|
|
22
|
+
"astrometry",
|
|
23
|
+
"image-processing",
|
|
24
|
+
"pipeline"
|
|
25
|
+
]
|
|
26
|
+
classifiers = [
|
|
27
|
+
"Development Status :: 4 - Beta",
|
|
28
|
+
"Intended Audience :: Science/Research",
|
|
29
|
+
"License :: OSI Approved :: MIT License",
|
|
30
|
+
"Operating System :: OS Independent",
|
|
31
|
+
"Programming Language :: Python :: 3",
|
|
32
|
+
"Programming Language :: Python :: 3.8",
|
|
33
|
+
"Programming Language :: Python :: 3.9",
|
|
34
|
+
"Programming Language :: Python :: 3.10",
|
|
35
|
+
"Programming Language :: Python :: 3.11",
|
|
36
|
+
"Programming Language :: Python :: 3.12",
|
|
37
|
+
"Programming Language :: Python :: 3.13",
|
|
38
|
+
"Topic :: Scientific/Engineering :: Astronomy",
|
|
39
|
+
"Topic :: Scientific/Engineering :: Image Processing",
|
|
40
|
+
]
|
|
41
|
+
requires-python = ">=3.8"
|
|
42
|
+
|
|
43
|
+
# Core dependencies
|
|
44
|
+
dependencies = [
|
|
45
|
+
"numpy",
|
|
46
|
+
"scipy",
|
|
47
|
+
"astropy>=4.1",
|
|
48
|
+
"matplotlib",
|
|
49
|
+
"astroquery>0.4.1",
|
|
50
|
+
"sep",
|
|
51
|
+
"astroscrappy",
|
|
52
|
+
"photutils>1.9",
|
|
53
|
+
"statsmodels",
|
|
54
|
+
"tqdm",
|
|
55
|
+
"regions",
|
|
56
|
+
"python-dateutil",
|
|
57
|
+
"requests",
|
|
58
|
+
# "sip_tpv @ git+https://github.com/pmvreeswijk/sip_tpv.git",
|
|
59
|
+
"sip_tpv",
|
|
60
|
+
"pyfftw",
|
|
61
|
+
]
|
|
62
|
+
|
|
63
|
+
[project.optional-dependencies]
|
|
64
|
+
# Development dependencies
|
|
65
|
+
dev = [
|
|
66
|
+
"pytest>=6.0",
|
|
67
|
+
"pytest-cov>=2.10",
|
|
68
|
+
"pytest-xdist>=2.0",
|
|
69
|
+
"pytest-mock>=3.0",
|
|
70
|
+
"pytest-timeout>=2.0",
|
|
71
|
+
"pytest-benchmark>=3.4",
|
|
72
|
+
"hypothesis>=6.0",
|
|
73
|
+
]
|
|
74
|
+
|
|
75
|
+
# Documentation dependencies
|
|
76
|
+
docs = [
|
|
77
|
+
"sphinx>=4.0",
|
|
78
|
+
"sphinx-rtd-theme",
|
|
79
|
+
"sphinx-math-dollar",
|
|
80
|
+
"numpydoc",
|
|
81
|
+
"myst-parser",
|
|
82
|
+
"sphinxcontrib-apidoc",
|
|
83
|
+
"sphinx-prompt",
|
|
84
|
+
]
|
|
85
|
+
|
|
86
|
+
# All optional dependencies
|
|
87
|
+
all = [
|
|
88
|
+
"stdpipe[dev,docs]",
|
|
89
|
+
]
|
|
90
|
+
|
|
91
|
+
[project.urls]
|
|
92
|
+
Homepage = "https://github.com/karpov-sv/stdpipe"
|
|
93
|
+
Documentation = "https://stdpipe.readthedocs.io/"
|
|
94
|
+
Repository = "https://github.com/karpov-sv/stdpipe"
|
|
95
|
+
"Bug Tracker" = "https://github.com/karpov-sv/stdpipe/issues"
|
|
96
|
+
Changelog = "https://github.com/karpov-sv/stdpipe/commits/master"
|
|
97
|
+
|
|
98
|
+
# ============================================================================
|
|
99
|
+
# Tool configurations
|
|
100
|
+
# ============================================================================
|
|
101
|
+
|
|
102
|
+
[tool.setuptools]
|
|
103
|
+
zip-safe = false
|
|
104
|
+
include-package-data = true
|
|
105
|
+
|
|
106
|
+
[tool.setuptools.packages.find]
|
|
107
|
+
where = ["."]
|
|
108
|
+
include = ["stdpipe*"]
|
|
109
|
+
exclude = ["tests*", "docs*", "notebooks*", "build*", "dist*"]
|
|
110
|
+
|
|
111
|
+
[tool.setuptools.package-data]
|
|
112
|
+
stdpipe = ["data/*"]
|
|
113
|
+
|
|
114
|
+
# ============================================================================
|
|
115
|
+
# pytest configuration
|
|
116
|
+
# ============================================================================
|
|
117
|
+
|
|
118
|
+
[tool.pytest.ini_options]
|
|
119
|
+
minversion = "6.0"
|
|
120
|
+
testpaths = ["tests"]
|
|
121
|
+
python_files = ["test_*.py"]
|
|
122
|
+
python_classes = ["Test*"]
|
|
123
|
+
python_functions = ["test_*"]
|
|
124
|
+
addopts = [
|
|
125
|
+
"-v",
|
|
126
|
+
"--strict-markers",
|
|
127
|
+
"--showlocals",
|
|
128
|
+
"-ra",
|
|
129
|
+
]
|
|
130
|
+
markers = [
|
|
131
|
+
"unit: Unit tests that don't require external dependencies",
|
|
132
|
+
"integration: Integration tests that may require external tools",
|
|
133
|
+
"slow: Tests that take significant time to run",
|
|
134
|
+
"requires_sextractor: Tests requiring SExtractor to be installed",
|
|
135
|
+
"requires_scamp: Tests requiring SCAMP to be installed",
|
|
136
|
+
"requires_psfex: Tests requiring PSFEx to be installed",
|
|
137
|
+
"requires_hotpants: Tests requiring HOTPANTS to be installed",
|
|
138
|
+
"requires_astrometry_net: Tests requiring Astrometry.Net to be installed",
|
|
139
|
+
"requires_network: Tests that require network access",
|
|
140
|
+
]
|
|
141
|
+
filterwarnings = [
|
|
142
|
+
"ignore::FutureWarning",
|
|
143
|
+
"ignore::DeprecationWarning:astropy.*",
|
|
144
|
+
"ignore::astropy.wcs.FITSFixedWarning",
|
|
145
|
+
]
|
|
146
|
+
|
|
147
|
+
# ============================================================================
|
|
148
|
+
# coverage configuration
|
|
149
|
+
# ============================================================================
|
|
150
|
+
|
|
151
|
+
[tool.coverage.run]
|
|
152
|
+
source = ["stdpipe"]
|
|
153
|
+
omit = [
|
|
154
|
+
"*/tests/*",
|
|
155
|
+
"*/test_*.py",
|
|
156
|
+
"setup.py",
|
|
157
|
+
"*/flycheck_*.py",
|
|
158
|
+
]
|
|
159
|
+
parallel = true
|
|
160
|
+
branch = true
|
|
161
|
+
|
|
162
|
+
[tool.coverage.report]
|
|
163
|
+
precision = 2
|
|
164
|
+
show_missing = true
|
|
165
|
+
skip_covered = false
|
|
166
|
+
exclude_lines = [
|
|
167
|
+
"pragma: no cover",
|
|
168
|
+
"def __repr__",
|
|
169
|
+
"raise AssertionError",
|
|
170
|
+
"raise NotImplementedError",
|
|
171
|
+
"if __name__ == .__main__.:",
|
|
172
|
+
"if TYPE_CHECKING:",
|
|
173
|
+
"class .*\\bProtocol\\):",
|
|
174
|
+
"@(abc\\.)?abstractmethod",
|
|
175
|
+
]
|
|
176
|
+
|
|
177
|
+
[tool.coverage.html]
|
|
178
|
+
directory = "htmlcov"
|
|
179
|
+
|
|
180
|
+
# ============================================================================
|
|
181
|
+
# Black code formatter
|
|
182
|
+
# ============================================================================
|
|
183
|
+
|
|
184
|
+
[tool.black]
|
|
185
|
+
line-length = 100
|
|
186
|
+
target-version = ["py38", "py39", "py310", "py311", "py312"]
|
|
187
|
+
include = '\.pyi?$'
|
|
188
|
+
extend-exclude = '''
|
|
189
|
+
/(
|
|
190
|
+
\.git
|
|
191
|
+
| \.venv
|
|
192
|
+
| build
|
|
193
|
+
| dist
|
|
194
|
+
| __pycache__
|
|
195
|
+
| \.pytest_cache
|
|
196
|
+
| \.eggs
|
|
197
|
+
)/
|
|
198
|
+
'''
|
|
199
|
+
|
|
200
|
+
# ============================================================================
|
|
201
|
+
# isort import sorter
|
|
202
|
+
# ============================================================================
|
|
203
|
+
|
|
204
|
+
[tool.isort]
|
|
205
|
+
profile = "black"
|
|
206
|
+
line_length = 100
|
|
207
|
+
multi_line_output = 3
|
|
208
|
+
include_trailing_comma = true
|
|
209
|
+
force_grid_wrap = 0
|
|
210
|
+
use_parentheses = true
|
|
211
|
+
ensure_newline_before_comments = true
|
|
212
|
+
skip_glob = ["*/flycheck_*.py"]
|
|
213
|
+
|
|
214
|
+
# ============================================================================
|
|
215
|
+
# ruff linter (modern alternative to flake8)
|
|
216
|
+
# ============================================================================
|
|
217
|
+
|
|
218
|
+
[tool.ruff]
|
|
219
|
+
line-length = 100
|
|
220
|
+
target-version = "py38"
|
|
221
|
+
extend-exclude = [
|
|
222
|
+
"flycheck_*.py",
|
|
223
|
+
"__pycache__",
|
|
224
|
+
".pytest_cache",
|
|
225
|
+
"build",
|
|
226
|
+
"dist",
|
|
227
|
+
]
|
|
228
|
+
|
|
229
|
+
[tool.ruff.lint]
|
|
230
|
+
select = [
|
|
231
|
+
"E", # pycodestyle errors
|
|
232
|
+
"W", # pycodestyle warnings
|
|
233
|
+
"F", # pyflakes
|
|
234
|
+
"I", # isort
|
|
235
|
+
"N", # pep8-naming
|
|
236
|
+
"UP", # pyupgrade
|
|
237
|
+
"B", # flake8-bugbear
|
|
238
|
+
"C4", # flake8-comprehensions
|
|
239
|
+
"SIM", # flake8-simplify
|
|
240
|
+
]
|
|
241
|
+
ignore = [
|
|
242
|
+
"E501", # line too long (handled by black)
|
|
243
|
+
"B008", # do not perform function calls in argument defaults
|
|
244
|
+
"C901", # function is too complex
|
|
245
|
+
"N803", # argument name should be lowercase (conflicts with astronomical conventions)
|
|
246
|
+
"N806", # variable in function should be lowercase (conflicts with astronomical conventions)
|
|
247
|
+
]
|
|
248
|
+
|
|
249
|
+
[tool.ruff.lint.per-file-ignores]
|
|
250
|
+
"__init__.py" = ["F401"] # Unused imports in __init__.py
|
|
251
|
+
"tests/*" = ["F401", "F811"] # Unused imports and redefinitions in tests
|
|
252
|
+
|
|
253
|
+
# ============================================================================
|
|
254
|
+
# mypy type checker
|
|
255
|
+
# ============================================================================
|
|
256
|
+
|
|
257
|
+
[tool.mypy]
|
|
258
|
+
python_version = "3.8"
|
|
259
|
+
warn_return_any = true
|
|
260
|
+
warn_unused_configs = true
|
|
261
|
+
disallow_untyped_defs = false # Start lenient, can tighten later
|
|
262
|
+
ignore_missing_imports = true
|
|
263
|
+
exclude = [
|
|
264
|
+
"tests/",
|
|
265
|
+
"docs/",
|
|
266
|
+
"build/",
|
|
267
|
+
"dist/",
|
|
268
|
+
]
|
stdpipe-0.2.5/setup.py
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
# -*- coding: utf-8 -*-
|
|
3
|
+
"""
|
|
4
|
+
Minimal setup.py for backward compatibility.
|
|
5
|
+
|
|
6
|
+
Modern configuration is in pyproject.toml.
|
|
7
|
+
This file is kept for backward compatibility with older pip versions
|
|
8
|
+
and tools that don't yet support PEP 517/518.
|
|
9
|
+
|
|
10
|
+
For development installation:
|
|
11
|
+
pip install -e .
|
|
12
|
+
|
|
13
|
+
For installation with optional dependencies:
|
|
14
|
+
pip install -e ".[dev]"
|
|
15
|
+
pip install -e ".[docs]"
|
|
16
|
+
pip install -e ".[all]"
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
from setuptools import setup
|
|
20
|
+
|
|
21
|
+
# All configuration is in pyproject.toml
|
|
22
|
+
# This setup.py is just for backward compatibility
|
|
23
|
+
if __name__ == "__main__":
|
|
24
|
+
setup()
|
|
@@ -123,11 +123,11 @@ def spherical_match(ra1, dec1, ra2, dec2, sr=1 / 3600):
|
|
|
123
123
|
|
|
124
124
|
"""
|
|
125
125
|
|
|
126
|
-
# Ensure that inputs are arrays
|
|
127
|
-
ra1 = np.atleast_1d(ra1)
|
|
128
|
-
dec1 = np.atleast_1d(dec1)
|
|
129
|
-
ra2 = np.atleast_1d(ra2)
|
|
130
|
-
dec2 = np.atleast_1d(dec2)
|
|
126
|
+
# Ensure that inputs are arrays, and drop units if any
|
|
127
|
+
ra1 = np.array(np.atleast_1d(ra1))
|
|
128
|
+
dec1 = np.array(np.atleast_1d(dec1))
|
|
129
|
+
ra2 = np.array(np.atleast_1d(ra2))
|
|
130
|
+
dec2 = np.array(np.atleast_1d(dec2))
|
|
131
131
|
|
|
132
132
|
idx1, idx2, dist, _ = search_around_sky(
|
|
133
133
|
SkyCoord(ra1, dec1, unit='deg'), SkyCoord(ra2, dec2, unit='deg'), sr * u.deg
|
|
@@ -299,6 +299,7 @@ def blind_match_objects(
|
|
|
299
299
|
'sort-column': 'FLUX',
|
|
300
300
|
'width': width,
|
|
301
301
|
'height': height,
|
|
302
|
+
'crpix-center': True,
|
|
302
303
|
#
|
|
303
304
|
'overwrite': True,
|
|
304
305
|
'no-plots': True,
|
|
@@ -309,7 +310,7 @@ def blind_match_objects(
|
|
|
309
310
|
if config is not None:
|
|
310
311
|
opts['config'] = config
|
|
311
312
|
|
|
312
|
-
if order is not None:
|
|
313
|
+
if order is not None and order > 0:
|
|
313
314
|
opts['tweak-order'] = order
|
|
314
315
|
else:
|
|
315
316
|
opts['no-tweak'] = True
|
|
@@ -330,52 +331,43 @@ def blind_match_objects(
|
|
|
330
331
|
|
|
331
332
|
opts.update(extra)
|
|
332
333
|
|
|
333
|
-
# Build the command line
|
|
334
|
-
command = binname + ' ' + shlex.quote(objname) + ' ' + utils.format_long_opts(opts)
|
|
335
|
-
if not verbose:
|
|
336
|
-
command += ' > /dev/null 2>/dev/null'
|
|
337
|
-
log('Will run first iteration of Astrometry.Net like that:')
|
|
338
|
-
log(command)
|
|
339
|
-
|
|
340
|
-
res = os.system(command)
|
|
341
|
-
|
|
342
334
|
wcs = None
|
|
343
|
-
if res == 0 and os.path.exists(wcsname):
|
|
344
|
-
log('Successfully run first iteration')
|
|
345
|
-
shutil.move(wcsname, tmpname)
|
|
346
335
|
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
336
|
+
for iter in range(2):
|
|
337
|
+
if os.path.exists(wcsname):
|
|
338
|
+
shutil.move(wcsname, tmpname)
|
|
339
|
+
opts['verify'] = tmpname
|
|
340
|
+
|
|
341
|
+
# Build the command line
|
|
342
|
+
command = binname + ' ' + shlex.quote(objname) + ' ' + utils.format_long_opts(opts)
|
|
351
343
|
if not verbose:
|
|
352
344
|
command += ' > /dev/null 2>/dev/null'
|
|
353
|
-
log('Will run
|
|
345
|
+
log('Will run iteration %d of Astrometry.Net like that:' % (iter,))
|
|
354
346
|
log(command)
|
|
355
347
|
|
|
356
348
|
res = os.system(command)
|
|
357
349
|
|
|
358
350
|
if res == 0 and os.path.exists(wcsname):
|
|
359
|
-
log('Successfully run
|
|
360
|
-
header = fits.getheader(wcsname)
|
|
361
|
-
wcs = WCS(header)
|
|
351
|
+
log('Successfully run iteration %d' % (iter,))
|
|
362
352
|
|
|
363
|
-
|
|
364
|
-
|
|
353
|
+
else:
|
|
354
|
+
log('Error %s running Astrometry.Net' % res)
|
|
365
355
|
|
|
366
|
-
log(
|
|
367
|
-
'Got WCS solution with center at %.4f %.4f radius %.2f deg and pixel scale %.2f arcsec/pix'
|
|
368
|
-
% (ra0, dec0, sr0, pixscale * 3600)
|
|
369
|
-
)
|
|
370
356
|
|
|
371
|
-
|
|
372
|
-
|
|
357
|
+
if res == 0 and os.path.exists(wcsname):
|
|
358
|
+
header = fits.getheader(wcsname)
|
|
359
|
+
wcs = WCS(header)
|
|
373
360
|
|
|
374
|
-
|
|
375
|
-
|
|
361
|
+
ra0, dec0, sr0 = get_frame_center(wcs=wcs, width=width, height=height)
|
|
362
|
+
pixscale = get_pixscale(wcs=wcs)
|
|
376
363
|
|
|
377
|
-
|
|
378
|
-
|
|
364
|
+
log(
|
|
365
|
+
'Got WCS solution with center at %.4f %.4f radius %.2f deg and pixel scale %.2f arcsec/pix'
|
|
366
|
+
% (ra0, dec0, sr0, pixscale * 3600)
|
|
367
|
+
)
|
|
368
|
+
|
|
369
|
+
if update and wcs:
|
|
370
|
+
obj['ra'], obj['dec'] = wcs.all_pix2world(obj['x'], obj['y'], 0)
|
|
379
371
|
|
|
380
372
|
if _workdir is None:
|
|
381
373
|
shutil.rmtree(workdir)
|